2.3 GFX Graphic Library

This library provides an interface to draw graphics on monochrome graphical displays. The graphics drivers consists of the following:

  • Display driver interface (gfx_mono.h)
  • General graphics drawing primitives (gfx_mono_generic.h)
  • Display specific implementation (ex. gfx_mono_ug_2832hsweg04.h)

The generic drawing primitives is a library of functions for drawing graphics primitives such as lines, rectangles, and circles. It uses other functions implemented by the display driver for drawing the primitives. The implementation of these functions can optionally be used by a display driver, but if the hardware of the display allows faster handling of any of the primitives, the display driver can implement it directly.

Note: The functions in the library are not interrupt safe.

The generic graphic library functions are listed below, implemented in gfx_mono_generic.h/c:

Table 2-3. GFX Graphic Library Functions:
FunctionDescription
gfx_mono_generic_put_bitmap()Put bitmap from FLASH or RAM to display
gfx_mono_generic_draw_circle()Draw an outline of a circle or arc
gfx_mono_generic_draw_filled_circle()Draw a filled circle or sector
gfx_mono_generic_draw_filled_rect()Draw a filled rectangle
gfx_mono_generic_draw_horizontal_line()Draw a horizontal line, one pixel wide
gfx_mono_generic_draw_line()Draw a line between two arbitrary points
gfx_mono_generic_draw_rect()Draw an outline of a rectangle
gfx_mono_generic_draw_vertical_line()Draw a vertical line, one pixel wide