| Supported ESP SoCs | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | ESP32-P4 |
|---|
This example demonstrates how to port LVGL v8. And for RGB/MIPI-DSI interface LCDs, it can enable the avoid tearing and rotation function.
-
[Optional]
ESP32_Display_Panel:- This example already has the esp_panel_board_custom_conf.h and esp_panel_drivers_conf.h configuration files in the project directory. Edit these files as needed
- see Board Configuration Guide for more information
-
[Optional]
esp-lib-utils:- This example already has the esp_utils_conf.h configuration file in the project directory. Edit this file as needed
- See Configuring esp-lib-utils section for more information
-
[Optional]
lvgl:- This example already has the lv_conf.h configuration file which been modified with the recommended configurations in the project directory. Edit this file as needed
- See Configuring LVGL section for more information
-
This example uses the
BOARD_ESPRESSIF_ESP32_S3_LCD_EV_BOARD_2_V1_5board as default. You can choose another board in the[platformio]:default_envsof the platformio.ini file. -
If there is no the board you want to use, please check the following:
-
If using a supported board, take the
BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85board as an example, follow the steps:-
Copy a supported board file in the boards directory, which has the same chip as your board, for example, the
BOARD_ESPRESSIF_ESP32_S3_LCD_EV_BOARD_2_V1_5.jsonfile. Then paste it to the boards directory and rename it toBOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85.json. Modify the content as needed. -
Add a new board env in the platformio.ini file as follows:
... [env:BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85] build_flags = ${common.build_flags} ${spi_qspi_lcd.build_flags} ; or ${rgb_mipi_lcd.build_flags} -DESP_PANEL_BOARD_DEFAULT_USE_SUPPORTED=1 -DBOARD_M5STACK_M5CORE2 board = BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 ...
-
Add the board env to the
[platformio]:default_envsas follows:... default_envs = ... ; BOARD_ESPRESSIF_ESP32_S3_USB_OTG ; BOARD_ESPRESSIF_ESP32_P4_FUNCTION_EV_BOARD ... BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 ...
-
-
If using a custom board, follow the steps:
- Modify the BOARD_CUSTOM.json board file by referring to a supported board file which has the same chip as your board.
- Modify the
[env:BOARD_CUSTOM]board env in the platformio.ini file as needed - Modify the esp_panel_board_custom_conf.h file and set
ESP_PANEL_BOARD_DEFAULT_USE_CUSTOMto1. Then change other configurations as needed in the file
-
See PlatformIO Docs for more information
-
-
[Optional] Edit the macro definitions in the lvgl_v8_port.h file
- If using
RGB/MIPI-DSIinterface, change theLVGL_PORT_AVOID_TEARING_MODEmacro definition to1/2/3to enable the avoid tearing function. After that, change theLVGL_PORT_ROTATION_DEGREEmacro definition to the target rotation degree - If using other interfaces, please don't modify the
LVGL_PORT_AVOID_TEARING_MODEandLVGL_PORT_ROTATION_DEGREEmacro definitions
- If using
- Connect the board to your computer
- Click the
uploadbutton
- Open the serial monitor
- Check the output logs
The following are the logs output when using the Espressif:ESP32_S3_LCD_EV_BOARD_2_V1_5 development board. The logs content may vary with different development boards or different configurations, and it is provided for reference only.
...
Initializing board
[I][Panel][esp_panel_board.cpp:0066](init): Initializing board (Espressif:ESP32_S3_LCD_EV_BOARD_2_V1_5)
[I][Panel][esp_panel_board.cpp:0235](init): Board initialize success
[I][Panel][esp_panel_board.cpp:0253](begin): Beginning board (Espressif:ESP32_S3_LCD_EV_BOARD_2_V1_5)
[I][Panel][esp_lcd_touch_gt1151.c:0050](esp_lcd_touch_new_i2c_gt1151): version: 1.0.5
[I][Panel][esp_lcd_touch_gt1151.c:0234](read_product_id): IC version: GT1158_000101(Patch)_0102(Mask)_00(SensorID)
[I][Panel][esp_panel_board.cpp:0459](begin): Board begin success
Initializing LVGL
[I][LvPort][lvgl_v8_port.cpp:0769](lvgl_port_init): Initializing LVGL display driver
Creating UI
IDLE loop
IDLE loop
...Please check the FAQ first to see if the same question exists. If not, please create a Github Issue. We will get back to you as soon as possible.