See Quick Start Guide for the mono graphics service.
This library provides an interface to drawing graphics on monochrome graphical displays
The graphics drivers consists of the following:
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.
The display specific drivers provides an interface to the graphical display. It implements the low level communication with the display hardware, putting pixels on the display and drawing primitives such as lines, circles and rectangles. Depending on the display driver implementation, drawing the graphics primitives might be handled by the generic graphics drawing primitives rather than the display driver itself.
The following examples are available for the driver:
Modules | |
2832HSWEG04 graphic library abstraction | |
This module is an abstraction layer between the graphic library and the 2832HSWEG04 monochrome LCD display connected to a SSD1306 LCD controller. | |
Generic monochrome graphic primitives | |
This is a service providing generic implementations of graphic primitives. | |
Framebuffer | |
This module provides read/write from and to a framebuffer in RAM. | |
GFX Mono Font Library | |
This modules provides functionality for outputting a monochrome font to a display. | |
Typedefs | |
typedef uint8_t | gfx_coord_t |
typedef uint8_t | gfx_mono_color_t |
Enumerations | |
enum | gfx_mono_bitmap_type { GFX_MONO_BITMAP_RAM, GFX_MONO_BITMAP_PROGMEM } |
Bitmap types. More... | |
enum | gfx_mono_color { GFX_PIXEL_CLR = 0, GFX_PIXEL_SET = 1, GFX_PIXEL_XOR = 2 } |
Pixel operations. More... | |
Circle Sector Definitions | |
#define | GFX_OCTANT0 (1 << 0) |
Bitmask for drawing circle octant 0. More... | |
#define | GFX_OCTANT1 (1 << 1) |
Bitmask for drawing circle octant 1. More... | |
#define | GFX_OCTANT2 (1 << 2) |
Bitmask for drawing circle octant 2. More... | |
#define | GFX_OCTANT3 (1 << 3) |
Bitmask for drawing circle octant 3. More... | |
#define | GFX_OCTANT4 (1 << 4) |
Bitmask for drawing circle octant 4. More... | |
#define | GFX_OCTANT5 (1 << 5) |
Bitmask for drawing circle octant 5. More... | |
#define | GFX_OCTANT6 (1 << 6) |
Bitmask for drawing circle octant 6. More... | |
#define | GFX_OCTANT7 (1 << 7) |
Bitmask for drawing circle octant 7. More... | |
#define | GFX_QUADRANT0 (GFX_OCTANT0 | GFX_OCTANT1) |
Bitmask for drawing circle quadrant 0. More... | |
#define | GFX_QUADRANT1 (GFX_OCTANT2 | GFX_OCTANT3) |
Bitmask for drawing circle quadrant 1. More... | |
#define | GFX_QUADRANT2 (GFX_OCTANT4 | GFX_OCTANT5) |
Bitmask for drawing circle quadrant 2. More... | |
#define | GFX_QUADRANT3 (GFX_OCTANT6 | GFX_OCTANT7) |
Bitmask for drawing circle quadrant 3. More... | |
#define | GFX_LEFTHALF (GFX_QUADRANT3 | GFX_QUADRANT0) |
Bitmask for drawing left half of circle. More... | |
#define | GFX_TOPHALF (GFX_QUADRANT0 | GFX_QUADRANT1) |
Bitmask for drawing top half of circle. More... | |
#define | GFX_RIGHTHALF (GFX_QUADRANT1 | GFX_QUADRANT2) |
Bitmask for drawing right half of circle. More... | |
#define | GFX_BOTTOMHALF (GFX_QUADRANT2 | GFX_QUADRANT3) |
Bitmask for drawing bottom half of circle. More... | |
#define | GFX_WHOLE 0xFF |
Bitmask for drawing whole circle. More... | |
Graphic Drawing Primitives | |
#define | gfx_mono_draw_horizontal_line(x, y, length, color) gfx_mono_generic_draw_horizontal_line(x, y, length, color) |
Draw a horizontal line, one pixel wide. More... | |
#define | gfx_mono_draw_vertical_line(x, y, length, color) gfx_mono_generic_draw_vertical_line(x, y, length, color) |
Draw a vertical line, one pixel wide. More... | |
#define | gfx_mono_draw_line(x1, y1, x2, y2, color) gfx_mono_generic_draw_line(x1, y1, x2, y2, color) |
Draw a line between two arbitrary points. More... | |
#define | gfx_mono_draw_rect(x, y, width, height, color) gfx_mono_generic_draw_rect(x, y, width, height, color) |
Draw an outline of a rectangle. More... | |
#define | gfx_mono_draw_filled_rect(x, y, width, height, color) |
Draw a filled rectangle. More... | |
#define | gfx_mono_draw_circle(x, y, radius, color, octant_mask) |
Draw an outline of a circle or arc. More... | |
#define | gfx_mono_draw_filled_circle(x, y, radius, color, quadrant_mask) |
Draw a filled circle or sector. More... | |
#define GFX_BOTTOMHALF (GFX_QUADRANT2 | GFX_QUADRANT3) |
Bitmask for drawing bottom half of circle.
#define GFX_LEFTHALF (GFX_QUADRANT3 | GFX_QUADRANT0) |
Bitmask for drawing left half of circle.
#define gfx_mono_draw_circle | ( | x, | |
y, | |||
radius, | |||
color, | |||
octant_mask | |||
) |
Draw an outline of a circle or arc.
The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).
The octant_mask parameter is a bitmask that decides which octants of the circle to draw. Use the GFX_OCTANTn, GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.
[in] | x | X coordinate of center. |
[in] | y | Y coordinate of center. |
[in] | radius | Circle radius in pixels. |
[in] | color | Pixel operation. |
[in] | octant_mask | Bitmask indicating which octants to draw. |
#define gfx_mono_draw_filled_circle | ( | x, | |
y, | |||
radius, | |||
color, | |||
quadrant_mask | |||
) |
Draw a filled circle or sector.
The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).
The quadrant_mask parameter is a bitmask that decides which quadrants of the circle to draw. Use the GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.
[in] | x | X coordinate of center. |
[in] | y | Y coordinate of center. |
[in] | radius | Circle radius in pixels. |
[in] | color | Pixel operation. |
[in] | quadrant_mask | Bitmask indicating which quadrants to draw. |
#define gfx_mono_draw_filled_rect | ( | x, | |
y, | |||
width, | |||
height, | |||
color | |||
) |
Draw a filled rectangle.
[in] | x | X coordinate of the left side. |
[in] | y | Y coordinate of the top side. |
[in] | width | Width of the rectangle. |
[in] | height | Height of the rectangle. |
[in] | color | Pixel operation of the line |
Referenced by gfx_mono_draw_char(), main_task(), and terminal_task().
#define gfx_mono_draw_horizontal_line | ( | x, | |
y, | |||
length, | |||
color | |||
) | gfx_mono_generic_draw_horizontal_line(x, y, length, color) |
Draw a horizontal line, one pixel wide.
[in] | x | X coordinate of leftmost pixel. |
[in] | y | Y coordinate of the line. |
[in] | length | Length of the line in pixels. |
[in] | color | Pixel operation of the line. |
Referenced by gfx_mono_generic_draw_filled_rect(), gfx_mono_generic_draw_rect(), and main_task().
#define gfx_mono_draw_line | ( | x1, | |
y1, | |||
x2, | |||
y2, | |||
color | |||
) | gfx_mono_generic_draw_line(x1, y1, x2, y2, color) |
Draw a line between two arbitrary points.
[in] | x1 | Start X coordinate. |
[in] | y1 | Start Y coordinate. |
[in] | x2 | End X coordinate. |
[in] | y2 | End Y coordinate. |
[in] | color | Pixel operation of the line. |
Referenced by graph_task().
#define gfx_mono_draw_rect | ( | x, | |
y, | |||
width, | |||
height, | |||
color | |||
) | gfx_mono_generic_draw_rect(x, y, width, height, color) |
Draw an outline of a rectangle.
[in] | x | X coordinate of the left side. |
[in] | y | Y coordinate of the top side. |
[in] | width | Width of the rectangle. |
[in] | height | Height of the rectangle. |
[in] | color | Pixel operation of the line. |
Referenced by main_task().
#define gfx_mono_draw_vertical_line | ( | x, | |
y, | |||
length, | |||
color | |||
) | gfx_mono_generic_draw_vertical_line(x, y, length, color) |
Draw a vertical line, one pixel wide.
[in] | x | X coordinate of the line. |
[in] | y | Y coordinate of the topmost pixel. |
[in] | length | Length of the line in pixels. |
[in] | color | Pixel operation of the line. |
Referenced by gfx_mono_generic_draw_filled_circle(), gfx_mono_generic_draw_rect(), graph_task(), and main_task().
#define GFX_OCTANT0 (1 << 0) |
Bitmask for drawing circle octant 0.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT1 (1 << 1) |
Bitmask for drawing circle octant 1.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT2 (1 << 2) |
Bitmask for drawing circle octant 2.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT3 (1 << 3) |
Bitmask for drawing circle octant 3.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT4 (1 << 4) |
Bitmask for drawing circle octant 4.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT5 (1 << 5) |
Bitmask for drawing circle octant 5.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT6 (1 << 6) |
Bitmask for drawing circle octant 6.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_OCTANT7 (1 << 7) |
Bitmask for drawing circle octant 7.
Referenced by gfx_mono_generic_draw_circle().
#define GFX_QUADRANT0 (GFX_OCTANT0 | GFX_OCTANT1) |
Bitmask for drawing circle quadrant 0.
Referenced by gfx_mono_generic_draw_filled_circle().
#define GFX_QUADRANT1 (GFX_OCTANT2 | GFX_OCTANT3) |
Bitmask for drawing circle quadrant 1.
Referenced by gfx_mono_generic_draw_filled_circle().
#define GFX_QUADRANT2 (GFX_OCTANT4 | GFX_OCTANT5) |
Bitmask for drawing circle quadrant 2.
Referenced by gfx_mono_generic_draw_filled_circle().
#define GFX_QUADRANT3 (GFX_OCTANT6 | GFX_OCTANT7) |
Bitmask for drawing circle quadrant 3.
Referenced by gfx_mono_generic_draw_filled_circle().
#define GFX_RIGHTHALF (GFX_QUADRANT1 | GFX_QUADRANT2) |
Bitmask for drawing right half of circle.
#define GFX_TOPHALF (GFX_QUADRANT0 | GFX_QUADRANT1) |
Bitmask for drawing top half of circle.
#define GFX_WHOLE 0xFF |
Bitmask for drawing whole circle.
typedef uint8_t gfx_coord_t |
typedef uint8_t gfx_mono_color_t |
enum gfx_mono_bitmap_type |
enum gfx_mono_color |