- Using with ESP-IDF
Before using this library, please ensure you have installed the SDK that meets the following version requirements:
| SDK | Version Required |
|---|---|
| esp-idf | >= 5.1 |
| Dependencies | Version Required |
|---|---|
| esp32_io_expander | 1.* |
| esp-lib-utils | 0.2.* |
Note
- For SDK installation, please refer to ESP-IDF Programming Guide - Installation
- Dependencies will be automatically downloaded during compilation after adding this library to your project
ESP32_Display_Panel has been uploaded to the Espressif Component Registry. You can add it to your project in the following ways:
-
Using Command Line
Run the following command in your project directory:
idf.py add-dependency "espressif/esp32_display_panel==1.*" -
Modifying Configuration File
Create or modify the idf_component.yml file in your project directory:
dependencies: espressif/esp32_display_panel: "1.*"
For detailed information, please refer to Espressif Documentation - IDF Component Manager.
When developing with ESP-IDF, you can configure ESP32_Display_Panel by modifying menuconfig. Here are the steps:
- Run the command
idf.py menuconfig. - Navigate to
Component config>ESP Display Panel Configurations.
Additionally, since ESP32_Display_Panel depends on the esp-lib-utils component, you can also influence ESP32_Display_Panel's behavior by configuring the esp-lib-utils component, such as enabling debug information. Here are the steps:
- Run the command
idf.py menuconfig. - Navigate to
Component config>ESP Library Utils Configurations.
Tip
- Run
idf.py save-defconfigto save the current project'smenuconfigconfiguration and generate a sdkconfig.defaults default configuration file in the project directory. - To discard the current project's menuconfig configuration and load default settings, first delete the sdkconfig file in the project directory, then run
idf.py reconfigure.
It can be justified to not use menuconfig to set up a custom board with the esp_panel_board_custom_conf.h file instead, for example to be able to easily define macros that will execute between the board components initialisation steps, or to tinker with advanced vendor commands.
Because of the component-centric philosophy of ESP-IDF, it is not as simple as dropping the configuration file in the main folder and including it in your main app source file.
Instead, you need to follow these steps :
- Run the command
idf.py menuconfigand make sure that the option Enable to skipesp_panel_board_*.his unchecked. If you don't see this option, make sure you have added the library as a component to your project first ! - Copy your
esp_panel_board_custom_conf.hfile to a folder inside your project folder. For those instructions, we will assume that the file is correctly configured and copied inside a folder located at/main/conf/like so :
Project Folder - |
| - CMakeLists.txt
| - main - |
| | - main.c
| | - conf - |
| | | - esp_panel_board_custom_conf.h
| | | ...
| | ...
| ...
- Edith the project
CMakeLists.txtby adding the following line before theprojectinstruction, like so :
...
include_directories(${CMAKE_CURRENT_LIST_DIR}/main/conf)
project(...
This will have the effect of loading the macros way before compilation, making it similar to use as under the PlatformIO IDE or Arduino framework.
- lvgl_v8_port: This example demonstrates how to port
LVGL v8. And it runs LVGL's internal demos includeMusic Player,Widgets,StressandBenchmark.
Please follow these steps to resolve:
-
Understand the Issue
- Please refer to ESP32-S3 RGB LCD Screen Drift Issue Description
-
Enable
RGB LCD Bounce Buffer + XIP on PSRAMFeaturea. Enable
XIP on PSRAMFeature inESP-IDF- For
ESP-IDFversion>= 5.1 && < 5.3, enableSPIRAM_FETCH_INSTRUCTIONSandSPIRAM_RODATAoptions inmenuconfig - For
ESP-IDFversion>= 5.3, enableSPIRAM_XIP_FROM_PSRAMoption inmenuconfig
b. Configure
RGB LCD Bounce Buffer-
For supported boards:
- Usually
ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZEis already configured to(ESP_PANEL_BOARD_WIDTH * 10)by default - If the issue persists, increase the buffer size by referring to the example code
- Usually
-
For custom boards:
- Set
ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZEin esp_panel_board_custom_conf.h - If the issue persists, increase the buffer size by referring to the example
- Set
c. Configure LVGL Task
- If using LVGL, setting the task that executes
lv_timer_handler()to run on the same core as the task that executesboard->begin()can help mitigate the screen drift issue
- For
-
Example Code
a. Modifying
Bounce Buffersize when using a board.... esp_panel::board::Board *board = new esp_panel::board::Board(); board->init(); ... /** * 1. Should be called after `board->init()` and before `board->begin()` * 2. `ESP_PANEL_BOARD_WIDTH` should be replaced with the actual width of the LCD */ auto bus = static_cast<esp_panel::drivers::BusRGB *>(board->getLCD()->getBus()); bus->configRGB_BounceBufferSize(ESP_PANEL_BOARD_WIDTH * 20); ... board->begin(); ...
b. Modifying
Bounce Buffersize when using standalone drivers.... esp_panel::drivers::BusRGB *bus = new esp_panel::drivers::BusRGB(...); ... /** * 1. Should be called before `bus->init()` * 2. `EXAMPLE_LCD_WIDTH` should be replaced with the actual width of the LCD */ bus->configRGB_BounceBufferSize(EXAMPLE_LCD_WIDTH * 20); ... bus->init(); ...
Please follow these steps:
- Disable unused drivers: Use
menuconfigto disable unused drivers inESP Display Panel Configurations - Drivers - Turn off debug logs: Use
menuconfigto setLog leveltoNoneinESP Library Utils Configurations - Log functions - See Configuration Guide for detailed configuration
Please refer to ESP-FAQ - LCD