From 3961d242e4385227c4f1bb7c0d7ed0a606b2a5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 21:48:33 +0200 Subject: [PATCH 01/19] Waveshare ESP32-S3-Touch-LCD-4.3 board --- ESP_Panel_Board_Supported.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ESP_Panel_Board_Supported.h b/ESP_Panel_Board_Supported.h index 33853e08..9ccf9fc8 100644 --- a/ESP_Panel_Board_Supported.h +++ b/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: From 99a8ae60f414c154780013ed3041db1da97c00e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 21:48:51 +0200 Subject: [PATCH 02/19] Waveshare ESP32-S3-Touch-LCD-4.3 board --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 290 +++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h new file mode 100644 index 00000000..7f92791b --- /dev/null +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -0,0 +1,290 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure the LCD panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* Set to 1 when using an LCD panel */ +#define ESP_PANEL_USE_LCD (1) // 0/1 + +#if ESP_PANEL_USE_LCD +/** + * LCD Controller Name + */ +#define ESP_PANEL_LCD_NAME ST7262 + +/* LCD resolution in pixels */ +#define ESP_PANEL_LCD_WIDTH (800) +#define ESP_PANEL_LCD_HEIGHT (480) + +/* LCD Bus Settings */ +/** + * If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance. + * It is useful if other devices use the same host. Please ensure that the host is initialized only once. + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (0) // 0/1 +/** + * LCD Bus Type. + */ +#define ESP_PANEL_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) +/** + * LCD Bus Parameters. + * + * Please refer to https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/lcd.html and + * https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/index.html for more details. + * + */ +#if ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB + + #define ESP_PANEL_LCD_RGB_CLK_HZ (16 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (40) + #define ESP_PANEL_LCD_RGB_HBP (40) + #define ESP_PANEL_LCD_RGB_HFP (48) + #define ESP_PANEL_LCD_RGB_VPW (23) + #define ESP_PANEL_LCD_RGB_VBP (32) + #define ESP_PANEL_LCD_RGB_VFP (13) + #define ESP_PANEL_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge + #define ESP_PANEL_LCD_RGB_DATA_WIDTH (16) // 8 | 16 + #define ESP_PANEL_LCD_RGB_PIXEL_BITS (24) // 24 | 16 + #define ESP_PANEL_LCD_RGB_FRAME_BUF_NUM (1) // 1/2/3 + #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_LCD_WIDTH * 10) + // Bounce buffer size in bytes. This function is used to avoid screen drift. + // To enable the bounce buffer, set it to a non-zero value. + // Typically set to `ESP_PANEL_LCD_WIDTH * 10` + #define ESP_PANEL_LCD_RGB_IO_HSYNC (46) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (3) + #define ESP_PANEL_LCD_RGB_IO_DE (5) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (7) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_DATA0 (1) + #define ESP_PANEL_LCD_RGB_IO_DATA1 (2) + #define ESP_PANEL_LCD_RGB_IO_DATA2 (42) + #define ESP_PANEL_LCD_RGB_IO_DATA3 (41) + #define ESP_PANEL_LCD_RGB_IO_DATA4 (40) + #define ESP_PANEL_LCD_RGB_IO_DATA5 (14) + #define ESP_PANEL_LCD_RGB_IO_DATA6 (38) + #define ESP_PANEL_LCD_RGB_IO_DATA7 (18) +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (17) + #define ESP_PANEL_LCD_RGB_IO_DATA9 (10) + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) + #define ESP_PANEL_LCD_RGB_IO_DATA11 (0) + #define ESP_PANEL_LCD_RGB_IO_DATA12 (45) + #define ESP_PANEL_LCD_RGB_IO_DATA13 (48) + #define ESP_PANEL_LCD_RGB_IO_DATA14 (47) + #define ESP_PANEL_LCD_RGB_IO_DATA15 (21) +#endif +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_3WIRE_SPI_IO_CS (39) + #define ESP_PANEL_LCD_3WIRE_SPI_IO_SCK (48) + #define ESP_PANEL_LCD_3WIRE_SPI_IO_SDA (47) + #define ESP_PANEL_LCD_3WIRE_SPI_CS_USE_EXPNADER (0) // 0/1 + #define ESP_PANEL_LCD_3WIRE_SPI_SCL_USE_EXPNADER (0) // 0/1 + #define ESP_PANEL_LCD_3WIRE_SPI_SDA_USE_EXPNADER (0) // 0/1 + #define ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE (0) // 0: rising edge, 1: falling edge + #define ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO (0) // Delete the panel IO instance automatically if set to 1. + // If the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs, + // Please set it to 1 to release the panel IO and its pins (except CS signal). + #define ESP_PANEL_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO) + // The `mirror()` function will be implemented by LCD command if set to 1. +#endif + +#endif /* ESP_PANEL_LCD_BUS_TYPE */ + +/** + * LCD Venbdor Initialization Commands. + * + * Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for + * initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver + * will use the default initialization sequence code. + * + * There are two formats for the sequence code: + * 1. Raw data: {command, (uint8_t []){ data0, data1, ... }, data_size, delay_ms} + * 2. Formater: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and + * ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command) + */ +#define ESP_PANEL_LCD_VENDOR_INIT_CMD() \ + { \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC2, {0x31, 0x05}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xCD, {0x00}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB0, {0x00, 0x11, 0x18, 0x0E, 0x11, 0x06, 0x07, 0x08, 0x07, 0x22, 0x04, 0x12, 0x0F, 0xAA, 0x31, 0x18}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x00, 0x11, 0x19, 0x0E, 0x12, 0x07, 0x08, 0x08, 0x08, 0x22, 0x04, 0x11, 0x11, 0xA9, 0x32, 0x18}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x11}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB0, {0x60}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x32}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB2, {0x07}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB3, {0x80}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB5, {0x49}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB7, {0x85}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB8, {0x21}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x78}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC2, {0x78}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE0, {0x00, 0x1B, 0x02}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE1, {0x08, 0xA0, 0x00, 0x00, 0x07, 0xA0, 0x00, 0x00, 0x00, 0x44, 0x44}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE2, {0x11, 0x11, 0x44, 0x44, 0xED, 0xA0, 0x00, 0x00, 0xEC, 0xA0, 0x00, 0x00}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE3, {0x00, 0x00, 0x11, 0x11}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE4, {0x44, 0x44}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE5, {0x0A, 0xE9, 0xD8, 0xA0, 0x0C, 0xEB, 0xD8, 0xA0, 0x0E, 0xED, 0xD8, 0xA0, 0x10, 0xEF, 0xD8, 0xA0}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE6, {0x00, 0x00, 0x11, 0x11}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE7, {0x44, 0x44}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE8, {0x09, 0xE8, 0xD8, 0xA0, 0x0B, 0xEA, 0xD8, 0xA0, 0x0D, 0xEC, 0xD8, 0xA0, 0x0F, 0xEE, 0xD8, 0xA0}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xEB, {0x02, 0x00, 0xE4, 0xE4, 0x88, 0x00, 0x40}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xEC, {0x3C, 0x00}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xED, {0xAB, 0x89, 0x76, 0x54, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x45, 0x67, 0x98, 0xBA}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x13}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE5, {0xE4}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x00}), \ + ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x11), \ + } + +/* LCD Color Settings */ +/* LCD color depth in bits */ +#define ESP_PANEL_LCD_COLOR_BITS (18) // 8/16/18/24 +/* + * LCD RGB Element Order. Choose one of the following: + * - 0: RGB + * - 1: BGR + */ +#define ESP_PANEL_LCD_BGR_ORDER (0) // 0/1 +#define ESP_PANEL_LCD_INEVRT_COLOR (0) // 0/1 + +/* LCD Transformation Flags */ +#define ESP_PANEL_LCD_SWAP_XY (0) // 0/1 +#define ESP_PANEL_LCD_MIRROR_X (0) // 0/1 +#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1 + +/* LCD Other Settings */ +/* IO num of RESET pin, set to -1 if not use */ +#define ESP_PANEL_LCD_IO_RST (-1) +#define ESP_PANEL_LCD_RST_LEVEL (0) // 0: low level, 1: high level + +#endif /* ESP_PANEL_USE_LCD */ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure the touch panel /////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* Set to 1 when using an touch panel */ +#define ESP_PANEL_USE_TOUCH (1) // 0/1 +#if ESP_PANEL_USE_TOUCH +/** + * Touch controller name + */ +#define ESP_PANEL_TOUCH_NAME GT911 + +/* Touch resolution in pixels */ +#define ESP_PANEL_TOUCH_H_RES (ESP_PANEL_LCD_WIDTH) // Typically set to the same value as the width of LCD +#define ESP_PANEL_TOUCH_V_RES (ESP_PANEL_LCD_HEIGHT) // Typically set to the same value as the height of LCD + +/* Touch Panel Bus Settings */ +/** + * If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance. + * It is useful if other devices use the same host. Please ensure that the host is initialized only once. + */ +#define ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST (0) // 0/1 +/** + * Touch panel bus type + */ +#define ESP_PANEL_TOUCH_BUS_TYPE (ESP_PANEL_BUS_TYPE_I2C) +/* Touch panel bus parameters */ +#if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C + + #define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0 + #define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // Typically set to 0 to use default address +#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST + #define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000) + // Typically set to 400K + #define ESP_PANEL_TOUCH_I2C_SCL_PULLUP (1) // 0/1 + #define ESP_PANEL_TOUCH_I2C_SDA_PULLUP (1) // 0/1 + #define ESP_PANEL_TOUCH_I2C_IO_SCL (9) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (8) +#endif + +#endif /* ESP_PANEL_TOUCH_BUS_TYPE */ + +/* Touch Transformation Flags */ +#define ESP_PANEL_TOUCH_SWAP_XY (0) // 0/1 +#define ESP_PANEL_TOUCH_MIRROR_X (0) // 0/1 +#define ESP_PANEL_TOUCH_MIRROR_Y (0) // 0/1 + +/* Touch Other Settings */ +/* IO num of RESET pin, set to -1 if not use */ +#define ESP_PANEL_TOUCH_IO_RST (-1) +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // 0: low level, 1: high level +/* IO num of INT pin, set to -1 if not use */ +#define ESP_PANEL_TOUCH_IO_INT (-1) +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // 0: low level, 1: high level + +#endif /* ESP_PANEL_USE_TOUCH */ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// Please update the following macros to configure the backlight //////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#define ESP_PANEL_USE_BACKLIGHT (1) // 0/1 +#if ESP_PANEL_USE_BACKLIGHT +/* IO num of backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (38) +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level + +/* Set to 1 if turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (0) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#define ESP_PANEL_LCD_BL_USE_PWM (1) // 0/1 +#endif /* ESP_PANEL_USE_BACKLIGHT */ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// Please update the following macros to configure the IO expander ////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* Set to 0 if not using IO Expander */ +#define ESP_PANEL_USE_EXPANDER (1) // 0/1 +#if ESP_PANEL_USE_EXPANDER +/** + * IO expander name. + */ +#define ESP_PANEL_EXPANDER_NAME CH422G + +/* IO expander Settings */ +/** + * If set to 1, the driver will skip to initialize the corresponding host. Users need to initialize the host in advance. + * It is useful if other devices use the same host. Please ensure that the host is initialized only once. + */ +#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (0) // 0/1 +/* IO expander parameters */ +#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x24) +#if !ESP_PANEL_EXPANDER_SKIP_INIT_HOST + #define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0 + #define ESP_PANEL_EXPANDER_I2C_CLK_HZ (400 * 1000) + // Typically set to 400K + #define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (0) // 0/1 + #define ESP_PANEL_EXPANDER_I2C_SDA_PULLUP (0) // 0/1 + #define ESP_PANEL_EXPANDER_I2C_IO_SCL (18) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (8) +#endif +#endif /* ESP_PANEL_USE_EXPANDER */ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// Please utilize the following macros to execute any additional code if required. ////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// #define ESP_PANEL_BEGIN_START_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_EXPANDER_START_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_EXPANDER_END_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_LCD_START_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_LCD_END_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_TOUCH_START_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_TOUCH_END_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_BACKLIGHT_START_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_BACKLIGHT_END_FUNCTION( panel ) +// #define ESP_PANEL_BEGIN_END_FUNCTION( panel ) + +// *INDENT-OFF* + From 03253354def8097c7f5ef60af1ce390c33668e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 21:56:24 +0200 Subject: [PATCH 03/19] Update Board_Instructions.md --- docs/Board_Instructions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 05dcb8a6..6bb3bd07 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -38,6 +38,12 @@ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :----------------: | :-----------: | :------------------: | | [](https://www.displaysmodule.com/sale-41828962-experience-the-power-of-the-esp32-display-module-sku-esp32-4848s040c-i-y-3.html) | [ESP32-4848S040C_I_Y_3](http://pan.jczn1688.com/directlink/1/ESP32%20module/4.0inch_ESP32-4848S040.zip) | 3-wire SPI + RGB | ST7701 | 480x480 | I2C | GT911 | +## [Waveshare](https://www.waveshare.com/) + +| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **LCD resolution** | **Touch Bus** | **Touch Controller** | +| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | ------------------ | :-----------: | :------------------: | +| | [ESP32-S3-Touch-LCD-4.3](https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm) | RGB | ST7262 | 800x480 | I2C | GT911 | + ## Recommended Configurations in the Arduino IDE Below are recommended configurations for developing GUI applications on different development boards. These settings can be adjusted according to specific requirements, and users can navigate to the `Tools` menu in the Arduino IDE to configure the following settings. From 96de7f36dec4357b01fb3f04a795aa856705e3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 21:58:54 +0200 Subject: [PATCH 04/19] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a24616bb..5e4ba39c 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Below is a list of [supported development boards](docs/Board_Instructions.md): | [Espressif](docs/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-BOX, ESP32-S3-BOX-3, ESP32-S3-BOX-3B, 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 | | [M5Stack](docs/Board_Instructions.md#m5stack) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 | | [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | +| [Waveshare](docs/Board_Instructions.md#waveshare) | ESP32-S3-Touch-LCD-4.3 | 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). From a247199673db7c91bd934a2cda9dd46e3b6cea1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 21:59:17 +0200 Subject: [PATCH 05/19] Update README_CN.md --- README_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_CN.md b/README_CN.md index 0f929db6..175cc8cd 100644 --- a/README_CN.md +++ b/README_CN.md @@ -65,6 +65,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | [Espressif](docs/Board_Instructions.md#espressif) | ESP32-C3-LCDkit, ESP32-S3-BOX, ESP32-S3-BOX-3, ESP32-S3-BOX-3B, 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 | | [M5Stack](docs/Board_Instructions.md#m5stack) | M5STACK-M5CORE2, M5STACK-M5DIAL, M5STACK-M5CORES3 | | [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | +| [Waveshare](docs/Board_Instructions.md#waveshare) | ESP32-S3-Touch-LCD-4.3 | 欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./docs/Board_Contribution_Guide_CN.md)。 From f08170c2656d10c99760c720c067ca31fd74d19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:02:08 +0200 Subject: [PATCH 06/19] Update Board_Instructions.md --- docs/Board_Instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 6bb3bd07..07e27c57 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -65,6 +65,7 @@ Below are recommended configurations for developing GUI applications on differen | M5STACK-M5CORES3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | Default 4MB with spiffs | | ESP32-4848S040C_I_Y_3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Disabled | 16M Flash (3MB) | | ElecrowCrowPanel 7.0" | ESP32S3 Dev Module | OPI | QIO 80MHz | 4MB | Disabled | Huge App (3MB) | +| Waveshare-ESP32-S3-Touch-LCD-4.3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | Default 4MB with spiffs | **Notes:** From 746adf93fa846fdbdb7f1aae58cdf21ab5729bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:18:58 +0200 Subject: [PATCH 07/19] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index e29ffed2..2f8a775e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP32_Display_Panel -version=0.1.5 +version=0.1.6 author=espressif maintainer=espressif sentence=ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development. From 7f5e6301ebdd3b47f437ce111e9cc55eee00dc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:19:12 +0200 Subject: [PATCH 08/19] Update ESP_PanelVersions.h --- src/ESP_PanelVersions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h index ac7043f8..6d15df0f 100644 --- a/src/ESP_PanelVersions.h +++ b/src/ESP_PanelVersions.h @@ -11,7 +11,7 @@ /* Library Version */ #define ESP_PANEL_VERSION_MAJOR 0 #define ESP_PANEL_VERSION_MINOR 1 -#define ESP_PANEL_VERSION_PATCH 5 +#define ESP_PANEL_VERSION_PATCH 6 /* File `ESP_Panel_Conf.h` */ #define ESP_PANEL_CONF_VERSION_MAJOR 0 From 6f006b36b212a339e2cf218cc9226714c9062e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:23:08 +0200 Subject: [PATCH 09/19] BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 --- ESP_Panel_Board_Supported.h | 2 +- src/board/ESP_PanelBoard.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ESP_Panel_Board_Supported.h b/ESP_Panel_Board_Supported.h index 9ccf9fc8..58d065c3 100644 --- a/ESP_Panel_Board_Supported.h +++ b/ESP_Panel_Board_Supported.h @@ -81,7 +81,7 @@ * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * */ -// #define BOARD_ESP32_S3_Touch_LCD_4_3 +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with diff --git a/src/board/ESP_PanelBoard.h b/src/board/ESP_PanelBoard.h index 1ecb59b7..2126fa2a 100644 --- a/src/board/ESP_PanelBoard.h +++ b/src/board/ESP_PanelBoard.h @@ -59,6 +59,9 @@ /* Jingcai */ #elif defined(BOARD_ESP32_4848S040C_I_Y_3) || CONFIG_BOARD_ESP32_4848S040C_I_Y_3 #include "board/jingcai/ESP32_4848S040C_I_Y_3.h" +/* Waveshare */ +#elif defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3) || CONFIG_BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + #include "board/waveshare/ESP32_S3_Touch_LCD_4.3.h" #else #error "Unkonw board selected! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif From f35b64c95bfa670657cf56b5a3ce9a1048a8f043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:35:04 +0200 Subject: [PATCH 10/19] Update ESP32_S3_Touch_LCD_4.3.h --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index 7f92791b..2e015781 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -229,10 +229,10 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// Please update the following macros to configure the backlight //////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define ESP_PANEL_USE_BACKLIGHT (1) // 0/1 +#define ESP_PANEL_USE_BACKLIGHT (0) // 0/1 #if ESP_PANEL_USE_BACKLIGHT /* IO num of backlight pin */ -#define ESP_PANEL_BACKLIGHT_IO (38) +#define ESP_PANEL_BACKLIGHT_IO (-1) #define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level /* Set to 1 if turn off the backlight after initializing the panel; otherwise, set it to turn on */ From 4b2a16ce3252b9e139c03c10b842faa968b2253b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 22:47:14 +0200 Subject: [PATCH 11/19] Update Board_Instructions.md --- docs/Board_Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 07e27c57..beb745bf 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -65,7 +65,7 @@ Below are recommended configurations for developing GUI applications on differen | M5STACK-M5CORES3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | Default 4MB with spiffs | | ESP32-4848S040C_I_Y_3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Disabled | 16M Flash (3MB) | | ElecrowCrowPanel 7.0" | ESP32S3 Dev Module | OPI | QIO 80MHz | 4MB | Disabled | Huge App (3MB) | -| Waveshare-ESP32-S3-Touch-LCD-4.3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | Default 4MB with spiffs | +| Waveshare-ESP32-S3-Touch-LCD-4.3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | 8M with spiffs | **Notes:** From 4207dc2ca340d087f8a82190f0a895bb1b4ad22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 29 Jul 2024 21:27:29 +0200 Subject: [PATCH 12/19] Update ESP32_S3_Touch_LCD_4.3.h The RGB interface is used without the 3-wire SPI interface --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index 2e015781..677c3b82 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -29,7 +29,7 @@ * If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance. * It is useful if other devices use the same host. Please ensure that the host is initialized only once. */ -#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (0) // 0/1 +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1) // 0/1 /** * LCD Bus Type. */ From 61e946ac31dc74a90b2a6fcafe87fbedddc59c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 29 Jul 2024 21:28:09 +0200 Subject: [PATCH 13/19] Update ESP32_S3_Touch_LCD_4.3.h --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 50 +++++--------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index 677c3b82..b6ce73b9 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -99,7 +99,7 @@ #endif /* ESP_PANEL_LCD_BUS_TYPE */ /** - * LCD Venbdor Initialization Commands. + * LCD Vendor Initialization Commands. * * Vendor specific initialization can be different between manufacturers, should consult the LCD supplier for * initialization sequence code. Please uncomment and change the following macro definitions. Otherwise, the LCD driver @@ -110,42 +110,18 @@ * 2. Formater: ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, { data0, data1, ... }) and * ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command) */ -#define ESP_PANEL_LCD_VENDOR_INIT_CMD() \ - { \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC2, {0x31, 0x05}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xCD, {0x00}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB0, {0x00, 0x11, 0x18, 0x0E, 0x11, 0x06, 0x07, 0x08, 0x07, 0x22, 0x04, 0x12, 0x0F, 0xAA, 0x31, 0x18}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x00, 0x11, 0x19, 0x0E, 0x12, 0x07, 0x08, 0x08, 0x08, 0x22, 0x04, 0x11, 0x11, 0xA9, 0x32, 0x18}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x11}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB0, {0x60}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x32}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB2, {0x07}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB3, {0x80}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB5, {0x49}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB7, {0x85}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB8, {0x21}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x78}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC2, {0x78}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE0, {0x00, 0x1B, 0x02}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE1, {0x08, 0xA0, 0x00, 0x00, 0x07, 0xA0, 0x00, 0x00, 0x00, 0x44, 0x44}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE2, {0x11, 0x11, 0x44, 0x44, 0xED, 0xA0, 0x00, 0x00, 0xEC, 0xA0, 0x00, 0x00}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE3, {0x00, 0x00, 0x11, 0x11}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE4, {0x44, 0x44}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE5, {0x0A, 0xE9, 0xD8, 0xA0, 0x0C, 0xEB, 0xD8, 0xA0, 0x0E, 0xED, 0xD8, 0xA0, 0x10, 0xEF, 0xD8, 0xA0}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE6, {0x00, 0x00, 0x11, 0x11}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE7, {0x44, 0x44}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE8, {0x09, 0xE8, 0xD8, 0xA0, 0x0B, 0xEA, 0xD8, 0xA0, 0x0D, 0xEC, 0xD8, 0xA0, 0x0F, 0xEE, 0xD8, 0xA0}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xEB, {0x02, 0x00, 0xE4, 0xE4, 0x88, 0x00, 0x40}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xEC, {0x3C, 0x00}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xED, {0xAB, 0x89, 0x76, 0x54, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x45, 0x67, 0x98, 0xBA}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x13}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xE5, {0xE4}), \ - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x00}), \ - ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x11), \ - } +// #define ESP_PANEL_LCD_VENDOR_INIT_CMD \ +// { \ +// {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \ +// {0xC0, (uint8_t []){0x3B, 0x00}, 2, 0}, \ +// {0xC1, (uint8_t []){0x0D, 0x02}, 2, 0}, \ +// {0x29, (uint8_t []){0x00}, 0, 120}, \ +// or \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFF, {0x77, 0x01, 0x00, 0x00, 0x10}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC0, {0x3B, 0x00}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x0D, 0x02}), \ +// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29), \ +// } /* LCD Color Settings */ /* LCD color depth in bits */ From fa31976d29b62eaca4c2c16f30abc8240e00541d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 29 Jul 2024 21:56:52 +0200 Subject: [PATCH 14/19] Update ESP32_S3_Touch_LCD_4.3.h --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 76 +++++++++++--------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index b6ce73b9..84734750 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -44,47 +44,53 @@ #if ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB #define ESP_PANEL_LCD_RGB_CLK_HZ (16 * 1000 * 1000) - #define ESP_PANEL_LCD_RGB_HPW (40) - #define ESP_PANEL_LCD_RGB_HBP (40) - #define ESP_PANEL_LCD_RGB_HFP (48) - #define ESP_PANEL_LCD_RGB_VPW (23) - #define ESP_PANEL_LCD_RGB_VBP (32) - #define ESP_PANEL_LCD_RGB_VFP (13) - #define ESP_PANEL_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge - #define ESP_PANEL_LCD_RGB_DATA_WIDTH (16) // 8 | 16 - #define ESP_PANEL_LCD_RGB_PIXEL_BITS (24) // 24 | 16 + #define ESP_PANEL_LCD_RGB_HPW (4) + #define ESP_PANEL_LCD_RGB_HBP (8) + #define ESP_PANEL_LCD_RGB_HFP (8) + #define ESP_PANEL_LCD_RGB_VPW (4) + #define ESP_PANEL_LCD_RGB_VBP (8) + #define ESP_PANEL_LCD_RGB_VFP (8) + #define ESP_PANEL_LCD_RGB_PCLK_ACTIVE_NEG (1) // 0: rising edge, 1: falling edge + + // | 8-bit RGB888 | 16-bit RGB565 | + // |--------------|---------------| + #define ESP_PANEL_LCD_RGB_DATA_WIDTH (16) // | 8 | 16 | + #define ESP_PANEL_LCD_RGB_PIXEL_BITS (16) // | 24 | 16 | #define ESP_PANEL_LCD_RGB_FRAME_BUF_NUM (1) // 1/2/3 - #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_LCD_WIDTH * 10) - // Bounce buffer size in bytes. This function is used to avoid screen drift. - // To enable the bounce buffer, set it to a non-zero value. - // Typically set to `ESP_PANEL_LCD_WIDTH * 10` + #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_LCD_WIDTH * 10) // Bounce buffer size in bytes. This function is used to avoid screen drift. + // To enable the bounce buffer, set it to a non-zero value. Typically set to `ESP_PANEL_LCD_WIDTH * 10` + // The size of the Bounce Buffer must satisfy `width_of_lcd * height_of_lcd = size_of_buffer * N`, + // where N is an even number. #define ESP_PANEL_LCD_RGB_IO_HSYNC (46) #define ESP_PANEL_LCD_RGB_IO_VSYNC (3) - #define ESP_PANEL_LCD_RGB_IO_DE (5) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_DE (5) // -1 if not used #define ESP_PANEL_LCD_RGB_IO_PCLK (7) #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used - #define ESP_PANEL_LCD_RGB_IO_DATA0 (1) - #define ESP_PANEL_LCD_RGB_IO_DATA1 (2) - #define ESP_PANEL_LCD_RGB_IO_DATA2 (42) - #define ESP_PANEL_LCD_RGB_IO_DATA3 (41) - #define ESP_PANEL_LCD_RGB_IO_DATA4 (40) - #define ESP_PANEL_LCD_RGB_IO_DATA5 (14) - #define ESP_PANEL_LCD_RGB_IO_DATA6 (38) - #define ESP_PANEL_LCD_RGB_IO_DATA7 (18) + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (14) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (38) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (18) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (17) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (10) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (39) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (0) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (45) // | G2 | G2 | G4 | #if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 - #define ESP_PANEL_LCD_RGB_IO_DATA8 (17) - #define ESP_PANEL_LCD_RGB_IO_DATA9 (10) - #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) - #define ESP_PANEL_LCD_RGB_IO_DATA11 (0) - #define ESP_PANEL_LCD_RGB_IO_DATA12 (45) - #define ESP_PANEL_LCD_RGB_IO_DATA13 (48) - #define ESP_PANEL_LCD_RGB_IO_DATA14 (47) - #define ESP_PANEL_LCD_RGB_IO_DATA15 (21) + #define ESP_PANEL_LCD_RGB_IO_DATA8 (48) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (47) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (21) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (1) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (2) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (41) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (40) // | R4 | R5 | R7 | #endif #if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST - #define ESP_PANEL_LCD_3WIRE_SPI_IO_CS (39) - #define ESP_PANEL_LCD_3WIRE_SPI_IO_SCK (48) - #define ESP_PANEL_LCD_3WIRE_SPI_IO_SDA (47) + #define ESP_PANEL_LCD_3WIRE_SPI_IO_CS (0) + #define ESP_PANEL_LCD_3WIRE_SPI_IO_SCK (1) + #define ESP_PANEL_LCD_3WIRE_SPI_IO_SDA (2) #define ESP_PANEL_LCD_3WIRE_SPI_CS_USE_EXPNADER (0) // 0/1 #define ESP_PANEL_LCD_3WIRE_SPI_SCL_USE_EXPNADER (0) // 0/1 #define ESP_PANEL_LCD_3WIRE_SPI_SDA_USE_EXPNADER (0) // 0/1 @@ -175,7 +181,7 @@ #if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C #define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0 - #define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // Typically set to 0 to use default address + #define ESP_PANEL_TOUCH_I2C_ADDRESS (0x14) // For GT911, there are two addresses: 0x5D(default) and 0x14 #if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST #define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000) // Typically set to 400K @@ -222,7 +228,7 @@ ///////////////////////////// Please update the following macros to configure the IO expander ////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 0 if not using IO Expander */ -#define ESP_PANEL_USE_EXPANDER (1) // 0/1 +#define ESP_PANEL_USE_EXPANDER (0) // 0/1 #if ESP_PANEL_USE_EXPANDER /** * IO expander name. From dd5d725acc4331ac428485474db38d9fee7f2c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 30 Jul 2024 08:06:41 +0200 Subject: [PATCH 15/19] Update ESP32_S3_Touch_LCD_4.3.h --- src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index 84734750..d792fb6f 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -181,7 +181,7 @@ #if ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C #define ESP_PANEL_TOUCH_BUS_HOST_ID (0) // Typically set to 0 - #define ESP_PANEL_TOUCH_I2C_ADDRESS (0x14) // For GT911, there are two addresses: 0x5D(default) and 0x14 + #define ESP_PANEL_TOUCH_I2C_ADDRESS (0) // For GT911, there are two addresses: 0x5D(default) and 0x14 #if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST #define ESP_PANEL_TOUCH_I2C_CLK_HZ (400 * 1000) // Typically set to 400K @@ -221,14 +221,14 @@ #define ESP_PANEL_BACKLIGHT_IDLE_OFF (0) // 0: on, 1: off /* Set to 1 if use PWM for brightness control */ -#define ESP_PANEL_LCD_BL_USE_PWM (1) // 0/1 +#define ESP_PANEL_LCD_BL_USE_PWM (0) // 0/1 #endif /* ESP_PANEL_USE_BACKLIGHT */ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// Please update the following macros to configure the IO expander ////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 0 if not using IO Expander */ -#define ESP_PANEL_USE_EXPANDER (0) // 0/1 +#define ESP_PANEL_USE_EXPANDER (1) // 0/1 #if ESP_PANEL_USE_EXPANDER /** * IO expander name. @@ -240,15 +240,15 @@ * If set to 1, the driver will skip to initialize the corresponding host. Users need to initialize the host in advance. * It is useful if other devices use the same host. Please ensure that the host is initialized only once. */ -#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (0) // 0/1 +#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (1) // 0/1 /* IO expander parameters */ -#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x24) +#define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0 +#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x20) #if !ESP_PANEL_EXPANDER_SKIP_INIT_HOST - #define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0 #define ESP_PANEL_EXPANDER_I2C_CLK_HZ (400 * 1000) // Typically set to 400K - #define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (0) // 0/1 - #define ESP_PANEL_EXPANDER_I2C_SDA_PULLUP (0) // 0/1 + #define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (1) // 0/1 + #define ESP_PANEL_EXPANDER_I2C_SDA_PULLUP (1) // 0/1 #define ESP_PANEL_EXPANDER_I2C_IO_SCL (18) #define ESP_PANEL_EXPANDER_I2C_IO_SDA (8) #endif From 6fdbc30ffa768aa87821aa0d347fc4555be094b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 30 Jul 2024 11:44:14 +0200 Subject: [PATCH 16/19] Fix pre-commit CI check --- examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h | 9 +++++++++ examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h | 9 +++++++++ examples/Panel/PanelTest/ESP_Panel_Board_Supported.h | 9 +++++++++ examples/PlatformIO/src/ESP_Panel_Board_Supported.h | 9 +++++++++ .../SquareLine/v8/Porting/ESP_Panel_Board_Supported.h | 9 +++++++++ .../SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h | 9 +++++++++ src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h | 1 - 7 files changed, 54 insertions(+), 1 deletion(-) diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h +++ b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h index 33853e08..58d065c3 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h @@ -74,6 +74,15 @@ */ // #define BOARD_ESP32_4848S040C_I_Y_3 +/* + * Waveshare Supported Boards (https://www.waveshare.com/): + * + * - ESP32_S3_Touch_LCD_4_3: + * - https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm + * + */ +// #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3 + /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Supported.h` in the library. The detailed rules are as follows: diff --git a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h index d792fb6f..3b2f72c2 100644 --- a/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h +++ b/src/board/waveshare/ESP32_S3_Touch_LCD_4.3.h @@ -269,4 +269,3 @@ // #define ESP_PANEL_BEGIN_END_FUNCTION( panel ) // *INDENT-OFF* - From 79d82639f99b7f6529b6d8907def15c4bad1c9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 30 Jul 2024 11:47:38 +0200 Subject: [PATCH 17/19] ChangeLog v0.1.6 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf68e068..07cd1968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Enhancements: * feat(board): add support for Fitipower EK9716B LCD controller for CrowPanel 7.0" board by @lboue (#78) +* feat(board): add support for Waveshare ESP32-S3-Touch-LCD-4.3 by @lboue (#99) ### Bugfixes: From 4d10fa6f89663526bf76bfc08d06d6b83fe5577d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 31 Jul 2024 07:28:57 +0200 Subject: [PATCH 18/19] Update ESP_PanelBoard.h --- src/board/ESP_PanelBoard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/board/ESP_PanelBoard.h b/src/board/ESP_PanelBoard.h index 2126fa2a..95a95de0 100644 --- a/src/board/ESP_PanelBoard.h +++ b/src/board/ESP_PanelBoard.h @@ -13,9 +13,9 @@ defined(BOARD_ESP32_S3_BOX_3_BETA) + defined(BOARD_ESP32_S3_BOX_LITE) + defined(BOARD_ESP32_S3_EYE) + \ defined(BOARD_ESP32_S3_KORVO_2) + defined(BOARD_ESP32_S3_LCD_EV_BOARD) + \ defined(BOARD_ESP32_S3_LCD_EV_BOARD_V1_5) + defined(BOARD_ESP32_S3_LCD_EV_BOARD_2) + \ - defined(BOARD_ESP32_S3_LCD_EV_BOARD_2_V1_5) + defined(BOARD_ESP32_S3_USB_OTG) + \ + defined(BOARD_ESP32_S3_LCD_EV_BOARD_2_V1_5) + defined(BOARD_ESP32_S3_USB_OTG) + defined(BOARD_ELECROW_CROWPANEL_7_0) \ defined(BOARD_M5STACK_M5CORE2) + defined(BOARD_M5STACK_M5DIAL) + defined(BOARD_M5STACK_M5CORES3) + \ - defined(BOARD_ESP32_4848S040C_I_Y_3) \ + defined(BOARD_ESP32_4848S040C_I_Y_3) + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_4_3) \ > 1 #error "Multiple boards enabled! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif From 3db75b7b7f54b86716c0b3f42f026b1cf72f7a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 31 Jul 2024 07:31:12 +0200 Subject: [PATCH 19/19] Bump minor version for `ESP_Panel_Board_Custom.h` & `ESP_Panel_Board_Supported.h` --- src/ESP_PanelVersions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h index 25584c5b..e0b3ffff 100644 --- a/src/ESP_PanelVersions.h +++ b/src/ESP_PanelVersions.h @@ -56,7 +56,7 @@ !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR) && \ !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH) #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif // Check if the current configuration file version is compatible with the library version