Skip to content

Commit

Permalink
Merge pull request #129 from Lzw655/bsp/s3-lcd-ev-board_improve
Browse files Browse the repository at this point in the history
Bsp/improve_s3-lcd-ev-board
  • Loading branch information
espzav authored Feb 28, 2023
2 parents f647ca6 + a594afa commit 579c1ac
Show file tree
Hide file tree
Showing 9 changed files with 273 additions and 70 deletions.
15 changes: 15 additions & 0 deletions esp32_s3_lcd_ev_board/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ChangeLog

## v1.0.3 - 2023-02-13

### Features

* Configurations:
* Support to set number of frame buffers for RGB
* Support to use bounce-buffer for RGB
* Support to change the minimum delay time of LVGL task
* Support to change the stack size of LVGL task
* Support to enable anti-tearing function simply by using multiple buffers
* RGB Anti-tearing:
* Optimize direct mode
* Use triple-buffer in full-refresh mode
56 changes: 44 additions & 12 deletions esp32_s3_lcd_ev_board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,50 @@ menu "Board Support Package"
bool "Sub board 3 with 800x480 RGB LCD"
endchoice

config BSP_LCD_RGB_DOUBLE_BUFFER
bool "Enable to use double frame buffers"
config BSP_LCD_RGB_BUFFER_NUMS
int "Set number of frame buffers"
depends on BSP_LCD_SUB_BOARD_480_480 || BSP_LCD_SUB_BOARD_800_480
default "n"
default 1
range 1 3
help
Let RGB LCD driver create two frame size buffers. It's a necessary configuration to avoiding tearing effect.
Let RGB LCD driver create a specified number of frame-size buffers. Only when it is set to multiple can the avoiding tearing be turned on.

config BSP_LCD_RGB_REFRESH_TASK_ENABLE
bool "Enable to refresh LCD manually"
choice BSP_LCD_RGB_REFRESH_MODE
prompt "Select the refresh mode for RGB LCD"
depends on BSP_LCD_SUB_BOARD_480_480 || BSP_LCD_SUB_BOARD_800_480
default "n"
help
Refresh the LCD in a specific task instead of automatically refreshing. It's a necessary configuration to avoiding tearing effect.
default BSP_LCD_RGB_REFRESH_AUTO
config BSP_LCD_RGB_REFRESH_AUTO
bool "Auto refresh mode"
help
Refresh the LCD in the most common way.
config BSP_LCD_RGB_REFRESH_MANUALLY
bool "Manually refresh mode"
help
Refresh the LCD in a specific task instead of automatically refreshing.
config BSP_LCD_RGB_BOUNCE_BUFFER_MODE
bool "Bounce buffer mode"
help
Enable bounce buffer mode can achieve higher PCLK frequency at the cost of higher CPU consumption.
endchoice

config BSP_LCD_RGB_REFRESH_TASK_PERIOD
int "Minimum Period(ms) of LCD refreshing task"
depends on BSP_LCD_RGB_REFRESH_TASK_ENABLE
depends on BSP_LCD_RGB_REFRESH_MANUALLY
default 10
help
This configuration does not necessarily represent the actual refresh cycle of the RGB interface.

config BSP_LCD_RGB_REFRESH_TASK_PRIORITY
int "Priority of LCD refreshing task"
depends on BSP_LCD_RGB_REFRESH_TASK_ENABLE
depends on BSP_LCD_RGB_REFRESH_MANUALLY
default 2

config BSP_LCD_RGB_BOUNCE_BUFFER_HEIGHT
depends on BSP_LCD_RGB_BOUNCE_BUFFER_MODE
int "Bounce buffer height"
default 10
help
Height of bounce buffer. The width of the buffer is the same as that of the LCD.
endmenu

menu "Display"
Expand All @@ -70,6 +89,19 @@ menu "Board Support Package"
help
The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler().

