|
TB2026-YDS Firmware
|
Software rendering into an in-RAM RGB565 framebuffer, blitted by gfx_flush(). More...

Macros | |
| #define | GFX_W 176 |
| #define | GFX_H 176 |
| #define | GFX_BLACK ((gfx_color_t)0x0000) |
| #define | GFX_WHITE ((gfx_color_t)0xFFFF) |
| #define | GFX_CHAR_W 6 |
| #define | GFX_CHAR_H 8 |
Typedefs | |
| typedef uint16_t | gfx_color_t |
Functions | |
| void | gfx_clear (gfx_color_t color) |
| Fill the whole framebuffer with one color. | |
| void | gfx_pixel (int x, int y, gfx_color_t color) |
| Set one pixel; off-canvas coordinates are ignored. | |
| void | gfx_fill_rect (int x, int y, int w, int h, gfx_color_t color) |
| Fill a rectangle, clipped to the canvas. | |
| void | gfx_draw_rect (int x, int y, int w, int h, gfx_color_t color) |
| Draw a 1px rectangle outline. | |
| void | gfx_draw_text (int x, int y, const char *s, gfx_color_t color, int scale) |
| Draw an ASCII string (0x20..0x7E) left to right. | |
| void | gfx_blit_1bpp (int x, int y, int w, int h, const uint8_t *bitmap, gfx_color_t color) |
Draw a 1-bpp bitmap; set bits are drawn in color, clear bits are skipped. | |
| void | gfx_flush (void) |
| Blit the framebuffer to the OLED over SPI. | |
| const gfx_color_t * | gfx_buffer (void) |
| Read-only access to the framebuffer (GFX_W*GFX_H pixels). | |
Software rendering into an in-RAM RGB565 framebuffer, blitted by gfx_flush().
| #define GFX_BLACK ((gfx_color_t)0x0000) |
Black.
| #define GFX_CHAR_H 8 |
Character cell height.
| #define GFX_CHAR_W 6 |
Character cell width: 5px glyph + 1px gap.
| #define GFX_H 176 |
Canvas height in pixels.
| #define GFX_W 176 |
Canvas width in pixels (the SSD1333 panel).
| #define GFX_WHITE ((gfx_color_t)0xFFFF) |
White.
| typedef uint16_t gfx_color_t |
A pixel: RGB565, native byte order.
| void gfx_blit_1bpp | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| const uint8_t * | bitmap, | ||
| gfx_color_t | color ) |
Draw a 1-bpp bitmap; set bits are drawn in color, clear bits are skipped.
The bitmap is row-major, MSB-first within each byte (bit 7 = leftmost pixel), with each row padded to a whole number of bytes (stride = (w + 7) / 8). This is the format emitted by scripts/icon2c.py. Clear bits leave the framebuffer untouched, so the background shows through (transparency).
| x,y | Top-left position in the framebuffer. |
| w,h | Bitmap dimensions in pixels. |
| bitmap | 1-bpp pixel data, (w + 7) / 8 * h bytes. |
| color | Color for set bits. |
| const gfx_color_t * gfx_buffer | ( | void | ) |
Read-only access to the framebuffer (GFX_W*GFX_H pixels).
| void gfx_clear | ( | gfx_color_t | color | ) |
Fill the whole framebuffer with one color.
| void gfx_draw_rect | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| gfx_color_t | color ) |
Draw a 1px rectangle outline.
| void gfx_draw_text | ( | int | x, |
| int | y, | ||
| const char * | s, | ||
| gfx_color_t | color, | ||
| int | scale ) |
Draw an ASCII string (0x20..0x7E) left to right.
| x,y | Top-left of the first glyph. |
| s | NUL-terminated string; non-printable bytes advance but draw nothing. |
| color | Glyph color. |
| scale | Integer pixel scale (clamped to >= 1). |
| void gfx_fill_rect | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| gfx_color_t | color ) |
Fill a rectangle, clipped to the canvas.
| void gfx_flush | ( | void | ) |
Blit the framebuffer to the OLED over SPI.
| void gfx_pixel | ( | int | x, |
| int | y, | ||
| gfx_color_t | color ) |
Set one pixel; off-canvas coordinates are ignored.