[](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml) [](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml) [](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/build_test.yml) # ESP Display Panel * [English Version](./README.md) ESP32_Display_Panel 是为 ESP SoCs 设计用来驱动显示屏幕的 Arduino 库。它不仅可以用于开发多款[乐鑫开发板](#乐鑫开发板),也适用于开发自定义的开发板。 ESP32_Display_Panel 封装了多种[乐鑫组件库](https://components.espressif.com/)中相关的组件,它需要基于 [arduino-esp32](https://github.com/espressif/arduino-esp32) 进行开发,并且可以直接从 Arduino IDE 中下载获取。 ## 目录 - [ESP Display Panel](#esp-display-panel) - [目录](#目录) - [概述](#概述) - [支持的开发板和驱动](#支持的开发板和驱动) - [乐鑫开发板](#乐鑫开发板) - [接口总线](#接口总线) - [LCD 控制器](#lcd-控制器) - [触摸控制器](#触摸控制器) - [依赖项版本](#依赖项版本) - [如何使用](#如何使用) - [示例](#示例) - [Panel](#panel) - [LVGL](#lvgl) - [Squareline](#squareline) - [详细使用说明](#详细使用说明) - [配置 ESP32\_Display\_Panel](#配置-esp32_display_panel) - [对于支持的开发板](#对于支持的开发板) - [对于不支持的开发板](#对于不支持的开发板) - [使用接口](#使用接口) - [配置开发板](#配置开发板) - [配置 LVGL](#配置-lvgl) - [移植 Squareline 工程](#移植-squareline-工程) ## 概述 ESP32_Display_Panel 的功能框图如下所示,主要包含了以下功能: * 支持多款乐鑫开发板。 * 支持自定义的开发板。 * 支持多种类型的设备驱动,包括接口总线、LCD、触摸、背光。

