From f4d673d83114e3118d354fdf52a8f88ef64300aa Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Mon, 25 Nov 2024 18:17:58 +0800 Subject: [PATCH 01/24] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 91b0650e..10c48e71 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Below is the list of [Supported Development Boards](docs/Board_Instructions.md): | [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-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-4.3, ESP32-S3-Touch-LCD-4.3B, ESP32-S3-Touch-LCD-5, ESP32-S3-Touch-LCD-5B, ESP32-S3-Touch-LCD-7, ESP32-P4-NANO | +| [VIEWE](docs/Board_Instructions.md#viewe) | VIEWE_ESP_S3_Knob_LCD_21(UEDX48480021-MD80E), VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_40(DX48480040E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A),VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A)| Developers and manufacturers are welcome to contribute PRs to add more boards. For details, please refer to the [Board Contribution Guide](./docs/Board_Contribution_Guide.md). @@ -69,6 +70,7 @@ Below is the list of [Supported Touch Controllers](docs/Touch_Controllers.md): | Parade | TT21100 | | Sitronix | ST7123 | | Xptek | XPT2046 | +|Chipsemicorp | CHSC6540 | ## FAQ From 57e4dca4be086ab505fadfb2d7832508048068eb Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Mon, 25 Nov 2024 18:21:49 +0800 Subject: [PATCH 02/24] Update README_CN.md --- README_CN.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 9a0bbef3..ec19cc97 100644 --- a/README_CN.md +++ b/README_CN.md @@ -16,7 +16,7 @@ ESP32_Display_Panel 内部集成了多个[乐鑫组件库](https://components.es ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: -- 支持多种 **Espressif** 官方及第三方开发板,包括 **M5Stack**、**Elecrow**、**Waveshare** 等。 +- 支持多种 **Espressif** 官方及第三方开发板,包括 **M5Stack**、**Elecrow**、**Waveshare**、**VIEWE** 等。 - 支持适配 **自定义的开发板**。 - 支持多种类型的设备驱动,包括 **接口总线**、**LCD**、**触摸**、**背光** 和 **IO 扩展**。 - 支持动态配置驱动,如开启调试 LOG 等。 @@ -41,6 +41,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | [Elecrow](docs/Board_Instructions.md#elecrow) | CrowPanel 7.0" | | [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | | [Waveshare](docs/Board_Instructions.md#waveshare) | ESP32-S3-Touch-LCD-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-4.3, ESP32-S3-Touch-LCD-4.3B, ESP32-S3-Touch-LCD-5, ESP32-S3-Touch-LCD-5B, ESP32-S3-Touch-LCD-7, ESP32-P4-NANO | +| [VIEWE](docs/Board_Instructions.md#viewe) | VIEWE_ESP_S3_Knob_LCD_21(UEDX48480021-MD80E), VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_40(DX48480040E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A),VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A)| 欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./docs/Board_Contribution_Guide_CN.md)。 @@ -69,6 +70,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | Parade | TT21100 | | Sitronix | ST7123 | | Xptek | XPT2046 | +|Chipsemicorp | CHSC6540 | ## 常见问题解答 From b96f30d126536e739910a148446a810876ff336e Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Mon, 25 Nov 2024 18:22:43 +0800 Subject: [PATCH 03/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10c48e71..a43456e2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ESP32_Display_Panel integrates multiple display-related driver components from t The functional block diagram of ESP32_Display_Panel is shown below and includes the following features: -- Supports a variety of **Espressif** official and third-party development boards, including **M5Stack**, **Elecrow**, **Waveshare**, and others. +- Supports a variety of **Espressif** official and third-party development boards, including **M5Stack**, **Elecrow**, **Waveshare**,**VIEWE** and others. - Supports **custom development board** adaptation. - Supports a variety of device drivers, including interface **Bus**, **LCD**, **Touch**, **Backlight** and **IO Expander**. - Supports dynamic driver configuration, such as enabling debug logs. From dead5c05f2ff426b14e1e2ce6f960e7125a5dbcf Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Mon, 25 Nov 2024 18:40:53 +0800 Subject: [PATCH 04/24] Update Board_Instructions.md --- docs/Board_Instructions.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index de2f6618..516f5a04 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -52,6 +52,20 @@ | | [ESP32-S3-Touch-LCD-7](https://www.waveshare.com/esp32-s3-touch-lcd-7.htm) | RGB | ST7262 | 800x480 | I2C | GT911 | | | [ESP32-P4-NANO](https://www.waveshare.com/esp32-p4-nano.htm) | MIPI-DSI | JD9365 | 800x1280 | I2C | GT9271 (GT911-like) | +## [VIEWE](https://viewedisplay.com/) + +| **Picture** | **Name** | **LCD Bus** |**LCD Controller**| **LCD resolution** | **Touch Bus** | **Touch Controller** | +| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | ------------------ | :-----------: | :------------------: | +| | [VIEWE-ESP32-S3-Touch-LCD-2.4](https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-2.8](https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V1](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V2](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | ST7365P(like ST7789) | 320x480 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-4.0](https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT6336U(like FT5x06) | +| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V1](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 800x480 | I2C | GT911 | +| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V2](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 480x272 | I2C | GT911 | +| | [VIEWE-ESP32-S3-Touch-LCD-5.0](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | +| | [VIEWE-ESP32-S3-Touch-LCD-7.0](https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/) | RGB | EK9716BD3+EK73002AB2(like 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. @@ -82,6 +96,15 @@ Below are recommended configurations for developing GUI applications on differen | Waveshare-ESP32-S3-Touch-LCD-5B | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | Waveshare-ESP32-S3-Touch-LCD-7 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | 8M with spiffs | | Waveshare-ESP32-P4-NANO | ESP32P4 Dev Module | Enabled | QIO | 16MB | Disabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-2.4 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-2.8 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-3.5_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-3.5_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.3_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.3_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-5.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-7.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | **Notes:** From c4b5a82ec106614e253f9f57b078a10f85b57281 Mon Sep 17 00:00:00 2001 From: VIEWE-CN Date: Mon, 25 Nov 2024 18:43:52 +0800 Subject: [PATCH 05/24] Add a touch with model number CHSC6540 --- src/touch/CHSC6540.cpp | 46 ++++++ src/touch/CHSC6540.h | 50 ++++++ src/touch/base/esp_lcd_touch_chsc6540.c | 211 ++++++++++++++++++++++++ src/touch/base/esp_lcd_touch_chsc6540.h | 60 +++++++ 4 files changed, 367 insertions(+) create mode 100644 src/touch/CHSC6540.cpp create mode 100644 src/touch/CHSC6540.h create mode 100644 src/touch/base/esp_lcd_touch_chsc6540.c create mode 100644 src/touch/base/esp_lcd_touch_chsc6540.h diff --git a/src/touch/CHSC6540.cpp b/src/touch/CHSC6540.cpp new file mode 100644 index 00000000..765aad3d --- /dev/null +++ b/src/touch/CHSC6540.cpp @@ -0,0 +1,46 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "ESP_PanelLog.h" +#include "CHSC6540.h" + +static const char *TAG = "CHSC6540_CPP"; + +ESP_PanelTouch_CHSC6540::ESP_PanelTouch_CHSC6540(ESP_PanelBus *bus, uint16_t width, uint16_t height, + int rst_io, int int_io): + ESP_PanelTouch(bus, width, height, rst_io, int_io) +{ +} + +ESP_PanelTouch_CHSC6540::ESP_PanelTouch_CHSC6540(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config): + ESP_PanelTouch(bus, config) +{ +} + +ESP_PanelTouch_CHSC6540::~ESP_PanelTouch_CHSC6540() +{ + ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); + + if (handle == NULL) { + goto end; + } + + if (!del()) { + ESP_LOGE(TAG, "Delete device failed"); + } + +end: + ESP_LOGD(TAG, "Destroyed"); +} + +bool ESP_PanelTouch_CHSC6540::begin(void) +{ + ESP_PANEL_CHECK_NULL_RET(bus, false, "Invalid bus"); + + ESP_PANEL_CHECK_ERR_RET(esp_lcd_touch_new_i2c_chsc6540(bus->getHandle(), &config, &handle), false, "New driver failed"); + + return true; +} diff --git a/src/touch/CHSC6540.h b/src/touch/CHSC6540.h new file mode 100644 index 00000000..676966b7 --- /dev/null +++ b/src/touch/CHSC6540.h @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "base/esp_lcd_touch_chsc6540.h" +#include "ESP_PanelTouch.h" + +/** + * @brief CHSC6540 touch device object class + * + * @note This class is a derived class of `ESP_PanelTouch`, user can use it directly + */ +class ESP_PanelTouch_CHSC6540 : public ESP_PanelTouch { +public: + /** + * @brief Construct a new touch device in a simple way, the `init()` function should be called after this function + * + * @param bus Pointer to panel bus + * @param width The width of the touch screen + * @param height The height of the touch screen + * @param rst_io The reset pin of the touch screen, set to `-1` if not used + * @param int_io The interrupt pin of the touch screen, set to `-1` if not used + */ + ESP_PanelTouch_CHSC6540(ESP_PanelBus *bus, uint16_t width, uint16_t height, int rst_io = -1, int int_io = -1); + + /** + * @brief Construct a new touch device in a complex way, the `init()` function should be called after this function + * + * @param bus Pointer to panel bus + * @param config Touch device configuration + */ + ESP_PanelTouch_CHSC6540(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config); + + /** + * @brief Destroy the LCD device + * + */ + ~ESP_PanelTouch_CHSC6540() override; + + /** + * @brief Startup the touch device + * + * @return true if success, otherwise false + */ + bool begin(void) override; +}; diff --git a/src/touch/base/esp_lcd_touch_chsc6540.c b/src/touch/base/esp_lcd_touch_chsc6540.c new file mode 100644 index 00000000..9206ba70 --- /dev/null +++ b/src/touch/base/esp_lcd_touch_chsc6540.c @@ -0,0 +1,211 @@ +/* + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "ESP_PanelLog.h" + +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "driver/i2c.h" +#include "esp_system.h" +#include "esp_err.h" +#include "esp_log.h" +#include "esp_check.h" +#include "esp_lcd_panel_io.h" +#include "esp_lcd_touch.h" + +#include "esp_lcd_touch_chsc6540.h" + +#define POINT_NUM_MAX (1) + +#define DATA_START_REG (0x00) + +#define CHIP_ID_REG (0xA7) + +static const char *TAG = "CHSC6540"; + +static esp_err_t read_data(esp_lcd_touch_handle_t tp); +static bool get_xy(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num); +static esp_err_t del(esp_lcd_touch_handle_t tp); + +static esp_err_t i2c_read_bytes(esp_lcd_touch_handle_t tp, uint16_t reg, uint8_t *data, uint8_t len); + +static esp_err_t reset(esp_lcd_touch_handle_t tp); +static esp_err_t read_id(esp_lcd_touch_handle_t tp); + +esp_err_t esp_lcd_touch_new_i2c_chsc6540(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *tp) +{ + ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "Invalid io"); + ESP_RETURN_ON_FALSE(config, ESP_ERR_INVALID_ARG, TAG, "Invalid config"); + ESP_RETURN_ON_FALSE(tp, ESP_ERR_INVALID_ARG, TAG, "Invalid touch handle"); + + ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); + + /* Prepare main structure */ + esp_err_t ret = ESP_OK; + esp_lcd_touch_handle_t chsc6540 = calloc(1, sizeof(esp_lcd_touch_t)); + ESP_GOTO_ON_FALSE(chsc6540, ESP_ERR_NO_MEM, err, TAG, "Touch handle malloc failed"); + + /* Communication interface */ + chsc6540->io = io; + /* Only supported callbacks are set */ + chsc6540->read_data = read_data; + chsc6540->get_xy = get_xy; + chsc6540->del = del; + /* Mutex */ + chsc6540->data.lock.owner = portMUX_FREE_VAL; + /* Save config */ + memcpy(&chsc6540->config, config, sizeof(esp_lcd_touch_config_t)); + + /* Prepare pin for touch interrupt */ + if (chsc6540->config.int_gpio_num != GPIO_NUM_NC) { + const gpio_config_t int_gpio_config = { + .mode = GPIO_MODE_INPUT, + .intr_type = (chsc6540->config.levels.interrupt ? GPIO_INTR_POSEDGE : GPIO_INTR_NEGEDGE), + .pin_bit_mask = BIT64(chsc6540->config.int_gpio_num) + }; + ESP_GOTO_ON_ERROR(gpio_config(&int_gpio_config), err, TAG, "GPIO intr config failed"); + + /* Register interrupt callback */ + if (chsc6540->config.interrupt_callback) { + esp_lcd_touch_register_interrupt_callback(chsc6540, chsc6540->config.interrupt_callback); + } + } + /* Prepare pin for touch controller reset */ + if (chsc6540->config.rst_gpio_num != GPIO_NUM_NC) { + const gpio_config_t rst_gpio_config = { + .mode = GPIO_MODE_OUTPUT, + .pin_bit_mask = BIT64(chsc6540->config.rst_gpio_num) + }; + ESP_GOTO_ON_ERROR(gpio_config(&rst_gpio_config), err, TAG, "GPIO reset config failed"); + } + /* Reset controller */ + ESP_GOTO_ON_ERROR(reset(chsc6540), err, TAG, "Reset failed"); + /* Read product id */ + // ESP_GOTO_ON_ERROR(read_id(chsc6540), err, TAG, "Read version failed"); + *tp = chsc6540; + + ESP_LOGI(TAG, "LCD touch panel create success, version: %d.%d.%d", ESP_LCD_TOUCH_CHSC6540_VER_MAJOR, ESP_LCD_TOUCH_CHSC6540_VER_MINOR, + ESP_LCD_TOUCH_CHSC6540_VER_PATCH); + + return ESP_OK; +err: + if (chsc6540) { + del(chsc6540); + } + ESP_LOGE(TAG, "Initialization failed!"); + return ret; +} + +static esp_err_t read_data(esp_lcd_touch_handle_t tp) +{ + typedef struct { + uint8_t num; + uint8_t x_h : 4; + uint8_t : 4; + uint8_t x_l; + uint8_t y_h : 4; + uint8_t : 4; + uint8_t y_l; + } data_t; + + data_t point; + + uint8_t buf[15]={0}; + uint8_t touch_num=0; + uint16_t x=0; + uint16_t y=0; + uint8_t gc=0;//报点过程 + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, DATA_START_REG, buf, sizeof(buf)), TAG, "I2C read failed"); + + point.num=buf[2]; + + gc=buf[3]>>4; + + x= (uint16_t)(((buf[3]&0x0F)<<8)+buf[4]); + y= (uint16_t)(((buf[5]&0x0F)<<8)+buf[6]); + + + portENTER_CRITICAL(&tp->data.lock); + point.num = (point.num > POINT_NUM_MAX ? POINT_NUM_MAX : point.num); + tp->data.points = point.num; + /* Fill all coordinates */ + for (int i = 0; i < tp->data.points ; i++) { + tp->data.coords[i].x = x; + tp->data.coords[i].y = y; + } + portEXIT_CRITICAL(&tp->data.lock); + + return ESP_OK; +} + +static bool get_xy(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num) +{ + portENTER_CRITICAL(&tp->data.lock); + /* Count of points */ + *point_num = (tp->data.points > max_point_num ? max_point_num : tp->data.points); + for (size_t i = 0; i < *point_num; i++) { + x[i] = tp->data.coords[i].x; + y[i] = tp->data.coords[i].y; + + if (strength) { + strength[i] = tp->data.coords[i].strength; + } + } + /* Invalidate */ + tp->data.points = 0; + portEXIT_CRITICAL(&tp->data.lock); + + return (*point_num > 0); +} + +static esp_err_t del(esp_lcd_touch_handle_t tp) +{ + /* Reset GPIO pin settings */ + if (tp->config.int_gpio_num != GPIO_NUM_NC) { + gpio_reset_pin(tp->config.int_gpio_num); + if (tp->config.interrupt_callback) { + gpio_isr_handler_remove(tp->config.int_gpio_num); + } + } + if (tp->config.rst_gpio_num != GPIO_NUM_NC) { + gpio_reset_pin(tp->config.rst_gpio_num); + } + /* Release memory */ + free(tp); + + return ESP_OK; +} + +static esp_err_t reset(esp_lcd_touch_handle_t tp) +{ + if (tp->config.rst_gpio_num != GPIO_NUM_NC) { + ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, tp->config.levels.reset), TAG, "GPIO set level failed"); + vTaskDelay(pdMS_TO_TICKS(200)); + ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, !tp->config.levels.reset), TAG, "GPIO set level failed"); + vTaskDelay(pdMS_TO_TICKS(200)); + } + + return ESP_OK; +} + +static esp_err_t read_id(esp_lcd_touch_handle_t tp) +{ + uint8_t id; + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, CHIP_ID_REG, &id, 1), TAG, "I2C read failed"); + ESP_LOGI(TAG, "IC id: %d", id); + return ESP_OK; +} + +static esp_err_t i2c_read_bytes(esp_lcd_touch_handle_t tp, uint16_t reg, uint8_t *data, uint8_t len) +{ + ESP_RETURN_ON_FALSE(data, ESP_ERR_INVALID_ARG, TAG, "Invalid data"); + + return esp_lcd_panel_io_rx_param(tp->io, reg, data, len); +} diff --git a/src/touch/base/esp_lcd_touch_chsc6540.h b/src/touch/base/esp_lcd_touch_chsc6540.h new file mode 100644 index 00000000..438c36eb --- /dev/null +++ b/src/touch/base/esp_lcd_touch_chsc6540.h @@ -0,0 +1,60 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief ESP LCD touch: CHSC6540 + */ + +#pragma once + +#include "esp_lcd_touch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ESP_LCD_TOUCH_CHSC6540_VER_MAJOR (1) +#define ESP_LCD_TOUCH_CHSC6540_VER_MINOR (0) +#define ESP_LCD_TOUCH_CHSC6540_VER_PATCH (0) + +/** + * @brief Create a new CHSC6540 touch driver + * + * @note The I2C communication should be initialized before use this function. + * + * @param io LCD panel IO handle, it should be created by `esp_lcd_new_panel_io_i2c()` + * @param config Touch panel configuration + * @param tp Touch panel handle + * @return + * - ESP_OK: on success + */ +esp_err_t esp_lcd_touch_new_i2c_chsc6540(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *tp); + +/** + * @brief I2C address of the CHSC6540 controller + * + */ +#define ESP_LCD_TOUCH_IO_I2C_CHSC6540_ADDRESS (0x2E) +/** + * @brief Touch IO configuration structure + * + */ +#define ESP_LCD_TOUCH_IO_I2C_CHSC6540_CONFIG() \ + { \ + .dev_addr = ESP_LCD_TOUCH_IO_I2C_CHSC6540_ADDRESS, \ + .control_phase_bytes = 1, \ + .dc_bit_offset = 0, \ + .lcd_cmd_bits = 8, \ + .flags = \ + { \ + .disable_control_phase = 1, \ + } \ + } + +#ifdef __cplusplus +} +#endif From 9ecb6e32115410c7658b877e10db8f85db02d4ab Mon Sep 17 00:00:00 2001 From: VIEWE-CN Date: Mon, 25 Nov 2024 19:07:03 +0800 Subject: [PATCH 06/24] update examples --- .../v8/Porting/ESP_Panel_Board_Supported.h | 40 ++ examples/LVGL/v8/Porting/Porting.ino | 12 + .../v8/Rotation/ESP_Panel_Board_Supported.h | 40 ++ examples/LVGL/v8/Rotation/Rotation.ino | 12 + .../PanelTest/ESP_Panel_Board_Supported.h | 40 ++ examples/Panel/PanelTest/PanelTest.ino | 13 + .../src/ESP_Panel_Board_Supported.h | 40 ++ examples/PlatformIO/src/app.cpp | 12 + .../v8/Porting/ESP_Panel_Board_Supported.h | 40 ++ examples/SquareLine/v8/Porting/Porting.ino | 14 + .../v8/WiFiClock/ESP_Panel_Board_Supported.h | 40 ++ .../SquareLine/v8/WiFiClock/WiFiClock.ino | 12 + src/board/ESP_PanelBoard.h | 32 ++ src/board/viewe/viewe_panel2_8048050.h | 354 +++++++++++++++ src/board/viewe/viewe_panel_24320024.h | 403 +++++++++++++++++ src/board/viewe/viewe_panel_24320028.h | 404 ++++++++++++++++++ src/board/viewe/viewe_panel_24320035.h | 403 +++++++++++++++++ src/board/viewe/viewe_panel_32480035.h | 396 +++++++++++++++++ src/board/viewe/viewe_panel_48272043.h | 354 +++++++++++++++ src/board/viewe/viewe_panel_4848040.h | 320 ++++++++++++++ src/board/viewe/viewe_panel_8048043.h | 354 +++++++++++++++ src/board/viewe/viewe_panel_8048050.h | 354 +++++++++++++++ src/board/viewe/viewe_panel_8048070.h | 354 +++++++++++++++ 23 files changed, 4043 insertions(+) create mode 100644 src/board/viewe/viewe_panel2_8048050.h create mode 100644 src/board/viewe/viewe_panel_24320024.h create mode 100644 src/board/viewe/viewe_panel_24320028.h create mode 100644 src/board/viewe/viewe_panel_24320035.h create mode 100644 src/board/viewe/viewe_panel_32480035.h create mode 100644 src/board/viewe/viewe_panel_48272043.h create mode 100644 src/board/viewe/viewe_panel_4848040.h create mode 100644 src/board/viewe/viewe_panel_8048043.h create mode 100644 src/board/viewe/viewe_panel_8048050.h create mode 100644 src/board/viewe/viewe_panel_8048070.h diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/LVGL/v8/Porting/Porting.ino b/examples/LVGL/v8/Porting/Porting.ino index 0a1d9bb8..55d2885a 100644 --- a/examples/LVGL/v8/Porting/Porting.ino +++ b/examples/LVGL/v8/Porting/Porting.ino @@ -68,6 +68,18 @@ void setup() Serial.println(title + " start"); Serial.println("Initialize panel device"); +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif ESP_Panel *panel = new ESP_Panel(); panel->init(); #if LVGL_PORT_AVOID_TEAR diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/LVGL/v8/Rotation/Rotation.ino b/examples/LVGL/v8/Rotation/Rotation.ino index 65669413..1689c682 100644 --- a/examples/LVGL/v8/Rotation/Rotation.ino +++ b/examples/LVGL/v8/Rotation/Rotation.ino @@ -98,6 +98,18 @@ void setup() Serial.println(title + " start"); Serial.println("Initialize panel device"); +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif ESP_Panel *panel = new ESP_Panel(); panel->init(); #if LVGL_PORT_AVOID_TEAR diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/Panel/PanelTest/PanelTest.ino b/examples/Panel/PanelTest/PanelTest.ino index 2f9b29bd..1cec42d2 100644 --- a/examples/Panel/PanelTest/PanelTest.ino +++ b/examples/Panel/PanelTest/PanelTest.ino @@ -75,6 +75,19 @@ void setup() Serial.begin(115200); Serial.println("Panel test example start"); +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif + panel = new ESP_Panel(); Serial.println("Initialize display panel"); diff --git a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h +++ b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/PlatformIO/src/app.cpp b/examples/PlatformIO/src/app.cpp index 0a2c1af1..4d242777 100644 --- a/examples/PlatformIO/src/app.cpp +++ b/examples/PlatformIO/src/app.cpp @@ -24,6 +24,18 @@ void setup() Serial.println(title + " start"); Serial.println("Initialize panel device"); +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif ESP_Panel *panel = new ESP_Panel(); panel->init(); #if LVGL_PORT_AVOID_TEAR diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/SquareLine/v8/Porting/Porting.ino b/examples/SquareLine/v8/Porting/Porting.ino index b72018fd..77c871bb 100644 --- a/examples/SquareLine/v8/Porting/Porting.ino +++ b/examples/SquareLine/v8/Porting/Porting.ino @@ -59,6 +59,20 @@ void setup() Serial.println("Squareline porting example start"); Serial.println("Initialize panel device"); + +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif + ESP_Panel *panel = new ESP_Panel(); panel->init(); #if LVGL_PORT_AVOID_TEAR diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h index ba8fba0f..e5e6716a 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h @@ -97,6 +97,46 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + * Where () is the model of the board, some boards are suitable for more than one screen, + * so the name after adding the screen will be different from the name of the individual board + * + */ + +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 +// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 + +/* +The following products control IM through software +*/ +#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/SquareLine/v8/WiFiClock/WiFiClock.ino b/examples/SquareLine/v8/WiFiClock/WiFiClock.ino index 0d8b3321..e473223b 100644 --- a/examples/SquareLine/v8/WiFiClock/WiFiClock.ino +++ b/examples/SquareLine/v8/WiFiClock/WiFiClock.ino @@ -799,6 +799,18 @@ void setup() prev_weather = "Clear"; Serial.println("Initialize panel device"); +#ifdef IM + pinMode(IM1, OUTPUT); + digitalWrite(IM1, HIGH); + #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, HIGH); + #endif + #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + pinMode(IM0, OUTPUT); + digitalWrite(IM0, LOW); + #endif +#endif ESP_Panel *panel = new ESP_Panel(); panel->init(); #if LVGL_PORT_AVOID_TEAR diff --git a/src/board/ESP_PanelBoard.h b/src/board/ESP_PanelBoard.h index 234f83b0..ea78bf01 100644 --- a/src/board/ESP_PanelBoard.h +++ b/src/board/ESP_PanelBoard.h @@ -41,6 +41,17 @@ + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_5_B) \ + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7) \ + defined(BOARD_WAVESHARE_ESP32_P4_NANO) \ + /* viewe */ \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_40) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V2) \ + + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_70) \ > 1 #error "Multiple boards enabled! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif @@ -103,6 +114,27 @@ #include "board/waveshare/ESP32_S3_Touch_LCD_7.h" #elif defined(BOARD_WAVESHARE_ESP32_P4_NANO) #include "board/waveshare/ESP32_P4_NANO.h" +/* viewe */ +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) + #include "board/viewe/viewe_panel_24320024.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) + #include "board/viewe/viewe_panel_24320028.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) + #include "board/viewe/viewe_panel_24320035.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) + #include "board/viewe/viewe_panel_32480035.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_40) + #include "board/viewe/viewe_panel_4848040.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1) + #include "board/viewe/viewe_panel_8048043.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2) + #include "board/viewe/viewe_panel_48272043.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1) + #include "board/viewe/viewe_panel_8048050.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V2) + #include "board/viewe/viewe_panel2_8048050.h" +#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_70) + #include "board/viewe/viewe_panel_8048070.h" #else #error "Unknown board selected! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif diff --git a/src/board/viewe/viewe_panel2_8048050.h b/src/board/viewe/viewe_panel2_8048050.h new file mode 100644 index 00000000..ccf02908 --- /dev/null +++ b/src/board/viewe/viewe_panel2_8048050.h @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#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. + * + * Set to 1 if only the RGB interface is used without the 3-wire SPI interface, + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1) // 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_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 (20 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (1) + #define ESP_PANEL_LCD_RGB_HBP (42) + #define ESP_PANEL_LCD_RGB_HFP (20) + #define ESP_PANEL_LCD_RGB_VPW (10) + #define ESP_PANEL_LCD_RGB_VBP (12) + #define ESP_PANEL_LCD_RGB_VFP (4) + #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 (2) // 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` + // 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 (39) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (41) + #define ESP_PANEL_LCD_RGB_IO_DE (40) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (42) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (8) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (3) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (46) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (9) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (1) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (5) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (6) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (7) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | +#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 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 + * 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 (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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (20) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (19) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (2) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (0) // 0: low level, 1: high level + +/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 (20) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (19) +#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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_24320024.h b/src/board/viewe/viewe_panel_24320024.h new file mode 100644 index 00000000..3e4d32ac --- /dev/null +++ b/src/board/viewe/viewe_panel_24320024.h @@ -0,0 +1,403 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - 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 (320) + +/* 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 (42) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (40) + #define ESP_PANEL_LCD_SPI_IO_MOSI (45) + #define ESP_PANEL_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif + #define ESP_PANEL_LCD_SPI_IO_DC (41) + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (80 * 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 + + // | 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 (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 + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (10) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (11) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (12) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (13) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (14) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (21) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (47) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (48) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | +#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 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 + * 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() \ + { \ + {0xfe, (uint8_t []){0x00}, 0, 0}, \ + {0xef, (uint8_t []){0x00}, 0, 0}, \ + {0x36, (uint8_t []){0x48}, 1, 0}, \ + {0x3a, (uint8_t []){0x05}, 1, 0}, \ + {0x86, (uint8_t []){0x98}, 1, 0}, \ + {0x89, (uint8_t []){0x13}, 1, 0}, \ + {0x8b, (uint8_t []){0x80}, 1, 0},\ + {0x8d, (uint8_t []){0x33}, 1, 0},\ + {0x8e, (uint8_t []){0x0f}, 1, 0},\ + {0xe8, (uint8_t []){0x12, 0x00}, 2, 0},\ + {0xec, (uint8_t []){0x13, 0x02, 0x88}, 3, 0},\ + {0xff, (uint8_t []){0x62}, 1, 0},\ + {0x99, (uint8_t []){0x3e}, 1, 0},\ + {0x9d, (uint8_t []){0x4b}, 1, 0},\ + {0x98, (uint8_t []){0x3e}, 1, 0},\ + {0x9c, (uint8_t []){0x4b}, 1, 0},\ + {0xc3, (uint8_t []){0x27}, 1, 0},\ + {0xc4, (uint8_t []){0x18}, 1, 0},\ + {0xc9, (uint8_t []){0x0a}, 1, 0},\ + {0xf0, (uint8_t []){0x47, 0x0c, 0x0A, 0x09, 0x15, 0x33}, 6, 0},\ + {0xf1, (uint8_t []){0x4b, 0x8F, 0x8f, 0x3B, 0x3F, 0x6f}, 6, 0},\ + {0xf2, (uint8_t []){0x47, 0x0c, 0x0A, 0x09, 0x15, 0x33}, 6, 0},\ + {0xf3, (uint8_t []){0x4b, 0x8f, 0x8f, 0x3B, 0x3F, 0x6f}, 6, 0},\ + {0x11, (uint8_t []){0x00}, 0, 100}, \ + {0x29, (uint8_t []){0x00}, 0, 0},\ + {0x2c, (uint8_t []){0x00}, 0, 0},\ + } + +/* 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 (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 (1) // 0/1 +#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1 + +/* LCD Other Settings */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 CST816S + +/* 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (3) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (1) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (13) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level + +/* Set to 1 if you want to 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 (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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_24320028.h b/src/board/viewe/viewe_panel_24320028.h new file mode 100644 index 00000000..89cf36eb --- /dev/null +++ b/src/board/viewe/viewe_panel_24320028.h @@ -0,0 +1,404 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - 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 (320) + +/* 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 (42) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (40) + #define ESP_PANEL_LCD_SPI_IO_MOSI (45) + #define ESP_PANEL_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif + #define ESP_PANEL_LCD_SPI_IO_DC (41) + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (80 * 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 + + // | 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 (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 + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (10) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (11) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (12) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (13) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (14) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (21) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (47) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (48) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | +#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 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 + * 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() \ + { \ + {0xfe, (uint8_t []){0x00}, 0, 0}, \ + {0xfe, (uint8_t []){0x00}, 0, 0}, \ + {0xef, (uint8_t []){0x00}, 0, 0}, \ + {0x36, (uint8_t []){0x48}, 1, 0}, \ + {0x3a, (uint8_t []){0x05}, 1, 0}, \ + {0x86, (uint8_t []){0x98}, 1, 0}, \ + {0x89, (uint8_t []){0x03}, 1, 0}, \ + {0x8b, (uint8_t []){0x80}, 1, 0}, \ + {0x8d, (uint8_t []){0x33}, 1, 0}, \ + {0x8e, (uint8_t []){0x0f}, 1, 0}, \ + {0xe8, (uint8_t []){0x12, 0x00}, 2, 0}, \ + {0xc3, (uint8_t []){0x1d}, 1, 0}, \ + {0xc4, (uint8_t []){0x1d}, 1, 0}, \ + {0xc9, (uint8_t []){0x0f}, 1, 0}, \ + {0xff, (uint8_t []){0x62}, 1, 0}, \ + {0x99, (uint8_t []){0x3e}, 1, 0}, \ + {0x9d, (uint8_t []){0x4b}, 1, 0}, \ + {0x98, (uint8_t []){0x3e}, 1, 0}, \ + {0x9c, (uint8_t []){0x4b}, 1, 0}, \ + {0xf0, (uint8_t []){0x49, 0x0b, 0x09, 0x08, 0x06, 0x2e}, 6, 0}, \ + {0xf2, (uint8_t []){0x49, 0x0b, 0x09, 0x08, 0x06, 0x2e}, 6, 0}, \ + {0xf1, (uint8_t []){0x45, 0x92, 0x93, 0x2b, 0x31, 0x6F}, 6, 0}, \ + {0xf3, (uint8_t []){0x45, 0x92, 0x93, 0x2b, 0x31, 0x6F}, 6, 0}, \ + {0x35, (uint8_t []){0x00}, 1, 0}, \ + {0x11, NULL, 0, 120}, \ + {0x29, NULL, 0, 0}, \ + {0x2c, NULL, 0, 0}, \ + } + +/* 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 (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 (1) // 0/1 +#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1 + +/* LCD Other Settings */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 CST816S + +/* 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (3) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (1) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (13) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level + +/* Set to 1 if you want to 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 (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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_24320035.h b/src/board/viewe/viewe_panel_24320035.h new file mode 100644 index 00000000..3e4d32ac --- /dev/null +++ b/src/board/viewe/viewe_panel_24320035.h @@ -0,0 +1,403 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - 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 (320) + +/* 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 (42) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (40) + #define ESP_PANEL_LCD_SPI_IO_MOSI (45) + #define ESP_PANEL_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif + #define ESP_PANEL_LCD_SPI_IO_DC (41) + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (80 * 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 + + // | 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 (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 + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (10) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (11) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (12) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (13) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (14) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (21) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (47) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (48) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | +#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 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 + * 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() \ + { \ + {0xfe, (uint8_t []){0x00}, 0, 0}, \ + {0xef, (uint8_t []){0x00}, 0, 0}, \ + {0x36, (uint8_t []){0x48}, 1, 0}, \ + {0x3a, (uint8_t []){0x05}, 1, 0}, \ + {0x86, (uint8_t []){0x98}, 1, 0}, \ + {0x89, (uint8_t []){0x13}, 1, 0}, \ + {0x8b, (uint8_t []){0x80}, 1, 0},\ + {0x8d, (uint8_t []){0x33}, 1, 0},\ + {0x8e, (uint8_t []){0x0f}, 1, 0},\ + {0xe8, (uint8_t []){0x12, 0x00}, 2, 0},\ + {0xec, (uint8_t []){0x13, 0x02, 0x88}, 3, 0},\ + {0xff, (uint8_t []){0x62}, 1, 0},\ + {0x99, (uint8_t []){0x3e}, 1, 0},\ + {0x9d, (uint8_t []){0x4b}, 1, 0},\ + {0x98, (uint8_t []){0x3e}, 1, 0},\ + {0x9c, (uint8_t []){0x4b}, 1, 0},\ + {0xc3, (uint8_t []){0x27}, 1, 0},\ + {0xc4, (uint8_t []){0x18}, 1, 0},\ + {0xc9, (uint8_t []){0x0a}, 1, 0},\ + {0xf0, (uint8_t []){0x47, 0x0c, 0x0A, 0x09, 0x15, 0x33}, 6, 0},\ + {0xf1, (uint8_t []){0x4b, 0x8F, 0x8f, 0x3B, 0x3F, 0x6f}, 6, 0},\ + {0xf2, (uint8_t []){0x47, 0x0c, 0x0A, 0x09, 0x15, 0x33}, 6, 0},\ + {0xf3, (uint8_t []){0x4b, 0x8f, 0x8f, 0x3B, 0x3F, 0x6f}, 6, 0},\ + {0x11, (uint8_t []){0x00}, 0, 100}, \ + {0x29, (uint8_t []){0x00}, 0, 0},\ + {0x2c, (uint8_t []){0x00}, 0, 0},\ + } + +/* 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 (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 (1) // 0/1 +#define ESP_PANEL_LCD_MIRROR_Y (0) // 0/1 + +/* LCD Other Settings */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 CST816S + +/* 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (3) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (1) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (13) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level + +/* Set to 1 if you want to 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 (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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_32480035.h b/src/board/viewe/viewe_panel_32480035.h new file mode 100644 index 00000000..36689493 --- /dev/null +++ b/src/board/viewe/viewe_panel_32480035.h @@ -0,0 +1,396 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#define ESP_PANEL_LCD_NAME ST7789 + +/* LCD resolution in pixels */ +#define ESP_PANEL_LCD_WIDTH (320) +#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. + * + * 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 (42) +#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST + #define ESP_PANEL_LCD_SPI_IO_SCK (40) + #define ESP_PANEL_LCD_SPI_IO_MOSI (45) + #define ESP_PANEL_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif + #define ESP_PANEL_LCD_SPI_IO_DC (41) + #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0 + #define ESP_PANEL_LCD_SPI_CLK_HZ (80 * 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 + + // | 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 (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 + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (10) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (11) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (12) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (13) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (14) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (21) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (47) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (48) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | +#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 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 + * 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() \ + { \ + {0x11, (uint8_t []){0x00}, 0, 120}, \ + {0xF0, (uint8_t []){0xC3}, 1, 0}, \ + {0xF0, (uint8_t []){0x96}, 1, 0}, \ + {0x36, (uint8_t []){0x28}, 1, 0}, \ + {0x3A, (uint8_t []){0x55}, 1, 0}, \ + {0xB4, (uint8_t []){0x01}, 1, 0}, \ + {0xB7, (uint8_t []){0xC6}, 1, 0}, \ + {0xC0, (uint8_t []){0x80, 0x04}, 2, 0}, \ + {0xC1, (uint8_t []){0x13}, 1, 0}, \ + {0xC5, (uint8_t []){0xA7}, 1, 0}, \ + {0xC5, (uint8_t []){0x16}, 1, 0}, \ + {0xE8, (uint8_t []){0x40, 0x8a, 0x00, 0x00, 0x29, 0x19, 0xA5, 0x33}, 8, 0}, \ + {0xE0, (uint8_t []){0xF0, 0x19, 0x20, 0x10, 0x11, 0x0A, 0x46, 0x44, 0x57, 0x09, 0x1A, 0x1B, 0x2A, 0x2D}, 14, 0}, \ + {0xE1, (uint8_t []){0xF0, 0x12, 0x1A, 0x0A, 0x0C, 0x18, 0x45, 0x44, 0x56, 0x3F, 0x15, 0x11, 0x24, 0x26}, 14, 0}, \ + {0xF0, (uint8_t []){0x3C}, 1, 0}, \ + {0xF0, (uint8_t []){0x69}, 1, 0}, \ + {0x21, (uint8_t []){0x00}, 0, 0}, \ + {0x29, (uint8_t []){0x00}, 0, 50}, \ + {0x2C, (uint8_t []){0x00}, 0, 0}, \ + } + +/* 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 (0) // 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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 CST816S + +/* 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (3) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (1) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (13) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level + +/* Set to 1 if you want to 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 (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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_48272043.h b/src/board/viewe/viewe_panel_48272043.h new file mode 100644 index 00000000..71cd3a82 --- /dev/null +++ b/src/board/viewe/viewe_panel_48272043.h @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#define ESP_PANEL_LCD_NAME ST7262 + +/* LCD resolution in pixels */ +#define ESP_PANEL_LCD_WIDTH (480) +#define ESP_PANEL_LCD_HEIGHT (272) + +/* 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 (1) // 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_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 (15 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (1) + #define ESP_PANEL_LCD_RGB_HBP (42) + #define ESP_PANEL_LCD_RGB_HFP (20) + #define ESP_PANEL_LCD_RGB_VPW (10) + #define ESP_PANEL_LCD_RGB_VBP (12) + #define ESP_PANEL_LCD_RGB_VFP (4) + #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 (2) // 1/2/3 + #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_LCD_WIDTH *17) // 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 (39) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (41) + #define ESP_PANEL_LCD_RGB_IO_DE (40) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (42) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (8) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (3) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (46) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (9) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (1) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (5) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (6) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (7) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | +#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 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 + * 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 (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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 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. 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (20) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (19) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (2) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (0) // 0: low level, 1: high level + +/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 (20) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (19) +#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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_4848040.h b/src/board/viewe/viewe_panel_4848040.h new file mode 100644 index 00000000..9e3a0a4f --- /dev/null +++ b/src/board/viewe/viewe_panel_4848040.h @@ -0,0 +1,320 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#define ESP_PANEL_LCD_NAME GC9503 + +/* LCD resolution in pixels */ +#define ESP_PANEL_LCD_WIDTH (480) +#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. 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_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 (18 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (8) + #define ESP_PANEL_LCD_RGB_HBP (40) + #define ESP_PANEL_LCD_RGB_HFP (40) + #define ESP_PANEL_LCD_RGB_VPW (2) + #define ESP_PANEL_LCD_RGB_VBP (4) + #define ESP_PANEL_LCD_RGB_VFP (16) + #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 (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 (16) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (17) + #define ESP_PANEL_LCD_RGB_IO_DE (18) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (21) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (15) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (14) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (13) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (12) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (11) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (10) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (9) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (8) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (7) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (6) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (5) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (4) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (3) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (2) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (1) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (0) // | 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_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() \ +// { \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xF0, {0x55, 0xAA, 0x52, 0x08, 0x00}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xF6, {0x5A, 0x87}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x3A, {0x60}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC1, {0x3F}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC2, {0x0E}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC6, {0xF8}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC9, {0x10}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xCD, {0x25}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xF8, {0x8A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xAC, {0x65}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xA0, {0xDD}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xA7, {0x47}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFA, {0x00, 0x00, 0x00, 0x04}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x86, {0x99, 0xA3, 0xA3, 0x51}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xA3, {0xEE}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFD, {0x3c, 0x3c, 0x00}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x71, {0x48}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x72, {0x48}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x73, {0x00, 0x44}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x97, {0xEE}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x83, {0x93}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x9A, {0x72}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x9B, {0x5A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x82, {0x2C, 0x2C}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x10}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x6D, {0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0e, 0x0c, 0x0a, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0b, 0x0D, 0x0F, 0x1a, 0x19, 0x1f, 0x00}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x64, {0x38, 0x05, 0x01, 0xdb, 0x03, 0x03, 0x38, 0x04, 0x01, 0xdc, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x65, {0x38, 0x03, 0x01, 0xdd, 0x03, 0x03, 0x38, 0x02, 0x01, 0xde, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x66, {0x38, 0x01, 0x01, 0xdf, 0x03, 0x03, 0x38, 0x00, 0x01, 0xe0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x67, {0x30, 0x05, 0x01, 0xe1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xe2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x68, {0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x60, {0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x63, {0x31, 0xe4, 0x7A, 0x7A, 0x31, 0xe5, 0x7A, 0x7A}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x69, {0x14, 0x22, 0x14, 0x22, 0x14, 0x14, 0x22, 0x08}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x6B, {0x07}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x7A, {0x08, 0x13}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x7B, {0x08, 0x13}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD1, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD2, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD3, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD4, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD5, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD6, {0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0XFF}), \ +// ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x3a, {0x66}), \ +// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(200, 0x11), \ +// ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(200, 0x29), \ +// } + +/* 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 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 + */ +#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 (41) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (40) +#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 (0) // 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 (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// 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 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_8048043.h b/src/board/viewe/viewe_panel_8048043.h new file mode 100644 index 00000000..3dc6f6c9 --- /dev/null +++ b/src/board/viewe/viewe_panel_8048043.h @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#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. + * + * Set to 1 if only the RGB interface is used without the 3-wire SPI interface, + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1) // 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_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 (15 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (1) + #define ESP_PANEL_LCD_RGB_HBP (42) + #define ESP_PANEL_LCD_RGB_HFP (20) + #define ESP_PANEL_LCD_RGB_VPW (10) + #define ESP_PANEL_LCD_RGB_VBP (12) + #define ESP_PANEL_LCD_RGB_VFP (4) + #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 (2) // 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` + // 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 (39) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (41) + #define ESP_PANEL_LCD_RGB_IO_DE (40) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (42) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (8) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (3) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (46) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (9) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (1) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (5) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (6) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (7) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | +#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 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 + * 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 (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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 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. 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (20) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (19) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (2) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (0) // 0: low level, 1: high level + +/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 (20) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (19) +#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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_8048050.h b/src/board/viewe/viewe_panel_8048050.h new file mode 100644 index 00000000..c170cb97 --- /dev/null +++ b/src/board/viewe/viewe_panel_8048050.h @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#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. + * + * Set to 1 if only the RGB interface is used without the 3-wire SPI interface, + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1) // 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_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 (20 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (1) + #define ESP_PANEL_LCD_RGB_HBP (42) + #define ESP_PANEL_LCD_RGB_HFP (20) + #define ESP_PANEL_LCD_RGB_VPW (10) + #define ESP_PANEL_LCD_RGB_VBP (12) + #define ESP_PANEL_LCD_RGB_VFP (4) + #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 (2) // 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` + // 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 (39) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (41) + #define ESP_PANEL_LCD_RGB_IO_DE (40) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (42) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (8) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (3) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (46) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (9) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (1) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (5) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (6) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (7) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | +#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 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 + * 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 (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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 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. 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (20) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (19) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (2) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (0) // 0: low level, 1: high level + +/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 (20) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (19) +#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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* diff --git a/src/board/viewe/viewe_panel_8048070.h b/src/board/viewe/viewe_panel_8048070.h new file mode 100644 index 00000000..f19f2193 --- /dev/null +++ b/src/board/viewe/viewe_panel_8048070.h @@ -0,0 +1,354 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// *INDENT-OFF* + +/* Set to 1 if using a custom board */ +#define ESP_PANEL_USE_CUSTOM_BOARD (1) // 0/1 + +#if ESP_PANEL_USE_CUSTOM_BOARD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// 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: + * - EK9716B + * - GC9A01, GC9B71, GC9503 + * - ILI9341 + * - NV3022B + * - SH8601 + * - SPD2010 + * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922 + */ +#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. + * + * Set to 1 if only the RGB interface is used without the 3-wire SPI interface, + */ +#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (1) // 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_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 (25 * 1000 * 1000) + #define ESP_PANEL_LCD_RGB_HPW (48) + #define ESP_PANEL_LCD_RGB_HBP (40) + #define ESP_PANEL_LCD_RGB_HFP (88) + #define ESP_PANEL_LCD_RGB_VPW (6) + #define ESP_PANEL_LCD_RGB_VBP (26) + #define ESP_PANEL_LCD_RGB_VFP (30) + #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 (2) // 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` + // 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 (39) + #define ESP_PANEL_LCD_RGB_IO_VSYNC (41) + #define ESP_PANEL_LCD_RGB_IO_DE (40) // -1 if not used + #define ESP_PANEL_LCD_RGB_IO_PCLK (42) + #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used + + // | RGB565 | RGB666 | RGB888 | + // |--------|--------|--------| + #define ESP_PANEL_LCD_RGB_IO_DATA0 (8) // | B0 | B0-1 | B0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA1 (3) // | B1 | B2 | B4 | + #define ESP_PANEL_LCD_RGB_IO_DATA2 (46) // | B2 | B3 | B5 | + #define ESP_PANEL_LCD_RGB_IO_DATA3 (9) // | B3 | B4 | B6 | + #define ESP_PANEL_LCD_RGB_IO_DATA4 (1) // | B4 | B5 | B7 | + #define ESP_PANEL_LCD_RGB_IO_DATA5 (5) // | G0 | G0 | G0-2 | + #define ESP_PANEL_LCD_RGB_IO_DATA6 (6) // | G1 | G1 | G3 | + #define ESP_PANEL_LCD_RGB_IO_DATA7 (7) // | G2 | G2 | G4 | +#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8 + #define ESP_PANEL_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | + #define ESP_PANEL_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | + #define ESP_PANEL_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | +#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 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 + * 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 (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 */ +/* Reset pin */ +#define ESP_PANEL_LCD_IO_RST (-1) // IO num of RESET pin, set to -1 if not use +#define ESP_PANEL_LCD_RST_LEVEL (0) // Active level. 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 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. 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 the default address. + // - For touchs with only one address, set to 0 + // - For touchs with multiple addresses, set to 0 or the address + // Like 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 + #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 (20) + #define ESP_PANEL_TOUCH_I2C_IO_SDA (19) +#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 */ +/* Reset pin */ +#define ESP_PANEL_TOUCH_IO_RST (-1) // IO num of RESET pin, set to -1 if not use + // For GT911, the RST pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_RST_LEVEL (0) // Active level. 0: low level, 1: high level +/* Interrupt pin */ +#define ESP_PANEL_TOUCH_IO_INT (-1) // IO num of INT pin, set to -1 if not use + // For GT911, the INT pin is also used to configure the I2C address +#define ESP_PANEL_TOUCH_INT_LEVEL (0) // Active level. 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 +/* Backlight pin */ +#define ESP_PANEL_BACKLIGHT_IO (2) // IO num of backlight pin +#define ESP_PANEL_BACKLIGHT_ON_LEVEL (0) // 0: low level, 1: high level + +/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */ +#define ESP_PANEL_BACKLIGHT_IDLE_OFF (1) // 0: on, 1: off + +/* Set to 1 if use PWM for brightness control */ +#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 +#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_HOST_ID (0) // Typically set to 0 +#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_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 (20) + #define ESP_PANEL_EXPANDER_I2C_IO_SDA (19) +#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 ) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * 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 2 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2 + +#endif /* ESP_PANEL_USE_CUSTOM_BOARD */ + +// *INDENT-OFF* From 5b7e95e839dddc86655c914e9aafa6a11e446258 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Tue, 26 Nov 2024 11:21:14 +0800 Subject: [PATCH 07/24] Update Board_Instructions.md --- docs/Board_Instructions.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 516f5a04..3be56007 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -58,11 +58,11 @@ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | ------------------ | :-----------: | :------------------: | | | [VIEWE-ESP32-S3-Touch-LCD-2.4](https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | | | [VIEWE-ESP32-S3-Touch-LCD-2.8](https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V1](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V2](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | ST7365P(like ST7789) | 320x480 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V1](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V2](https://viewedisplay.com/product/esp32-3-5-inch-320x4-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | ST7365P(like ST7789) | 320x480 | I2C | CHSC6540 | | | [VIEWE-ESP32-S3-Touch-LCD-4.0](https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT6336U(like FT5x06) | | | [VIEWE-ESP32-S3-Touch-LCD-4.3_V1](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 800x480 | I2C | GT911 | -| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V2](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 480x272 | I2C | GT911 | +| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V2](https://viewedisplay.com/product/esp32-4-3-inch-480x272-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | RGB | ST7262 | 480x272 | I2C | GT911 | | | [VIEWE-ESP32-S3-Touch-LCD-5.0](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | | | [VIEWE-ESP32-S3-Touch-LCD-7.0](https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/) | RGB | EK9716BD3+EK73002AB2(like ST7262) | 800x480 | I2C | GT911 | @@ -96,15 +96,15 @@ Below are recommended configurations for developing GUI applications on differen | Waveshare-ESP32-S3-Touch-LCD-5B | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | Waveshare-ESP32-S3-Touch-LCD-7 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | 8M with spiffs | | Waveshare-ESP32-P4-NANO | ESP32P4 Dev Module | Enabled | QIO | 16MB | Disabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-2.4 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-2.8 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-3.5_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-3.5_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.3_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.3_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-5.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-7.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-2.4 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-2.8 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-3.5_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-3.5_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.3_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-4.3_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-5.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-7.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | **Notes:** From f0e0370cd68b4986a34b466ebc72d5dc6f68f3be Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Tue, 26 Nov 2024 11:46:10 +0800 Subject: [PATCH 08/24] Update Board_Instructions.md --- docs/Board_Instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 3be56007..3450a7ca 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -63,7 +63,7 @@ | | [VIEWE-ESP32-S3-Touch-LCD-4.0](https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT6336U(like FT5x06) | | | [VIEWE-ESP32-S3-Touch-LCD-4.3_V1](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 800x480 | I2C | GT911 | | | [VIEWE-ESP32-S3-Touch-LCD-4.3_V2](https://viewedisplay.com/product/esp32-4-3-inch-480x272-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | RGB | ST7262 | 480x272 | I2C | GT911 | -| | [VIEWE-ESP32-S3-Touch-LCD-5.0](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | +| | [VIEWE-ESP32-S3-Touch-LCD-5.0_V1](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | | | [VIEWE-ESP32-S3-Touch-LCD-7.0](https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/) | RGB | EK9716BD3+EK73002AB2(like ST7262) | 800x480 | I2C | GT911 | ## Recommended Configurations in the Arduino IDE @@ -103,7 +103,7 @@ Below are recommended configurations for developing GUI applications on differen | VIEWE-ESP32-S3-Touch-LCD-4.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | VIEWE-ESP32-S3-Touch-LCD-4.3_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | VIEWE-ESP32-S3-Touch-LCD-4.3_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-5.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-ESP32-S3-Touch-LCD-5.0_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | VIEWE-ESP32-S3-Touch-LCD-7.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | **Notes:** From 7020370b526e520c29f2a2b50d30b7793fb64b96 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 13:38:24 +0800 Subject: [PATCH 09/24] Update Board_Instructions.md --- docs/Board_Instructions.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/Board_Instructions.md b/docs/Board_Instructions.md index 3450a7ca..83b4ff23 100644 --- a/docs/Board_Instructions.md +++ b/docs/Board_Instructions.md @@ -56,15 +56,15 @@ | **Picture** | **Name** | **LCD Bus** |**LCD Controller**| **LCD resolution** | **Touch Bus** | **Touch Controller** | | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | ------------------ | :-----------: | :------------------: | -| | [VIEWE-ESP32-S3-Touch-LCD-2.4](https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-2.8](https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V1](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-3.5_V2](https://viewedisplay.com/product/esp32-3-5-inch-320x4-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | ST7365P(like ST7789) | 320x480 | I2C | CHSC6540 | -| | [VIEWE-ESP32-S3-Touch-LCD-4.0](https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT6336U(like FT5x06) | -| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V1](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 800x480 | I2C | GT911 | -| | [VIEWE-ESP32-S3-Touch-LCD-4.3_V2](https://viewedisplay.com/product/esp32-4-3-inch-480x272-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | RGB | ST7262 | 480x272 | I2C | GT911 | -| | [VIEWE-ESP32-S3-Touch-LCD-5.0_V1](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | -| | [VIEWE-ESP32-S3-Touch-LCD-7.0](https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/) | RGB | EK9716BD3+EK73002AB2(like ST7262) | 800x480 | I2C | GT911 | +| | [UEDX24320028E-WB-A-2.4](https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [UEDX24320028E-WB-A-2.8](https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [UEDX24320028E-WB-A-3.5-240x320](https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | GC9307(like GC9A01) | 240x320 | I2C | CHSC6540 | +| | [UEDX24320028E-WB-A-3.5-320x480](https://viewedisplay.com/product/esp32-3-5-inch-320x4-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | SPI | ST7365P(like ST7789) | 320x480 | I2C | CHSC6540 | +| | [UEDX48480040E-WB-A](https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT6336U(like FT5x06) | +| | [UEDX80480043E-WB-A-800x480](https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262 | 800x480 | I2C | GT911 | +| | [UEDX80480043E-WB-A-480x272](https://viewedisplay.com/product/esp32-4-3-inch-480x272-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/) | RGB | ST7262 | 480x272 | I2C | GT911 | +| | [UEDX80480050E-WB-A](https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/) | RGB | ST7262E43-G4(like ST7262) | 800x480 | I2C | GT911 | +| | [UEDX80480070E-WB-A](https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/) | RGB | EK9716BD3+EK73002AB2(like ST7262) | 800x480 | I2C | GT911 | ## Recommended Configurations in the Arduino IDE @@ -96,15 +96,15 @@ Below are recommended configurations for developing GUI applications on differen | Waveshare-ESP32-S3-Touch-LCD-5B | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | | Waveshare-ESP32-S3-Touch-LCD-7 | ESP32S3 Dev Module | OPI | QIO 80MHz | 8MB | Disabled | 8M with spiffs | | Waveshare-ESP32-P4-NANO | ESP32P4 Dev Module | Enabled | QIO | 16MB | Disabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-2.4 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-2.8 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-3.5_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-3.5_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.3_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-4.3_V2 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-5.0_V1 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| VIEWE-ESP32-S3-Touch-LCD-7.0 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320028E-WB-A-2.4 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320028E-WB-A-2.8 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320028E-WB-A-3.5-240x320 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320028E-WB-A-3.5-320x480 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX48480040E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX80480043E-WB-A-800x480 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX80480043E-WB-A-480x272 | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX80480050E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX80480070E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | **Notes:** From 88f917199fee629508a6b76fa996bc68e52f10db Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 13:53:30 +0800 Subject: [PATCH 10/24] Update ESP_PanelBoard.h --- src/board/ESP_PanelBoard.h | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/board/ESP_PanelBoard.h b/src/board/ESP_PanelBoard.h index ea78bf01..1bbd8ae2 100644 --- a/src/board/ESP_PanelBoard.h +++ b/src/board/ESP_PanelBoard.h @@ -42,16 +42,16 @@ + defined(BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7) \ + defined(BOARD_WAVESHARE_ESP32_P4_NANO) \ /* viewe */ \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_40) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V2) \ - + defined(BOARD_VIEWE_ESP_S3_Touch_LCD_70) \ + + defined(BOARD_UEDX24320028E_WB_A_2_4) \ + + defined(BOARD_UEDX24320028E_WB_A_2_8) \ + + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) \ + + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) \ + + defined(BOARD_UEDX48480040E_WB_A_4_0) \ + + defined(BOARD_UEDX80480043E_WB_A_4_3_800_480) \ + + defined(BOARD_UEDX80480043E_WB_A_4_3_480_272) \ + + defined(BOARD_UEDX80480050E_WB_A_5_0) \ + + defined(BOARD_UEDX80480050E_WB_A_5_0_B) \ + + defined(BOARD_UEDX80480070E_WB_A_7_0) \ > 1 #error "Multiple boards enabled! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." #endif @@ -115,25 +115,25 @@ #elif defined(BOARD_WAVESHARE_ESP32_P4_NANO) #include "board/waveshare/ESP32_P4_NANO.h" /* viewe */ -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) +#elif defined(BOARD_UEDX24320028E_WB_A_2_4) #include "board/viewe/viewe_panel_24320024.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) +#elif defined(BOARD_UEDX24320028E_WB_A_2_8) #include "board/viewe/viewe_panel_24320028.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) +#elif defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) #include "board/viewe/viewe_panel_24320035.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#elif defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #include "board/viewe/viewe_panel_32480035.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_40) +#elif defined(BOARD_UEDX48480040E_WB_A_4_0) #include "board/viewe/viewe_panel_4848040.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1) +#elif defined(BOARD_UEDX80480043E_WB_A_4_3_800_480) #include "board/viewe/viewe_panel_8048043.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2) +#elif defined(BOARD_UEDX80480043E_WB_A_4_3_480_272) #include "board/viewe/viewe_panel_48272043.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1) +#elif defined(BOARD_UEDX80480050E_WB_A_5_0) #include "board/viewe/viewe_panel_8048050.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_50_V2) +#elif defined(BOARD_UEDX80480050E_WB_A_5_0_B) #include "board/viewe/viewe_panel2_8048050.h" -#elif defined(BOARD_VIEWE_ESP_S3_Touch_LCD_70) +#elif defined(BOARD_UEDX80480070E_WB_A_7_0) #include "board/viewe/viewe_panel_8048070.h" #else #error "Unknown board selected! Please check file `ESP_Panel_Board_Supported.h` and make sure only one board is enabled." From e0c5596294f95ea2f9b557e069ecc50b2e73eeaf Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:07:31 +0800 Subject: [PATCH 11/24] Update ESP_Panel_Board_Supported.h --- .../v8/Porting/ESP_Panel_Board_Supported.h | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 From 8a06ec6f9aa1a2ada55c7869a141ffd434bd014e Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:09:39 +0800 Subject: [PATCH 12/24] Update Porting.ino --- examples/LVGL/v8/Porting/Porting.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/LVGL/v8/Porting/Porting.ino b/examples/LVGL/v8/Porting/Porting.ino index 55d2885a..0d003b29 100644 --- a/examples/LVGL/v8/Porting/Porting.ino +++ b/examples/LVGL/v8/Porting/Porting.ino @@ -71,11 +71,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From 4953247d27b692f38b00ac1985ce648a7bedc32c Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:10:37 +0800 Subject: [PATCH 13/24] Update Rotation.ino --- examples/LVGL/v8/Rotation/Rotation.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/LVGL/v8/Rotation/Rotation.ino b/examples/LVGL/v8/Rotation/Rotation.ino index 1689c682..4ef90850 100644 --- a/examples/LVGL/v8/Rotation/Rotation.ino +++ b/examples/LVGL/v8/Rotation/Rotation.ino @@ -101,11 +101,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From bd161a731fbce53eb01af16bce912d7890c3dc07 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:12:09 +0800 Subject: [PATCH 14/24] Update PanelTest.ino --- examples/Panel/PanelTest/PanelTest.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Panel/PanelTest/PanelTest.ino b/examples/Panel/PanelTest/PanelTest.ino index 1cec42d2..bb90b6d8 100644 --- a/examples/Panel/PanelTest/PanelTest.ino +++ b/examples/Panel/PanelTest/PanelTest.ino @@ -78,11 +78,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From 77bbd27efb644b53b80cd15c93c9a38646cb20ca Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:14:16 +0800 Subject: [PATCH 15/24] Update app.cpp --- examples/PlatformIO/src/app.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/PlatformIO/src/app.cpp b/examples/PlatformIO/src/app.cpp index 4d242777..9e1a27cc 100644 --- a/examples/PlatformIO/src/app.cpp +++ b/examples/PlatformIO/src/app.cpp @@ -27,11 +27,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From e2c4b0e08d83f11a108ed820a6a50fd968b74d0f Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:15:12 +0800 Subject: [PATCH 16/24] Update Porting.ino --- examples/SquareLine/v8/Porting/Porting.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/SquareLine/v8/Porting/Porting.ino b/examples/SquareLine/v8/Porting/Porting.ino index 77c871bb..9e2e3025 100644 --- a/examples/SquareLine/v8/Porting/Porting.ino +++ b/examples/SquareLine/v8/Porting/Porting.ino @@ -63,11 +63,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From 139f90b9b84274c832f20897ff0b6e17b999baf6 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:16:35 +0800 Subject: [PATCH 17/24] Update WiFiClock.ino --- examples/SquareLine/v8/WiFiClock/WiFiClock.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/SquareLine/v8/WiFiClock/WiFiClock.ino b/examples/SquareLine/v8/WiFiClock/WiFiClock.ino index e473223b..1bd0c24e 100644 --- a/examples/SquareLine/v8/WiFiClock/WiFiClock.ino +++ b/examples/SquareLine/v8/WiFiClock/WiFiClock.ino @@ -802,11 +802,11 @@ void setup() #ifdef IM pinMode(IM1, OUTPUT); digitalWrite(IM1, HIGH); - #ifdef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifdef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, HIGH); #endif - #ifndef BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 + #ifndef BOARD_UEDX24320028E_WB_A_3_5_320_480 pinMode(IM0, OUTPUT); digitalWrite(IM0, LOW); #endif From f9960fc064558ad9071f721bf7624218cc2a4572 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:23:08 +0800 Subject: [PATCH 18/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a43456e2..4921835f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Below is the list of [Supported Development Boards](docs/Board_Instructions.md): | [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-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-4.3, ESP32-S3-Touch-LCD-4.3B, ESP32-S3-Touch-LCD-5, ESP32-S3-Touch-LCD-5B, ESP32-S3-Touch-LCD-7, ESP32-P4-NANO | -| [VIEWE](docs/Board_Instructions.md#viewe) | VIEWE_ESP_S3_Knob_LCD_21(UEDX48480021-MD80E), VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_40(DX48480040E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A),VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A)| +| [VIEWE](docs/Board_Instructions.md#viewe) | UEDX24320028E-WB-A-2.4, UEDX24320028E-WB-A-2.8, UEDX24320028E-WB-A-3.5-240x320, UEDX24320028E-WB-A-3.5-320x480, DX48480040E-WB-A, UEDX80480043E-WB-A-4.3-800x480, UEDX80480043E-WB-A-4.3-480x272, UEDX80480050E-WB-A,UEDX80480070E-WB-A| Developers and manufacturers are welcome to contribute PRs to add more boards. For details, please refer to the [Board Contribution Guide](./docs/Board_Contribution_Guide.md). From 4ef0503dd49badcac9b342d9bf6fd4b7ef204b4a Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:24:21 +0800 Subject: [PATCH 19/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4921835f..41075942 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Below is the list of [Supported Development Boards](docs/Board_Instructions.md): | [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-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-4.3, ESP32-S3-Touch-LCD-4.3B, ESP32-S3-Touch-LCD-5, ESP32-S3-Touch-LCD-5B, ESP32-S3-Touch-LCD-7, ESP32-P4-NANO | -| [VIEWE](docs/Board_Instructions.md#viewe) | UEDX24320028E-WB-A-2.4, UEDX24320028E-WB-A-2.8, UEDX24320028E-WB-A-3.5-240x320, UEDX24320028E-WB-A-3.5-320x480, DX48480040E-WB-A, UEDX80480043E-WB-A-4.3-800x480, UEDX80480043E-WB-A-4.3-480x272, UEDX80480050E-WB-A,UEDX80480070E-WB-A| +| [VIEWE](docs/Board_Instructions.md#viewe) | UEDX24320028E-WB-A-2.4, UEDX24320028E-WB-A-2.8, UEDX24320028E-WB-A-3.5-240x320, UEDX24320028E-WB-A-3.5-320x480, DX48480040E-WB-A, UEDX80480043E-WB-A-4.3-800x480, UEDX80480043E-WB-A-4.3-480x272, UEDX80480050E-WB-A, UEDX80480070E-WB-A| Developers and manufacturers are welcome to contribute PRs to add more boards. For details, please refer to the [Board Contribution Guide](./docs/Board_Contribution_Guide.md). From d7d7a69159849371deb61bb15b4ce3fcbaa71ec6 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Thu, 28 Nov 2024 14:25:22 +0800 Subject: [PATCH 20/24] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index ec19cc97..21eac43d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -41,7 +41,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | [Elecrow](docs/Board_Instructions.md#elecrow) | CrowPanel 7.0" | | [Jingcai](docs/Board_Instructions.md#shenzhen-jingcai-intelligent) | ESP32-4848S040C_I_Y_3 | | [Waveshare](docs/Board_Instructions.md#waveshare) | ESP32-S3-Touch-LCD-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-4.3, ESP32-S3-Touch-LCD-4.3B, ESP32-S3-Touch-LCD-5, ESP32-S3-Touch-LCD-5B, ESP32-S3-Touch-LCD-7, ESP32-P4-NANO | -| [VIEWE](docs/Board_Instructions.md#viewe) | VIEWE_ESP_S3_Knob_LCD_21(UEDX48480021-MD80E), VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A), VIEWE_ESP_S3_Touch_LCD_40(DX48480040E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX80480070E-WB-A), VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A),VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A)| +| [VIEWE](docs/Board_Instructions.md#viewe) | UEDX24320028E-WB-A-2.4, UEDX24320028E-WB-A-2.8, UEDX24320028E-WB-A-3.5-240x320, UEDX24320028E-WB-A-3.5-320x480, DX48480040E-WB-A, UEDX80480043E-WB-A-4.3-800x480, UEDX80480043E-WB-A-4.3-480x272, UEDX80480050E-WB-A, UEDX80480070E-WB-A| 欢迎开发者和厂商贡献 PR 来添加更多的开发板,详细说明请参考 [`开发板贡献指南`](./docs/Board_Contribution_Guide_CN.md)。 From 6d9fd6017986ea39e804d5baf489d3dd8c3873dd Mon Sep 17 00:00:00 2001 From: VIEWE-CN Date: Thu, 28 Nov 2024 14:43:16 +0800 Subject: [PATCH 21/24] Modify the configuration file --- ESP_Panel_Board_Supported.h | 37 +++++++++++++++ .../v8/Rotation/ESP_Panel_Board_Supported.h | 47 +++++++++---------- .../PanelTest/ESP_Panel_Board_Supported.h | 47 +++++++++---------- .../src/ESP_Panel_Board_Supported.h | 47 +++++++++---------- .../v8/Porting/ESP_Panel_Board_Supported.h | 47 +++++++++---------- .../v8/WiFiClock/ESP_Panel_Board_Supported.h | 47 +++++++++---------- 6 files changed, 147 insertions(+), 125 deletions(-) diff --git a/ESP_Panel_Board_Supported.h b/ESP_Panel_Board_Supported.h index ba8fba0f..339d47ac 100644 --- a/ESP_Panel_Board_Supported.h +++ b/ESP_Panel_Board_Supported.h @@ -97,6 +97,43 @@ // #define BOARD_WAVESHARE_ESP32_S3_Touch_LCD_7 // #define BOARD_WAVESHARE_ESP32_P4_NANO +/* + * VIEWE Supported Boards (https://viewedisplay.com/): + * + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ + * + */ + +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 + +/* +The following products control IM through software +*/ +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) +#define IM +#define IM0 47 +#define IM1 48 +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 diff --git a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/PlatformIO/src/ESP_Panel_Board_Supported.h +++ b/examples/PlatformIO/src/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h index e5e6716a..339d47ac 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Supported.h @@ -100,38 +100,35 @@ /* * VIEWE Supported Boards (https://viewedisplay.com/): * - * - BOARD_VIEWE_ESP_S3_Touch_LCD_24(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_28(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1(UEDX24320028E-WB-A):https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2(UEDX24320028E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_40(UEDX48480040E-WB-A):https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2(UEDX48240070E-WB-A):https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf - * - BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1(UEDX80480050E-WB-A):https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ - * - BOARD_VIEWE_ESP_S3_Touch_LCD_70(UEDX80480070E-WB-A):https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ - * - * Where () is the model of the board, some boards are suitable for more than one screen, - * so the name after adding the screen will be different from the name of the individual board + * - BOARD_UEDX24320028E_WB_A_2_4:https://viewedisplay.com/product/esp32-2-4-inch-240x320-rgb-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_2_8:https://viewedisplay.com/product/esp32-2-8-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_240_320:https://viewedisplay.com/product/esp32-3-5-inch-240x320-mcu-ips-tft-display-touch-screen-arduino-lvgl-wifi-ble-uart-smart-module/ + * - BOARD_UEDX24320028E_WB_A_3_5_320_480:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_UEDX48480040E_WB_A_4_0:https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_800_480:https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480043E_WB_A_4_3_480_272:https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/4.3inch/Low-Resolution_480272/UEDX48270043E-WB-A%20SPEC.pdf + * - BOARD_UEDX80480050E_WB_A_5_0:https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_UEDX80480070E_WB_A_7_0:https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ * */ -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_24 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_28 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1 //The resolution is 240*320 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2 //The resolution is 320*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_40 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V1 //The resolution is 800*480 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_43_V2 //The resolution is 480*272 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_50_V1 -// #define BOARD_VIEWE_ESP_S3_Touch_LCD_70 +// #define BOARD_UEDX24320028E_WB_A_2_4 +// #define BOARD_UEDX24320028E_WB_A_2_8 +// #define BOARD_UEDX24320028E_WB_A_3_5_240_320 //The resolution is 240*320 +// #define BOARD_UEDX24320028E_WB_A_3_5_320_480 //The resolution is 320*480 +// #define BOARD_UEDX48480040E_WB_A_4_0 +// #define BOARD_UEDX80480043E_WB_A_4_3_800_480 //The resolution is 800*480 +// #define BOARD_UEDX80480043E_WB_A_4_3_480_272 //The resolution is 480*272 +// #define BOARD_UEDX80480050E_WB_A_5_0 +// #define BOARD_UEDX80480070E_WB_A_7_0 /* The following products control IM through software */ -#if defined(BOARD_VIEWE_ESP_S3_Touch_LCD_24) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_28) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V1) || \ - defined(BOARD_VIEWE_ESP_S3_Touch_LCD_35_V2) +#if defined(BOARD_UEDX24320028E_WB_A_2_4) || \ + defined(BOARD_UEDX24320028E_WB_A_2_8) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_240_320) || \ + defined(BOARD_UEDX24320028E_WB_A_3_5_320_480) #define IM #define IM0 47 #define IM1 48 From 5772d1c4486cf3898558d2833bb3ffc319c2b4fb Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Wed, 25 Dec 2024 10:42:50 +0800 Subject: [PATCH 22/24] Update FAQ.md --- docs/FAQ.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 726f8507..ac1ebc69 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -11,6 +11,7 @@ - [Where are the installation directory for arduino-esp32 and the SDK located?](#where-are-the-installation-directory-for-arduino-esp32-and-the-sdk-located) - [How to fix screen drift issue when driving RGB LCD with ESP32-S3?](#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3) - [How to Use ESP32\_Display\_Panel on PlatformIO?](#how-to-use-esp32_display_panel-on-platformio) + - [How to add an LVGL library and how to configure?](#How-to-add-an-LVGL-library-and-how-to-configure) ## Where is the directory for Arduino libraries? @@ -82,3 +83,5 @@ When encountering screen drift issue when driving RGB LCD with ESP32-S3, you can ## How to Use ESP32_Display_Panel on PlatformIO? You can refer to the example [PlatformIO](../examples/PlatformIO/) to use the ESP32_Display_Panel library in PlatformIO. By default, it is suitable for the **ESP32-S3-LCD-EV-Board** and **ESP32-S3-LCD-EV-Board-2** development boards. You need to modify the [boards/ESP-LCD.json](../examples/PlatformIO/boards/ESP-LCD.json) file according to the actual situation. + +## How to add an LVGL library and how to configure? From e2f6b46ee200771f5df76f004a6863a480642fd4 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Wed, 25 Dec 2024 11:49:54 +0800 Subject: [PATCH 23/24] Update FAQ.md --- docs/FAQ.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index ac1ebc69..cd31d453 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -85,3 +85,70 @@ When encountering screen drift issue when driving RGB LCD with ESP32-S3, you can You can refer to the example [PlatformIO](../examples/PlatformIO/) to use the ESP32_Display_Panel library in PlatformIO. By default, it is suitable for the **ESP32-S3-LCD-EV-Board** and **ESP32-S3-LCD-EV-Board-2** development boards. You need to modify the [boards/ESP-LCD.json](../examples/PlatformIO/boards/ESP-LCD.json) file according to the actual situation. ## How to add an LVGL library and how to configure? +* How to use it normally + 1.Download the LVGL library in Arduino, it is best to choose the `V8.4.0` version. + + 2.Find the downloaded LVGL library, copy and paste the `lv_conf_template.h` file into the same directory as the LVGL library. + + 3.Change the `lv_conf_template.h` file name to `lv_conf.h`. + + 4.Open `lv_conf.h` to modify the macro definition and save: `#if 0`--> `#if 1` + ```c + ... + /* clang-format off */ + #if 1 /*Set it to "1" to enable content*/ + + #ifndef LV_CONF_H + #define LV_CONF_H + + #include + ... + ``` +* How to use the examples and demos in lvgl + + please open the corresponding macros + ```c + ... + /*================== + * EXAMPLES + *==================*/ + + /*Enable the examples to be built with the library*/ + #define LV_BUILD_EXAMPLES 1 + + /*=================== + * DEMO USAGE + ====================*/ + + /*Show some widget. It might be required to increase `LV_MEM_SIZE` */ + #define LV_USE_DEMO_WIDGETS 1 + #if LV_USE_DEMO_WIDGETS + #define LV_DEMO_WIDGETS_SLIDESHOW 0 + #endif + + /*Demonstrate the usage of encoder and keyboard*/ + #define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + + /*Benchmark your system*/ + #define LV_USE_DEMO_BENCHMARK 0 + #if LV_USE_DEMO_BENCHMARK + /*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/ + #define LV_DEMO_BENCHMARK_RGB565A8 0 + #endif + + /*Stress test for LVGL*/ + #define LV_USE_DEMO_STRESS 0 + + /*Music player demo*/ + #define LV_USE_DEMO_MUSIC 0 + #if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 + #endif + + ... + ``` + From cffaac5d1e9dd0ab210026e91ddb3c668e7f7ad5 Mon Sep 17 00:00:00 2001 From: VIEWESMART Date: Wed, 25 Dec 2024 11:50:40 +0800 Subject: [PATCH 24/24] Update FAQ.md --- docs/FAQ.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index cd31d453..32e01477 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -86,6 +86,7 @@ You can refer to the example [PlatformIO](../examples/PlatformIO/) to use the ES ## How to add an LVGL library and how to configure? * How to use it normally + 1.Download the LVGL library in Arduino, it is best to choose the `V8.4.0` version. 2.Find the downloaded LVGL library, copy and paste the `lv_conf_template.h` file into the same directory as the LVGL library.