Skip to content

Display and Windows

rudidl edited this page Nov 22, 2016 · 7 revisions

Switch display driver on/off

void displayOn(boolean on)

  • on: TRUE: switches display driver on
  • on: FALSE: switches display driver off

Set the backlight

void backlight(boolean on)

  • on: enables/disables the backlight

void brightness(uint8_t val)

  • val: sets the brightness level when the backlight is on. Can be changed while the backlight is on to dim the backlight. (0 ... 255)

Get the display width & height

void width(bool absolute)

void height(bool absolute)

  • absolute: TRUE: returns the physical dimension of the display
  • absolute: FALSE: returns the rotation dependant dimension

Change the rotation of the display

void setRotation(uint8_t rotation)

  • rotation: 0: default
  • rotation: 1: 90 degrees rotated counter clockwise
  • rotation: 2: upside down
  • rotation: 3: 90 degrees rotated clockwise

Get current rotation

uint8_t getRotation()

Return value: see setRotation()

Sets the borders of the active window

Sets the active window to the complete screen

void XGLCD::setActiveWindow(void)

Sets the active window between two coordinate pairs

void setActiveWindow(int16_t XL,int16_t XR ,int16_t YT ,int16_t YB)

void getActiveWindow(int16_t &XL,int16_t &XR ,int16_t &YT ,int16_t &YB)

  • XL: horizontal left border
  • XR: horizontal right border
  • YT: vertical top border
  • YB: vertical bottom border

Clear the complete video memory

Clears independent of the selected LCD resolution or color depth the complete video memory. The video memory might contain several video buffers, all of them are cleared.

void clearMemory(bool stop)

  • stop: FALSE (TRUE not allowed)

Clear the active window video memory

void clearActiveWindow(bool full)

  • full: FALSE: clear current window
  • full: TRUE: clear full window

Fill the active window video memory

void fillWindow(uint16_t color)

Fill the complete active window with 'color'.

Clear screen

void clearScreen(uint16_t color)

Fill the complete visible screen with 'color'.

Enable/disable sleep mode

void sleep(boolean sleep)

  • sleep: TRUE: switch the LCD in sleep mode & switch off the backlight
  • sleep: FALSE: enable the LCD and switch the backlight on