diff --git a/README.md b/README.md index 377a225c..630f97f4 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ The functional block diagram is shown below: | [Jingcai](./docs/board/board_jingcai.md) | ESP32-4848S040C_I_Y_3 | | [Waveshare](./docs/board/board_waveshare.md) | ESP32-S3-Touch-LCD-1.85, ESP32-S3-Touch-LCD-2.1, ESP32-S3-Touch-LCD-2.8C, 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/board_viewe.md) | UEDX24320024E-WB-A, UEDX24320028E-WB-A, UEDX24320035E-WB-A, UEDX32480035E-WB-A, UEDX48270043E-WB-A, UEDX48480040E-WB-A, UEDX80480043E-WB-A, UEDX80480050E-WB-A, UEDX80480070E-WB-A | +| Wireless-Tag | WTP4C5MP07S | 📌 Click on the manufacturer name for detailed information. diff --git a/esp_panel_board_supported_conf.h b/esp_panel_board_supported_conf.h index b25171bb..34b37fef 100644 --- a/esp_panel_board_supported_conf.h +++ b/esp_panel_board_supported_conf.h @@ -164,6 +164,13 @@ // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A +/* + * Wireless-Tag (https://www.wireless-tag.com/): + * + * -BOARD_WIRELESSTAG_WTP4C5MP07S (WTP4C5MP07S): https://shop.wireless-tag.com/products/7inch-lcd-touch-screen-1024x600-mipi-smart-displays-wtp4c5mp07s-esp32-lcd-board-used-with-esp32-p4-and-esp32-c5-dev-board + */ +// #define BOARD_WIRELESSTAG_WTP4C5MP07S + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/examples/arduino/board/board_static_config/esp_panel_board_supported_conf.h b/examples/arduino/board/board_static_config/esp_panel_board_supported_conf.h index b25171bb..34b37fef 100644 --- a/examples/arduino/board/board_static_config/esp_panel_board_supported_conf.h +++ b/examples/arduino/board/board_static_config/esp_panel_board_supported_conf.h @@ -164,6 +164,13 @@ // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A +/* + * Wireless-Tag (https://www.wireless-tag.com/): + * + * -BOARD_WIRELESSTAG_WTP4C5MP07S (WTP4C5MP07S): https://shop.wireless-tag.com/products/7inch-lcd-touch-screen-1024x600-mipi-smart-displays-wtp4c5mp07s-esp32-lcd-board-used-with-esp32-p4-and-esp32-c5-dev-board + */ +// #define BOARD_WIRELESSTAG_WTP4C5MP07S + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/board/supported/Kconfig.board_supported b/src/board/supported/Kconfig.board_supported index c07412c3..9783f9b1 100644 --- a/src/board/supported/Kconfig.board_supported +++ b/src/board/supported/Kconfig.board_supported @@ -36,6 +36,11 @@ choice bool "VIEWE" help https://viewedisplay.com/ + + config ESP_PANEL_BOARD_MANUFACTURER_WIRELESSTAG + bool "Wireless-Tag" + help + https://www.wireless-tag.com/ endchoice choice @@ -64,4 +69,8 @@ choice if ESP_PANEL_BOARD_MANUFACTURER_VIEWE || ESP_PANEL_BOARD_MANUFACTURER_ALL orsource "./viewe/Kconfig.viewe" endif + + if ESP_PANEL_BOARD_MANUFACTURER_WIRELESSTAG || ESP_PANEL_BOARD_MANUFACTURER_ALL + orsource "./wirelesstag/Kconfig.wirelesstag" + endif endchoice diff --git a/src/board/supported/esp_panel_board_config_supported.h b/src/board/supported/esp_panel_board_config_supported.h index fd919212..d747fcec 100644 --- a/src/board/supported/esp_panel_board_config_supported.h +++ b/src/board/supported/esp_panel_board_config_supported.h @@ -120,6 +120,8 @@ + defined(BOARD_VIEWE_UEDX80480050E_WB_A_2) \ + defined(BOARD_VIEWE_UEDX80480050E_AC_A) \ + defined(BOARD_VIEWE_UEDX80480070E_WB_A) \ + /* Wireless-Tag */ \ + + defined(BOARD_WIRELESSTAG_WTP4C5MP07S) \ > 1 #error "Multiple boards enabled! Please check file `esp_panel_board_supported_conf.h` and make sure only one board is enabled." #endif @@ -225,6 +227,9 @@ #include "viewe/BOARD_VIEWE_UEDX80480050E_AC_A.h" #elif defined(BOARD_VIEWE_UEDX80480070E_WB_A) #include "viewe/BOARD_VIEWE_UEDX80480070E_WB_A.h" + /* Wireless-Tag */ + #elif defined(BOARD_WIRELESSTAG_WTP4C5MP07S) + #include "wirelesstag/BOARD_WIRELESSTAG_WTP4C5MP07S.h" #else #error "Unknown board selected!" #endif diff --git a/src/board/supported/esp_panel_board_kconfig_supported.h b/src/board/supported/esp_panel_board_kconfig_supported.h index ad9f9165..a88a3294 100644 --- a/src/board/supported/esp_panel_board_kconfig_supported.h +++ b/src/board/supported/esp_panel_board_kconfig_supported.h @@ -273,4 +273,11 @@ #endif #endif +// Wireless-Tag +#ifndef BOARD_WIRELESSTAG_WTP4C5MP07S + #ifdef CONFIG_BOARD_WIRELESSTAG_WTP4C5MP07S + #define BOARD_WIRELESSTAG_WTP4C5MP07S CONFIG_BOARD_WIRELESSTAG_WTP4C5MP07S + #endif +#endif + // *INDENT-ON* diff --git a/src/board/supported/wirelesstag/BOARD_WIRELESSTAG_WTP4C5MP07S.h b/src/board/supported/wirelesstag/BOARD_WIRELESSTAG_WTP4C5MP07S.h new file mode 100644 index 00000000..5087290d --- /dev/null +++ b/src/board/supported/wirelesstag/BOARD_WIRELESSTAG_WTP4C5MP07S.h @@ -0,0 +1,284 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_WIRELESSTAG_WTP4C5MP07S.h + * @brief Configuration file for Wireless-Tag WTP4C5MP07S + * @author @lyusupov + * @link https://shop.wireless-tag.com/products/7inch-lcd-touch-screen-1024x600-mipi-smart-displays-wtp4c5mp07s-esp32-lcd-board-used-with-esp32-p4-and-esp32-c5-dev-board + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Wireless-Tag:WTP4C5MP07S" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (1024) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (600) // Panel height (vertical, in pixels) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure the LCD panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief LCD panel configuration flag (0/1) + * + * Set to `1` to enable LCD panel support, `0` to disable + */ +#define ESP_PANEL_BOARD_USE_LCD (1) + +#if ESP_PANEL_BOARD_USE_LCD +/** + * @brief LCD controller selection + */ +#define ESP_PANEL_BOARD_LCD_CONTROLLER EK79007 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_MIPI_DSI) + +/** + * @brief LCD bus parameters configuration + * + * Configure parameters based on the selected bus type. Parameters for other bus types will be ignored. + * For detailed parameter explanations, see: + * https://docs.espressif.com/projects/esp-idf/en/v5.3.1/esp32s3/api-reference/peripherals/lcd/index.html + * https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/index.html + */ +#if ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_MIPI_DSI + + /** + * @brief MIPI DSI bus + */ + /* For host */ + #define ESP_PANEL_BOARD_LCD_MIPI_DSI_LANE_NUM (2) // ESP32-P4 supports 1 or 2 lanes + #define ESP_PANEL_BOARD_LCD_MIPI_DSI_LANE_RATE_MBPS (1000) // Single lane bit rate, should check the LCD drive IC + // datasheet for the supported lane rate. Different + // color format (RGB565/RGB888) may have different + // lane bit rate requirements. + // ESP32-P4 supports max 1500Mbps + /* For refresh panel (DPI) */ + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_CLK_MHZ (52) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) + // ESP_PANEL_LCD_COLOR_BITS_RGB565/RGB666/RGB888 + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_HPW (10) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_HBP (160) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_HFP (160) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_VPW (1) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_VBP (23) + #define ESP_PANEL_BOARD_LCD_MIPI_DPI_VFP (12) + /* For DSI power PHY */ + #define ESP_PANEL_BOARD_LCD_MIPI_PHY_LDO_ID (3) // -1 if not used. + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +/** + * @brief 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. + * + * The initialization sequence can be specified in two formats: + * 1. Raw format: + * {command, (uint8_t []){data0, data1, ...}, data_size, delay_ms} + * 2. Helper macros: + * - ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(delay_ms, command, {data0, data1, ...}) + * - ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(delay_ms, command) + */ +/* +#define ESP_PANEL_BOARD_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), \ + } +*/ + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) + // ESP_PANEL_LCD_COLOR_BITS_RGB565/RGB666/RGB888 +#define ESP_PANEL_BOARD_LCD_COLOR_BGR_ORDER (0) // 0: RGB, 1: BGR +#define ESP_PANEL_BOARD_LCD_COLOR_INEVRT_BIT (0) // 0/1 + +/** + * @brief LCD transformation configuration + */ +#define ESP_PANEL_BOARD_LCD_SWAP_XY (0) // 0/1 +#define ESP_PANEL_BOARD_LCD_MIRROR_X (0) // 0/1 +#define ESP_PANEL_BOARD_LCD_MIRROR_Y (0) // 0/1 +#define ESP_PANEL_BOARD_LCD_GAP_X (0) // [0, ESP_PANEL_BOARD_WIDTH] +#define ESP_PANEL_BOARD_LCD_GAP_Y (0) // [0, ESP_PANEL_BOARD_HEIGHT] + +/** + * @brief LCD reset pin configuration + */ +#define ESP_PANEL_BOARD_LCD_RST_IO (23) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (1) // Reset active level, 0: low, 1: high + +#endif // ESP_PANEL_BOARD_USE_LCD + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure the touch panel /////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Touch panel configuration flag (0/1) + * + * Set to `1` to enable touch panel support, `0` to disable + */ +#define ESP_PANEL_BOARD_USE_TOUCH (1) + +#if ESP_PANEL_BOARD_USE_TOUCH +/** + * @brief Touch controller selection + */ +#define ESP_PANEL_BOARD_TOUCH_CONTROLLER GT911 + +/** + * @brief Touch bus type selection + */ +#define ESP_PANEL_BOARD_TOUCH_BUS_TYPE (ESP_PANEL_BUS_TYPE_I2C) + +#if (ESP_PANEL_BOARD_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C) || \ + (ESP_PANEL_BOARD_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI) +/** + * If set to 1, the bus will skip to initialize the corresponding host. Users need to initialize the host in advance. + * + * For drivers which created by this library, even if they use the same host, the host will be initialized only once. + * So it is not necessary to set the macro to `1`. For other drivers (like `Wire`), please set the macro to `1` + * ensure that the host is initialized only once. + */ +#define ESP_PANEL_BOARD_TOUCH_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0 +#endif + +/** + * @brief Touch bus parameters configuration + */ +#if ESP_PANEL_BOARD_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_I2C + + /** + * @brief I2C bus + */ + /* For general */ + #define ESP_PANEL_BOARD_TOUCH_I2C_HOST_ID (0) // Typically set to 0 +#if !ESP_PANEL_BOARD_TOUCH_BUS_SKIP_INIT_HOST + /* For host */ + #define ESP_PANEL_BOARD_TOUCH_I2C_CLK_HZ (400 * 1000) + // Typically set to 400K + #define ESP_PANEL_BOARD_TOUCH_I2C_SCL_PULLUP (0) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (0) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (8) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (7) +#endif + /* For panel */ + #define ESP_PANEL_BOARD_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 + +#endif // ESP_PANEL_BOARD_TOUCH_BUS_TYPE + +/** + * @brief Touch panel transformation flags + */ +#define ESP_PANEL_BOARD_TOUCH_SWAP_XY (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_X (1) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (1) // 0/1 + +/** + * @brief Touch panel control pins + */ +#define ESP_PANEL_BOARD_TOUCH_RST_IO (-1) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_TOUCH_RST_LEVEL (1) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (21) // Interrupt pin, -1 if not used +#define ESP_PANEL_BOARD_TOUCH_INT_LEVEL (0) // Interrupt active level, 0: low, 1: high + +#endif // ESP_PANEL_BOARD_USE_TOUCH + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// Please update the following macros to configure the backlight //////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Backlight configuration flag (0/1) + * + * Set to `1` to enable backlight support, `0` to disable + */ +#define ESP_PANEL_BOARD_USE_BACKLIGHT (1) + +#if ESP_PANEL_BOARD_USE_BACKLIGHT +/** + * @brief Backlight control type selection + */ +#define ESP_PANEL_BOARD_BACKLIGHT_TYPE (ESP_PANEL_BACKLIGHT_TYPE_SWITCH_GPIO) + +#if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_SWITCH_GPIO) || \ + (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_SWITCH_EXPANDER) || \ + (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC) + + /** + * @brief Backlight control pin configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_IO (20) // Output GPIO pin number + #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high + +#endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE + +/** + * @brief Backlight idle state configuration (0/1) + * + * Set to 1 if want to turn off the backlight after initializing. Otherwise, the backlight will be on. + */ +#define ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF (0) + +#endif // ESP_PANEL_BOARD_USE_BACKLIGHT + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////// Please update the following macros to configure the IO expander ////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief IO expander configuration flag (0/1) + * + * Set to `1` to enable IO expander support, `0` to disable + */ +#define ESP_PANEL_BOARD_USE_EXPANDER (0) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////// Please utilize the following macros to execute any additional code if required ///////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * Do not change the following versions. These version numbers are used to check compatibility between this + * configuration file and the library. Rules for version numbers: + * 1. Major version mismatch: Configurations are incompatible, must use library version + * 2. Minor version mismatch: May be missing new configurations, recommended to update + * 3. Patch version mismatch: No impact on functionality + */ +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/wirelesstag/Kconfig.wirelesstag b/src/board/supported/wirelesstag/Kconfig.wirelesstag new file mode 100644 index 00000000..8b3eac7a --- /dev/null +++ b/src/board/supported/wirelesstag/Kconfig.wirelesstag @@ -0,0 +1,4 @@ +config BOARD_WIRELESSTAG_WTP4C5MP07S + bool "Wireless-Tag WTP4C5MP07S (with 7-inch 1024x600 LCD)" + help + https://shop.wireless-tag.com/products/7inch-lcd-touch-screen-1024x600-mipi-smart-displays-wtp4c5mp07s-esp32-lcd-board-used-with-esp32-p4-and-esp32-c5-dev-board