|
Firmware SDK
|
Graphics library. More...
Data Structures | |
| struct | twr_gfx_caps_t |
| Display size. More... | |
| struct | twr_gfx_driver_t |
| Display driver interface. More... | |
| struct | twr_gfx_t |
| Instance. More... | |
Enumerations | |
| enum | twr_gfx_rotation_t { TWR_GFX_ROTATION_0 = 0 , TWR_GFX_ROTATION_90 = 1 , TWR_GFX_ROTATION_180 = 2 , TWR_GFX_ROTATION_270 = 3 } |
| Rotation. More... | |
| enum | twr_gfx_round_corner_t { TWR_GFX_ROUND_CORNER_RIGHT_TOP = 0x01 , TWR_GFX_ROUND_CORNER_RIGHT_BOTTOM = 0x02 , TWR_GFX_ROUND_CORNER_LEFT_BOTTOM = 0x04 , TWR_GFX_ROUND_CORNER_LEFT_TOP = 0x08 } |
Functions | |
| void | twr_gfx_init (twr_gfx_t *self, void *display, const twr_gfx_driver_t *driver) |
| Initialize button. More... | |
| bool | twr_gfx_display_is_ready (twr_gfx_t *self) |
| Check if display driver is ready for commands. More... | |
| twr_gfx_caps_t | twr_gfx_get_caps (twr_gfx_t *self) |
| Get Display capabilities. More... | |
| void | twr_gfx_clear (twr_gfx_t *self) |
| Clear. More... | |
| void | twr_gfx_set_font (twr_gfx_t *self, const twr_font_t *font) |
| Set font. More... | |
| void | twr_gfx_set_rotation (twr_gfx_t *self, twr_gfx_rotation_t rotation) |
| Set rotation. More... | |
| twr_gfx_rotation_t | twr_gfx_get_rotation (twr_gfx_t *self) |
| Get rotation. More... | |
| void | twr_gfx_draw_pixel (twr_gfx_t *self, int x, int y, uint32_t color) |
| Draw pixel. More... | |
| int | twr_gfx_draw_char (twr_gfx_t *self, int left, int top, uint8_t ch, uint32_t color) |
| Display draw char. More... | |
| int | twr_gfx_calc_char_width (twr_gfx_t *self, uint8_t ch) |
| Calc width character. More... | |
| int | twr_gfx_draw_string (twr_gfx_t *self, int left, int top, char *str, uint32_t color) |
| Display draw string. More... | |
| int | twr_gfx_calc_string_width (twr_gfx_t *self, char *str) |
| Calc width string. More... | |
| int | twr_gfx_printf (twr_gfx_t *self, int left, int top, uint32_t color, char *format,...) |
| Display string. More... | |
| void | twr_gfx_draw_line (twr_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color) |
| Display draw line. More... | |
| void | twr_gfx_draw_rectangle (twr_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color) |
| Display draw rectangle. More... | |
| void | twr_gfx_draw_fill_rectangle (twr_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color) |
| Display draw fill rectangle. More... | |
| void | twr_gfx_draw_fill_rectangle_dithering (twr_gfx_t *self, int x0, int y0, int x1, int y1, uint32_t color) |
| Display draw fill rectangle with a dithering pattern defined in the color parameter. More... | |
| void | twr_gfx_draw_fill_rectangle_dithering_color (twr_gfx_t *self, int x0, int y0, int x1, int y1, uint16_t pattern, uint32_t color_fg, uint32_t color_bg) |
| Display draw fill rectangle with a dithering pattern defined in the pattern parameter, with the support for multicolor dithering. More... | |
| void | twr_gfx_draw_circle (twr_gfx_t *self, int x0, int y0, int radius, uint32_t color) |
| Lcd draw circle, using Midpoint circle algorithm. More... | |
| void | twr_gfx_draw_fill_circle (twr_gfx_t *self, int x0, int y0, int radius, uint32_t color) |
| Lcd draw fill circle, using Midpoint circle algorithm. More... | |
| void | twr_gfx_draw_round_corner (twr_gfx_t *self, int x0, int y0, int radius, twr_gfx_round_corner_t corner, uint32_t color) |
| Lcd draw round corner, using Midpoint circle algorithm. More... | |
| void | twr_gfx_draw_fill_round_corner (twr_gfx_t *self, int x0, int y0, int radius, twr_gfx_round_corner_t corner, uint32_t color) |
| Lcd draw fill round corner, using Midpoint circle algorithm. More... | |
| bool | twr_gfx_update (twr_gfx_t *self) |
| Display update, send data. More... | |
Graphics library.
| enum twr_gfx_rotation_t |
| int twr_gfx_calc_char_width | ( | twr_gfx_t * | self, |
| uint8_t | ch | ||
| ) |
Calc width character.
| [in] | self | Instance |
Definition at line 132 of file twr_gfx.c.
Referenced by twr_gfx_calc_string_width().

