179 #include "em_types.h" 
  186 #define ECODE_GLIB_BASE                         0x00000000 
  190 #define GLIB_OK                                 0x00000000 
  192 #define GLIB_ERROR_NOTHING_TO_DRAW              (ECODE_GLIB_BASE | 0x0001) 
  194 #define GLIB_ERROR_INVALID_CHAR                 (ECODE_GLIB_BASE | 0x0002) 
  196 #define GLIB_OUT_OF_BOUNDS                      (ECODE_GLIB_BASE | 0x0003) 
  198 #define GLIB_ERROR_INVALID_CLIPPINGREGION       (ECODE_GLIB_BASE | 0x0004) 
  200 #define GLIB_ERROR_INVALID_ARGUMENT             (ECODE_GLIB_BASE | 0x0005) 
  202 #define GLIB_ERROR_OUT_OF_MEMORY                (ECODE_GLIB_BASE | 0x0006) 
  204 #define GLIB_ERROR_FILE_NOT_SUPPORTED           (ECODE_GLIB_BASE | 0x0007) 
  206 #define GLIB_ERROR_IO                           (ECODE_GLIB_BASE | 0x0008) 
  208 #define GLIB_ERROR_INVALID_FILE                 (ECODE_GLIB_BASE | 0x0009) 
  312 uint32_t 
GLIB_rgbColor(uint8_t red, uint8_t green, uint8_t blue);
 
  327                                 int32_t yCenter, uint32_t radius, uint8_t bitMask);
 
  332                          int32_t x0, int32_t y0, 
bool opaque);
 
  335                        int32_t y, 
bool opaque);
 
  338                          uint32_t width, uint32_t height, 
const uint8_t *picData);
 
  341                        int32_t x2, int32_t y2);
 
  355                           uint32_t numPoints, 
const int32_t *polyPoints);
 
  358                            uint8_t red, uint8_t green, uint8_t blue);
 
EMSTATUS GLIB_drawPolygon(GLIB_Context_t *pContext, uint32_t numPoints, const int32_t *polyPoints)
Draws a polygon using Bresnham's Midpoint Line Algorithm. 
 
EMSTATUS GLIB_drawCircle(GLIB_Context_t *pContext, int32_t x, int32_t y, uint32_t radius)
Draws a circle with center at x, y, and a radius. 
 
EMSTATUS GLIB_drawLineV(GLIB_Context_t *pContext, int32_t x1, int32_t y1, int32_t y2)
Draws a vertical line from x1, y1 to x1, y2. 
 
EMSTATUS GLIB_drawRect(GLIB_Context_t *pContext, const GLIB_Rectangle_t *pRect)
Draws a rectangle outline defined by the passed in rectangle. 
 
Font definition structure. 
 
const DMD_DisplayGeometry * pDisplayGeometry
 
EMSTATUS GLIB_resetDisplayClippingArea(GLIB_Context_t *pContext)
Reset the display driver clipping area to the whole display. 
 
EMSTATUS GLIB_drawRectFilled(GLIB_Context_t *pContext, const GLIB_Rectangle_t *pRect)
Draws a filled rectangle defined by the passed in rectangle. The filled rectangle is drawn from (xMin...
 
const GLIB_Font_t GLIB_FontNarrow6x8
Narrow 6x8 pixels font containing characters and numbers. 
 
EMSTATUS GLIB_drawPartialCircle(GLIB_Context_t *pContext, int32_t xCenter, int32_t yCenter, uint32_t radius, uint8_t bitMask)
Draws a partial circle with center at x, y, and a radius. 
 
struct __GLIB_Rectangle_t GLIB_Rectangle_t
Rectangle structure. 
 
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. 
 
uint16_t cntOfMapElements
 
EMSTATUS GLIB_drawString(GLIB_Context_t *pContext, const char *pString, uint32_t sLength, int32_t x0, int32_t y0, bool opaque)
Draws a string using the font supplied with the library. 
 
EMSTATUS GLIB_displayWakeUp(void)
Returns the display from sleep mode. 
 
enum __GLIB_Font_Class GLIB_Font_Class
Font classes. 
 
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...
 
EMSTATUS GLIB_drawCircleFilled(GLIB_Context_t *pContext, int32_t x, int32_t y, uint32_t radius)
Draws a filled circle with center at x, y, and a radius. 
 
EMSTATUS GLIB_drawLineH(GLIB_Context_t *pContext, int32_t x1, int32_t y1, int32_t x2)
Draws a horizontal line from x1, y1 to x2, y2. 
 
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. 
 
struct __GLIB_Font_t GLIB_Font_t
Font definition structure. 
 
void GLIB_normalizeRect(GLIB_Rectangle_t *pRect)
Normalize the rectangle that is passed in. Sets yMin to the minimum value of yMin and yMax...
 
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. 
 
struct __GLIB_Context_t GLIB_Context_t
GLIB Drawing Context (Multiple instances of GLIB_Context_t can exist) 
 
__GLIB_Font_Class
Font classes. 
 
const GLIB_Font_t GLIB_FontNumber16x20
Large 16x20 pixels font containing only numbers. 
 
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. 
 
Silicon Labs Graphics Library: Color Defines. 
 
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_drawBitmap(GLIB_Context_t *pContext, int32_t x, int32_t y, uint32_t width, uint32_t height, const uint8_t *picData)
Draws a bitmap. 
 
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(void)
Sets the display in sleep mode. 
 
EMSTATUS GLIB_drawLine(GLIB_Context_t *pContext, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
Draws a line from x1,y1 to x2, y2. 
 
GLIB_Rectangle_t clippingRegion
 
const GLIB_Font_t GLIB_FontNormal8x8
Normal 8x8 pixels font containing characters and numbers. 
 
EMSTATUS GLIB_drawChar(GLIB_Context_t *pContext, char myChar, int32_t x, int32_t y, bool opaque)
Draws a char using the font supplied with the library. 
 
GLIB Drawing Context (Multiple instances of GLIB_Context_t can exist)