libPocuter 1.0 Support library for programming the Pocuter

Public Types | Public Member Functions | List of all members
PocuterDisplay Class Referenceabstract

this class has basic display operations only. If you want to write a GUI, consider to use ugui instead. More...

`#include <PocuterDisplay.h>`

## Public Types
enum | BUFFER_MODE { BUFFER_MODE_NO_BUFFER, BUFFER_MODE_DOUBLE_BUFFER }

## Public Member Functions
virtual void | getDisplaySize (uint16_t &sizeX, uint16_t &sizeY)=0
| get the Display size More...
virtual void | setPixel (int16_t x, int16_t y, uint32_t color)=0
| set a Pixel on the display More...
virtual void | drawLine (int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t color)=0
| draw a line More...
virtual void | drawScanLine (int16_t x, int16_t y, uint16_t width, uint32_t *colors)=0
| draw a horizontal line More...
virtual void | draw16BitScanLine (int16_t x, int16_t y, uint16_t width, uint16_t *colors)=0
| draw a horizontal line with 16 bit color instead of 24 bit More...
virtual void | drawRectangle (int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t color)=0
| draws a filled rectangle More...
virtual void | setBrightness (uint8_t brightness)=0
| set the display brightness More...
virtual void | clearWindow (int16_t x, int16_t y, int16_t width, int16_t height)=0
| clear a rectangle More...
virtual void | clearScreen ()=0
| clear the hole screen More...
virtual void | continuousScreenUpdate (bool on)=0
| automatic screen update More...
virtual void | updateScreen ()=0
| update the screen. Only available in DOUBLE BUFFER mode More...
virtual BUFFER_MODE | getBufferMode ()=0
| get the current buffer mode More...
virtual void | doSleep ()=0
| let the display sleep More...
virtual void | doWakeUp ()=0
| wake up the display More...

## Detailed Description

this class has basic display operations only. If you want to write a GUI, consider to use ugui instead.

## Member Enumeration Documentation

## ◆ BUFFER_MODE

enum PocuterDisplay::BUFFER_MODE

Enumerator
BUFFER_MODE_NO_BUFFER |
BUFFER_MODE_DOUBLE_BUFFER |

## Member Function Documentation

## ◆ clearScreen()

virtual void PocuterDisplay::clearScreen | ( |  | ) |
| pure virtual

clear the hole screen

Note
  in NO BUFFER mode this is hardware accelerated, otherwise it is the same as drawRectangle on the hole screen with color 0

## ◆ clearWindow()

virtual void PocuterDisplay::clearWindow | ( | int16_t | x,
|  | int16_t | y,
|  | int16_t | width,
|  | int16_t | height
| ) |  |
| pure virtual

clear a rectangle

Note
  in NO BUFFER mode this is hardware accelerated, otherwise it is the same as drawRectangle with color 0

Parameters

  x | x start coordinate
  y | y start coordinate
  width | the width
  height | the height

## ◆ continuousScreenUpdate()

virtual void PocuterDisplay::continuousScreenUpdate | ( | bool | on | ) |
| pure virtual

automatic screen update

Note
  if you set this to false you have to call updateScreen every time you want to update the screen. This can prevent flickering. It is in available in double buffer mode only.

Parameters

  on | switch automatic screen update on / off

## ◆ doSleep()

virtual void PocuterDisplay::doSleep | ( |  | ) |
| pure virtual

let the display sleep

## ◆ doWakeUp()

virtual void PocuterDisplay::doWakeUp | ( |  | ) |
| pure virtual

wake up the display

## ◆ draw16BitScanLine()

virtual void PocuterDisplay::draw16BitScanLine | ( | int16_t | x,
|  | int16_t | y,
|  | uint16_t | width,
|  | uint16_t * | colors
| ) |  |
| pure virtual

draw a horizontal line with 16 bit color instead of 24 bit

Note
  this draws one line beginning at x. It is even faster than drawScanLine
  it will stop drawing if the line is longer than the display can show

Parameters

  x | x start coordinate
  y | y start coordinate
  width | number of pixels to draw
  colors | 16 bit color array (RGB565)

## ◆ drawLine()

virtual void PocuterDisplay::drawLine | ( | int16_t | x1,
|  | int16_t | y1,
|  | int16_t | x2,
|  | int16_t | y2,
|  | uint32_t | color
| ) |  |
| pure virtual

draw a line

Parameters

  x1 | x start coordinate
  y1 | y start coordinate
  x2 | x end coordinate
  y2 | y end coordinate
  color | a 24 bit color value (RGB888)

## ◆ drawRectangle()

virtual void PocuterDisplay::drawRectangle | ( | int16_t | x1,
|  | int16_t | y1,
|  | int16_t | x2,
|  | int16_t | y2,
|  | uint32_t | color
| ) |  |
| pure virtual

draws a filled rectangle

Parameters

  x1 | x start coordinate
  y1 | y start coordinate
  x2 | x end coordinate
  y2 | y end coordinate
  color | a 24 bit color value (RGB888)

## ◆ drawScanLine()

virtual void PocuterDisplay::drawScanLine | ( | int16_t | x,
|  | int16_t | y,
|  | uint16_t | width,
|  | uint32_t * | colors
| ) |  |
| pure virtual

draw a horizontal line

Note
  this draws one horizontal line beginning at x. It is faster than drawing every pixel (especially in no buffer mode) or using drawLine
  it will stop drawing if the line is longer than the display can show

Parameters

  x | x start coordinate
  y | y start coordinate
  width | number of pixels to draw
  colors | a 24 bit color array (RGB888)

## ◆ getBufferMode()

virtual BUFFER_MODE PocuterDisplay::getBufferMode | ( |  | ) |
| pure virtual

get the current buffer mode

Returns
  BUFFER_MODE return the current buffer mode

## ◆ getDisplaySize()

virtual void PocuterDisplay::getDisplaySize | ( | uint16_t & | sizeX,
|  | uint16_t & | sizeY
| ) |  |
| pure virtual

get the Display size

Parameters

  sizeX | output
  sizeY | output

## ◆ setBrightness()

virtual void PocuterDisplay::setBrightness | ( | uint8_t | brightness | ) |
| pure virtual

set the display brightness

Parameters

  brightness | 0 - 15

## ◆ setPixel()

virtual void PocuterDisplay::setPixel | ( | int16_t | x,
|  | int16_t | y,
|  | uint32_t | color
| ) |  |
| pure virtual

set a Pixel on the display

Parameters

  x | x coordinate
  y | y coordinate
  color | a 24 bit color value (RGB888)

## ◆ updateScreen()

virtual void PocuterDisplay::updateScreen | ( |  | ) |
| pure virtual

update the screen. Only available in DOUBLE BUFFER mode

Note
  this function copies the backbuffer to the frontbuffer (double buffering) and returns immediately. Display drawing is executed in another thread. If the frontbuffer is currently sending to the display, the function waits until this is done.

The documentation for this class was generated from the following file:

- include/hal/PocuterDisplay.h