examples/peripherals/lcd/spi_lcd_touch/README.md
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|---|
This example demonstrates how to interface an ESP32 development board with an SPI LCD display and optional touch controller using the ESP-IDF framework. The example creates an animated user interface using the LVGL graphics library. The touch controller and the LCD display share the same SPI bus, allowing for efficient communication and resource usage.
This example:
The example implements several important concepts:
To run this example, you will need:
Connect your ESP development board to the ST7789 LCD display as shown below. Make sure to power off your board before making any connections.
ESP Development Board ST7789 LCD Display
+----------------------+ +--------------------+
| GND +------------->| GND |
| | | |
| 3V3 +------------->| VCC |
| | | |
| PCLK +------------->| SCL |
| | | |
| MOSI +------------->| MOSI |
| | | |
| MISO |<-------------+ MISO |
| | | |
| RST +------------->| RES |
| | | |
| DC +------------->| DC |
| | | |
| LCD CS +------------->| LCD CS |
| | | |
| TOUCH CS +------------->| TOUCH CS |
| | | |
| BK_LIGHT +------------->| BLK |
+----------------------+ +--------------------+
EXAMPLE_LCD_BK_LIGHT_ON_LEVEL to 1 if your display requires active-high).This example provides several configuration options through the ESP-IDF configuration system:
idf.py menuconfig
Navigate to "Example Configuration" to find:
To exit the serial monitor, press Ctrl+].
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
When the example runs successfully, you should see:
I (307) main_task: Started on CPU0
I (307) main_task: Calling app_main()
I (307) example: Turn off LCD backlight
I (307) example: Initialize SPI bus
I (317) example: Install panel IO
I (317) example: Install ST7789 panel driver
I (447) example: Turn on LCD backlight
I (447) example: Initialize LVGL library
I (457) example: Install LVGL tick timer
I (457) example: Register io panel event callback for LVGL flush ready notification
I (457) example: Create LVGL task
I (467) example: Starting LVGL task
I (547) example: Display LVGL Meter Widget
I (557) main_task: Returned from app_main()
For any technical queries, please open an issue on GitHub. We will get back to you soon.