| int twr_gfx_calc_string_width | ( | twr_gfx_t * | self, |
| char * | str | ||
| ) |
| void twr_gfx_clear | ( | twr_gfx_t * | self | ) |
Clear.
| [in] | self | Instance |
Definition at line 22 of file twr_gfx.c.
Referenced by twr_module_lcd_clear(), and twr_module_lcd_init().

| bool twr_gfx_display_is_ready | ( | twr_gfx_t * | self | ) |
Check if display driver is ready for commands.
| [in] | self | Instance |
Definition at line 12 of file twr_gfx.c.
Referenced by twr_module_lcd_is_ready().

| int twr_gfx_draw_char | ( | twr_gfx_t * | self, |
| int | left, | ||
| int | top, | ||
| uint8_t | ch, | ||
| uint32_t | color | ||
| ) |
Display draw char.
| [in] | self | Instance |
| [in] | left | Pixels from left edge |
| [in] | top | Pixels from top edge |
| [in] | ch | Char to be printed |
| [in] | color |
Definition at line 86 of file twr_gfx.c.
Referenced by twr_gfx_draw_string(), and twr_module_lcd_draw_char().


| void twr_gfx_draw_circle | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | radius, | ||
| uint32_t | color | ||
| ) |
Lcd draw circle, using Midpoint circle algorithm.
| [in] | self | Instance |
| [in] | x0 | Center - pixels from left edge |
| [in] | y0 | Center - pixels from top edge |
| [in] | radius | In pixels |
| [in] | color |
Definition at line 328 of file twr_gfx.c.
Referenced by twr_module_lcd_draw_circle().


| void twr_gfx_draw_fill_circle | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | radius, | ||
| uint32_t | color | ||
| ) |
| void twr_gfx_draw_fill_rectangle | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| uint32_t | color | ||
| ) |
| void twr_gfx_draw_fill_rectangle_dithering | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| uint32_t | color | ||
| ) |
Display draw fill rectangle with a dithering pattern defined in the color parameter.
| [in] | self | Instance |
| [in] | x0 | Pixels from left edge |
| [in] | y0 | Pixels from top edge |
| [in] | x1 | Pixels from left edge |
| [in] | y1 | Pixels from top edge |
| [in] | color | Dithering mask, 16 bits define bit pattern in the 4 by 4 area |
Definition at line 298 of file twr_gfx.c.

| void twr_gfx_draw_fill_rectangle_dithering_color | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| uint16_t | pattern, | ||
| uint32_t | color_fg, | ||
| uint32_t | color_bg | ||
| ) |
Display draw fill rectangle with a dithering pattern defined in the pattern parameter, with the support for multicolor dithering.
| [in] | self | Instance |
| [in] | x0 | Pixels from left edge |
| [in] | y0 | Pixels from top edge |
| [in] | x1 | Pixels from left edge |
| [in] | y1 | Pixels from top edge |
| [in] | pattern | Dithering mask, 16 bits define bit pattern in the 4 by 4 area |
| [in] | color_fg | Color used for the foreground of the rectangle |
| [in] | color_bg | Color used for the background of the rectangle |
Definition at line 313 of file twr_gfx.c.

