From 8803abe216811f572d056f4270cb20d39b126194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 16:59:34 +0200 Subject: [PATCH 01/15] Driver for the EK9716BD3 EK9716 is a highly integrated 1200 channel source driver with TTL interface Timing Controller for color TFT-LCD panels. EK9716 integrated source driver, timing controller and pin control interface. --- src/lcd/EK9716BD3.cpp | 87 +++++++++++++++++++++++++++++++++++++++++++ src/lcd/EK9716BD3.h | 66 ++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 src/lcd/EK9716BD3.cpp create mode 100644 src/lcd/EK9716BD3.h diff --git a/src/lcd/EK9716BD3.cpp b/src/lcd/EK9716BD3.cpp new file mode 100644 index 00000000..aca2473c --- /dev/null +++ b/src/lcd/EK9716BD3.cpp @@ -0,0 +1,87 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/soc_caps.h" + +#if SOC_LCD_RGB_SUPPORTED +#include "driver/gpio.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_check.h" +#include "esp_lcd_panel_io.h" +#include "esp_lcd_panel_rgb.h" +#include "esp_lcd_panel_vendor.h" +#include "esp_log.h" + +#include "ESP_PanelLog.h" +#include "bus/RGB.h" +#include "EK9716BD3.h" + +static const char *TAG = "EK9716BD3_CPP"; + +ESP_PanelLcd_EK9716BD3::ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, uint8_t color_bits, int rst_io): + ESP_PanelLcd(bus, color_bits, rst_io) +{ +} + +ESP_PanelLcd_EK9716BD3::ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config): + ESP_PanelLcd(bus, panel_config) +{ +} + +ESP_PanelLcd_EK9716BD3::~ESP_PanelLcd_EK9716BD3() +{ + 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_PanelLcd_EK9716BD3::init(void) +{ + ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); + + if (panel_config.reset_gpio_num >= 0) { + gpio_config_t gpio_conf = { + .pin_bit_mask = BIT64(panel_config.reset_gpio_num), + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = GPIO_PULLUP_DISABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, + }; + ESP_PANEL_CHECK_ERR_RET(gpio_config(&gpio_conf), false, "`Config RST gpio failed"); + } + ESP_PANEL_CHECK_ERR_RET(esp_lcd_new_rgb_panel(vendor_config.rgb_config, &handle), false, "Create panel failed"); + + ESP_LOGD(TAG, "LCD panel @%p created", handle); + + return true; +} + +bool ESP_PanelLcd_EK9716BD3::reset(void) +{ + ESP_PANEL_CHECK_NULL_RET(handle, false, "Invalid handle"); + + if (panel_config.reset_gpio_num >= 0) { + gpio_set_level((gpio_num_t)panel_config.reset_gpio_num, panel_config.flags.reset_active_high); + vTaskDelay(pdMS_TO_TICKS(10)); + gpio_set_level((gpio_num_t)panel_config.reset_gpio_num, !panel_config.flags.reset_active_high); + vTaskDelay(pdMS_TO_TICKS(120)); + } + ESP_PANEL_CHECK_ERR_RET(esp_lcd_panel_reset(handle), false, "Reset panel failed"); + + return true; +} + +#endif /* SOC_LCD_RGB_SUPPORTED */ diff --git a/src/lcd/EK9716BD3.h b/src/lcd/EK9716BD3.h new file mode 100644 index 00000000..d99ccb0e --- /dev/null +++ b/src/lcd/EK9716BD3.h @@ -0,0 +1,66 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "soc/soc_caps.h" + +#if SOC_LCD_RGB_SUPPORTED +#include "ESP_PanelLcd.h" + +/** + * @brief EK9716BD3 LCD device object class + * + * @note This class is a derived class of `ESP_PanelLcd`, user can use it directly + */ +class ESP_PanelLcd_EK9716BD3: public ESP_PanelLcd { +public: + /** + * @brief Construct a new LCD device in a simple way, the `init()` function should be called after this function + * + * @note This function uses some default values to config the LCD device, please use `config*()` functions to + * change them + * + * @param bus Pointer of panel bus + * @param color_bits Bits per pixel (24) + * @param rst_io Reset pin, set to `-1` if no use + */ + ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, uint8_t color_bits, int rst_io = -1); + + /** + * @brief Construct a new LCD device in a complex way, the `init()` function should be called after this function + * + * @param bus Pointer of panel bus + * @param panel_config LCD device configuration + */ + ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config); + + /** + * @brief Destroy the LCD device + * + */ + ~ESP_PanelLcd_EK9716BD3() override; + + /** + * @brief Initialize the LCD device, the `begin()` function should be called after this function + * + * @note This function typically calls `esp_lcd_new_panel_*()` to create the LCD panel handle + * + * @return true if success, otherwise false + */ + bool init(void) override; + + /** + * @brief Reset the LCD. If the `rst_io` is not set, this function will do reset by software instead of hardware + * + * @note This function should be called after `init()` + * + * @return true if success, otherwise false + */ + bool reset(void); +}; + +#endif /* SOC_LCD_RGB_SUPPORTED */ From 5cb4b76f266d8010ebcbb41f60fe602c22a261a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:06:49 +0200 Subject: [PATCH 02/15] Update ESP_Panel_Library.h to add EK9716B --- src/ESP_Panel_Library.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ESP_Panel_Library.h b/src/ESP_Panel_Library.h index 33c0f090..a602f15b 100644 --- a/src/ESP_Panel_Library.h +++ b/src/ESP_Panel_Library.h @@ -24,6 +24,7 @@ /* LCD */ #include "lcd/ESP_PanelLcd.h" +#include "lcd/EK9716B.h" #include "lcd/GC9503.h" #include "lcd/GC9A01.h" #include "lcd/GC9B71.h" From e456c1fbc0f23b3455af1115c0eb80402b72510a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:07:02 +0200 Subject: [PATCH 03/15] Rename EK9716BD3.cpp to EK9716B.cpp --- src/lcd/{EK9716BD3.cpp => EK9716B.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/lcd/{EK9716BD3.cpp => EK9716B.cpp} (100%) diff --git a/src/lcd/EK9716BD3.cpp b/src/lcd/EK9716B.cpp similarity index 100% rename from src/lcd/EK9716BD3.cpp rename to src/lcd/EK9716B.cpp From a3dbf87b199615e85411fb8cb872fef8967f1519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:07:15 +0200 Subject: [PATCH 04/15] Rename EK9716BD3.h to EK9716B.h --- src/lcd/{EK9716BD3.h => EK9716B.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/lcd/{EK9716BD3.h => EK9716B.h} (100%) diff --git a/src/lcd/EK9716BD3.h b/src/lcd/EK9716B.h similarity index 100% rename from src/lcd/EK9716BD3.h rename to src/lcd/EK9716B.h From 5f5964e2b6d0b18122a326082777a4a9bd2262a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:13:09 +0200 Subject: [PATCH 05/15] Update EK9716B.cpp --- src/lcd/EK9716B.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lcd/EK9716B.cpp b/src/lcd/EK9716B.cpp index aca2473c..0495c7b3 100644 --- a/src/lcd/EK9716B.cpp +++ b/src/lcd/EK9716B.cpp @@ -18,21 +18,21 @@ #include "ESP_PanelLog.h" #include "bus/RGB.h" -#include "EK9716BD3.h" +#include "EK9716B.h" -static const char *TAG = "EK9716BD3_CPP"; +static const char *TAG = "EK9716B_CPP"; -ESP_PanelLcd_EK9716BD3::ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, uint8_t color_bits, int rst_io): +ESP_PanelLcd_EK9716B::ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, uint8_t color_bits, int rst_io): ESP_PanelLcd(bus, color_bits, rst_io) { } -ESP_PanelLcd_EK9716BD3::ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config): +ESP_PanelLcd_EK9716B::ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config): ESP_PanelLcd(bus, panel_config) { } -ESP_PanelLcd_EK9716BD3::~ESP_PanelLcd_EK9716BD3() +ESP_PanelLcd_EK9716B::~ESP_PanelLcd_EK9716B() { ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); @@ -48,7 +48,7 @@ ESP_PanelLcd_EK9716BD3::~ESP_PanelLcd_EK9716BD3() ESP_LOGD(TAG, "Destroyed"); } -bool ESP_PanelLcd_EK9716BD3::init(void) +bool ESP_PanelLcd_EK9716B::init(void) { ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); @@ -69,7 +69,7 @@ bool ESP_PanelLcd_EK9716BD3::init(void) return true; } -bool ESP_PanelLcd_EK9716BD3::reset(void) +bool ESP_PanelLcd_EK9716B::reset(void) { ESP_PANEL_CHECK_NULL_RET(handle, false, "Invalid handle"); From 4c224429422c6a7fa26c903bd2cc25af9803228b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:13:21 +0200 Subject: [PATCH 06/15] Update EK9716B.h --- src/lcd/EK9716B.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lcd/EK9716B.h b/src/lcd/EK9716B.h index d99ccb0e..53cc4eb4 100644 --- a/src/lcd/EK9716B.h +++ b/src/lcd/EK9716B.h @@ -12,11 +12,11 @@ #include "ESP_PanelLcd.h" /** - * @brief EK9716BD3 LCD device object class + * @brief EK9716B LCD device object class * * @note This class is a derived class of `ESP_PanelLcd`, user can use it directly */ -class ESP_PanelLcd_EK9716BD3: public ESP_PanelLcd { +class ESP_PanelLcd_EK9716B: public ESP_PanelLcd { public: /** * @brief Construct a new LCD device in a simple way, the `init()` function should be called after this function @@ -28,7 +28,7 @@ class ESP_PanelLcd_EK9716BD3: public ESP_PanelLcd { * @param color_bits Bits per pixel (24) * @param rst_io Reset pin, set to `-1` if no use */ - ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, uint8_t color_bits, int rst_io = -1); + ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, uint8_t color_bits, int rst_io = -1); /** * @brief Construct a new LCD device in a complex way, the `init()` function should be called after this function @@ -36,13 +36,13 @@ class ESP_PanelLcd_EK9716BD3: public ESP_PanelLcd { * @param bus Pointer of panel bus * @param panel_config LCD device configuration */ - ESP_PanelLcd_EK9716BD3(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config); + ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config); /** * @brief Destroy the LCD device * */ - ~ESP_PanelLcd_EK9716BD3() override; + ~ESP_PanelLcd_EK9716B() override; /** * @brief Initialize the LCD device, the `begin()` function should be called after this function From 023a1efce596a7d26b1531f83b460d9cae9af31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:18:35 +0200 Subject: [PATCH 07/15] Update LCD_Controllers.md --- docs/LCD_Controllers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/LCD_Controllers.md b/docs/LCD_Controllers.md index 8f6208ea..b916bb69 100644 --- a/docs/LCD_Controllers.md +++ b/docs/LCD_Controllers.md @@ -15,3 +15,4 @@ | [ST7796](https://components.espressif.com/components/espressif/esp_lcd_st7796) | 1.2.1 | | [ST77916](https://components.espressif.com/components/espressif/esp_lcd_st77916) | 0.0.2 | | [ST77922](https://components.espressif.com/components/espressif/esp_lcd_st77922) | 0.0.2 | +| EK9716B | 0.1.6 | From 5e9a2093341693772e47ef3ac50da4cc4648bee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:29:09 +0200 Subject: [PATCH 08/15] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index e29ffed2..2f8a775e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP32_Display_Panel -version=0.1.5 +version=0.1.6 author=espressif maintainer=espressif sentence=ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development. From 0651fe81052591f37baef3dd358dc8b1a94f219a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 17:44:04 +0200 Subject: [PATCH 09/15] Update ESP_PanelVersions.h --- src/ESP_PanelVersions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h index ac7043f8..6d15df0f 100644 --- a/src/ESP_PanelVersions.h +++ b/src/ESP_PanelVersions.h @@ -11,7 +11,7 @@ /* Library Version */ #define ESP_PANEL_VERSION_MAJOR 0 #define ESP_PANEL_VERSION_MINOR 1 -#define ESP_PANEL_VERSION_PATCH 5 +#define ESP_PANEL_VERSION_PATCH 6 /* File `ESP_Panel_Conf.h` */ #define ESP_PANEL_CONF_VERSION_MAJOR 0 From a202ca128880081e2cea4b96555943f18b1120ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 18:02:33 +0200 Subject: [PATCH 10/15] Update README.md to add Fitipower EK9716B --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a24616bb..e37bdc9d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ Below is a list of [supported LCD controllers](docs/LCD_Controllers.md): | **Manufacturer** | **Model** | | --------------- | --------- | +| Fitipower | EK9716B | | GalaxyCore | GC9A01, GC9B71, GC9503 | | Ilitek | ILI9341 | | NewVision | NV3022B | From 763b4c0c2575866222152741f507148123511bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 25 Jul 2024 18:03:05 +0200 Subject: [PATCH 11/15] Update README_CN.md --- README_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_CN.md b/README_CN.md index 0f929db6..f7767f50 100644 --- a/README_CN.md +++ b/README_CN.md @@ -74,6 +74,7 @@ ESP32_Display_Panel 的功能框图如下所示,主要包含以下特性: | **厂商** | **型号** | | -------- | -------- | +| Fitipower | EK9716B | | GalaxyCore | GC9A01, GC9B71, GC9503 | | Ilitek | ILI9341 | | NewVision | NV3022B | From 4b8ec3a437b8b48b5d9d2b342d5c1fd054cc95f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 18:12:29 +0200 Subject: [PATCH 12/15] Update CROWPANEL_7_0.h board definition to work with EK9716B (#1) * Update CROWPANEL_7_0.h * Update library.properties * Update ESP_PanelVersions.h --- src/board/elecrow/CROWPANEL_7_0.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/board/elecrow/CROWPANEL_7_0.h b/src/board/elecrow/CROWPANEL_7_0.h index c8ccc6a8..8f0ebd87 100644 --- a/src/board/elecrow/CROWPANEL_7_0.h +++ b/src/board/elecrow/CROWPANEL_7_0.h @@ -18,7 +18,7 @@ /** * LCD Controller Name. */ -#define ESP_PANEL_LCD_NAME EK9716BD3 +#define ESP_PANEL_LCD_NAME EK9716B // Fitipower EK9716B /* LCD resolution in pixels */ #define ESP_PANEL_LCD_WIDTH (800) From 161148ea5eef5c6c63cfa311693582278b62efc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 18:15:28 +0200 Subject: [PATCH 13/15] Update Supported LCD Controllers for RGB example (#2) * Update Supported LCD Controllers for RGB example --- examples/LCD/RGB/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/LCD/RGB/README.md b/examples/LCD/RGB/README.md index e515bd60..ad2dfd7a 100644 --- a/examples/LCD/RGB/README.md +++ b/examples/LCD/RGB/README.md @@ -1,8 +1,12 @@ -| Supported ESP SoCs | ESP32-S3 | -| ------------------ | -------- | +| Supported ESP SoCs | +| ------------------ | +| ESP32-S3 | + +| Supported LCD Controllers | +| ------------------------- | +| EK9716B | +| ST7262 | -| Supported LCD Controllers | ST7262 | -| ------------------------- | ------ | # Single RGB LCD Example From 8ae7ef423e86dd85a33c7a8b5d5ea34ea738e8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sun, 28 Jul 2024 18:18:53 +0200 Subject: [PATCH 14/15] CROWPANEL: Remove the extra line causing the error during build (#3) --- src/board/elecrow/CROWPANEL_7_0.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/board/elecrow/CROWPANEL_7_0.h b/src/board/elecrow/CROWPANEL_7_0.h index 8f0ebd87..7556fe11 100644 --- a/src/board/elecrow/CROWPANEL_7_0.h +++ b/src/board/elecrow/CROWPANEL_7_0.h @@ -217,7 +217,6 @@ // #define ESP_PANEL_BEGIN_EXPANDER_START_FUNCTION( panel ) // #define ESP_PANEL_BEGIN_EXPANDER_END_FUNCTION( panel ) #define ESP_PANEL_BEGIN_LCD_START_FUNCTION( panel ) \ - { \ /* Maintain the touch INT signal in a low state during the reset process to set its I2C address to `0x5D` */ \ gpio_set_direction((gpio_num_t)ESP_PANEL_TOUCH_IO_INT, GPIO_MODE_OUTPUT); \ From 4be9844f5f79e996b62c4e291ed566873b748475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 29 Jul 2024 07:06:25 +0200 Subject: [PATCH 15/15] Update LCD_Controllers.md Co-authored-by: Zhongwei Liu <109257001+Lzw655@users.noreply.github.com> --- docs/LCD_Controllers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/LCD_Controllers.md b/docs/LCD_Controllers.md index b916bb69..0b306133 100644 --- a/docs/LCD_Controllers.md +++ b/docs/LCD_Controllers.md @@ -15,4 +15,4 @@ | [ST7796](https://components.espressif.com/components/espressif/esp_lcd_st7796) | 1.2.1 | | [ST77916](https://components.espressif.com/components/espressif/esp_lcd_st77916) | 0.0.2 | | [ST77922](https://components.espressif.com/components/espressif/esp_lcd_st77922) | 0.0.2 | -| EK9716B | 0.1.6 | +| EK9716B | - |