|
TB2026-YDS Firmware
|
Panel init and full-frame RGB565 blit over SPI. More...

Macros | |
| #define | DISPLAY_OLED_BRIGHTNESS_MAX 15 |
Functions | |
| esp_err_t | display_oled_init (spi_device_handle_t spi) |
| Reset the panel and run the SSD1333 init sequence (gamma, contrast, display on). | |
| esp_err_t | display_oled_draw (const uint8_t *buf, size_t len) |
| Blit a full framebuffer to the panel. | |
| esp_err_t | display_oled_clear (void) |
| Clear the panel to black directly, without a framebuffer. | |
| esp_err_t | display_oled_set_brightness (uint8_t level) |
| Set the global panel brightness (SSD1333 Master Current, cmd 0xC7). | |
| esp_err_t | display_oled_sleep (void) |
| Put the panel to sleep (SSD1333 Display OFF, cmd 0xAE). | |
| esp_err_t | display_oled_wake (void) |
| Wake the panel from sleep (SSD1333 Display ON, cmd 0xAF). | |
Panel init and full-frame RGB565 blit over SPI.
| #define DISPLAY_OLED_BRIGHTNESS_MAX 15 |
Highest brightness level accepted by display_oled_set_brightness().
| esp_err_t display_oled_clear | ( | void | ) |
Clear the panel to black directly, without a framebuffer.
| esp_err_t display_oled_draw | ( | const uint8_t * | buf, |
| size_t | len ) |
Blit a full framebuffer to the panel.
Streams the whole 176x176 RAM window, byte-swapping each native RGB565 pixel to the panel's MSB-first order.
| buf | Framebuffer, native-order RGB565, GFX_W*GFX_H pixels. |
| len | Byte length; must equal 176*176*2. |
len is wrong, or the SPI error. | esp_err_t display_oled_init | ( | spi_device_handle_t | spi | ) |
Reset the panel and run the SSD1333 init sequence (gamma, contrast, display on).
Configures the D/C# and RST GPIOs, pulses reset, then sends the datasheet init sequence. Must be called once before any draw.
| spi | SPI device handle for the panel (from spi_bus_display_init()). |
| esp_err_t display_oled_set_brightness | ( | uint8_t | level | ) |
Set the global panel brightness (SSD1333 Master Current, cmd 0xC7).
Scales the segment output current uniformly across all colours, so it dims the whole picture without shifting the colour balance – and lowers the panel's current draw, which matters on battery. The init sequence leaves this at the maximum; call this to override it.
Runs on the caller's task; call from the UI task only (same task as display_oled_draw()), never concurrently with a blit.
| level | 0 (dimmest) .. DISPLAY_OLED_BRIGHTNESS_MAX (brightest); clamped. |
| esp_err_t display_oled_sleep | ( | void | ) |
Put the panel to sleep (SSD1333 Display OFF, cmd 0xAE).
Blanks the output and drops the panel to its ~2 µA sleep current; the RAM contents and all configuration are retained, so display_oled_wake() restores the last frame with no re-init and no redraw. Building block for a future screen auto-off / sleep policy – this driver applies no timeout of its own.
Not serialised internally: call it from the same task as display_oled_draw() (the UI task), never concurrently with a blit.
| esp_err_t display_oled_wake | ( | void | ) |
Wake the panel from sleep (SSD1333 Display ON, cmd 0xAF).
Undoes display_oled_sleep(); the previously shown frame reappears. Same task constraint as display_oled_sleep().