Low level device functions. More...
Protected Member Functions | |
void | GotoXY (uint8_t x, uint8_t y) |
set current x,y coordinate on display device More... | |
int | Init (glcd_device_mode invert=NON_INVERTED) |
Low level h/w initialization of library and display. More... | |
int | Off (void) |
Turn off the display & backlight. More... | |
int | OffBacklight (void) |
Turn off the backlight. More... | |
int | OffDisplay (void) |
Turn the display pixels off. More... | |
int | On (void) |
Turn on the display & backlight. More... | |
int | OnBacklight (void) |
Turn on the backlight. More... | |
int | OnDisplay (void) |
Turn the display pixels on. More... | |
uint8_t | ReadData (void) |
read a data byte from display device memory More... | |
int | SetBacklight (int val) |
Set backlight brightness. More... | |
void | SetDot (uint8_t x, uint8_t y, uint8_t color) |
set pixel at x,y to the given color More... | |
void | SetPixels (uint8_t x, uint8_t y, uint8_t x1, uint8_t y1, uint8_t color) |
set an area of pixels More... | |
void | WriteData (uint8_t data) |
Write a byte to display device memory. More... | |
Low level device functions.
|
protected |
set current x,y coordinate on display device
x | X coordinate |
y | Y coordinate |
Sets the current pixel location to x,y. x and y are relative to the 0,0 origin of the display which is the upper left most pixel on the display.
|
protected |
Low level h/w initialization of library and display.
invert | specifices whether display is in normal mode or inverted mode. |
This should be called prior to any other graphic library function. It does all the needed initializations including taking care of the low level hardware initalization of the display device.
The optional invert parameter specifies if the display should be run in a normal mode, or inverted mode.
It does not refer to whether the display uses light or darg pixels.
In "normal" or NON_INVERTED mode, pixels are turned on for PIXEL_ON or BLACK and turned off for PIXEL_OFF or WHITE.
In "inverted" or INVERTED mode, pixels are turned off for PIXEL_ON or BLACK and turned on for PIXEL_OFF or WHITE.
NON_INVERTED mode clears the display with all pixels off and drawing with PIXEL_ON or BLACK will turn on pixels.
INVERTED mode clears the display with all pixels on and drawing with PIXEL_OFF or WHITE will turn on pixels.
The terminology of BLACK and WHITE is from the perspective of a display that uses black pixels on a light background. For example, if a pixel is set to BLACK and used on a black pixel on light background display, you get a black pixel.
However, if the display is a white pixel on dark background display, then setting a pixel to BLACK turns on a white pixel on the display.
Because of this, it can be less confusing to use PIXEL_ON and PIXEL_OFF vs BLACK and WHITE.
Upon successful completion of the initialization:
|
protected |
Turn off the display & backlight.
Turns off the display's pixels and backlight
|
protected |
Turn off the backlight.
|
protected |
Turn the display pixels off.
Turns off the display pixels. It does not alter or modify the backlight setting. If the display backlight is on, it will remain on.
|
protected |
Turn on the display & backlight.
Turns on the display's pixels and backlight
|
protected |
Turn on the backlight.
|
protected |
Turn the display pixels on.
Turns on the display pixels. It does not alter or modify the backlight setting.
|
protected |
read a data byte from display device memory
|
protected |
Set backlight brightness.
val | backlight brightness (0-255) |
If the display circuitry only has the option to turn the backlight on and off then any non zero value will turn the display on with maximum brightness The value HIGH should not be used to turn the backlight on since this function is used to control backlight intensity and not for on / off control. A value of HIGH is typically 1 which would be a very dim backlight.
|
protected |
set pixel at x,y to the given color
x | X coordinate, a value from 0 to GLCD.Width-1 |
y | Y coordinate, a value from 0 to GLCD.Heigh-1 |
color | Sets the pixel at location x,y to the specified color. x and y are relative to the 0,0 origin of the display which is the upper left corner. Requests to set pixels outside the range of the display will be ignored. |
|
protected |
set an area of pixels
x | X coordinate of upper left corner |
y | Y coordinate of upper left corner |
x2 | X coordinate of lower right corner |
y2 | Y coordinate of lower right corner |
color | sets the pixels an area bounded by x,y to x2,y2 inclusive to the specified color. x,y is the upper left corner and x2,y2 is the lower left corner. |
The width of the area is x2-x + 1. The height of the area is y2-y+1
|
protected |
Write a byte to display device memory.
data | date byte to write to memory |
The data specified is written to glcd memory at the current x,y position. If the y location is not on a byte boundary, the write is fragemented up into multiple writes.