From 1e9a03c28daede8b207bdf6a235e97665582c06e Mon Sep 17 00:00:00 2001 From: MacChu0315-Espressif Date: Wed, 5 Jun 2024 14:30:39 +0800 Subject: [PATCH] feat(board): add new board M5DIAL feat(docs): update changelog --- CHANGELOG.md | 3 +- ESP_Panel_Board_Supported.h | 4 +- README.md | 2 +- README_CN.md | 2 +- .../v8/Porting/ESP_Panel_Board_Supported.h | 4 +- .../v8/Rotation/ESP_Panel_Board_Supported.h | 4 +- .../PanelTest/ESP_Panel_Board_Supported.h | 4 +- .../v8/Porting/ESP_Panel_Board_Supported.h | 4 +- .../v8/WiFiClock/ESP_Panel_Board_Supported.h | 4 +- library.properties | 2 +- src/ESP_PanelVersions.h | 2 +- src/board/Board_Instructions.md | 2 + src/board/ESP_PanelBoard.h | 4 +- src/board/m5stack/M5DIAL.h | 362 ++++++++++++++++++ 14 files changed, 391 insertions(+), 12 deletions(-) create mode 100644 src/board/m5stack/M5DIAL.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b47074..a9461201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # ChangeLog -## v0.1.3 - 2024-06-04 +## v0.1.3 - 2024-06-14 ### Enhancements: * feat(board): add add new board M5CORE2 by @MacChu0315-Espressif (#40) +* feat(board): add add new board M5DIAL by @MacChu0315-Espressif (#41) ### Bugfixes: diff --git a/ESP_Panel_Board_Supported.h b/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/ESP_Panel_Board_Supported.h +++ b/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/README.md b/README.md index 70ccea83..195fedf2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Below is a list of [supported development boards](src/board/Board_Instructions.m | **Manufacturer** | **Board Model** | | --------------- | --------------- | | [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 | -| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2 | +| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2, M5STACK-M5DIAL | | [Jingcai](src/board/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | 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). diff --git a/README_CN.md b/README_CN.md index 745bb675..c860a416 100644 --- a/README_CN.md +++ b/README_CN.md @@ -60,7 +60,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | **厂商** | **开发板型号** | | -------- | -------------- | | [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 | -| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2 | +| [M5Stack](https://m5stack.com/) | M5STACK-M5CORE2, M5STACK-M5DIAL | | [Jingcai](src/board/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | 欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./src/board/Board_Contribution_Guide_CN.md)。 diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h index 2d9807a6..9a968fa9 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h @@ -50,9 +50,11 @@ * M5Stack (https://m5stack.com/): * * - M5STACK_M5CORE2: https://docs.m5stack.com/zh_CN/core/core2 + * - M5STACK_M5DIAL: https://docs.m5stack.com/zh_CN/core/M5Dial * */ // #define BOARD_M5STACK_M5CORE2 +// #define BOARD_M5STACK_M5DIAL /* * Shenzhen Jingcai Intelligent Supported Boards (https://www.displaysmodule.com/): @@ -76,7 +78,7 @@ * */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/library.properties b/library.properties index 908d5a7a..a95bcd17 100644 --- a/library.properties +++ b/library.properties @@ -3,7 +3,7 @@ version=0.1.3 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. -paragraph=Currently supported boards: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,M5STACK-M5CORE2,ESP32-4848S040C_I_Y_3. Currently supported devices: Bus,LCD,Touch,Backlight,IO expander. Currently supported Bus: I2C,SPI,QSPI,3-wire SPI + RGB. Currently supported LCD controllers: GC9A01,GC9B71,GC9503,ILI9341,NV3022B,ST7262,ST7701,ST7789,ST7796,ST77916,ST77922. Currently supported Touch controllers: CST816S,FT5x06,GT1151,GT911,ST7123,TT21100,XPT2046. +paragraph=Currently supported boards: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,M5STACK-M5CORE2,M5STACK-M5DIAL,ESP32-4848S040C_I_Y_3. Currently supported devices: Bus,LCD,Touch,Backlight,IO expander. Currently supported Bus: I2C,SPI,QSPI,3-wire SPI + RGB. Currently supported LCD controllers: GC9A01,GC9B71,GC9503,ILI9341,NV3022B,ST7262,ST7701,ST7789,ST7796,ST77916,ST77922. Currently supported Touch controllers: CST816S,FT5x06,GT1151,GT911,ST7123,TT21100,XPT2046. category=Other architectures=esp32 url=https://github.com/esp-arduino-libs/ESP32_Display_Panel diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h index 8788bc1f..1d3828ae 100644 --- a/src/ESP_PanelVersions.h +++ b/src/ESP_PanelVersions.h @@ -25,7 +25,7 @@ /* File `ESP_Panel_Board_Supported.h` */ #define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 0 -#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 2 +#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 3 #define ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH 0 /* Check if the current configuration file version is compatible with the library version */ diff --git a/src/board/Board_Instructions.md b/src/board/Board_Instructions.md index ea0561e4..8912ed64 100644 --- a/src/board/Board_Instructions.md +++ b/src/board/Board_Instructions.md @@ -22,6 +22,7 @@ | **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **Touch Bus** | **Touch Controller** | | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :-----------: | :------------------: | | [](https://www.displaysmodule.com/sale-41828962-experience-the-power-of-the-esp32-display-module-sku-esp32-4848s040c-i-y-3.html) | [M5STACK_M5CORE2](https://docs.m5stack.com/zh_CN/core/core2) | SPI | ILI9342C | I2C | FT6336U | +| [](https://www.displaysmodule.com/sale-41828962-experience-the-power-of-the-esp32-display-module-sku-esp32-4848s040c-i-y-3.html) | [M5STACK_M5DIAL](https://docs.m5stack.com/zh_CN/core/M5Dial) | SPI | GC9A01 | I2C | FT5x06 | ### [Shenzhen Jingcai Intelligent](https://www.displaysmodule.com/) @@ -46,6 +47,7 @@ Below are recommended configurations for developing GUI applications on differen | ESP32-S3-LCD-EV-Board-2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | **See Note 1** | 16M Flash (3MB) | | ESP32-S3-USB-OTG | ESP32-S3-USB-OTG | - | - | - | - | 8M with spiffs | | M5STACK-M5CORE2 | M5Stack-Core2 | Enabled | - | - | - | Default | +| M5STACK-M5DIAL | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | Default | | ESP32-4848S040C_I_Y_3 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Disabled | 16M Flash (3MB) | **Notes:** diff --git a/src/board/ESP_PanelBoard.h b/src/board/ESP_PanelBoard.h index 23ee0a2f..e0376619 100644 --- a/src/board/ESP_PanelBoard.h +++ b/src/board/ESP_PanelBoard.h @@ -14,7 +14,7 @@ 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_M5STACK_M5CORE2) + defined(BOARD_ESP32_4848S040C_I_Y_3) \ + defined(BOARD_M5STACK_M5CORE2) + defined(BOARD_M5STACK_M5DIAL) + defined(BOARD_ESP32_4848S040C_I_Y_3) \ > 1 #error "Multiple boards enabled! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif @@ -48,6 +48,8 @@ /* M5Stack */ #elif defined(BOARD_M5STACK_M5CORE2) || CONFIG_BOARD_M5STACK_M5CORE2 #include "board/m5stack/M5CORE2.h" +#elif defined(BOARD_M5STACK_M5DIAL) || CONFIG_BOARD_M5STACK_M5DIAL + #include "board/m5stack/M5DIAL.h" /* 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" diff --git a/src/board/m5stack/M5DIAL.h b/src/board/m5stack/M5DIAL.h new file mode 100644 index 00000000..9463fff7 --- /dev/null +++ b/src/board/m5stack/M5DIAL.h @@ -0,0 +1,362 @@ +/* + * SPDX-FileCopyrightText: 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. Choose one of the following: + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#define ESP_PANEL_LCD_NAME GC9A01 + +/* LCD resolution in pixels */ +#define ESP_PANEL_LCD_WIDTH (240) +#define ESP_PANEL_LCD_HEIGHT (240) + +/* 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. + * + * Set to 1 if only the RGB interface is used without the 3-wire SPI interface, + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (0) // 0/1 +/** + * LCD Bus Type. Choose one of the following: + * - ESP_PANEL_BUS_TYPE_I2C (not ready) + * - ESP_PANEL_BUS_TYPE_SPI + * - ESP_PANEL_BUS_TYPE_QSPI + * - ESP_PANEL_BUS_TYPE_I80 (not ready) + * - ESP_PANEL_BUS_TYPE_RGB (only supported for ESP32-S3) + */ +#define ESP_PANEL_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_SPI) +/** + * 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_SPI + + #define ESP_PANEL_LCD_BUS_HOST_ID (1) // Typically set to 1 + #define ESP_PANEL_LCD_SPI_IO_CS (7) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (6) + #define ESP_PANEL_LCD_SPI_IO_MOSI (5) + #define ESP_PANEL_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif + #define ESP_PANEL_LCD_SPI_IO_DC (4) + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (40 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M + #define ESP_PANEL_LCD_SPI_TRANS_QUEUE_SZ (10) // Typically set to 10 + #define ESP_PANEL_LCD_SPI_CMD_BITS (8) // Typically set to 8 + #define ESP_PANEL_LCD_SPI_PARAM_BITS (8) // Typically set to 8 + +#elif ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI + + #define ESP_PANEL_LCD_BUS_HOST_ID (1) // Typically set to 1 + #define ESP_PANEL_LCD_SPI_IO_CS (5) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (9) + #define ESP_PANEL_LCD_SPI_IO_DATA0 (10) + #define ESP_PANEL_LCD_SPI_IO_DATA1 (11) + #define ESP_PANEL_LCD_SPI_IO_DATA2 (12) + #define ESP_PANEL_LCD_SPI_IO_DATA3 (13) +#endif + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (40 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M + #define ESP_PANEL_LCD_SPI_TRANS_QUEUE_SZ (10) // Typically set to 10 + #define ESP_PANEL_LCD_SPI_CMD_BITS (32) // Typically set to 32 + #define ESP_PANEL_LCD_SPI_PARAM_BITS (8) // Typically set to 8 + +#elif 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 (10) + #define ESP_PANEL_LCD_RGB_HBP (10) + #define ESP_PANEL_LCD_RGB_HFP (20) + #define ESP_PANEL_LCD_RGB_VPW (10) + #define ESP_PANEL_LCD_RGB_VBP (10) + #define ESP_PANEL_LCD_RGB_VFP (10) + #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 (16) // 24 | 16 + #define ESP_PANEL_LCD_RGB_FRAME_BUF_NUM (1) // 1/2/3 + #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (0) // 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 (17) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (9) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_DATA0 (10) + #define ESP_PANEL_LCD_RGB_IO_DATA1 (11) + #define ESP_PANEL_LCD_RGB_IO_DATA2 (12) + #define ESP_PANEL_LCD_RGB_IO_DATA3 (13) + #define ESP_PANEL_LCD_RGB_IO_DATA4 (14) + #define ESP_PANEL_LCD_RGB_IO_DATA5 (21) + #define ESP_PANEL_LCD_RGB_IO_DATA6 (47) + #define ESP_PANEL_LCD_RGB_IO_DATA7 (48) +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (45) + #define ESP_PANEL_LCD_RGB_IO_DATA9 (38) + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) + #define ESP_PANEL_LCD_RGB_IO_DATA11 (40) + #define ESP_PANEL_LCD_RGB_IO_DATA12 (41) + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) + #define ESP_PANEL_LCD_RGB_IO_DATA14 (2) + #define ESP_PANEL_LCD_RGB_IO_DATA15 (1) +#endif +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #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 + #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 + +#else + +#error "The function is not ready and will be implemented in the future." + +#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 \ +// { \ +// {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 */ +#define ESP_PANEL_LCD_COLOR_BITS (16) // 8/16/18/24 +/* + * LCD RGB Element Order. Choose one of the following: + * - 0: RGB + * - 1: BGR + */ +#define ESP_PANEL_LCD_BGR_ORDER (1) // 0/1 +#define ESP_PANEL_LCD_INEVRT_COLOR (1) // 0/1 + +/* LCD Transformation Flags */ +#define ESP_PANEL_LCD_SWAP_XY (0) // 0/1 +#define ESP_PANEL_LCD_MIRROR_X (1) // 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 (8) +#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. Choose one of the following: + * - CST816S + * - FT5x06 + * - GT911, GT1151 + * - ST1633, ST7123 + * - TT21100 + * - XPT2046 + */ +#define ESP_PANEL_TOUCH_NAME FT5x06 + +/* 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. Choose one of the following: + * - ESP_PANEL_BUS_TYPE_I2C + * - ESP_PANEL_BUS_TYPE_SPI + */ +#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 (12) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (11) +#endif + +#elif ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI + + #define ESP_PANEL_TOUCH_BUS_HOST_ID (1) // Typically set to 1 + #define ESP_PANEL_TOUCH_SPI_IO_CS (5) +#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST + #define ESP_PANEL_TOUCH_SPI_IO_SCK (7) + #define ESP_PANEL_TOUCH_SPI_IO_MOSI (6) + #define ESP_PANEL_TOUCH_SPI_IO_MISO (9) +#endif + #define ESP_PANEL_TOUCH_SPI_CLK_HZ (1 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 1M + +#else + +#error "The function is not ready and will be implemented in the future." + +#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 (14) +#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 (9) +#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 (0) // 0/1 +#if ESP_PANEL_USE_EXPANDER +/** + * IO expander name. Choose one of the following: + * - CH422G + * - HT8574 + * - TCA95xx_8bit + * - TCA95xx_16bit + */ +#define ESP_PANEL_EXPANDER_NAME TCA95xx_8bit + +/* 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 (0x20) // The actual I2C address. Even for the same model of IC, + // the I2C address may be different, and confirmation based on + // the actual hardware connection is required +#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 (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 +#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 ) + +/** + * 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_Custom.h` in the library. The detailed rules are as follows: + * + * 1. If the major version is not consistent, then the configurations in this file are incompatible with the library + * and must be replaced with the file from the library. + * 2. If the minor version is not consistent, this file might be missing some new configurations, which will be set to + * default values. It is recommended to replace it with the file from the library. + * 3. Even if the patch version is not consistent, it will not affect normal functionality. + * + */ +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 + +// *INDENT-OFF*