Skip to content

Commit a20b003

Browse files
authored
Merge pull request #67 from esp-arduino-libs/bugfix/fix_lvgl_port_rotation
fix(examples): fix lvgl port rotation issue when enabling avoid tearing
2 parents 293faff + d2143ab commit a20b003

38 files changed

+408
-221
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# ChangeLog
22

3-
## v0.1.5 - 2024-07-01
3+
## v0.1.5 - 2024-07-09
4+
5+
### Enhancements:
6+
7+
* feat(gt911): support set I2C address by using RST and INT pins
8+
* feat(lvgl_port): set the lvgl task to run on the same core as the Arduino task by default
9+
* feat(board): increase the RGB pclk frequency to 26MHz for `ESP32_4848S040C_I_Y_3`
410

511
### Bugfixes:
612

713
* fix(panel): init expander host with correct macro (#65)
14+
* fix(panel): don't reset the LCD if the bus is RGB bus and the `ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO` is enabled
15+
* fix(examples): fix lvgl port rotation issue when enabling avoid tearing by @NecroMancer05
816

917
## v0.1.4 - 2024-06-17
1018

ESP_Panel_Board_Custom.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@
197197
#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1
198198

199199
/* LCD Other Settings */
200-
/* IO num of RESET pin, set to -1 if not use */
201-
#define ESP_PANEL_LCD_IO_RST (-1)
202-
#define ESP_PANEL_LCD_RST_LEVEL (0) // 0: low level, 1: high level
200+
/* Reset pin */
201+
#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use
202+
#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 0: low level, 1: high level
203203

204204
#endif /* ESP_PANEL_USE_LCD */
205205

@@ -239,8 +239,8 @@
239239
/* Touch panel bus parameters */
240240
#if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C
241241

242-
#define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0
243-
#define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // Typically set to 0 to use default address
242+
#define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0 to use the default address
243+
#define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // For GT911, there are two addresses: 0x5D(default) and 0x14
244244
#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST
245245
#define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000)
246246
// Typically set to 400K
@@ -274,12 +274,14 @@
274274
#define ESP_PANEL_TOUCH_MIRROR_Y (0) // 0/1
275275

276276
/* Touch Other Settings */
277-
/* IO num of RESET pin, set to -1 if not use */
278-
#define ESP_PANEL_TOUCH_IO_RST (-1)
279-
#define ESP_PANEL_TOUCH_RST_LEVEL (0) // 0: low level, 1: high level
280-
/* IO num of INT pin, set to -1 if not use */
281-
#define ESP_PANEL_TOUCH_IO_INT (-1)
282-
#define ESP_PANEL_TOUCH_INT_LEVEL (0) // 0: low level, 1: high level
277+
/* Reset pin */
278+
#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use
279+
// For GT911, the RST pin is also used to configure the I2C address
280+
#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level
281+
/* Interrupt pin */
282+
#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use
283+
// For GT911, the INT pin is also used to configure the I2C address
284+
#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 0: low level, 1: high level
283285

284286
#endif /* ESP_PANEL_USE_TOUCH */
285287

@@ -288,8 +290,8 @@
288290
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
289291
#define ESP_PANEL_USE_BACKLIGHT (0) // 0/1
290292
#if ESP_PANEL_USE_BACKLIGHT
291-
/* IO num of backlight pin */
292-
#define ESP_PANEL_BACKLIGHT_IO (45)
293+
/* Backlight pin */
294+
#define ESP_PANEL_BACKLIGHT_IO (45) // IO num of backlight pin
293295
#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level
294296

295297
/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */
@@ -362,7 +364,7 @@
362364
*/
363365
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
364366
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
365-
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1
367+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
366368

367369
#endif /* ESP_PANEL_USE_CUSTOM_BOARD */
368370

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[![Arduino Lint](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml) [![pre-commit](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml)
1+
[![GitHub Release](https://img.shields.io/github/v/release/esp-arduino-libs/ESP32_Display_Panel)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/releases) [![Arduino Lint](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml) [![pre-commit](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml)
22

33
# ESP Display Panel
44

55
* [中文版本](./README_CN.md)
66

7-
ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development. Users can develop directly for a variety of [supported development boards](src/board/Board_Instructions.md) or create custom ones through simple adaptation. Additionally, ESP32_Display_Panel is compatible with various LCD and touch drivers, allowing users to develop using standalone drivers as needed.
7+
ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development. Users can develop directly for a variety of [supported development boards](docs/Board_Instructions.md) or create custom ones through simple adaptation. Additionally, ESP32_Display_Panel is compatible with various LCD and touch drivers, allowing users to develop using standalone drivers as needed.
88

99
ESP32_Display_Panel encapsulates various components from the [Espressif Components Registry](https://components.espressif.com/), requiring development based on [arduino-esp32](https://github.com/espressif/arduino-esp32), and can be directly downloaded from the Arduino IDE.
1010

@@ -58,19 +58,19 @@ The functional block diagram of ESP32_Display_Panel is as follows, mainly compri
5858

5959
### Development Boards
6060

61-
Below is a list of [supported development boards](src/board/Board_Instructions.md):
61+
Below is a list of [supported development boards](docs/Board_Instructions.md):
6262

6363
| **Manufacturer** | **Board Model** |
6464
| --------------- | --------------- |
65-
| [Espressif](src/board/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-Box, ESP32-S3-Box-3, ESP32-S3-Box-3(beta), ESP32-S3-Box-Lite, ESP32-S3-EYE, ESP32-S3-Korvo-2, ESP32-S3-LCD-EV-Board, ESP32-S3-LCD-EV-Board-2, ESP32-S3-USB-OTG |
66-
| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 |
67-
| [Jingcai](src/board/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 |
65+
| [Espressif](docs/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-Box, ESP32-S3-Box-3, ESP32-S3-Box-3(beta), ESP32-S3-Box-Lite, ESP32-S3-EYE, ESP32-S3-Korvo-2, ESP32-S3-LCD-EV-Board, ESP32-S3-LCD-EV-Board-2, ESP32-S3-USB-OTG |
66+
| [M5Stack](docs/Board_Instructions.md#m5stack) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 |
67+
| [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 |
6868

69-
Developers and manufacturers are welcomed to contribute PRs to add more development boards. For detailed instructions, please refer to the [`Board Development Guide`](./src/board/Board_Contribution_Guide.md).
69+
Developers and manufacturers are welcomed to contribute PRs to add more development boards. For detailed instructions, please refer to the [`Board Development Guide`](./docs/Board_Contribution_Guide.md).
7070

7171
### LCD Controllers
7272

73-
Below is a list of [supported LCD controllers](src/lcd/README.md):
73+
Below is a list of [supported LCD controllers](docs/LCD_Controllers.md):
7474

7575
| **Manufacturer** | **Model** |
7676
| --------------- | --------- |
@@ -81,7 +81,7 @@ Below is a list of [supported LCD controllers](src/lcd/README.md):
8181

8282
### Touch Controllers
8383

84-
Below is a list of [supported touch controllers](src/touch/README.md):
84+
Below is a list of [supported touch controllers](docs/Touch_Controllers.md):
8585

8686
| **Manufacturer** | **Model** |
8787
| --------------- | --------- |
@@ -112,10 +112,10 @@ Below are detailed instructions on how to configure ESP32_Display_Panel, mainly
112112
3. For projects without configuration files, users can copy them from the root directory or examples of ESP32_Display_Panel to their own projects.
113113
4. If multiple projects need to use the same configuration, users can place the configuration files in the [Arduino Library Directory](#where-is-the-directory-for-arduino-libraries), so that all projects can share the same configuration.
114114

115-
**Notes**:
116-
117-
* The same directory can simultaneously contain both `ESP_Panel_Board_Supported.h` and `ESP_Panel_Board_Custom.h` configuration files, but they cannot be enabled at the same time, meaning `ESP_PANEL_USE_SUPPORTED_BOARD` and `ESP_PANEL_USE_CUSTOM_BOARD` can only have one set to `1`.
118-
* If neither of the above two configuration files is enabled, users cannot use the `ESP_Panel` driver and can only use other standalone device drivers, such as `ESP_PanelBus`, `ESP_PanelLcd`, etc.
115+
> [!WARNING]
116+
> * The same directory can simultaneously contain both `ESP_Panel_Board_Supported.h` and `ESP_Panel_Board_Custom.h` configuration files, but they cannot be enabled at the same time, meaning `ESP_PANEL_USE_SUPPORTED_BOARD` and `ESP_PANEL_USE_CUSTOM_BOARD` can only have one set to `1`.
117+
> * If neither of the above two configuration files is enabled, users cannot use the `ESP_Panel` driver and can only use other standalone device drivers, such as `ESP_PanelBus`, `ESP_PanelLcd`, etc.
118+
> * Since the configurations within these files might change, such as adding, deleting, or renaming, to ensure the compatibility of the program, the library manages the versions of these files independently and checks whether the configuration files currently used by the user are compatible with the library during compilation. Detailed version information and checking rules can be found at the end of the file.
119119
120120
#### Configuring Drivers
121121

@@ -309,7 +309,7 @@ To port the SquareLine project (v1.3.x), please refer to [here](#porting-squarel
309309

310310
### Configuring Supported Development Boards
311311

312-
For details on how to configure the supported development boards in the Arduino IDE, see [Board_Instructions.md](./src/board/Board_Instructions.md#recommended-configurations-in-the-arduino-ide).
312+
For details on how to configure the supported development boards in the Arduino IDE, see [Board_Instructions - Recommended Configurations in the Arduino IDE](./docs/Board_Instructions.md#recommended-configurations-in-the-arduino-ide).
313313

314314
### Configuring LVGL
315315

README_CN.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[![Arduino Lint](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml) [![pre-commit](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml)
1+
[![GitHub Release](https://img.shields.io/github/v/release/esp-arduino-libs/ESP32_Display_Panel)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/releases) [![Arduino Lint](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/arduino_lint.yml) [![pre-commit](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/esp-arduino-libs/ESP32_Display_Panel/actions/workflows/pre-commit.yml)
22

33
# ESP Display Panel
44

55
* [English Version](./README.md)
66

7-
ESP32_Display_Panel 是专为 ESP SoCs 设计的 Arduino 库,用于驱动显示屏并实现快速 GUI 开发。用户不仅可以直接开发多款[内部支持的开发板](src/board/Board_Instructions.md),还可以通过简单的适配来开发自定义的开发板。此外,ESP32_Display_Panel 还适配了多款 LCD 和触摸的驱动,用户也可以根据需要使用独立的驱动进行开发。
7+
ESP32_Display_Panel 是专为 ESP SoCs 设计的 Arduino 库,用于驱动显示屏并实现快速 GUI 开发。用户不仅可以直接开发多款[内部支持的开发板](docs/Board_Instructions.md),还可以通过简单的适配来开发自定义的开发板。此外,ESP32_Display_Panel 还适配了多款 LCD 和触摸的驱动,用户也可以根据需要使用独立的驱动进行开发。
88

99
ESP32_Display_Panel 封装了多种[乐鑫组件库](https://components.espressif.com/)中相关的组件,需要基于 [arduino-esp32](https://github.com/espressif/arduino-esp32) 进行开发,并且可以直接从 Arduino IDE 中下载获取。
1010

@@ -58,19 +58,19 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性:
5858

5959
### 开发板
6060

61-
下面是支持的[开发板列表](src/board/Board_Instructions.md)
61+
下面是支持的[开发板列表](docs/Board_Instructions.md)
6262

6363
| **厂商** | **开发板型号** |
6464
| -------- | -------------- |
65-
| [Espressif](src/board/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-Box, ESP32-S3-Box-3, ESP32-S3-Box-3(beta), ESP32-S3-Box-Lite, ESP32-S3-EYE, ESP32-S3-Korvo-2, ESP32-S3-LCD-EV-Board, ESP32-S3-LCD-EV-Board-2, ESP32-S3-USB-OTG |
66-
| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 |
67-
| [Jingcai](src/board/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 |
65+
| [Espressif](docs/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-Box, ESP32-S3-Box-3, ESP32-S3-Box-3(beta), ESP32-S3-Box-Lite, ESP32-S3-EYE, ESP32-S3-Korvo-2, ESP32-S3-LCD-EV-Board, ESP32-S3-LCD-EV-Board-2, ESP32-S3-USB-OTG |
66+
| [M5Stack](docs/Board_Instructions.md#m5stack) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 |
67+
| [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 |
6868

69-
欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./src/board/Board_Contribution_Guide_CN.md)
69+
欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./docs/Board_Contribution_Guide_CN.md)
7070

7171
### LCD 控制器
7272

73-
下面是支持的 [LCD 控制器列表](src/lcd/README.md)
73+
下面是支持的 [LCD 控制器列表](docs/LCD_Controllers.md)
7474

7575
| **厂商** | **型号** |
7676
| -------- | -------- |
@@ -81,7 +81,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性:
8181

8282
### 触摸控制器
8383

84-
下面是支持的 [触摸控制器列表](src/touch/README.md)
84+
下面是支持的 [触摸控制器列表](docs/Touch_Controllers.md)
8585

8686
| **厂商** | **型号** |
8787
| -------- | -------- |
@@ -112,10 +112,10 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性:
112112
3. 对于没有配置文件的工程,用户可以将其从 ESP32_Display_Panel 的根目录或者示例工程中复制到自己的工程中。
113113
4. 如果有多个工程需要使用相同的配置,用户可以将配置文件放在 [Arduino 库目录](#arduino-库的目录在哪儿)中,这样所有的工程都可以共享相同的配置。
114114

115-
**Notes**:
116-
117-
* 同一个目录下可以同时包含 `ESP_Panel_Board_Supported.h``ESP_Panel_Board_Custom.h` 两种配置文件,但是它们不能同时被使能,即 `ESP_PANEL_USE_SUPPORTED_BOARD``ESP_PANEL_USE_CUSTOM_BOARD` 最多只能有一个为 `1`
118-
* 如果以上两个配置文件都被没有被使能,那么用户就无法使用 `ESP_Panel` 驱动,只能使用其他独立的设备驱动,如 `ESP_PanelBus`, `ESP_PanelLcd`
115+
> [!WARNING]
116+
> * 同一个目录下可以同时包含 `ESP_Panel_Board_Supported.h``ESP_Panel_Board_Custom.h` 两种配置文件,但是它们不能同时被使能,即 `ESP_PANEL_USE_SUPPORTED_BOARD``ESP_PANEL_USE_CUSTOM_BOARD` 最多只能有一个为 `1`
117+
> * 如果以上两个配置文件都被没有被使能,那么用户就无法使用 `ESP_Panel` 驱动,只能使用其他独立的设备驱动,如 `ESP_PanelBus`, `ESP_PanelLcd`
118+
> * 由于这些文件内的配置可能会发生变化,比如新增、删除或重命名,为了保证程序的兼容性,库对它们分别进行了独立的版本管理,并在编译时检查用户当前使用的配置文件与库是否兼容。详细的版本信息以及检查规则可以在文件的末尾处找到
119119
120120
#### 配置驱动
121121

@@ -309,7 +309,7 @@ ESP32_Display_Panel 会根据 [ESP_Panel_Board_Custom.h](./ESP_Panel_Board_Custo
309309

310310
### 配置支持的开发板
311311

312-
关于如何在 Arduino IDE 中配置支持的开发板,请参考 [Board_Instructions.md](./src/board/Board_Instructions.md#recommended-configurations-in-the-arduino-ide).
312+
关于如何在 Arduino IDE 中配置支持的开发板,请参考 [Board_Instructions - Recommended Configurations in the Arduino IDE](./docs/Board_Instructions.md#recommended-configurations-in-the-arduino-ide).
313313

314314
### 配置 LVGL
315315

0 commit comments

Comments
 (0)