30 #ifndef GLIB_NO_DEFAULT_FONT
31 #define GLIB_DEFAULT_FONT ((GLIB_Font_t *)&GLIB_FontNormal8x8)
38 static __INLINE
void GLIB_colorTranslate24bppInl(uint32_t color, uint8_t *red, uint8_t *green, uint8_t *blue)
62 DMD_DisplayGeometry *pTmpDisplayGeometry;
72 status = DMD_getDisplayGeometry(&pTmpDisplayGeometry);
73 if (status != DMD_OK)
return status;
78 GLIB_Rectangle_t tmpRect = {0, 0, pTmpDisplayGeometry->xSize - 1, pTmpDisplayGeometry->ySize - 1};
80 if (status !=
GLIB_OK)
return status;
83 #ifndef GLIB_NO_DEFAULT_FONT
141 if ((pRect->
xMin < 0) ||
180 if (status !=
GLIB_OK)
return status;
185 return DMD_writeColor(0, 0, red, green, blue, width * height);
215 if (status != DMD_OK)
return status;
220 status = DMD_writeColor(0, 0, red, green, blue, width * height);
221 if (status != DMD_OK)
return status;
311 GLIB_colorTranslate24bppInl(color, red, green, blue);
361 GLIB_colorTranslate24bppInl(pContext->
foregroundColor, &red, &green, &blue);
362 return DMD_writeColor(x, y, red, green, blue, 1);
393 GLIB_colorTranslate24bppInl(color, &red, &green, &blue);
394 return DMD_writeColor(x, y, red, green, blue, 1);
422 uint8_t red, uint8_t green, uint8_t blue)
429 return DMD_writeColor(x, y, red, green, blue, 1);
#define GLIB_DEFAULT_FONT
#define GLIB_ERROR_NOTHING_TO_DRAW
const DMD_DisplayGeometry * pDisplayGeometry
EMSTATUS GLIB_resetDisplayClippingArea(GLIB_Context_t *pContext)
Reset the display driver clipping area to the whole display.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
EMSTATUS GLIB_drawPixelRGB(GLIB_Context_t *pContext, int32_t x, int32_t y, uint8_t red, uint8_t green, uint8_t blue)
Draws a pixel at x, y with color defined by red, green and blue 1 byte per channel.
#define GLIB_ERROR_INVALID_ARGUMENT
EMSTATUS GLIB_displayWakeUp()
Returns the display from sleep mode.
Silicon Labs Graphics Library.
EMSTATUS GLIB_clear(GLIB_Context_t *pContext)
Clears the display with the background color of the GLIB_Context_t.
uint32_t GLIB_rgbColor(uint8_t red, uint8_t green, uint8_t blue)
Convert 3 uint8_t color components into a 24-bit color.
void GLIB_colorTranslate24bpp(uint32_t color, uint8_t *red, uint8_t *green, uint8_t *blue)
Extracts the color components from the 32-bit color passed and puts them in the passed in 8-bits ints...
#define GLIB_OUT_OF_BOUNDS
EMSTATUS GLIB_contextInit(GLIB_Context_t *pContext)
Initialize the GLIB_Context_t.
EMSTATUS GLIB_applyClippingRegion(const GLIB_Context_t *pContext)
Apply the clipping region from the GLIB_Context_t in the DMD driver.
bool GLIB_rectContainsPoint(const GLIB_Rectangle_t *pRect, int32_t xCenter, int32_t yCenter)
Checks if the point passed in is in the interior of the rectangle passed in.
EMSTATUS GLIB_drawPixelColor(GLIB_Context_t *pContext, int32_t x, int32_t y, uint32_t color)
Draws a pixel at x, y using the color parameter.
EMSTATUS GLIB_resetClippingRegion(GLIB_Context_t *pContext)
Reset the GLIB_Context_t clipping region to the whole display.
EMSTATUS GLIB_drawPixel(GLIB_Context_t *pContext, int32_t x, int32_t y)
Draws a pixel at x, y using foregroundColor defined in the GLIB_Context_t.
EMSTATUS GLIB_setFont(GLIB_Context_t *pContext, GLIB_Font_t *pFont)
Set new font for the library. Note that GLIB defines a default font in glib.c. Redefine GLIB_DEFAULT_...
EMSTATUS GLIB_clearRegion(const GLIB_Context_t *pContext)
Clears the clipping region by filling it with the background color of the GLIB_Context_t.
EMSTATUS GLIB_setClippingRegion(GLIB_Context_t *pContext, const GLIB_Rectangle_t *pRect)
Sets the clippingRegion of the passed in GLIB_Context_t.
EMSTATUS GLIB_displaySleep()
Sets the display in sleep mode.
#define GLIB_ERROR_INVALID_CLIPPINGREGION
GLIB_Rectangle_t clippingRegion
GLIB Drawing Context (Multiple instances of GLIB_Context_t can exist)