feat(rgb_lcd): support draw bitmap hook

This commit is contained in:
Chen Jichang
2026-06-17 15:49:51 +08:00
committed by Chen Ji Chang
parent 33fb0f6daf
commit f2cf926e0a
18 changed files with 979 additions and 122 deletions

View File

@@ -25,6 +25,14 @@ menu "RGB Panel Configuration"
Allocate one draw buffer in LVGL.
endchoice
config EXAMPLE_USE_DMA2D_COPY_FRAME
bool "Use DMA2D to copy draw buffer to frame buffer"
default y
depends on EXAMPLE_USE_SINGLE_FB && SOC_DMA2D_SUPPORTED
help
Enable this option, DMA2D will be used to copy the LVGL draw buffer to the target frame buffer.
This can save some CPU time and improve the performance.
choice EXAMPLE_LCD_DATA_LINES
prompt "RGB LCD Data Lines"
default EXAMPLE_LCD_DATA_LINES_16

View File

@@ -139,6 +139,12 @@ void app_main(void)
esp_lcd_panel_handle_t panel_handle = NULL;
ESP_ERROR_CHECK(example_rgb_lcd_panel_new(&panel_handle));
#if CONFIG_EXAMPLE_USE_DMA2D_COPY_FRAME
// use DMA2D to copy draw buffer to frame buffer
ESP_LOGI(TAG, "RGB panel added DMA2D draw bitmap hook");
ESP_ERROR_CHECK(esp_lcd_rgb_panel_enable_dma2d(panel_handle));
#endif
ESP_LOGI(TAG, "Initialize RGB LCD panel");
ESP_ERROR_CHECK(example_rgb_lcd_panel_init(panel_handle));