| void twr_gfx_draw_fill_round_corner | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | radius, | ||
| twr_gfx_round_corner_t | corner, | ||
| uint32_t | color | ||
| ) |
| void twr_gfx_draw_line | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| uint32_t | color | ||
| ) |
Display draw line.
| [in] | self | Instance |
| [in] | x0 | Pixels from left edge |
| [in] | y0 | Pixels from top edge |
| [in] | x1 | Pixels from left edge |
| [in] | y1 | Pixels from top edge |
| [in] | color |
Definition at line 188 of file twr_gfx.c.
Referenced by twr_gfx_draw_fill_circle(), twr_gfx_draw_fill_round_corner(), twr_gfx_draw_rectangle(), and twr_module_lcd_draw_line().


| void twr_gfx_draw_pixel | ( | twr_gfx_t * | self, |
| int | x, | ||
| int | y, | ||
| uint32_t | color | ||
| ) |
Draw pixel.
| [in] | self | Instance |
| [in] | left | Pixels from left edge |
| [in] | top | Pixels from top edge |
| [in] | color |
Definition at line 42 of file twr_gfx.c.
Referenced by twr_gfx_draw_char(), twr_gfx_draw_circle(), twr_gfx_draw_fill_rectangle(), twr_gfx_draw_fill_rectangle_dithering(), twr_gfx_draw_fill_rectangle_dithering_color(), twr_gfx_draw_line(), twr_gfx_draw_round_corner(), twr_module_lcd_draw_image(), and twr_module_lcd_draw_pixel().

| void twr_gfx_draw_rectangle | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| uint32_t | color | ||
| ) |
Display draw rectangle.
| [in] | self | Instance |
| [in] | x0 | Pixels from left edge |
| [in] | y0 | Pixels from top edge |
| [in] | x1 | Pixels from left edge |
| [in] | y1 | Pixels from top edge |
| [in] | color |
Definition at line 278 of file twr_gfx.c.
Referenced by twr_module_lcd_draw_rectangle().


| void twr_gfx_draw_round_corner | ( | twr_gfx_t * | self, |
| int | x0, | ||
| int | y0, | ||
| int | radius, | ||
| twr_gfx_round_corner_t | corner, | ||
| uint32_t | color | ||
| ) |
| int twr_gfx_draw_string | ( | twr_gfx_t * | self, |
| int | left, | ||
| int | top, | ||
| char * | str, | ||
| uint32_t | color | ||
| ) |
Display draw string.
| [in] | self | Instance |
| [in] | left | Pixels from left edge |
| [in] | top | Pixels from top edge |
| [in] | *str | String to be printed |
| [in] | color |
Definition at line 152 of file twr_gfx.c.
Referenced by twr_gfx_printf(), and twr_module_lcd_draw_string().


| twr_gfx_caps_t twr_gfx_get_caps | ( | twr_gfx_t * | self | ) |
| twr_gfx_rotation_t twr_gfx_get_rotation | ( | twr_gfx_t * | self | ) |
Get rotation.
| [in] | self | Instance |
Definition at line 37 of file twr_gfx.c.
Referenced by twr_module_lcd_get_rotation().

| void twr_gfx_init | ( | twr_gfx_t * | self, |
| void * | display, | ||
| const twr_gfx_driver_t * | driver | ||
| ) |
Initialize button.
| [in] | self | Instance |
Definition at line 3 of file twr_gfx.c.
Referenced by twr_module_lcd_init().

| int twr_gfx_printf | ( | twr_gfx_t * | self, |
| int | left, | ||
| int | top, | ||
| uint32_t | color, | ||
| char * | format, | ||
| ... | |||
| ) |
| void twr_gfx_set_font | ( | twr_gfx_t * | self, |
| const twr_font_t * | font | ||
| ) |
Set font.
| [in] | self | Instance |
| [in] | *font | Font |
Definition at line 27 of file twr_gfx.c.
Referenced by twr_module_lcd_set_font().

| void twr_gfx_set_rotation | ( | twr_gfx_t * | self, |
| twr_gfx_rotation_t | rotation | ||
| ) |
Set rotation.
| [in] | self | Instance |
| [in] | rotation | Rotation of diplay |
Definition at line 32 of file twr_gfx.c.
Referenced by twr_module_lcd_set_rotation().

| bool twr_gfx_update | ( | twr_gfx_t * | self | ) |
Display update, send data.
| [in] | self | Instance |
Definition at line 491 of file twr_gfx.c.
Referenced by twr_module_lcd_update().
