Display Simple Graphics library  v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
Data Fields
screen_st Struct Reference

#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)
 

Field Documentation

◆ bg_color

int bg_color

Color of the background of text characters. Set to the same color as the text for transparent

◆ clk_pin

char clk_pin

Device clock pin (SPI)

◆ color_depth

char color_depth

String representing color-depth of display in bits/channel

◆ cursor_x

int cursor_x

Current horizontal position of the cursor for drawing characters

◆ cursor_y

int cursor_y

Current vertical position of the cursor for drawing characters

◆ customCharLarge

char* customCharLarge

Array for holding large (17x23) custom characters

◆ customCharMed

char* customCharMed

Array for holding medium (11x15) custom characters

◆ customCharSmall

char* customCharSmall

Array for holding small (5x7) custom characters

◆ dc_pin

char dc_pin

Device data/command pin (SPI 5-wire)

◆ dev_id

unsigned char dev_id

Device address (I2C) OR Chip Select pin (SPI)

◆ deviceBus

i2c* deviceBus

i2c bus pointer for accessing device

◆ deviceClearDisplay

void(* deviceClearDisplay) (struct screen_st *)

Device native function for clearing the display and setting it all to the default blank color

◆ deviceCopyRect

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

◆ deviceDrawFastHLine

void(* deviceDrawFastHLine) (struct screen_st *, int x, int y, int w, int color)

Device native horizontal line drawing function

◆ deviceDrawFastVLine

void(* deviceDrawFastVLine) (struct screen_st *, int x, int y, int w, int color)

Device native vertical line drawing function

◆ deviceDrawLine

void(* deviceDrawLine) (struct screen_st *, int x, int y, int w, int h, int color)

Use if device has accelerated line drawing

◆ deviceDrawPixel

void(* deviceDrawPixel) (struct screen_st *, int x, int y, int color)

Device native pixel drawing function

◆ deviceFillRect

void(* deviceFillRect) (struct screen_st *, int x, int y, int w, int h, int color)

Use if device has accelerated filled rectagle drawing

◆ deviceGetPixel

int(* deviceGetPixel) (struct screen_st *, int x, int y)

Device native pixel retrieving function

◆ deviceInterface

char deviceInterface

interface type (bit 1) (1-i2c/0-SPI) and buffer (bit 0) (0-yes/1-no)

◆ deviceInvertDisplay

void(* deviceInvertDisplay) (struct screen_st *, char i)

Device native color invert function

◆ deviceResetDisplay

void(* deviceResetDisplay) (struct screen_st *)

Device native reset function (Use clear display if not available)

◆ deviceScrollDisplay

void(* deviceScrollDisplay) (struct screen_st *, int h, int v)

Device native solling functions if available

◆ deviceSleepWakeDisplay

void(* deviceSleepWakeDisplay) (struct screen_st *, char i)

Device native sleep/wake display, if available

◆ deviceUpdateDisplay

void(* deviceUpdateDisplay) (struct screen_st *)

Use if display needs to be updated (otherwise 0)

◆ deviceWriteLock

char(* deviceWriteLock) (void)

Get state of lock to prevent multiple functions from accessing device at once

◆ deviceWriteLockClear

void(* deviceWriteLockClear) (struct screen_st *)

Clear the device write lock

◆ deviceWriteLockSet

void(* deviceWriteLockSet) (struct screen_st *)

Set the device write lock

◆ display_mode

int display_mode

Current display modes: bit 0=normal/inverted, bit 1=sleep/wake, bits 8:15=vert scroll, bits 16:23=horiz scroll

◆ eepromBus

i2c* eepromBus

i2c bus pointer for accessing fonts in EEPROM

◆ font

int font[5]

EEPROM locations of medium and large font definitions/bitmaps

◆ height

int height

Height of the device's display in pixels (fixed value)

◆ image_ptr

char* image_ptr

Pointer to the image buffer

◆ image_size

int image_size

Size of the image buffer, usually (length * width * color depth in bytes)

◆ rotation

int rotation

Current rotation of the dispaly. Sets top-left origin to different corners of the display

◆ rst_pin

char rst_pin

Device reset pin (-1 if not used or available)

◆ sdi_pin

char sdi_pin

Device data pin (SPI)

◆ status_pin

char status_pin

Device serial data out OR busy pin (SPI)

◆ text_color

int text_color

Color to draw text characters in

◆ text_size

char text_size

Current text size

◆ text_wrap

char text_wrap

Boolean to wrap or not wrap text at the end of the screen

◆ width

int width

Width of the device's display in pixels (fixed value)


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