config BSP_DISPLAY_LVGL_TASK_DELAY
int "LVGL task minimum delay time (ms)"
default 10
range 1 100
help
Minimum delay time for LVGL task. It should be larger if the task watchdog is triggered frequently.

config BSP_DISPLAY_LVGL_TASK_STACK_SIZE
int "LVGL task stack size (KB)"
default 4
help
Size(KB) of LVGL task stack.

config BSP_DISPLAY_LVGL_TICK
int "LVGL tick period"
default 5
Expand All @@ -79,7 +111,7 @@ menu "Board Support Package"

config BSP_DISPLAY_LVGL_AVOID_TEAR
bool "Avoid tearing effect"
depends on BSP_LCD_RGB_REFRESH_TASK_ENABLE && BSP_LCD_RGB_DOUBLE_BUFFER
depends on BSP_LCD_RGB_BUFFER_NUMS > 1
default "n"
help
Avoid tearing effect through LVGL buffer mode and double frame buffers of RGB LCD. This feature is only available for RGB LCD.
Expand Down
15 changes: 15 additions & 0 deletions esp32_s3_lcd_ev_board/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,18 @@ ESP32-S3-LCD-EV-BOARD is a development board for evaluating and verifying ESP32-
| ESP32-S3-LCD_Ev_Board_SUB2 | 3.5 | 480 x 320 | ST7796S (8080) | GT911 | [link](https://github.com/espressif/esp-dev-kits/blob/master/docs/_static/esp32-s3-lcd-ev-board/schematics/SCH_ESP32-S3-LCD_Ev_Board_SUB2_V1.0_20220615.pdf) | Not yet |
| | 3.95 | 480 x 480 | GC9503CV (RGB) | FT5x06 | | Yes |
| ESP32-S3-LCD_Ev_Board_SUB3 | 4.3 | 800 x 480 | Unkonw (RGB) | GT1151 | [link](https://github.com/espressif/esp-dev-kits/blob/master/docs/_static/esp32-s3-lcd-ev-board/schematics/SCH_ESP32-S3-LCD_Ev_Board_SUB2_V1.0_20220615.pdf) | Yes |

Here are some useful configurations in menuconfig that can be customed by user:

* `BSP_LCD_SUB_BOARD`: Choose a LCD sub-board according to hardware.
* `BSP_LCD_RGB_BUFFER_NUMS`: Set number of frame buffers. Only when it is set to multiple can the anti-tearing function be turned on.
* `BSP_LCD_RGB_REFRESH_MODE`: Select the refresh mode for RGB LCD.
* `BSP_LCD_RGB_REFRESH_AUTO`: Refresh the LCD in the most common way.
* `BSP_LCD_RGB_REFRESH_MANUALLY`:Refresh the LCD in a specific task. It can reduce the bandwidth of PSRAM usage.
* `BSP_LCD_RGB_BOUNCE_BUFFER_MODE`: Enable bounce buffer mode can achieve higher PCLK frequency at the cost of higher CPU consumption. **And it's helpful when the screen drifts (Especially using Wi-Fi or OTA)**. It should be used with `ESP32S3_DATA_CACHE_LINE_64B`.
* `BSP_DISPLAY_LVGL_BUF_CAPS`: Choose the memory type of LVGL buffer. Internal memory is more fast.
* `BSP_DISPLAY_LVGL_BUF_HEIGHT`: Set the height of LVGL buffer, and its width is equal to LCD's width.
* `BSP_DISPLAY_LVGL_AVOID_TEAR`: Avoid tearing effect by using multiple buffers. Need to set `BSP_LCD_RGB_BUFFER_NUMS` more than 1.
* `BSP_DISPLAY_LVGL_FULL_REFRESH`: Use LVGL full-refresh mode. Set `BSP_LCD_RGB_BUFFER_NUMS` to 3 will get higher FPS.
* `BSP_DISPLAY_LVGL_DIRECT_MODE`: Use LVGL direct mode.

Loading

0 comments on commit 579c1ac

Please sign in to comment.