21#ifndef GRAPHICDISPLAY_H_
22#define GRAPHICDISPLAY_H_
52#ifndef NO_SUPPORT_FOR_HAS_INCLUDED
53 #if __has_include("gd_config.h")
54 #include "gd_config.h"
56 #define GD_INCLUDE_FONT_6x8
57 #define GD_INCLUDE_FONT_7x10
58 #define GD_INCLUDE_FONT_11x18
59 #define GD_INCLUDE_FONT_16x26
60 #define GD_INCLUDE_FONT_16x24
61 #define GD_INCLUDE_FONT_16x15
64 #include "gd_config.h"
244 uint8_t (*fxnSetPixelColor)(
void* handle, uint32_t x, uint32_t y, uint8_t color);
254 uint8_t (*fxnFillFrameBuffer)(
void* handle, uint8_t color);
264 uint8_t (*fxnRefreshDisp)(
void* handle);
274 uint8_t (*fxnSetOn)(
void* handle,
bool on);
286 uint8_t (*fxnSetContrast)(
void* handle, uint8_t value);
void(* fxnGd_mtxUnlock)(void)
Unlock the mutex after use on threadsafe need operations.
Definition GraphicDisplay.h:112
gd_color_e
Defines the pixel color of the display we want to write.
Definition GraphicDisplay.h:90
@ GD_BLACK
Definition GraphicDisplay.h:91
@ GD_WHITE
Definition GraphicDisplay.h:92
gd_error_e
Errors that can be generated by library.
Definition GraphicDisplay.h:80
@ GD_OK
Definition GraphicDisplay.h:81
@ GD_FAIL
Definition GraphicDisplay.h:82
void(* fxnGd_mtxLock)(void)
Locks the mutex to prevent overrun and conflicts over threads in RTOS environments.
Definition GraphicDisplay.h:105
gd_driver_t * Gd_Driver_SSD1306
SSD1306 Display Driver pointer.
Definition GraphicDisplay.c:37
gd_driver_t * Gd_Driver_ST7920
ST7920 Display Driver poointer.
Definition GraphicDisplay.c:48
gd_error_e GD_SetContrast(gd_t *Gd, const uint8_t value)
Set the contrast of the display, if are supported. If display doesn't have this routine,...
Definition GraphicDisplay.c:574
gd_error_e GD_Init(gd_t *Gd, gd_params_t *params)
Initializes the Graphic Display module, configured with the parameters provided.
Definition GraphicDisplay.c:117
gd_error_e GD_SetDisplayOn(gd_t *Gd, bool on)
Set display On or Off, if the display implements this routine.
Definition GraphicDisplay.c:583
gd_error_e GD_DrawArc(gd_t *Gd, uint32_t x, uint32_t y, uint32_t radius, uint16_t start_angle, uint16_t sweep, gd_color_e color)
Draw an arc into the frame buffer with center, radius, start angle, and sweep.
Definition GraphicDisplay.c:334
gd_error_e GD_DrawCircle(gd_t *Gd, uint32_t par_x, uint32_t par_y, uint32_t par_r, gd_color_e color)
Draw a complete circle with defined radius.
Definition GraphicDisplay.c:440
gd_error_e GD_WriteChar(gd_t *Gd, char ch, const gd_font_t *Font, gd_color_e color)
Write a character into a Frame Buffer, with the lines with the desired color.
Definition GraphicDisplay.c:205
gd_error_e GD_Line(gd_t *Gd, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, gd_color_e color)
Write a line into the frame buffer between (x1,y1) (x2,y2).
Definition GraphicDisplay.c:281
gd_error_e GD_Polyline(gd_t *Gd, gd_vertex_t *par_vertex, uint16_t par_size, gd_color_e color)
Draw a polyline, composed by staigth lines connecting the points given by vertex array.
Definition GraphicDisplay.c:311
gd_error_e GD_Fill(gd_t *Gd, gd_color_e color)
Fill the Frame Buffer with the provided color.
Definition GraphicDisplay.c:148
gd_error_e GD_DrawBitmap(gd_t *Gd, uint32_t x, uint32_t y, const unsigned char *bitmap, uint32_t w, uint32_t h, gd_color_e color)
Draw a bitmap into the Frame Buffer. The bitmap is an array with the pixels on/off.
Definition GraphicDisplay.c:542
gd_error_e GD_SetCursor(gd_t *Gd, uint32_t x, uint32_t y)
Set the cursor to the position X,Y.
Definition GraphicDisplay.c:264
gd_error_e GD_DrawRectangle(gd_t *Gd, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, gd_color_e color)
Draw a Rectangle between the position (x1,y1) and (x2,y2). The rectangle is not filled,...
Definition GraphicDisplay.c:509
gd_error_e GD_DrawArcWithRadiusLine(gd_t *Gd, uint32_t x, uint32_t y, uint32_t radius, uint16_t start_angle, uint16_t sweep, gd_color_e color)
Draw an arc into frame buffer with lines in the radius line.
Definition GraphicDisplay.c:382
bool GD_GetDisplayOn(gd_t *Gd)
Gets the display On/Off state.
Definition GraphicDisplay.c:593
gd_error_e GD_FillRectangle(gd_t *Gd, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, gd_error_e color)
Draw a filled rectangle between the pointes (x1,y1) and (x2,y2).
Definition GraphicDisplay.c:522
gd_error_e GD_UpdateScreen(gd_t *Gd)
Update and refresh the update screen with the data into Frame Buffer.
Definition GraphicDisplay.c:160
gd_error_e GD_DrawPixel(gd_t *Gd, uint32_t x, uint32_t y, gd_color_e color)
Write a color into the desired pixel in the frame buffer.
Definition GraphicDisplay.c:177
gd_error_e GD_FillCircle(gd_t *Gd, uint32_t par_x, uint32_t par_y, uint32_t par_r, gd_color_e par_color)
Draw a circle filled with the provided color.
Definition GraphicDisplay.c:474
gd_error_e GD_WriteString(gd_t *Gd, char *str, const gd_font_t *Font, gd_color_e color)
Write a string into frame buffer, with the character lines with the desired color.
Definition GraphicDisplay.c:249
Driver for ST7920 display driver. This library needs you to implement interface control,...
Struct that creates a driver for the display, holding the handle and functions that are private of th...
Definition GraphicDisplay.h:229
void * pHandle
Handle of the display. The variable that holds all data of device.
Definition GraphicDisplay.h:231
Structure to holds Fonts. The default fonts are defined in GraphicDisplay_Fonts.h....
Definition GraphicDisplay.h:300
const uint8_t *const char_width
Definition GraphicDisplay.h:308
const uint8_t width
Font width in pixels.
Definition GraphicDisplay.h:302
const uint16_t *const data
Proportional character width in pixels (NULL for monospaced)
Definition GraphicDisplay.h:306
const uint8_t height
Pointer to font data array.
Definition GraphicDisplay.h:304
Parameters to initialize the Graphic Display Handler.
Definition GraphicDisplay.h:375
uint32_t u32Height
The Heigth of the display, in lines.
Definition GraphicDisplay.h:401
gd_driver_t * DisplayDriver
Driver for the display. External Drivers Already Implemented.
Definition GraphicDisplay.h:396
fxnGd_mtxLock mtxLock
mutex lock function pointer.
Definition GraphicDisplay.h:411
uint32_t u32Width
The Width of the display, in columns.
Definition GraphicDisplay.h:406
void * DisplayHandle
Handle of the display, provide the pointer of this handler. Example fort ssd1306 display:
Definition GraphicDisplay.h:392
fxnGd_mtxUnlock mtxUnlock
mutex unlock function pointer.
Definition GraphicDisplay.h:416
Definition GraphicDisplay.h:338
fxnGd_mtxLock mtxLock
mutex lock function pointer.
Definition GraphicDisplay.h:341
fxnGd_mtxUnlock mtxUnlock
mutex unlock function pointer.
Definition GraphicDisplay.h:344
Definition GraphicDisplay.h:351
bool bDisplayOn
Boolean to save display state.
Definition GraphicDisplay.h:363
uint32_t u32BufferLen
Size of the Frame Buffer display.
Definition GraphicDisplay.h:354
bool bInitialized
Boolean to tell if Graphic Display handler is initialized.
Definition GraphicDisplay.h:366
uint32_t u32CurrX
Current X display position.
Definition GraphicDisplay.h:357
uint32_t u32CurrY
Current Y display position.
Definition GraphicDisplay.h:360
Handler of Graphic Display. Each display must need your own handler. Yes, this library supports multi...
Definition GraphicDisplay.h:332
gd_driver_t * disp
Display driver, that contains the Handler and routines.
Definition GraphicDisplay.h:349
uint32_t u32Width
Display width in columns. Must be the same of display device.
Definition GraphicDisplay.h:336
uint32_t u32Height
Display height in Lines. Must be the same of display device.
Definition GraphicDisplay.h:334
Structure used to support the creation of polylines. In normal use, this is declared as an array,...
Definition GraphicDisplay.h:318
uint32_t y
point in Y axis
Definition GraphicDisplay.h:322
uint32_t x
point in X axis
Definition GraphicDisplay.h:320