| [ESP32-C3-LCDkit](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-lcdkit/index.html) | SPI | GC9A01 | - | - |
|
| [ESP32-S3-Box](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | I2C | TT21100 |
|
|[ESP32-S3-Box-3](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | I2C | GT911 |
|[ESP32-S3-Box-3(beta)](https://github.com/espressif/esp-box/tree/c4c954888e11250423f083df0067d99e22d59fbe) | SPI | ILI9342 | I2C | TT21100 |
|
| [ESP32-S3-Box-Lite](https://github.com/espressif/esp-box/tree/master) | SPI | ST7789 | - | - |
|
| [ESP32-S3-EYE](https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP32-S3-EYE_Getting_Started_Guide.md) | SPI | ST7789 | - | - |
|
| [ESP32-S3-Korvo-2](https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html) | SPI | ILI9342 | I2C | TT21100 |
|
| [ESP32-S3-LCD-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | 3-wire SPI + RGB | GC9503 | I2C | FT5X06 |
|
| [ESP32-S3-LCD-EV-Board-2](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | RGB | ST7262E43 | I2C | GT1151 |
|
| [ESP32-S3-USB-OTG](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/index.html) | SPI | ST7789 | - | - |
### 接口总线
| **接口总线** | **版本** |
| ---------------------------------------------------------------------------------------------------- | -------- |
| I2C | - |
| SPI | - |
| [3-wire SPI + RGB](https://components.espressif.com/components/espressif/esp_lcd_panel_io_additions) | v1.0.0 |
### LCD 控制器
| **LCD 控制器** | **版本** |
| -------------------------------------------------------------------------------- | -------- |
| [ILI9341](https://components.espressif.com/components/espressif/esp_lcd_ili9341) | 1.0.2 |
| [GC9503](https://components.espressif.com/components/espressif/esp_lcd_gc9503) | 1.0.0 |
| [GC9A01](https://components.espressif.com/components/espressif/esp_lcd_gc9a01) | 1.0.1 |
| ST7262 | - |
| ST7789 | - |
| [ST7796](https://components.espressif.com/components/espressif/esp_lcd_st7796) | 1.0.0 |
### 触摸控制器
| **触摸控制器** | **版本** |
| ---------------------------------------------------------------------------------------- | -------- |
| [esp_lcd_touch](https://components.espressif.com/components/espressif/esp_lcd_touch) | 1.0.4 |
| [CST816S](https://components.espressif.com/components/espressif/esp_lcd_touch_cst816s) | 1.0.3 |
| [FT5x06](https://components.espressif.com/components/espressif/esp_lcd_touch_ft5x06) | 1.0.5~1 |
| [GT1151](https://components.espressif.com/components/espressif/esp_lcd_touch_gt1151) | 1.0.5~1 |
| [GT911](https://components.espressif.com/components/espressif/esp_lcd_touch_gt911) | 1.0.7~1 |
| [TT21100](https://components.espressif.com/components/espressif/esp_lcd_touch_tt21100) | 1.0.7~1 |
| [STMPE610](https://components.espressif.com/components/espressif/esp_lcd_touch_stmpe610) | 1.0.6 |
## 依赖项版本
| **名称** | **版本** |
| ------------------------------------------------------------ | ------------------ |
| ESP32_Display_Panel | v0.0.2 |
| [ESP32_IO_Expander](https://github.com/esp-arduino-libs/ESP32_IO_Expander) | >= v0.0.1 |
| [arduino-esp32](https://github.com/espressif/arduino-esp32) | >= v2.0.9,< 3.0.0 |
## 如何使用
关于如何在 Arduino IDE 中使用库,请参阅 [Arduino IDE v1.x.x](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries) 或者 [Arduino IDE v2.x.x](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library) 的文档。Arduino 库文件夹的路径可以在 `File` > `Preferences` > `Settings` > `Sketchbook location` 中找到或更改。
### 示例
以下是使用 ESP32_Display_Panel 的一些示例。要在 Arduino IDE 中访问它们,请导航到 `File` > `Examples` > `ESP32_Display_Panel`。如果没有 ESP32_Display_Panel 选项,请检查库是否已正确安装,并首先选择一个 esp32 开发板。
#### Panel
* [Draw Color Bar](examples/Panel/DrawColorBar/): 此示例演示如何绘制简单的彩条。
* [Read Touch Point](examples/Panel/ReadTouchPoint/): 此示例演示如何读取触摸点。
#### LVGL
要配置 LVGL(v8.3.x),请参阅[此处](#配置-lvgl)以获取更多详细信息。
* [Porting](examples/LVGL/Porting/): 此示例演示如何移植 LVGL (v8.3.x)。
#### Squareline
要移植 Squarelina 项目(v1.3.x),请参阅[此处](#移植-Squareline-工程)获取更多详细信息。
- [Porting](examples/Squareline/Porting/): 此示例演示如何移植 Squareline 项目。
- [WiFiClock](examples/Squareline/WiFiClock/): 此示例实现了一个简单的 Wi-Fi 时钟。
### 详细使用说明
以下是如何使用 ESP32_Display_Panel 的详细说明。
#### 配置 ESP32_Display_Panel
ESP32_Display_Panel 具有自己的配置文件,称为 `ESP_Panel_Conf.h`。在安装 ESP32_Display_Panel 后,按照以下配置步骤进行操作:
1. 进入 Arduino 存放库的目录。
2. 进入 `ESP32_Display_Panel` 文件夹,将 `ESP_Panel_Conf_Template.h` 复制并放置在 `ESP32_Display_Panel` 文件夹之外。它应该与 `ESP32_Display_Panel` 文件夹在同一级别,然后将其重命名为 `ESP_Panel_Conf.h`。
3. 最终,包含 `ESP_Panel_Conf.h` 的 Arduino 库所在文件夹的布局应如下所示:
```
Arduino
|-libraries
|-ESP32_Display_Panel
|-other_lib_1
|-other_lib_2
|-ESP_Panel_Conf.h
```
4. 请参考[支持的开发板列表](#支持的开发板和驱动)来检查当前开发板是否兼容,如果兼容请跳转至“[对于支持的开发板](#对于支持的开发板)”一节,否则跳转至“[对于不支持的开发板](#对于不支持的开发板)”一节。
##### 对于支持的开发板
1. 打开 `ESP_Panel_Conf.h` 文件,首先,将宏 `ESP_PANEL_USE_SUPPORTED_BOARD` 设置为 `1`(默认值为 `1`)。然后,根据目标开发板的名称在其下方将格式为 `ESP_PANEL_BOARD_