Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framebuffer: esp-box/esp-box-lite use framebuf height form Kconfig (BSP-331) #186

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions esp-box-lite/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions esp-box-lite/esp-box-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion esp-box-lite/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 0 additions & 5 deletions esp-box-lite/include/bsp/esp-box-lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
13 changes: 13 additions & 0 deletions esp-box/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions esp-box/esp-box.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion esp-box/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 0 additions & 3 deletions esp-box/include/bsp/esp-box.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down