|
| 1 | +| Supported Targets | ESP32-P4 | |
| 2 | +| ----------------- | -------- | |
| 3 | + |
| 4 | +| Supported LCD Controller | EK79007 | |
| 5 | +| ----------------------------|---------| |
| 6 | + |
| 7 | +| Supported Touch Controller | GT911 | |
| 8 | +| ----------------------------| -------| |
| 9 | + |
| 10 | +# LCD Layer Blending Example |
| 11 | + |
| 12 | +[esp_lcd](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/lcd.html) provides several panel drivers out-of box, e.g. ST7789, SSD1306, NT35510. However, there're a lot of other panels on the market, it's beyond `esp_lcd` component's responsibility to include them all. |
| 13 | + |
| 14 | +`esp_lcd` allows user to add their own panel drivers in the project scope (i.e. panel driver can live outside of esp-idf), so that the upper layer code like LVGL porting code can be reused without any modifications, as long as user-implemented panel driver follows the interface defined in the `esp_lcd` component. |
| 15 | + |
| 16 | +This example demonstrates how to use LVGL v9 based on PPA to implement layer blending (e.g., integration with camera data streams) and color format switching. |
| 17 | + |
| 18 | +This example uses the [esp_timer](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_timer.html) to generate the ticks needed by LVGL and uses a dedicated task to run the `lv_timer_handler()`. Since the LVGL APIs are not thread-safe, this example uses a mutex which be invoked before the call of `lv_timer_handler()` and released after it. The same mutex needs to be used in other tasks and threads around every LVGL (lv_...) related function call and code. For more porting guides, please refer to [LVGL porting doc](https://docs.lvgl.io/master/porting/index.html). |
| 19 | + |
| 20 | +## How to use the example |
| 21 | + |
| 22 | +## ESP-IDF Required |
| 23 | + |
| 24 | +### Hardware Required |
| 25 | + |
| 26 | +* An ESP32-P4-Function-EV-Board. |
| 27 | +* A 7-inch 1024 x 600 LCD screen powered by the [EK79007](https://docs.espressif.com/projects/esp-dev-kits/en/latest/_static/esp32-p4-function-ev-board/camera_display_datasheet/display_driver_chip_EK79007AD_datasheet.pdf) IC, accompanied by a 32-pin FPC connection [adapter board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/_static/esp32-p4-function-ev-board/schematics/esp32-p4-function-ev-board-lcd-subboard-schematics.pdf) ([LCD Specifications](https://docs.espressif.com/projects/esp-dev-kits/en/latest/_static/esp32-p4-function-ev-board/camera_display_datasheet/display_datasheet.pdf)). |
| 28 | +* A MIPI-CSI camera powered by the SC2336 IC, accompanied by a 32-pin FPC connection [adapter board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/_static/esp32-p4-function-ev-board/schematics/esp32-p4-function-ev-board-camera-subboard-schematics.pdf) ([Camera Specifications](https://docs.espressif.com/projects/esp-dev-kits/en/latest/_static/esp32-p4-function-ev-board/camera_display_datasheet/camera_datasheet.pdf)). |
| 29 | +* A USB-C cable for power supply and programming. |
| 30 | +* Please refer to the following steps for the connection: |
| 31 | + * **Step 1**. According to the table below, connect the pins on the back of the screen adapter board to the corresponding pins on the development board. |
| 32 | + |
| 33 | + | Screen Adapter Board | ESP32-P4-Function-EV-Board | |
| 34 | + | -------------------- | -------------------------- | |
| 35 | + | 5V (any one) | 5V (any one) | |
| 36 | + | GND (any one) | GND (any one) | |
| 37 | + | PWM | GPIO26 | |
| 38 | + | LCD_RST | GPIO27 | |
| 39 | + |
| 40 | + * **Step 2**. Connect the FPC of LCD through the `MIPI_DSI` interface. |
| 41 | + * **Step 3**. Connect the FPC of Camera through the `MIPI_CSI` interface. |
| 42 | + * **Step 4**. Use a USB-C cable to connect the `USB-UART` port to a PC (Used for power supply and viewing serial output). |
| 43 | + * **Step 5**. Turn on the power switch of the board. |
| 44 | + |
| 45 | +### Configure the Project |
| 46 | + |
| 47 | +Run `idf.py menuconfig` and navigate to `Example Configuration` menu. |
| 48 | + |
| 49 | +### Build and Flash |
| 50 | + |
| 51 | +Run `idf.py set-target esp32p4` to select the target chip. |
| 52 | + |
| 53 | +Run `idf.py -p PORT build flash monitor` to build, flash and monitor the project. A fancy animation will show up on the LCD as expected. |
| 54 | + |
| 55 | +The first time you run `idf.py` for the example will cost extra time as the build system needs to address the component dependencies and downloads the missing components from registry into `managed_components` folder. |
| 56 | + |
| 57 | +(To exit the serial monitor, type ``Ctrl-]``.) |
| 58 | + |
| 59 | +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. |
| 60 | + |
| 61 | +## Troubleshooting |
| 62 | + |
| 63 | +For any technical queries, please open an [issue](https://github.com/espressif/esp-iot-solution/issues) on GitHub. We will get back to you soon. |
0 commit comments