Supported ESP SoCs | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | ESP32-P4 |
---|
This example demonstrates how to rotate the display by using the LVGL v8
.
For interfaces and LCDs which support swapXY
, mirrorX
and mirrorY
features, this example rotates the display by hardware. For others, it rotates the display by software.
For RGB/MIPI-DSI
interfaces, this example does not support the avoid tearing function.
-
Install the following SDK and library dependencies:
- See SDK & Dependencies and Installing Libraries sections for more information
-
Install the following example dependencies:
lvgl
: v8.4.0
-
[Mandatory]
ESP32_Display_Panel
:-
This example already has the esp_panel_board_supported_conf.h and esp_panel_board_custom_conf.h configuration files in the project directory. But no board configuration enabled by default, before compiling, please edit the configuration file according to your target board:
- If using a supported board, edit the esp_panel_board_supported_conf.h file and set
ESP_PANEL_BOARD_DEFAULT_USE_SUPPORTED
to1
. Then uncomment the target board definition in the file - If using a custom board, edit the esp_panel_board_custom_conf.h file and set
ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
to1
. Then change other configurations as needed in the file
- If using a supported board, edit the esp_panel_board_supported_conf.h file and set
-
This example already has the esp_panel_drivers_conf.h configuration file in the project directory. Edit this file 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
- Change the
LV_COLOR_16_SWAP
macro definition to1
if usingSPI/QSPI
interface, or0
if using other interfaces - Change other configurations in the file as needed
- See Configuring LVGL section for more information
-
[Optional] Edit the macro definitions in the lvgl_v8_port.h file
- If using
RGB/MIPI-DSI
interface, change theLVGL_PORT_AVOID_TEARING_MODE
macro definition to1
/2
/3
to enable the avoid tearing function. After that, change theLVGL_PORT_ROTATION_DEGREE
macro definition to the target rotation degree - If using other interfaces, please don't modify the
LVGL_PORT_AVOID_TEARING_MODE
andLVGL_PORT_ROTATION_DEGREE
macro definitions
- If using
- Navigate to the
Tools
menu - Select the target board in the
Board
menu - Change the
Partition Scheme
andFlash Size
to make the flash size enough for the project (likeHuge App
+4MB
) - Change the
PSRAM
option toOPI PSRAM
if usingESP32S3R8 + RGB LCD
, orEnabled
if usingESP32P4 + MIPI-DSI LCD
- Change the
USB CDC On Boot
option toEnabled
if usingUSB
port, orDisabled
if usingUART
port. If this configuration differs from previous flashing, first enableErase All Flash Before Sketch Upload
, then it can be disabled after flashing. - Change other configurations as needed
- see Configuring Arduino IDE for more information
- Connect the board to your computer
- Select the correct serial port
- Click the
upload
button
- Open the serial monitor and select the correct baud rate (like
115200
) - 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
Rotate left
IDLE loop
Rotate right
...
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.