diff --git a/esp-box-lite/Kconfig b/esp-box-lite/Kconfig index e3f541b3..28457ae6 100644 --- a/esp-box-lite/Kconfig +++ b/esp-box-lite/Kconfig @@ -60,6 +60,19 @@ menu "Board Support Package" help LEDC channel is used to generate PWM signal that controls display brightness. Set LEDC index that should be used. + + config BSP_LCD_DRAW_BUF_HEIGHT + int "LCD framebuf height" + default 100 + range 10 240 + help + Framebuf is used for lvgl rendering output. + + config BSP_LCD_DRAW_BUF_DOUBLE + bool "LCD double framebuf" + default n + help + Whether to enable double framebuf. endmenu config BSP_I2S_NUM diff --git a/esp-box-lite/esp-box-lite.c b/esp-box-lite/esp-box-lite.c index c7f55daa..7365a056 100644 --- a/esp-box-lite/esp-box-lite.c +++ b/esp-box-lite/esp-box-lite.c @@ -371,7 +371,7 @@ static lv_disp_t *bsp_display_lcd_init(void) esp_lcd_panel_io_handle_t io_handle = NULL; esp_lcd_panel_handle_t panel_handle = NULL; const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t), + .max_transfer_sz = (BSP_LCD_H_RES * CONFIG_BSP_LCD_DRAW_BUF_HEIGHT) * sizeof(uint16_t), }; BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); @@ -382,8 +382,12 @@ static lv_disp_t *bsp_display_lcd_init(void) const lvgl_port_display_cfg_t disp_cfg = { .io_handle = io_handle, .panel_handle = panel_handle, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, + .buffer_size = BSP_LCD_H_RES * CONFIG_BSP_LCD_DRAW_BUF_HEIGHT, +#if CONFIG_BSP_LCD_DRAW_BUF_DOUBLE + .double_buffer = 1, +#else + .double_buffer = 0, +#endif .hres = BSP_LCD_H_RES, .vres = BSP_LCD_V_RES, .monochrome = false, diff --git a/esp-box-lite/idf_component.yml b/esp-box-lite/idf_component.yml index 8f00b460..9ca663f0 100644 --- a/esp-box-lite/idf_component.yml +++ b/esp-box-lite/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.1" +version: "1.0.2" description: Board Support Package for ESP32-S3-BOX-Lite url: https://github.com/espressif/esp-bsp/tree/master/esp-box-lite diff --git a/esp-box-lite/include/bsp/esp-box-lite.h b/esp-box-lite/include/bsp/esp-box-lite.h index d7e7de12..dbbc05dc 100644 --- a/esp-box-lite/include/bsp/esp-box-lite.h +++ b/esp-box-lite/include/bsp/esp-box-lite.h @@ -299,11 +299,6 @@ esp_err_t bsp_spiffs_unmount(void); #define BSP_LCD_PIXEL_CLOCK_HZ (40 * 1000 * 1000) #define BSP_LCD_SPI_NUM (SPI3_HOST) -#ifndef BSP_LCD_DRAW_BUFF_SIZE -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * 100) -#endif -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - /** * @brief Initialize display * diff --git a/esp-box/Kconfig b/esp-box/Kconfig index 1c001bdf..162d1bfd 100644 --- a/esp-box/Kconfig +++ b/esp-box/Kconfig @@ -60,6 +60,19 @@ menu "Board Support Package" help LEDC channel is used to generate PWM signal that controls display brightness. Set LEDC index that should be used. + + config BSP_LCD_DRAW_BUF_HEIGHT + int "LCD framebuf height" + default 100 + range 10 240 + help + Framebuf is used for lvgl rendering output. + + config BSP_LCD_DRAW_BUF_DOUBLE + bool "LCD double framebuf" + default n + help + Whether to enable double framebuf. endmenu config BSP_I2S_NUM diff --git a/esp-box/esp-box.c b/esp-box/esp-box.c index ddd2bcea..3025d4e6 100644 --- a/esp-box/esp-box.c +++ b/esp-box/esp-box.c @@ -362,7 +362,7 @@ static lv_disp_t *bsp_display_lcd_init(void) esp_lcd_panel_io_handle_t io_handle = NULL; esp_lcd_panel_handle_t panel_handle = NULL; const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t), + .max_transfer_sz = (BSP_LCD_H_RES * CONFIG_BSP_LCD_DRAW_BUF_HEIGHT) * sizeof(uint16_t), }; BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); @@ -373,8 +373,12 @@ static lv_disp_t *bsp_display_lcd_init(void) const lvgl_port_display_cfg_t disp_cfg = { .io_handle = io_handle, .panel_handle = panel_handle, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, + .buffer_size = BSP_LCD_H_RES * CONFIG_BSP_LCD_DRAW_BUF_HEIGHT, +#if CONFIG_BSP_LCD_DRAW_BUF_DOUBLE + .double_buffer = 1, +#else + .double_buffer = 0, +#endif .hres = BSP_LCD_H_RES, .vres = BSP_LCD_V_RES, .monochrome = false, diff --git a/esp-box/idf_component.yml b/esp-box/idf_component.yml index b752200e..55fdb451 100644 --- a/esp-box/idf_component.yml +++ b/esp-box/idf_component.yml @@ -1,5 +1,5 @@ -version: "2.4.1" +version: "2.4.2" description: Board Support Package for ESP-BOX url: https://github.com/espressif/esp-bsp/tree/master/esp-box diff --git a/esp-box/include/bsp/esp-box.h b/esp-box/include/bsp/esp-box.h index 6e587092..7cebf573 100644 --- a/esp-box/include/bsp/esp-box.h +++ b/esp-box/include/bsp/esp-box.h @@ -283,9 +283,6 @@ esp_err_t bsp_spiffs_unmount(void); #define BSP_LCD_PIXEL_CLOCK_HZ (40 * 1000 * 1000) #define BSP_LCD_SPI_NUM (SPI3_HOST) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * 10) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - /** * @brief Initialize display *