![]() |
Display Simple Graphics library
v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
|
#include <simplegfx.h>
Data Fields | |
| int | width |
| int | height |
| int | rotation |
| int | cursor_x |
| int | cursor_y |
| int | font [5] |
| char | color_depth |
| char | text_size |
| char | text_wrap |
| int | text_color |
| int | bg_color |
| int | display_mode |
| i2c * | eepromBus |
| i2c * | deviceBus |
| char | deviceInterface |
| unsigned char | dev_id |
| char | status_pin |
| char | sdi_pin |
| char | rst_pin |
| char | clk_pin |
| char | dc_pin |
| int | image_size |
| char * | image_ptr |
| char * | customCharSmall |
| char * | customCharMed |
| char * | customCharLarge |
| char(* | deviceWriteLock )(void) |
| void(* | deviceWriteLockSet )(struct screen_st *) |
| void(* | deviceWriteLockClear )(struct screen_st *) |
| void(* | deviceDrawPixel )(struct screen_st *, int x, int y, int color) |
| int(* | deviceGetPixel )(struct screen_st *, int x, int y) |
| void(* | deviceDrawLine )(struct screen_st *, int x, int y, int w, int h, int color) |
| void(* | deviceDrawFastHLine )(struct screen_st *, int x, int y, int w, int color) |
| void(* | deviceDrawFastVLine )(struct screen_st *, int x, int y, int w, int color) |
| void(* | deviceFillRect )(struct screen_st *, int x, int y, int w, int h, int color) |
| void(* | deviceCopyRect )(struct screen_st *, int x, int y, int x0, int y0, int x1, int y1) |
| void(* | deviceClearDisplay )(struct screen_st *) |
| void(* | deviceUpdateDisplay )(struct screen_st *) |
| void(* | deviceResetDisplay )(struct screen_st *) |
| void(* | deviceInvertDisplay )(struct screen_st *, char i) |
| void(* | deviceSleepWakeDisplay )(struct screen_st *, char i) |
| void(* | deviceScrollDisplay )(struct screen_st *, int h, int v) |
| int bg_color |
Color of the background of text characters. Set to the same color as the text for transparent
| char clk_pin |
Device clock pin (SPI)
| char color_depth |
String representing color-depth of display in bits/channel
| int cursor_x |
Current horizontal position of the cursor for drawing characters
| int cursor_y |
Current vertical position of the cursor for drawing characters
| char* customCharLarge |
Array for holding large (17x23) custom characters
| char* customCharMed |
Array for holding medium (11x15) custom characters
| char* customCharSmall |
Array for holding small (5x7) custom characters
| char dc_pin |
Device data/command pin (SPI 5-wire)
| unsigned char dev_id |
Device address (I2C) OR Chip Select pin (SPI)
| i2c* deviceBus |
i2c bus pointer for accessing device
| void(* deviceClearDisplay) (struct screen_st *) |
Device native function for clearing the display and setting it all to the default blank color
| void(* deviceCopyRect) (struct screen_st *, int x, int y, int x0, int y0, int x1, int y1) |
Use if device has a native copy function
| void(* deviceDrawFastHLine) (struct screen_st *, int x, int y, int w, int color) |
Device native horizontal line drawing function
| void(* deviceDrawFastVLine) (struct screen_st *, int x, int y, int w, int color) |
Device native vertical line drawing function
| void(* deviceDrawLine) (struct screen_st *, int x, int y, int w, int h, int color) |
Use if device has accelerated line drawing
| void(* deviceDrawPixel) (struct screen_st *, int x, int y, int color) |
Device native pixel drawing function
| void(* deviceFillRect) (struct screen_st *, int x, int y, int w, int h, int color) |
Use if device has accelerated filled rectagle drawing
| int(* deviceGetPixel) (struct screen_st *, int x, int y) |
Device native pixel retrieving function
| char deviceInterface |
interface type (bit 1) (1-i2c/0-SPI) and buffer (bit 0) (0-yes/1-no)
| void(* deviceInvertDisplay) (struct screen_st *, char i) |
Device native color invert function
| void(* deviceResetDisplay) (struct screen_st *) |
Device native reset function (Use clear display if not available)
| void(* deviceScrollDisplay) (struct screen_st *, int h, int v) |
Device native solling functions if available
| void(* deviceSleepWakeDisplay) (struct screen_st *, char i) |
Device native sleep/wake display, if available
| void(* deviceUpdateDisplay) (struct screen_st *) |
Use if display needs to be updated (otherwise 0)
| char(* deviceWriteLock) (void) |
Get state of lock to prevent multiple functions from accessing device at once
| void(* deviceWriteLockClear) (struct screen_st *) |
Clear the device write lock
| void(* deviceWriteLockSet) (struct screen_st *) |
Set the device write lock
| int display_mode |
Current display modes: bit 0=normal/inverted, bit 1=sleep/wake, bits 8:15=vert scroll, bits 16:23=horiz scroll
| i2c* eepromBus |
i2c bus pointer for accessing fonts in EEPROM
| int font[5] |
EEPROM locations of medium and large font definitions/bitmaps
| int height |
Height of the device's display in pixels (fixed value)
| char* image_ptr |
Pointer to the image buffer
| int image_size |
Size of the image buffer, usually (length * width * color depth in bytes)
| int rotation |
Current rotation of the dispaly. Sets top-left origin to different corners of the display
| char rst_pin |
Device reset pin (-1 if not used or available)
| char sdi_pin |
Device data pin (SPI)
| char status_pin |
Device serial data out OR busy pin (SPI)
| int text_color |
Color to draw text characters in
| char text_size |
Current text size
| char text_wrap |
Boolean to wrap or not wrap text at the end of the screen
| int width |
Width of the device's display in pixels (fixed value)
1.8.14