Fix LVGL issues and test.

The display renders correctly
This commit is contained in:
2025-11-02 12:46:00 -05:00
parent e0b583f8c1
commit adf081cf1a
5 changed files with 204 additions and 202 deletions

View File

@@ -76,18 +76,9 @@ SSD1306_config_new(esp_lcd_panel_ssd1306_config_t vendor_config, int width,
SSD1306_config = vendor_config;
// Must initialize device with LCD_new_panel to use default LVGL callbacks.
struct IPanelDevice device = LCD_new_panel();
// TODO: Helper to set width and update lv_buf_size.
device.width_ = width, device.height_ = height;
device.esp_io_config_ = (esp_lcd_panel_io_i2c_config_t){
.dev_addr = I2C_HW_ADDR,
// User data to pass to the LVGL flush_ready callback.
// See IPanelDevice::lvgl_flush_ready_cb
.user_ctx = NULL,
.control_phase_bytes = 1,
.dc_bit_offset = 6,
.lcd_cmd_bits = LCD_CMD_BITS,
.lcd_param_bits = LCD_PARAM_BITS,
.scl_speed_hz = LCD_PIXEL_CLOCK_HZ,
};
device.lv_buf_size_ = width * height / 8 + LVGL_PALETTE_SIZE;
device.init_panel_cb = SSD1306_init_panel_cb;
device.vendor_config_cb = SSD1306_vendor_config_cb;
return device;