diff --git a/.github/workflows/issue_comment.yml b/.github/workflows/issue_comment.yml deleted file mode 100644 index 3b6fcc19..00000000 --- a/.github/workflows/issue_comment.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Sync issue comments to JIRA - -# This workflow will be triggered when new issue comment is created (including PR comments) -on: issue_comment - -# Limit to single concurrent run for workflows which can create Jira issues. -# Same concurrency group is used in new_issues.yml -concurrency: jira_issues - -jobs: - sync_issue_comments_to_jira: - name: Sync Issue Comments to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Sync issue comments to JIRA - uses: espressif/github-actions/sync_issues_to_jira@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }} - JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }} - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_issues.yml b/.github/workflows/new_issues.yml deleted file mode 100644 index f0fa4025..00000000 --- a/.github/workflows/new_issues.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Sync issues to Jira - -# This workflow will be triggered when a new issue is opened -on: issues - -# Limit to single concurrent run for workflows which can create Jira issues. -# Same concurrency group is used in issue_comment.yml -concurrency: jira_issues - -jobs: - sync_issues_to_jira: - name: Sync issues to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Sync GitHub issues to Jira project - uses: espressif/github-actions/sync_issues_to_jira@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }} - JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }} - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_prs.yml b/.github/workflows/new_prs.yml deleted file mode 100644 index 01d7fe26..00000000 --- a/.github/workflows/new_prs.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Sync remain PRs to Jira - -# This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project -# Note that, PRs can also get synced when new PR comment is created -on: - schedule: - - cron: "0 * * * *" - -# Limit to single concurrent run for workflows which can create Jira issues. -# Same concurrency group is used in issue_comment.yml -concurrency: jira_issues - -jobs: - sync_prs_to_jira: - name: Sync PRs to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Sync PRs to Jira project - uses: espressif/github-actions/sync_issues_to_jira@master - with: - cron_job: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }} - JIRA_COMPONENT: ${{ secrets.JIRA_COMPONENT }} - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa34ef28..32a2d4a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,14 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -exclude: '(libraries/ui/|lv_conf.h)' +exclude: '(libraries/ui/)' repos: - repo: https://github.com/igrr/astyle_py.git rev: v1.0.5 hooks: - id: astyle_py args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper'] + exclude: '(.*lv_conf.h)' - repo: https://github.com/espressif/check-copyright/ rev: v1.0.3 @@ -42,6 +43,7 @@ repos: .*_pb2.py| .*.pb-c.h| .*.pb-c.c| + .*lv_conf.h| .*.yuv )$ - id: end-of-file-fixer @@ -49,8 +51,10 @@ repos: - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - id: mixed-line-ending + exclude: *whitespace_excludes args: ['-f=lf'] - id: double-quote-string-fixer + exclude: *whitespace_excludes - id: no-commit-to-branch name: Do not use more than one slash in the branch name args: ['--pattern', '^[^/]*/[^/]*/'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 14c7f5a6..2bb4019b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,20 @@ # ChangeLog -## v1.0.3 - 2025-04-27 +## v1.0.3 - 2025-07-07 ### Enhancements: * feat(docs): provides an example of how to integrate this library into micropython by @tsteinruecken (#190) +* feat(board): add board Waveshare:ESP32_S3_TOUCH_LCD_1_85_C @hegdi (#208) +* feat(board & touch):add new supported viewe board and cst820 touch @VIEWESMART (#197) +* feat(examples): show the usage of 'configVendorCommands()' function in esp_idf/lvgl_v8_port @martinroger (#217) + +### Bugfixes: + +* fix(examples): lvgl_port_v8 only poll touch screen if interrupt happened @hegdi (#209) +* fix(examples): update lv_conf.h for Arduino IDE @davetheghost (#219) +* fix(lcd): correct conditional compilation logic for ST7701 driver @SinKy-Yan (#223) +* fix(board): correct the RGB IO mapping and backlight configuration for Jingcai:JC8048W550C @jompjomp (#210) ## v1.0.2 - 2025-04-23 diff --git a/README.md b/README.md index 1e6defd2..73cd1b16 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,14 @@ The functional block diagram is shown below: | **Manufacturer** | **Model** | | --------------- | --------- | | AXS | AXS15231B | -| Fitipower | EK9716B、EK79007 | -| GalaxyCore | GC9A01、GC9B71、GC9503 | +| Fitipower | EK9716B,EK79007 | +| GalaxyCore | GC9A01,GC9B71,GC9503 | | Himax | HX8399 | -| Ilitek | ILI9341、ILI9881C | -| JADARD | JD9165、JD9365 | +| Ilitek | ILI9341,ILI9881C | +| JADARD | JD9165,JD9365 | | NewVision | NV3022B | | SHENGHE | SH8601 | -| Sitronix | ST7262、ST7701、ST7703、ST7789、ST7796、ST77903、ST77916、ST77922 | +| Sitronix | ST7262,ST7701,ST7703,ST7789,ST7796,ST77903,ST77916,ST77922 | | Solomon Systech | SPD2010 | 📌 For detailed information, please refer to [Supported LCD Controllers](./docs/drivers/lcd.md). @@ -94,10 +94,10 @@ The functional block diagram is shown below: | AXS | AXS15231B | | Chipsemicorp | CHSC6540 | | FocalTech | FT5x06 | -| GOODiX | GT911、GT1151 | -| Hynitron | CST816S | +| GOODiX | GT911,GT1151 | +| Hynitron | CST816S,CST820 | | Parade | TT21100 | -| Sitronix | ST7123、ST1633 | +| Sitronix | ST7123,ST1633 | | Solomon Systech | SPD2010 | | ST | STMPE610 | | Xptek | XPT2046 | diff --git a/README_CN.md b/README_CN.md index 08364cf8..81666b9f 100644 --- a/README_CN.md +++ b/README_CN.md @@ -95,7 +95,7 @@ ESP32_Display_Panel 的主要特性如下: | Chipsemicorp | CHSC6540 | | FocalTech | FT5x06 | | GOODiX | GT911、GT1151 | -| Hynitron | CST816S | +| Hynitron | CST816S、CST820 | | Parade | TT21100 | | Sitronix | ST7123、ST1633 | | Solomon Systech | SPD2010 | diff --git a/check_copyright_config.yaml b/check_copyright_config.yaml index e397a788..8550c7e1 100644 --- a/check_copyright_config.yaml +++ b/check_copyright_config.yaml @@ -41,4 +41,4 @@ examples_and_unit_tests: ignore: # You can also select ignoring files here perform_check: no # Don't check files from that block include: - - 'examples/platformio/lvgl_v8_port/src/lv_conf.h' + - '**/**/lv_conf.h' diff --git a/docs/board/board_viewe.md b/docs/board/board_viewe.md index efd43575..d89d6f9e 100644 --- a/docs/board/board_viewe.md +++ b/docs/board/board_viewe.md @@ -4,6 +4,11 @@ | **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **LCD resolution** | **Touch Bus** | **Touch Controller** | | :--------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------: | :-------------------------------: | ------------------ | :-----------: | :------------------: | +| | [UEDX24240013-MD50E](https://viewedisplay.com/product/esp32-1-28-inch-240x240-round-tft-knob-display-gc9a01-arduino-lvgl/) | SPI | GC9A01 | 240x240 | | | +| | [UEDX46460015-MD50E](https://viewedisplay.com/product/esp32-1-5-inch-466x466-round-amoled-knob-display-touch-screen-arduino-lvgl/) | SPI | CO5300AF-42(like SH8601) | 466x466 | I2C | CST820 | +| | [VIEWE-SMARTRING](https://viewedisplay.com/product/esp32-1-8-inch-round-amoled-touch-display-arduino-lvgl-wifi-voice-assistant-ai-smart-displays/) | SPI | CO5300(like SH8601) | 466x466 | I2C | CST820 | +| | [UEDX48480021-MD80E](https://viewedisplay.com/product/esp32-2-1-inch-480x480-round-tft-knob-display-rotary-encoder-arduino-lvgl/) | SPI | GC9503 | 480x480 | | | +| | [UEDX48480021-MD80ET](https://viewedisplay.com/product/esp32-2-1-inch-480x480-round-tft-knob-touch-display-rotary-encoder-arduino-lvgl/) | SPI | ST7701S | 480x480 | I2C | CST826(like CST820) | | | [UEDX24320024E-WB-A](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](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 | | | [UEDX24320035E-WB-A](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 | @@ -22,17 +27,22 @@ Below are recommended configurations for developing GUI applications on differen 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. -| Supported Boards | Selected Board | PSRAM | Flash Mode | Flash Size | USB CDC On Boot | Partition Scheme | -| :----------------: | :----------------: | :---: | :--------: | :--------: | :-------------: | :--------------: | -| UEDX24320024E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| UEDX24320028E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| UEDX24320035E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| UEDX32480035E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | -| UEDX48270043E-WB-A | 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 | 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) | +| Supported Boards | Selected Board | PSRAM | Flash Mode | Flash Size | USB CDC On Boot | Partition Scheme | +| :-----------------: | :----------------: | :---: | :--------: | :--------: | :-------------: | :--------------: | +| UEDX24240013-MD50E | ESP32C3 Dev Module | OPI | QIO 80MHz | 4MB | Enabled | 4M | +| UEDX46460015-MD50E | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| VIEWE-SMARTRING | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX48480021-MD80E | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX48480021-MD80ET | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320024E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320028E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX24320035E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX32480035E-WB-A | ESP32S3 Dev Module | OPI | QIO 80MHz | 16MB | Enabled | 16M Flash (3MB) | +| UEDX48270043E-WB-A | 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 | 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) | > [!NOTE] > 1. Enable or disable `USB CDC On Boot` based on the type of port used: diff --git a/docs/drivers/touch.md b/docs/drivers/touch.md index 7c29347a..771b4d0b 100644 --- a/docs/drivers/touch.md +++ b/docs/drivers/touch.md @@ -3,15 +3,16 @@ | **Name** | **Version** | **I2C** | **SPI** | | :--------------------------------------------------------------------------------------: | :---------: | :-----: | :-----: | | [esp_lcd_touch](https://components.espressif.com/components/espressif/esp_lcd_touch) | 1.1.2 | | | -| AXS15231B | - | ✅ | | -| CHSC6540 | - | ✅ | | -| [CST816S](https://components.espressif.com/components/espressif/esp_lcd_touch_cst816s) | 1.0.3~1 | ✅ | | -| [FT5x06](https://components.espressif.com/components/espressif/esp_lcd_touch_ft5x06) | 1.0.6~1 | ✅ | | -| [GT911](https://components.espressif.com/components/espressif/esp_lcd_touch_gt911) | 1.1.1~1 | ✅ | | -| [GT1151](https://components.espressif.com/components/espressif/esp_lcd_touch_gt1151) | 1.0.5~2 | ✅ | | -| [SPD2010](https://components.espressif.com/components/espressif/esp_lcd_touch_spd2010) | 1.0.0 | ✅ | | -| ST1633 | 0.1.0 | ✅ | | -| [ST7123](https://components.espressif.com/components/espressif/esp_lcd_touch_st7123) | 1.0.0 | ✅ | | -| [STMPE610](https://components.espressif.com/components/espressif/esp_lcd_touch_stmpe610) | 1.0.6 | | ✅ | -| [TT21100](https://components.espressif.com/components/espressif/esp_lcd_touch_tt21100) | 1.1.0~1 | ✅ | | -| [XPT2046](https://components.espressif.com/components/atanisoft/esp_lcd_touch_xpt2046) | 1.0.5 | | ✅ | +| AXS15231B | - | ✅ | | +| CHSC6540 | - | ✅ | | +| [CST816S](https://components.espressif.com/components/espressif/esp_lcd_touch_cst816s) | 1.0.3~1 | ✅ | | +| CST820 | - | ✅ | | +| [FT5x06](https://components.espressif.com/components/espressif/esp_lcd_touch_ft5x06) | 1.0.6~1 | ✅ | | +| [GT911](https://components.espressif.com/components/espressif/esp_lcd_touch_gt911) | 1.1.1~1 | ✅ | | +| [GT1151](https://components.espressif.com/components/espressif/esp_lcd_touch_gt1151) | 1.0.5~2 | ✅ | | +| [SPD2010](https://components.espressif.com/components/espressif/esp_lcd_touch_spd2010) | 1.0.0 | ✅ | | +| ST1633 | 0.1.0 | ✅ | | +| [ST7123](https://components.espressif.com/components/espressif/esp_lcd_touch_st7123) | 1.0.0 | ✅ | | +| [STMPE610](https://components.espressif.com/components/espressif/esp_lcd_touch_stmpe610) | 1.0.6 | | ✅ | +| [TT21100](https://components.espressif.com/components/espressif/esp_lcd_touch_tt21100) | 1.1.0~1 | ✅ | | +| [XPT2046](https://components.espressif.com/components/atanisoft/esp_lcd_touch_xpt2046) | 1.0.5 | | ✅ | diff --git a/esp_panel_board_custom_conf.h b/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/esp_panel_board_custom_conf.h +++ b/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/esp_panel_board_supported_conf.h b/esp_panel_board_supported_conf.h index 3eb9292a..32bf5da8 100644 --- a/esp_panel_board_supported_conf.h +++ b/esp_panel_board_supported_conf.h @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/esp_panel_drivers_conf.h b/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/esp_panel_drivers_conf.h +++ b/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/board/board_dynamic_config/esp_panel_drivers_conf.h b/examples/arduino/board/board_dynamic_config/esp_panel_drivers_conf.h index bbf5d8b7..fbe4d5bf 100644 --- a/examples/arduino/board/board_dynamic_config/esp_panel_drivers_conf.h +++ b/examples/arduino/board/board_dynamic_config/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h b/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h +++ b/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM 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 3eb9292a..32bf5da8 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 @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/arduino/board/board_static_config/esp_panel_drivers_conf.h b/examples/arduino/board/board_static_config/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/board/board_static_config/esp_panel_drivers_conf.h +++ b/examples/arduino/board/board_static_config/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/lcd/lcd_3wire_spi_rgb/esp_panel_drivers_conf.h b/examples/arduino/drivers/lcd/lcd_3wire_spi_rgb/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/lcd/lcd_3wire_spi_rgb/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/lcd/lcd_3wire_spi_rgb/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/lcd/lcd_mipi_dsi/esp_panel_drivers_conf.h b/examples/arduino/drivers/lcd/lcd_mipi_dsi/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/lcd/lcd_mipi_dsi/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/lcd/lcd_mipi_dsi/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/lcd/lcd_qspi/esp_panel_drivers_conf.h b/examples/arduino/drivers/lcd/lcd_qspi/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/lcd/lcd_qspi/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/lcd/lcd_qspi/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/lcd/lcd_single_rgb/esp_panel_drivers_conf.h b/examples/arduino/drivers/lcd/lcd_single_rgb/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/lcd/lcd_single_rgb/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/lcd/lcd_single_rgb/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/lcd/lcd_spi/esp_panel_drivers_conf.h b/examples/arduino/drivers/lcd/lcd_spi/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/lcd/lcd_spi/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/lcd/lcd_spi/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/touch/touch_i2c/esp_panel_drivers_conf.h b/examples/arduino/drivers/touch/touch_i2c/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/touch/touch_i2c/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/touch/touch_i2c/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/drivers/touch/touch_spi/esp_panel_drivers_conf.h b/examples/arduino/drivers/touch/touch_spi/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/drivers/touch/touch_spi/esp_panel_drivers_conf.h +++ b/examples/arduino/drivers/touch/touch_spi/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_supported_conf.h b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_supported_conf.h index 3eb9292a..32bf5da8 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_supported_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_supported_conf.h @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_drivers_conf.h b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_drivers_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/simple_port/lv_conf.h b/examples/arduino/gui/lvgl_v8/simple_port/lv_conf.h index 57b48ac8..e27d5834 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/lv_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_port/lv_conf.h @@ -360,7 +360,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -451,7 +451,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -469,7 +469,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/examples/arduino/gui/lvgl_v8/simple_port/lvgl_v8_port.cpp b/examples/arduino/gui/lvgl_v8/simple_port/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/lvgl_v8_port.cpp +++ b/examples/arduino/gui/lvgl_v8/simple_port/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_supported_conf.h b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_supported_conf.h index 3eb9292a..32bf5da8 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_supported_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_supported_conf.h @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_drivers_conf.h b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_drivers_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/lv_conf.h b/examples/arduino/gui/lvgl_v8/simple_rotation/lv_conf.h index 57b48ac8..e27d5834 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/lv_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/lv_conf.h @@ -360,7 +360,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -451,7 +451,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -469,7 +469,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/lvgl_v8_port.cpp b/examples/arduino/gui/lvgl_v8/simple_rotation/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/lvgl_v8_port.cpp +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_supported_conf.h b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_supported_conf.h index 3eb9292a..32bf5da8 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_supported_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_supported_conf.h @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_drivers_conf.h b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_drivers_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/lv_conf.h b/examples/arduino/gui/lvgl_v8/squareline_port/lv_conf.h index 57b48ac8..e27d5834 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/lv_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_port/lv_conf.h @@ -360,7 +360,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -451,7 +451,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -469,7 +469,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/lvgl_v8_port.cpp b/examples/arduino/gui/lvgl_v8/squareline_port/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/lvgl_v8_port.cpp +++ b/examples/arduino/gui/lvgl_v8/squareline_port/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_supported_conf.h b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_supported_conf.h index 3eb9292a..32bf5da8 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_supported_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_supported_conf.h @@ -93,6 +93,7 @@ * Waveshare Supported Boards (https://www.waveshare.com/): * * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 (ESP32_S3_Touch_LCD_1_85): https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm + * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C (ESP32_S3_Touch_LCD_1_85_C): https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 (ESP32_S3_Touch_LCD_2_1): https://www.waveshare.com/esp32-s3-touch-lcd-2.1.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 (ESP32_S3_Touch_LCD_4_3): https://www.waveshare.com/esp32-s3-touch-lcd-4.3.htm * -BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B (ESP32_S3_Touch_LCD_4_3_B): https://www.waveshare.com/esp32-s3-touch-lcd-4.3B.htm @@ -102,6 +103,7 @@ * -BOARD_WAVESHARE_ESP32_P4_NANO (ESP32_P4_NANO): https://www.waveshare.com/esp32-p4-nano.htm */ // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 +// #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3 // #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B @@ -123,24 +125,39 @@ * +------------------- Horizontal resolution: 240 * So UEDX24320024E means: 240x320 resolution & 2.4 inch display * + * - BOARD_VIEWE_SMARTRING (SMARTRING): https://github.com/VIEWESMART/VIEWE-SMARTRING + * - BOARD_VIEWE_UEDX24240013_MD50E (UEDX24240013-MD50E): https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob * - BOARD_VIEWE_UEDX24320024E_WB_A (UEDX24320024E-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_UEDX24320028E_WB_A (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_UEDX24320035E_WB_A (UEDX24320035E-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_UEDX32480035E_WB_A (UEDX32480035E-WB-A): https://github.com/VIEWESMART/Product-Specification-and-Schematic/blob/main/ESP32/3.5inch/320480/UEDX32480035E-WB-A%20SPEC.pdf + * - BOARD_VIEWE_UEDX46460015_MD50ET (UEDX46460015-MD50ET): https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48270043E_WB_A (UEDX48270043E-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_UEDX48480021_MD80E_V2 (UEDX48480021-MD80E(T)): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80E (UEDX48480021-MD80E): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + * - BOARD_VIEWE_UEDX48480021_MD80ET (UEDX48480021-MD80ET): https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display * - BOARD_VIEWE_UEDX48480040E_WB_A (UEDX48480040E-WB-A): https://viewedisplay.com/product/esp32-4-inch-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480043E_WB_A (UEDX80480043E-WB-A): https://viewedisplay.com/product/esp32-4-3-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + * - BOARD_VIEWE_UEDX80480050E_AC_A (UEDX80480050E-AC-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480050E_WB_A_2 (UEDX80480050E-WB-A): https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ * - BOARD_VIEWE_UEDX80480070E_WB_A (UEDX80480070E-WB-A): https://viewedisplay.com/product/esp32-7-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl-uart/ */ +// #define BOARD_VIEWE_SMARTRING +// #define BOARD_VIEWE_UEDX24240013_MD50E // #define BOARD_VIEWE_UEDX24320024E_WB_A // #define BOARD_VIEWE_UEDX24320028E_WB_A // #define BOARD_VIEWE_UEDX24320035E_WB_A // #define BOARD_VIEWE_UEDX32480035E_WB_A +// #define BOARD_VIEWE_UEDX46460015_MD50ET // #define BOARD_VIEWE_UEDX48270043E_WB_A +// #define BOARD_VIEWE_UEDX48480021_MD80E_V2 +// #define BOARD_VIEWE_UEDX48480021_MD80E +// #define BOARD_VIEWE_UEDX48480021_MD80ET +// #define BOARD_VIEWE_UEDX48480028_MD80ET // #define BOARD_VIEWE_UEDX48480040E_WB_A // #define BOARD_VIEWE_UEDX80480043E_WB_A +// #define BOARD_VIEWE_UEDX80480050E_AC_A // #define BOARD_VIEWE_UEDX80480050E_WB_A // #define BOARD_VIEWE_UEDX80480050E_WB_A_2 // #define BOARD_VIEWE_UEDX80480070E_WB_A @@ -156,7 +173,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0 #endif diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_drivers_conf.h b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_drivers_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lv_conf.h b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lv_conf.h index 57b48ac8..e27d5834 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lv_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lv_conf.h @@ -360,7 +360,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -451,7 +451,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -469,7 +469,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lvgl_v8_port.cpp b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lvgl_v8_port.cpp +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/examples/esp_idf/lvgl_v8_port/main/lvgl_v8_port.cpp b/examples/esp_idf/lvgl_v8_port/main/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/esp_idf/lvgl_v8_port/main/lvgl_v8_port.cpp +++ b/examples/esp_idf/lvgl_v8_port/main/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/examples/esp_idf/lvgl_v8_port/main/main.cpp b/examples/esp_idf/lvgl_v8_port/main/main.cpp index b5b734a6..6e822257 100644 --- a/examples/esp_idf/lvgl_v8_port/main/main.cpp +++ b/examples/esp_idf/lvgl_v8_port/main/main.cpp @@ -11,10 +11,21 @@ #include "lvgl_v8_port.h" #include "lv_demos.h" +#define EXAMPLE_LCD_USE_EXTERNAL_INIT_CMD (0) + using namespace esp_panel::drivers; using namespace esp_panel::board; static const char *TAG = "example"; +#if EXAMPLE_LCD_USE_EXTERNAL_INIT_CMD +static const esp_panel_lcd_vendor_init_cmd_t external_init_cmd[] = { +// {cmd, { data }, data_size, delay_ms} + // {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, + // {0xEF, (uint8_t []){0x08}, 1, 0}, + // {0xFF, (uint8_t []){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, + // ... +}; +#endif // EXAMPLE_LCD_USE_EXTERNAL_INIT_CMD extern "C" void app_main() { @@ -23,22 +34,41 @@ extern "C" void app_main() ESP_LOGI(TAG, "Initializing board"); ESP_UTILS_CHECK_FALSE_EXIT(board->init(), "Board init failed"); + #if LVGL_PORT_AVOID_TEARING_MODE - auto lcd = board->getLCD(); - // When avoid tearing function is enabled, the frame buffer number should be set in the board driver - lcd->configFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM); -#if ESP_PANEL_DRIVERS_BUS_ENABLE_RGB && CONFIG_IDF_TARGET_ESP32S3 - auto lcd_bus = lcd->getBus(); + { + auto lcd = board->getLCD(); + // When avoid tearing function is enabled, the frame buffer number should be set in the board driver + lcd->configFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM); +# if ESP_PANEL_DRIVERS_BUS_ENABLE_RGB && CONFIG_IDF_TARGET_ESP32S3 + auto lcd_bus = lcd->getBus(); + /** + * As the anti-tearing feature typically consumes more PSRAM bandwidth, for the ESP32-S3, we need to utilize the + * "bounce buffer" functionality to enhance the RGB data bandwidth. + * This feature will consume `bounce_buffer_size * bytes_per_pixel * 2` of SRAM memory. + */ + if (lcd_bus->getBasicAttributes().type == ESP_PANEL_BUS_TYPE_RGB) { + static_cast(lcd_bus)->configRGB_BounceBufferSize(lcd->getFrameWidth() * 10); + } +# endif + } +#endif // LVGL_PORT_AVOID_TEARING_MODE + +#if EXAMPLE_LCD_USE_EXTERNAL_INIT_CMD + ESP_LOGI(TAG, "Using external LCD init command"); + { + auto lcd = board->getLCD(); + ESP_UTILS_CHECK_FALSE_EXIT( + lcd->configVendorCommands(external_init_cmd, sizeof(external_init_cmd) / sizeof(external_init_cmd[0])), + "LCD init failed" + ); + } /** - * As the anti-tearing feature typically consumes more PSRAM bandwidth, for the ESP32-S3, we need to utilize the - * "bounce buffer" functionality to enhance the RGB data bandwidth. - * This feature will consume `bounce_buffer_size * bytes_per_pixel * 2` of SRAM memory. + * In addition, you can also get handles to any other devices (like touch) and use `config*()` functions to + * configure or replace default parameters, but this must be completed before `board->begin()` */ - if (lcd_bus->getBasicAttributes().type == ESP_PANEL_BUS_TYPE_RGB) { - static_cast(lcd_bus)->configRGB_BounceBufferSize(lcd->getFrameWidth() * 10); - } -#endif -#endif +#endif // EXAMPLE_LCD_USE_EXTERNAL_INIT_CMD + ESP_UTILS_CHECK_FALSE_EXIT(board->begin(), "Board begin failed"); ESP_LOGI(TAG, "Initializing LVGL"); diff --git a/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h b/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h index aa417d4b..b86014e0 100644 --- a/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h +++ b/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h @@ -347,6 +347,7 @@ * - `AXS15231B` * - `CHSC6540` * - `CST816S` + * - `CST820` * - `FT5x06` * - `GT911`, `GT1151` * - `SPD2010` @@ -751,7 +752,7 @@ * 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_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 #endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM diff --git a/examples/platformio/lvgl_v8_port/src/esp_panel_drivers_conf.h b/examples/platformio/lvgl_v8_port/src/esp_panel_drivers_conf.h index fe0aecca..a1cef666 100644 --- a/examples/platformio/lvgl_v8_port/src/esp_panel_drivers_conf.h +++ b/examples/platformio/lvgl_v8_port/src/esp_panel_drivers_conf.h @@ -126,6 +126,7 @@ #define ESP_PANEL_DRIVERS_TOUCH_USE_AXS15231B (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CHSC6540 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_CST816S (0) + #define ESP_PANEL_DRIVERS_TOUCH_USE_CST820 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT911 (0) #define ESP_PANEL_DRIVERS_TOUCH_USE_GT1151 (0) @@ -260,7 +261,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/examples/platformio/lvgl_v8_port/src/lv_conf.h b/examples/platformio/lvgl_v8_port/src/lv_conf.h index e310ce1e..ef8bd20b 100644 --- a/examples/platformio/lvgl_v8_port/src/lv_conf.h +++ b/examples/platformio/lvgl_v8_port/src/lv_conf.h @@ -362,7 +362,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -453,7 +453,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -471,7 +471,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/examples/platformio/lvgl_v8_port/src/lvgl_v8_port.cpp b/examples/platformio/lvgl_v8_port/src/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/examples/platformio/lvgl_v8_port/src/lvgl_v8_port.cpp +++ b/examples/platformio/lvgl_v8_port/src/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/src/board/custom/Kconfig.board_custom.touch b/src/board/custom/Kconfig.board_custom.touch index 456b6d1b..4c574793 100644 --- a/src/board/custom/Kconfig.board_custom.touch +++ b/src/board/custom/Kconfig.board_custom.touch @@ -15,6 +15,9 @@ if ESP_PANEL_BOARD_USE_TOUCH config ESP_PANEL_BOARD_TOUCH_CONTROLLER_CST816S bool "CST816S" + config ESP_PANEL_BOARD_TOUCH_CONTROLLER_CST820 + bool "CST820" + config ESP_PANEL_BOARD_TOUCH_CONTROLLER_FT5x06 bool "FT5x06" diff --git a/src/board/custom/esp_panel_board_kconfig_custom_touch.h b/src/board/custom/esp_panel_board_kconfig_custom_touch.h index d01c30be..d257ccd7 100644 --- a/src/board/custom/esp_panel_board_kconfig_custom_touch.h +++ b/src/board/custom/esp_panel_board_kconfig_custom_touch.h @@ -23,6 +23,8 @@ #define ESP_PANEL_BOARD_TOUCH_CONTROLLER AXS15231B #elif defined(CONFIG_ESP_PANEL_BOARD_TOUCH_CONTROLLER_CST816S) #define ESP_PANEL_BOARD_TOUCH_CONTROLLER CST816S + #elif defined(CONFIG_ESP_PANEL_BOARD_TOUCH_CONTROLLER_CST820) + #define ESP_PANEL_BOARD_TOUCH_CONTROLLER CST820 #elif defined(CONFIG_ESP_PANEL_BOARD_TOUCH_CONTROLLER_FT5x06) #define ESP_PANEL_BOARD_TOUCH_CONTROLLER FT5x06 #elif defined(CONFIG_ESP_PANEL_BOARD_TOUCH_CONTROLLER_GT911) diff --git a/src/board/supported/esp_panel_board_config_supported.h b/src/board/supported/esp_panel_board_config_supported.h index 502d28a0..6f7e6547 100644 --- a/src/board/supported/esp_panel_board_config_supported.h +++ b/src/board/supported/esp_panel_board_config_supported.h @@ -92,6 +92,7 @@ + defined(BOARD_JINGCAI_JC8048W550C) \ /* Waveshare */ \ + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85) \ + + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C) \ + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1) \ + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3) \ + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3_B) \ @@ -100,6 +101,13 @@ + defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_7) \ + defined(BOARD_WAVESHARE_ESP32_P4_NANO) \ /* Viewe */ \ + + defined(BOARD_VIEWE_SMARTRING) \ + + defined(BOARD_VIEWE_UEDX24240013_MD50E) \ + + defined(BOARD_VIEWE_UEDX46460015_MD50ET) \ + + defined(BOARD_VIEWE_UEDX48480021_MD80E) \ + + defined(BOARD_VIEWE_UEDX48480021_MD80E_V2) \ + + defined(BOARD_VIEWE_UEDX48480021_MD80ET) \ + + defined(BOARD_VIEWE_UEDX48480028_MD80ET) \ + defined(BOARD_VIEWE_UEDX24320024E_WB_A) \ + defined(BOARD_VIEWE_UEDX24320028E_WB_A) \ + defined(BOARD_VIEWE_UEDX24320035E_WB_A) \ @@ -109,6 +117,7 @@ + defined(BOARD_VIEWE_UEDX80480043E_WB_A) \ + defined(BOARD_VIEWE_UEDX80480050E_WB_A) \ + defined(BOARD_VIEWE_UEDX80480050E_WB_A_2) \ + + defined(BOARD_VIEWE_UEDX80480050E_AC_A) \ + defined(BOARD_VIEWE_UEDX80480070E_WB_A) \ > 1 #error "Multiple boards enabled! Please check file `esp_panel_board_supported_conf.h` and make sure only one board is enabled." @@ -160,6 +169,8 @@ /* Waveshare */ #elif defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85) #include "waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85.h" + #elif defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C) + #include "waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C.h" #elif defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1) #include "waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1.h" #elif defined(BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_4_3) @@ -175,6 +186,20 @@ #elif defined(BOARD_WAVESHARE_ESP32_P4_NANO) #include "waveshare/BOARD_WAVESHARE_ESP32_P4_NANO.h" /* Viewe */ + #elif defined(BOARD_VIEWE_SMARTRING) + #include "viewe/BOARD_VIEWE_SMARTRING.h" + #elif defined(BOARD_VIEWE_UEDX24240013_MD50E) + #include "viewe/BOARD_VIEWE_UEDX24240013_MD50E.h" + #elif defined(BOARD_VIEWE_UEDX46460015_MD50ET) + #include "viewe/BOARD_VIEWE_UEDX46460015_MD50ET.h" + #elif defined(BOARD_VIEWE_UEDX48480021_MD80E) + #include "viewe/BOARD_VIEWE_UEDX48480021_MD80E.h" + #elif defined(BOARD_VIEWE_UEDX48480021_MD80E_V2) + #include "viewe/BOARD_VIEWE_UEDX48480021_MD80E_V2.h" + #elif defined(BOARD_VIEWE_UEDX48480021_MD80ET) + #include "viewe/BOARD_VIEWE_UEDX48480021_MD80ET.h" + #elif defined(BOARD_VIEWE_UEDX48480028_MD80ET) + #include "viewe/BOARD_VIEWE_UEDX48480028_MD80ET.h" #elif defined(BOARD_VIEWE_UEDX24320024E_WB_A) #include "viewe/BOARD_VIEWE_UEDX24320024E_WB_A.h" #elif defined(BOARD_VIEWE_UEDX24320028E_WB_A) @@ -193,6 +218,8 @@ #include "viewe/BOARD_VIEWE_UEDX80480050E_WB_A.h" #elif defined(BOARD_VIEWE_UEDX80480050E_WB_A_2) #include "viewe/BOARD_VIEWE_UEDX80480050E_WB_A_2.h" + #elif defined(BOARD_VIEWE_UEDX80480050E_AC_A) + #include "viewe/BOARD_VIEWE_UEDX80480050E_AC_A.h" #elif defined(BOARD_VIEWE_UEDX80480070E_WB_A) #include "viewe/BOARD_VIEWE_UEDX80480070E_WB_A.h" #else diff --git a/src/board/supported/esp_panel_board_kconfig_supported.h b/src/board/supported/esp_panel_board_kconfig_supported.h index 9d9a1789..96b946a7 100644 --- a/src/board/supported/esp_panel_board_kconfig_supported.h +++ b/src/board/supported/esp_panel_board_kconfig_supported.h @@ -118,6 +118,11 @@ #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 #endif #endif +#ifndef BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C + #ifdef CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C + #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C + #endif +#endif #ifndef BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 #ifdef CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 #define BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 @@ -155,6 +160,48 @@ #endif // VIEWE +#ifndef BOARD_VIEWE_SMARTRING + #ifdef CONFIG_BOARD_VIEWE_SMARTRING + #define BOARD_VIEWE_SMARTRING CONFIG_BOARD_VIEWE_SMARTRING + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX24240013_MD50E + #ifdef CONFIG_BOARD_VIEWE_UEDX24240013_MD50E + #define BOARD_VIEWE_UEDX24240013_MD50E CONFIG_BOARD_VIEWE_UEDX24240013_MD50E + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX46460015_MD50ET + #ifdef CONFIG_BOARD_VIEWE_UEDX46460015_MD50ET + #define BOARD_VIEWE_UEDX46460015_MD50ET CONFIG_BOARD_VIEWE_UEDX46460015_MD50ET + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX48480021_MD80E + #ifdef CONFIG_BOARD_VIEWE_UEDX48480021_MD80E + #define BOARD_VIEWE_UEDX48480021_MD80E CONFIG_BOARD_VIEWE_UEDX48480021_MD80E + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX48480021_MD80E_V2 + #ifdef CONFIG_BOARD_VIEWE_UEDX48480021_MD80E_V2 + #define BOARD_VIEWE_UEDX48480021_MD80E_V2 CONFIG_BOARD_VIEWE_UEDX48480021_MD80E_V2 + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX48480021_MD80ET + #ifdef CONFIG_BOARD_VIEWE_UEDX48480021_MD80ET + #define BOARD_VIEWE_UEDX48480021_MD80ET CONFIG_BOARD_VIEWE_UEDX48480021_MD80ET + #endif +#endif + +#ifndef BOARD_VIEWE_UEDX48480028_MD80ET + #ifdef CONFIG_BOARD_VIEWE_UEDX48480028_MD80ET + #define BOARD_VIEWE_UEDX48480028_MD80ET CONFIG_BOARD_VIEWE_UEDX48480028_MD80ET + #endif +#endif + #ifndef BOARD_VIEWE_UEDX24320024E_WB_A #ifdef CONFIG_BOARD_VIEWE_UEDX24320024E_WB_A #define BOARD_VIEWE_UEDX24320024E_WB_A CONFIG_BOARD_VIEWE_UEDX24320024E_WB_A @@ -209,6 +256,12 @@ #endif #endif +#ifndef BOARD_VIEWE_UEDX80480050E_AC_A + #ifdef CONFIG_BOARD_VIEWE_UEDX80480050E_AC_A + #define BOARD_VIEWE_UEDX80480050E_AC_A CONFIG_BOARD_VIEWE_UEDX80480050E_AC_A + #endif +#endif + #ifndef BOARD_VIEWE_UEDX80480070E_WB_A #ifdef CONFIG_BOARD_VIEWE_UEDX80480070E_WB_A #define BOARD_VIEWE_UEDX80480070E_WB_A CONFIG_BOARD_VIEWE_UEDX80480070E_WB_A diff --git a/src/board/supported/jingcai/BOARD_JINGCAI_JC8048W550C.h b/src/board/supported/jingcai/BOARD_JINGCAI_JC8048W550C.h index 48cffb59..b793037a 100644 --- a/src/board/supported/jingcai/BOARD_JINGCAI_JC8048W550C.h +++ b/src/board/supported/jingcai/BOARD_JINGCAI_JC8048W550C.h @@ -102,11 +102,11 @@ // |------|--------------|--------------------------| // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | // ┗------|--------------|--------|--------|--------| - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (45) // | D0 | B0 | B0-1 | B0-3 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (48) // | D1 | B1 | B2 | B4 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (47) // | D2 | B2 | B3 | B5 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (21) // | D3 | B3 | B4 | B6 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (14) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (8) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (3) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (46) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (9) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (1) // | D4 | B4 | B5 | B7 | #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (5) // | D5 | G0 | G0 | G0-2 | #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (6) // | D6 | G1 | G1 | G3 | #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (7) // | D7 | G2 | G2 | G4 | @@ -114,11 +114,11 @@ #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (15) // | G3 | G3 | G5 | #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (4) // | G5 | G5 | G7 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (8) // | R0 | R0-1 | R0-3 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (3) // | R1 | R2 | R4 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (46) // | R2 | R3 | R5 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (9) // | R3 | R4 | R6 | - #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (45) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (48) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (47) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (21) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (14) // | R4 | R5 | R7 | // ┗--------┻--------┻--------┛ #endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH @@ -282,6 +282,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (2) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (1000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE /** @@ -485,7 +501,7 @@ * 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 0 +#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/viewe/BOARD_VIEWE_SMARTRING.h b/src/board/supported/viewe/BOARD_VIEWE_SMARTRING.h new file mode 100644 index 00000000..25cff59c --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_SMARTRING.h @@ -0,0 +1,300 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_SMARTRING.h + * @brief Configuration file for Viewe SMARTRING + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/VIEWE-SMARTRING + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:SMARTRING" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (472) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (466) // 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 SH8601 + +/** + * @brief LCD bus type selection + * + * Supported bus types: + * - `ESP_PANEL_BUS_TYPE_SPI` + * - `ESP_PANEL_BUS_TYPE_QSPI` + * - `ESP_PANEL_BUS_TYPE_RGB` (ESP32-S3 only) + * - `ESP_PANEL_BUS_TYPE_MIPI_DSI` (ESP32-P4 only) + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_QSPI) + +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI) || \ + (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI) +/** + * 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_LCD_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0 +#endif + +/** + * @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_QSPI + +/** + * @brief QSPI bus + */ +/* For general */ +#define ESP_PANEL_BOARD_LCD_QSPI_HOST_ID (1) // Typically set to 1 +#if !ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST +/* For host */ +#define ESP_PANEL_BOARD_LCD_QSPI_IO_SCK (13) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA0 (12) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA1 (8) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA2 (14) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA3 (9) +#endif // ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST +/* For panel */ +#define ESP_PANEL_BOARD_LCD_QSPI_IO_CS (7) // -1 if not used +#define ESP_PANEL_BOARD_LCD_QSPI_MODE (0) // 0-3, typically set to 0 +#define ESP_PANEL_BOARD_LCD_QSPI_CLK_HZ (40 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M +#define ESP_PANEL_BOARD_LCD_QSPI_CMD_BITS (32) // Typically set to 32 +#define ESP_PANEL_BOARD_LCD_QSPI_PARAM_BITS (8) // Typically set to 8 + +#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() \ +{ \ + {0xFE, (uint8_t []){0x00}, 0, 0}, \ + {0xC4, (uint8_t []){0x80}, 1, 0}, \ + {0x3A, (uint8_t []){0x55}, 1, 0}, \ + {0x35, (uint8_t []){0x00}, 0, 10}, \ + {0x53, (uint8_t []){0x20}, 1, 10}, \ + {0x51, (uint8_t []){0xFF}, 1, 10}, \ + {0x63, (uint8_t []){0xFF}, 1, 10}, \ + {0x2A, (uint8_t []){0x00,0x06,0x01,0xDD}, 4, 0}, \ + {0x2B, (uint8_t []){0x00,0x00,0x01,0xD1}, 4, 0}, \ + {0x11, (uint8_t []){0x00}, 0, 60}, \ + {0x29, (uint8_t []){0x00}, 0, 0}, \ +} +/** + * @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 (11) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 CST820 + +/** + * @brief Touch bus type selection + * - `ESP_PANEL_BUS_TYPE_SPI` + */ +#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 (1) // 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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (45) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (41) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 0/1 + +/** + * @brief Touch panel control pins + */ +#define ESP_PANEL_BOARD_TOUCH_RST_IO (46) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_TOUCH_RST_LEVEL (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (42) // 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_PWM_LEDC) + +#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 (40) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX24240013_MD50E.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX24240013_MD50E.h new file mode 100644 index 00000000..660988dd --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX24240013_MD50E.h @@ -0,0 +1,359 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_UEDX24320013_MD50E.h + * @brief Configuration file for Viewe UEDX24320013-MD50E + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX24240013-MD50E" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (240) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (240) // 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 GC9A01 + +/** + * @brief LCD bus type selection + * + * Supported bus types: + * - `ESP_PANEL_BUS_TYPE_SPI` + * - `ESP_PANEL_BUS_TYPE_QSPI` + * - `ESP_PANEL_BUS_TYPE_RGB` (ESP32-S3 only) + * - `ESP_PANEL_BUS_TYPE_MIPI_DSI` (ESP32-P4 only) + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_SPI) + +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI) || \ + (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI) +/** + * 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_LCD_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0 +#endif + +/** + * @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_SPI + + /** + * @brief SPI bus + */ + /* For general */ + #define ESP_PANEL_BOARD_LCD_SPI_HOST_ID (1) // Typically set to 1 +#if !ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST + /* For host */ + #define ESP_PANEL_BOARD_LCD_SPI_IO_SCK (1) + #define ESP_PANEL_BOARD_LCD_SPI_IO_MOSI (0) + #define ESP_PANEL_BOARD_LCD_SPI_IO_MISO (-1) // -1 if not used +#endif // ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST + /* For panel */ + #define ESP_PANEL_BOARD_LCD_SPI_IO_CS (10) // -1 if not used + #define ESP_PANEL_BOARD_LCD_SPI_IO_DC (4) + #define ESP_PANEL_BOARD_LCD_SPI_MODE (0) // 0-3. Typically set to 0 + #define ESP_PANEL_BOARD_LCD_SPI_CLK_HZ (40 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M + #define ESP_PANEL_BOARD_LCD_SPI_CMD_BITS (8) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_SPI_PARAM_BITS (8) // Typically set to 8 + +#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() \ +{ \ + {0xfe, (uint8_t []){0x00}, 0, 0}, \ + {0xef, (uint8_t []){0x00}, 0, 0}, \ + {0xeb, (uint8_t []){0x14}, 1, 0}, \ + {0x84, (uint8_t []){0x60}, 1, 0}, \ + {0x85, (uint8_t []){0xFF}, 1, 0}, \ + {0x86, (uint8_t []){0xFF}, 1, 0}, \ + {0x87, (uint8_t []){0xFF}, 1, 0}, \ + {0x8e, (uint8_t []){0xFF}, 1, 0}, \ + {0x8f, (uint8_t []){0xFF}, 1, 0}, \ + {0x88, (uint8_t []){0x0A}, 1, 0}, \ + {0x89, (uint8_t []){0x21}, 1, 0}, \ + {0x8a, (uint8_t []){0x00}, 1, 0}, \ + {0x8b, (uint8_t []){0x80}, 1, 0}, \ + {0x8c, (uint8_t []){0x01}, 1, 0}, \ + {0x8d, (uint8_t []){0x03}, 1, 0}, \ + {0xb5, (uint8_t []){0x08, 0x09, 0x14, 0x08}, 4, 0}, \ + {0xb6, (uint8_t []){0x00, 0x00}, 2, 0}, \ + {0x36, (uint8_t []){0x48}, 1, 0}, \ + {0x3a, (uint8_t []){0x05}, 1, 0}, \ + {0x90, (uint8_t []){0x08, 0x08, 0x08, 0x08}, 4, 0}, \ + {0xbd, (uint8_t []){0x06}, 1, 0}, \ + {0xba, (uint8_t []){0x01}, 1, 0}, \ + {0xbc, (uint8_t []){0x00}, 1, 0}, \ + {0xff, (uint8_t []){0x60, 0x01, 0x04}, 3, 0}, \ + {0xc3, (uint8_t []){0x13}, 1, 0}, \ + {0xc4, (uint8_t []){0x13}, 1, 0}, \ + {0xc9, (uint8_t []){0x25}, 1, 0}, \ + {0xbe, (uint8_t []){0x11}, 1, 0}, \ + {0xe1, (uint8_t []){0x10, 0x0e}, 2, 0}, \ + {0xdf, (uint8_t []){0x21, 0x0c, 0x02}, 3, 0}, \ + {0xf0, (uint8_t []){0x45, 0x09, 0x08, 0x08, 0x26, 0x2a}, 6, 0}, \ + {0xf1, (uint8_t []){0x43, 0x70, 0x72, 0x36, 0x37, 0x6f}, 6, 0}, \ + {0xf2, (uint8_t []){0x45, 0x09, 0x08, 0x08, 0x26, 0x2a}, 6, 0}, \ + {0xf3, (uint8_t []){0x43, 0x70, 0x72, 0x36, 0x37, 0x6f}, 6, 0}, \ + {0xed, (uint8_t []){0x1b, 0x0b}, 2, 0}, \ + {0xae, (uint8_t []){0x77}, 1, 0}, \ + {0xcd, (uint8_t []){0x63}, 1, 0}, \ + {0x70, (uint8_t []){0x07, 0x07, 0x04, 0x0e, 0x0f, 0x09, 0x07, 0x08, 0x03}, 9, 0}, \ + {0xe8, (uint8_t []){0x34}, 1, 0}, \ + {0x62, (uint8_t []){0x18, 0x0d, 0x71, 0xed, 0x70, 0x70, 0x18, 0x0f, 0x71, 0xef, 0x70, 0x70}, 12, 0}, \ + {0x63, (uint8_t []){0x18, 0x11, 0x71, 0xf1, 0x70, 0x70, 0x18, 0x13, 0x71, 0xf3, 0x70, 0x70}, 12, 0}, \ + {0x64, (uint8_t []){0x28, 0x29, 0xf1, 0x01, 0xf1, 0x00, 0x07}, 7, 0}, \ + {0x66, (uint8_t []){0x3c, 0x00, 0xcd, 0x67, 0x45, 0x45, 0x10, 0x00, 0x00, 0x00}, 10, 0}, \ + {0x67, (uint8_t []){0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x54, 0x10, 0x32, 0x98}, 10, 0}, \ + {0x74, (uint8_t []){0x10, 0x85, 0x80, 0x00, 0x00, 0x4e, 0x00}, 7, 0}, \ + {0x98, (uint8_t []){0x3e, 0x07}, 2, 0}, \ + {0x99, (uint8_t []){0x3e, 0x07}, 2, 0}, \ + {0x35, (uint8_t []){0x00}, 1, 0}, \ + {0x44, (uint8_t []){0x00, 0x4a}, 2, 0}, \ + {0x21, (uint8_t []){0x00}, 0, 0}, \ + {0x2a, (uint8_t []){0x00, 0x00, 0x00, 0xef}, 4, 0}, \ + {0x2b, (uint8_t []){0x00, 0x00, 0x00, 0xef}, 4, 0}, \ + {0x2c, (uint8_t []){0x00}, 0, 0}, \ + {0x11, (uint8_t []){0x00}, 0, 120}, \ + {0x29, (uint8_t []){0x00}, 0, 20}, \ +} +/** + * @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 (1) // 0: RGB, 1: BGR +#define ESP_PANEL_BOARD_LCD_COLOR_INEVRT_BIT (1) // 0/1 + +/** + * @brief LCD transformation configuration + */ +#define ESP_PANEL_BOARD_LCD_SWAP_XY (0) // 0/1 +#define ESP_PANEL_BOARD_LCD_MIRROR_X (1) // 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 (-1) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 (0) + +#if ESP_PANEL_BOARD_USE_TOUCH +/** + * @brief Touch controller selection + */ +#define ESP_PANEL_BOARD_TOUCH_CONTROLLER CHSC6540 + +/** + * @brief Touch bus type selection + * - `ESP_PANEL_BUS_TYPE_SPI` + */ +#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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (3) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (1) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (8) // 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 (1) + +#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 ///////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Pre-begin function for board initialization + * + * @param[in] p Pointer to the board object + * @return true on success, false on failure + */ +// #define ESP_PANEL_BOARD_PRE_BEGIN_FUNCTION(p) \ +// { \ +// constexpr gpio_num_t IM0 = static_cast(47); \ +// constexpr gpio_num_t IM1 = static_cast(48); \ +// gpio_set_direction(IM0, GPIO_MODE_OUTPUT); \ +// gpio_set_direction(IM1, GPIO_MODE_OUTPUT); \ +// gpio_set_level(IM0, 0); \ +// gpio_set_level(IM1, 1); \ +// return true; \ +// } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX46460015_MD50ET.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX46460015_MD50ET.h new file mode 100644 index 00000000..d846d5fd --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX46460015_MD50ET.h @@ -0,0 +1,313 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_UEDX46460015_MD50ET.h + * @brief Configuration file for Viewe UEDX46460015-MD50ET + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX46460015-MD50ET" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (472) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (466) // 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 SH8601 + +/** + * @brief LCD bus type selection + * + * Supported bus types: + * - `ESP_PANEL_BUS_TYPE_SPI` + * - `ESP_PANEL_BUS_TYPE_QSPI` + * - `ESP_PANEL_BUS_TYPE_RGB` (ESP32-S3 only) + * - `ESP_PANEL_BUS_TYPE_MIPI_DSI` (ESP32-P4 only) + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_QSPI) + +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI) || \ + (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI) +/** + * 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_LCD_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0 +#endif + +/** + * @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_QSPI + +/** + * @brief QSPI bus + */ +/* For general */ +#define ESP_PANEL_BOARD_LCD_QSPI_HOST_ID (1) // Typically set to 1 +#if !ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST +/* For host */ +#define ESP_PANEL_BOARD_LCD_QSPI_IO_SCK (10) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA0 (13) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA1 (11) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA2 (14) +#define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA3 (9) +#endif // ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST +/* For panel */ +#define ESP_PANEL_BOARD_LCD_QSPI_IO_CS (12) // -1 if not used +#define ESP_PANEL_BOARD_LCD_QSPI_MODE (0) // 0-3, typically set to 0 +#define ESP_PANEL_BOARD_LCD_QSPI_CLK_HZ (40 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M +#define ESP_PANEL_BOARD_LCD_QSPI_CMD_BITS (32) // Typically set to 32 +#define ESP_PANEL_BOARD_LCD_QSPI_PARAM_BITS (8) // Typically set to 8 + +#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() \ +{ \ + {0xFE, (uint8_t []){0x00}, 0, 0}, \ + {0xC4, (uint8_t []){0x80}, 1, 0}, \ + {0x3A, (uint8_t []){0x55}, 1, 0}, \ + {0x35, (uint8_t []){0x00}, 0, 10}, \ + {0x53, (uint8_t []){0x20}, 1, 10}, \ + {0x51, (uint8_t []){0xFF}, 1, 10}, \ + {0x63, (uint8_t []){0xFF}, 1, 10}, \ + {0x2A, (uint8_t []){0x00,0x06,0x01,0xDD}, 4, 0}, \ + {0x2B, (uint8_t []){0x00,0x00,0x01,0xD1}, 4, 0}, \ + {0x11, (uint8_t []){0x00}, 0, 60}, \ + {0x29, (uint8_t []){0x00}, 0, 0}, \ +} +/** + * @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 (8) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 CST820 + +/** + * @brief Touch bus type selection + * - `ESP_PANEL_BUS_TYPE_SPI` + */ +#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 (1) // 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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (3) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (1) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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 (0) + +#if ESP_PANEL_BOARD_USE_BACKLIGHT +/** + * @brief Backlight control type selection + */ +#define ESP_PANEL_BOARD_BACKLIGHT_TYPE (ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC) + +#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 (17) // 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 (1) + +#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 ///////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Pre-begin function for board initialization + * + * @param[in] p Pointer to the board object + * @return true on success, false on failure + */ +#define ESP_PANEL_BOARD_PRE_BEGIN_FUNCTION(p) \ + { \ + constexpr gpio_num_t BL = static_cast(17); \ + gpio_set_direction(BL, GPIO_MODE_OUTPUT); \ + gpio_set_level(BL, 1); \ + return true; \ + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E.h new file mode 100644 index 00000000..bff0f4f7 --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E.h @@ -0,0 +1,369 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_UEDX48480021_MD80E.h + * @brief Configuration file for Viewe UEDX48480021-MD80E + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX48480021-MD80E" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (480) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (480) // 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 GC9503 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) + +/** + * @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_RGB + + /** + * @brief RGB bus + */ + /** + * Set to 0 if using simple "RGB" interface which does not contain "3-wire SPI" interface. + */ + #define ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL (1) // 0/1. Typically set to 1 + +#if ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For control panel (3wire-SPI) */ + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_CS (18) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SCK (13) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SDA (12) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CS_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SCL_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SDA_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_MODE (0) // 0-3, typically set to 0 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CMD_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_PARAM_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_USE_DC_BIT (1) // 0/1. Typically set to 1 +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For refresh panel (RGB) */ + #define ESP_PANEL_BOARD_LCD_RGB_CLK_HZ (16 * 1000 * 1000) + // To increase the upper limit of the PCLK, see: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#how-can-i-increase-the-upper-limit-of-pclk-settings-on-esp32-s3-while-ensuring-normal-rgb-screen-display + #define ESP_PANEL_BOARD_LCD_RGB_HPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_HBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_HFP (40) + #define ESP_PANEL_BOARD_LCD_RGB_VPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_VBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_VFP (50) + #define ESP_PANEL_BOARD_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge. Typically set to 0 + // The following sheet shows the valid combinations of + // data width and pixel bits: + // ┏---------------------------------┳- -------------------------------┓ + #define ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH (16) // | 16 | 8 | + #define ESP_PANEL_BOARD_LCD_RGB_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) // | ESP_PANEL_LCD_COLOR_BITS_RGB565 | ESP_PANEL_LCD_COLOR_BITS_RGB888 | + // ┗---------------------------------┻---------------------------------┛ + // To understand color format of RGB LCD, see: https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html#color-formats + #define ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_BOARD_WIDTH * 10) + // Bounce buffer size in bytes. It is used to avoid screen drift + // for ESP32-S3. Typically set to `ESP_PANEL_BOARD_WIDTH * 10` + // The size should satisfy `size * N = LCD_width * LCD_height`, + // where N is an even number. + // For more details, see: https://github.com/esp-arduino-libs/ESP32_Display_Panel/blob/master/docs/FAQ.md#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3 + #define ESP_PANEL_BOARD_LCD_RGB_IO_HSYNC (46) + #define ESP_PANEL_BOARD_LCD_RGB_IO_VSYNC (3) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DE (17) // -1 if not used + #define ESP_PANEL_BOARD_LCD_RGB_IO_PCLK (9) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DISP (-1) // -1 if not used. Typically set to -1 + + // The following sheet shows the mapping of ESP GPIOs to + // LCD data pins with different data width and color format: + // ┏------┳- ------------┳--------------------------┓ + // | ESP: | 8-bit RGB888 | 16-bit RGB565 | + // |------|--------------|--------------------------| + // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | + // ┗------|--------------|--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (10) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (11) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (12) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (13) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (14) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (21) // | D5 | G0 | G0 | G0-2 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (47) // | D6 | G1 | G1 | G3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (48) // | D7 | G2 | G2 | G4 | +#if ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH > 8 // ┗--------------┫--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | + // ┗--------┻--------┻--------┛ +#endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +#define ESP_PANEL_BOARD_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, 0xC1, {0x3F}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xCD, {0x25}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xCD, {0x00}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xC9, {0x10}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xF8, {0x8A}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xAC, {0x45}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xA7, {0x47}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xA0, {0xDD}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x87, {0x04, 0x03, 0x66}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x86, {0x99, 0xa3, 0xa3, 0x51}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xFA, {0x08, 0x08, 0x08, 0x04}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x9A, {0x8a}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x9B, {0x62}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x82, {0x48, 0x48}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xB1, {0x10}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x7A, {0x13, 0x1A}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x7B, {0x13, 0x1A}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x6D, {0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x02, 0x0b, 0x01, 0x00, 0x1f, 0x1e, 0x09, 0x0f, 0x1e, 0x1e, 0x1e, 0x1e, 0x10, 0x0a, 0x1e, 0x1f, 0x00, 0x08, 0x0b, 0x02, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x64, {0x18, 0x07, 0x01, 0xE7, 0x03, 0x03, 0x18, 0x06, 0x01, 0xE6, 0x03, 0x03, 0x7a, 0x7a, 0x7a, 0x7a}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x65, {0x58, 0x26, 0x18, 0x2c, 0x03, 0x03, 0x58, 0x26, 0x18, 0x2c, 0x03, 0x03, 0x7a, 0x7a, 0x7a, 0x7a}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x66, {0x58, 0x26, 0x18, 0x2c, 0x03, 0x03, 0x58, 0x26, 0x18, 0x2c, 0x03, 0x03, 0x7a, 0x7a, 0x7a, 0x7a}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x67, {0x18, 0x05, 0x01, 0xE5, 0x03, 0x03, 0x18, 0x04, 0x01, 0xE4, 0x03, 0x03, 0x7a, 0x7a, 0x7a, 0x7a}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x60, {0x18, 0x09, 0x7A, 0x7A, 0x51, 0xF1, 0x7A, 0x7A}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0x63, {0x51, 0xF1, 0x7A, 0x7A, 0x18, 0x08, 0x7A, 0x7A}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD1, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD2, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD3, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD4, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD5, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_8BIT_PARAM(0, 0xD6, {0x00, 0x00, 0x00, 0x0E, 0x00, 0x31, 0x00, 0x4E, 0x00, 0x67, 0x00, 0x92, 0x00, 0xB5, 0x00, 0xED, 0x01, 0x1C, 0x01, 0x66, 0x01, 0xA4, 0x02, 0x04, 0x02, 0x53, 0x02, 0x56, 0x02, 0x9F, 0x02, 0xF3, 0x03, 0x29, 0x03, 0x73, 0x03, 0xA1, 0x03, 0xB9, 0x03, 0xC8, 0x03, 0xDB, 0x03, 0xE7, 0x03, 0xF4, 0x03, 0xFB, 0x03, 0XFF}), \ + ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x11), \ + ESP_PANEL_LCD_CMD_WITH_NONE_PARAM(120, 0x29), \ +} + +/** + * @brief LCD specific flags configuration + * + * These flags are specific to the "3-wire SPI + RGB" bus. + */ +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB) && ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL +/** + * @brief Enable IO multiplex + * + * Set to 1 if the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs. Then, the control panel + * and its pins (except CS signal) will be released after LCD call `init()`. All `*_by_cmd` flags will be invalid. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX (1) // typically set to 0 +/** + * @brief Mirror by command + * + * Set to 1 if the `mirror()` function will be implemented by LCD command. Otherwise, the function will be implemented by + * software. Only valid when `ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX` is 0. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX) +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB888) + // 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 (8) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 (0) + +#if ESP_PANEL_BOARD_USE_TOUCH +/** + * @brief Touch controller selection + */ +#define ESP_PANEL_BOARD_TOUCH_CONTROLLER FT5x06 + +/** + * @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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (41) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (40) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (7) // Output GPIO pin number + #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (0) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80ET.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80ET.h new file mode 100644 index 00000000..9b1e6dcf --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80ET.h @@ -0,0 +1,382 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_UEDX48480021_MD80ET.h + * @brief Configuration file for Viewe UEDX48480021-MD80ET + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX48480021-MD80ET" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (480) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (480) // 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 GC9503 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) + +/** + * @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_RGB + + /** + * @brief RGB bus + */ + /** + * Set to 0 if using simple "RGB" interface which does not contain "3-wire SPI" interface. + */ + #define ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL (1) // 0/1. Typically set to 1 + + #if ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For control panel (3wire-SPI) */ + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_CS (18) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SCK (13) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SDA (12) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CS_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SCL_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SDA_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_MODE (0) // 0-3, typically set to 0 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CMD_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_PARAM_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_USE_DC_BIT (1) // 0/1. Typically set to 1 +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For refresh panel (RGB) */ + #define ESP_PANEL_BOARD_LCD_RGB_CLK_HZ (16 * 1000 * 1000) + // To increase the upper limit of the PCLK, see: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#how-can-i-increase-the-upper-limit-of-pclk-settings-on-esp32-s3-while-ensuring-normal-rgb-screen-display + #define ESP_PANEL_BOARD_LCD_RGB_HPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_HBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_HFP (40) + #define ESP_PANEL_BOARD_LCD_RGB_VPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_VBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_VFP (50) + #define ESP_PANEL_BOARD_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge. Typically set to 0 + // The following sheet shows the valid combinations of + // data width and pixel bits: + // ┏---------------------------------┳- -------------------------------┓ + #define ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH (16) // | 16 | 8 | + #define ESP_PANEL_BOARD_LCD_RGB_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) // | ESP_PANEL_LCD_COLOR_BITS_RGB565 | ESP_PANEL_LCD_COLOR_BITS_RGB888 | + // ┗---------------------------------┻---------------------------------┛ + // To understand color format of RGB LCD, see: https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html#color-formats + #define ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_BOARD_WIDTH * 10) + // Bounce buffer size in bytes. It is used to avoid screen drift + // for ESP32-S3. Typically set to `ESP_PANEL_BOARD_WIDTH * 10` + // The size should satisfy `size * N = LCD_width * LCD_height`, + // where N is an even number. + // For more details, see: https://github.com/esp-arduino-libs/ESP32_Display_Panel/blob/master/docs/FAQ.md#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3 + #define ESP_PANEL_BOARD_LCD_RGB_IO_HSYNC (46) + #define ESP_PANEL_BOARD_LCD_RGB_IO_VSYNC (3) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DE (17) // -1 if not used + #define ESP_PANEL_BOARD_LCD_RGB_IO_PCLK (9) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DISP (-1) // -1 if not used. Typically set to -1 + + // The following sheet shows the mapping of ESP GPIOs to + // LCD data pins with different data width and color format: + // ┏------┳- ------------┳--------------------------┓ + // | ESP: | 8-bit RGB888 | 16-bit RGB565 | + // |------|--------------|--------------------------| + // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | + // ┗------|--------------|--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (10) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (11) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (12) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (13) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (14) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (21) // | D5 | G0 | G0 | G0-2 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (47) // | D6 | G1 | G1 | G3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (48) // | D7 | G2 | G2 | G4 | +#if ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH > 8 // ┗--------------┫--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | + // ┗--------┻--------┻--------┛ +#endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +#define ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD() \ + { \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xEF, (uint8_t[]){0x08}, 1, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \ + {0xC0, (uint8_t[]){0x3B, 0x00}, 2, 0}, \ + {0xC1, (uint8_t[]){0x0B, 0x02}, 2, 0}, \ + {0xC2, (uint8_t[]){0x07, 0x02}, 2, 0}, \ + {0xC7, (uint8_t[]){0x00}, 1, 0}, \ + {0xCC, (uint8_t[]){0x10}, 1, 0}, \ + {0xCD, (uint8_t[]){0x08}, 1, 0}, \ + {0xB0, (uint8_t[]){0x00, 0x11, 0x16, 0x0E, 0x11, 0x06, 0x05, 0x09, 0x08, 0x21, 0x06, 0x13, 0x10, 0x29, 0x31, 0x18}, 16, 0}, \ + {0xB1, (uint8_t[]){0x00, 0x11, 0x16, 0x0E, 0x11, 0x07, 0x05, 0x09, 0x09, 0x21, 0x05, 0x13, 0x11, 0x2A, 0x31, 0x18}, 16, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x11}, 5, 0}, \ + {0xB0, (uint8_t[]){0x6D}, 1, 0}, \ + {0xB1, (uint8_t[]){0x37}, 1, 0}, \ + {0xB2, (uint8_t[]){0x8B}, 1, 0}, \ + {0xB3, (uint8_t[]){0x80}, 1, 0}, \ + {0xB5, (uint8_t[]){0x43}, 1, 0}, \ + {0xB7, (uint8_t[]){0x85}, 1, 0}, \ + {0xB8, (uint8_t[]){0x20}, 1, 0}, \ + {0xC0, (uint8_t[]){0x09}, 1, 0}, \ + {0xC1, (uint8_t[]){0x78}, 1, 0}, \ + {0xC2, (uint8_t[]){0x78}, 1, 0}, \ + {0xD0, (uint8_t[]){0x88}, 1, 0}, \ + {0xE0, (uint8_t[]){0x00, 0x00, 0x02}, 3, 0}, \ + {0xE1, (uint8_t[]){0x03, 0xA0, 0x00, 0x00, 0x04, 0xA0, 0x00, 0x00, 0x00, 0x20, 0x20}, 11, 0}, \ + {0xE2, (uint8_t[]){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 13, 0}, \ + {0xE3, (uint8_t[]){0x00, 0x00, 0x11, 0x00}, 4, 0}, \ + {0xE4, (uint8_t[]){0x22, 0x00}, 2, 0}, \ + {0xE5, (uint8_t[]){0x05, 0xEC, 0xF6, 0xCA, 0x07, 0xEE, 0xF6, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 16, 0}, \ + {0xE6, (uint8_t[]){0x00, 0x00, 0x11, 0x00}, 4, 0}, \ + {0xE7, (uint8_t[]){0x22, 0x00}, 2, 0}, \ + {0xE8, (uint8_t[]){0x06, 0xED, 0xF6, 0xCA, 0x08, 0xEF, 0xF6, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 16, 0}, \ + {0xE9, (uint8_t[]){0x36, 0x00}, 2, 0}, \ + {0xEB, (uint8_t[]){0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00}, 1, 0}, \ + {0xED, (uint8_t[]){0xFF, 0xFF, 0xFF, 0xBA, 0x0A, 0xFF, 0x45, 0xFF, 0xFF, 0x54, 0xFF, 0xA0, 0xAB, 0xFF, 0xFF, 0xFF}, 16, 0}, \ + {0xEF, (uint8_t[]){0x08, 0x08, 0x08, 0x45, 0x3F, 0x54}, 6, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x0E}, 2, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x00}, 5, 0}, \ + {0x11, (uint8_t[]){0x00}, 1, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x0C}, 2, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x00}, 2, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x00}, 5, 0}, \ + {0x36, (uint8_t[]){0x00}, 1, 0}, \ + {0x3A, (uint8_t[]){0x66}, 1, 0}, \ + {0x29, (uint8_t[]){0x00}, 1, 0},\ + } + +/** + * @brief LCD specific flags configuration + * + * These flags are specific to the "3-wire SPI + RGB" bus. + */ +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB) && ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL +/** + * @brief Enable IO multiplex + * + * Set to 1 if the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs. Then, the control panel + * and its pins (except CS signal) will be released after LCD call `init()`. All `*_by_cmd` flags will be invalid. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX (1) // typically set to 0 +/** + * @brief Mirror by command + * + * Set to 1 if the `mirror()` function will be implemented by LCD command. Otherwise, the function will be implemented by + * software. Only valid when `ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX` is 0. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX) +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB888) + // 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 (8) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 CST820 + +/** + * @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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (15) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (16) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (7) // Output GPIO pin number + #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (0) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E_V2.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E_V2.h new file mode 100644 index 00000000..2cb05e80 --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480021_MD80E_V2.h @@ -0,0 +1,382 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_VIEWE_UEDX48480021_MD80E_V2.h + * @brief Configuration file for Viewe UEDX48480021-MD80E-V2 + * @author Viewe@VIEWESMART + * @link https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX48480021-MD80E-V2" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (480) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (480) // 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 GC9503 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) + +/** + * @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_RGB + + /** + * @brief RGB bus + */ + /** + * Set to 0 if using simple "RGB" interface which does not contain "3-wire SPI" interface. + */ + #define ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL (1) // 0/1. Typically set to 1 + + #if ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For control panel (3wire-SPI) */ + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_CS (18) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SCK (13) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SDA (12) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CS_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SCL_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SDA_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_MODE (0) // 0-3, typically set to 0 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CMD_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_PARAM_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_USE_DC_BIT (1) // 0/1. Typically set to 1 +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For refresh panel (RGB) */ + #define ESP_PANEL_BOARD_LCD_RGB_CLK_HZ (16 * 1000 * 1000) + // To increase the upper limit of the PCLK, see: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#how-can-i-increase-the-upper-limit-of-pclk-settings-on-esp32-s3-while-ensuring-normal-rgb-screen-display + #define ESP_PANEL_BOARD_LCD_RGB_HPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_HBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_HFP (40) + #define ESP_PANEL_BOARD_LCD_RGB_VPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_VBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_VFP (50) + #define ESP_PANEL_BOARD_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge. Typically set to 0 + // The following sheet shows the valid combinations of + // data width and pixel bits: + // ┏---------------------------------┳- -------------------------------┓ + #define ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH (16) // | 16 | 8 | + #define ESP_PANEL_BOARD_LCD_RGB_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) // | ESP_PANEL_LCD_COLOR_BITS_RGB565 | ESP_PANEL_LCD_COLOR_BITS_RGB888 | + // ┗---------------------------------┻---------------------------------┛ + // To understand color format of RGB LCD, see: https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html#color-formats + #define ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_BOARD_WIDTH * 10) + // Bounce buffer size in bytes. It is used to avoid screen drift + // for ESP32-S3. Typically set to `ESP_PANEL_BOARD_WIDTH * 10` + // The size should satisfy `size * N = LCD_width * LCD_height`, + // where N is an even number. + // For more details, see: https://github.com/esp-arduino-libs/ESP32_Display_Panel/blob/master/docs/FAQ.md#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3 + #define ESP_PANEL_BOARD_LCD_RGB_IO_HSYNC (46) + #define ESP_PANEL_BOARD_LCD_RGB_IO_VSYNC (3) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DE (17) // -1 if not used + #define ESP_PANEL_BOARD_LCD_RGB_IO_PCLK (9) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DISP (-1) // -1 if not used. Typically set to -1 + + // The following sheet shows the mapping of ESP GPIOs to + // LCD data pins with different data width and color format: + // ┏------┳- ------------┳--------------------------┓ + // | ESP: | 8-bit RGB888 | 16-bit RGB565 | + // |------|--------------|--------------------------| + // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | + // ┗------|--------------|--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (10) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (11) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (12) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (13) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (14) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (21) // | D5 | G0 | G0 | G0-2 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (47) // | D6 | G1 | G1 | G3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (48) // | D7 | G2 | G2 | G4 | +#if ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH > 8 // ┗--------------┫--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | + // ┗--------┻--------┻--------┛ +#endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +#define ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD() \ + { \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xEF, (uint8_t[]){0x08}, 1, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0}, \ + {0xC0, (uint8_t[]){0x3B, 0x00}, 2, 0}, \ + {0xC1, (uint8_t[]){0x0B, 0x02}, 2, 0}, \ + {0xC2, (uint8_t[]){0x07, 0x02}, 2, 0}, \ + {0xC7, (uint8_t[]){0x00}, 1, 0}, \ + {0xCC, (uint8_t[]){0x10}, 1, 0}, \ + {0xCD, (uint8_t[]){0x08}, 1, 0}, \ + {0xB0, (uint8_t[]){0x00, 0x11, 0x16, 0x0E, 0x11, 0x06, 0x05, 0x09, 0x08, 0x21, 0x06, 0x13, 0x10, 0x29, 0x31, 0x18}, 16, 0}, \ + {0xB1, (uint8_t[]){0x00, 0x11, 0x16, 0x0E, 0x11, 0x07, 0x05, 0x09, 0x09, 0x21, 0x05, 0x13, 0x11, 0x2A, 0x31, 0x18}, 16, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x11}, 5, 0}, \ + {0xB0, (uint8_t[]){0x6D}, 1, 0}, \ + {0xB1, (uint8_t[]){0x37}, 1, 0}, \ + {0xB2, (uint8_t[]){0x8B}, 1, 0}, \ + {0xB3, (uint8_t[]){0x80}, 1, 0}, \ + {0xB5, (uint8_t[]){0x43}, 1, 0}, \ + {0xB7, (uint8_t[]){0x85}, 1, 0}, \ + {0xB8, (uint8_t[]){0x20}, 1, 0}, \ + {0xC0, (uint8_t[]){0x09}, 1, 0}, \ + {0xC1, (uint8_t[]){0x78}, 1, 0}, \ + {0xC2, (uint8_t[]){0x78}, 1, 0}, \ + {0xD0, (uint8_t[]){0x88}, 1, 0}, \ + {0xE0, (uint8_t[]){0x00, 0x00, 0x02}, 3, 0}, \ + {0xE1, (uint8_t[]){0x03, 0xA0, 0x00, 0x00, 0x04, 0xA0, 0x00, 0x00, 0x00, 0x20, 0x20}, 11, 0}, \ + {0xE2, (uint8_t[]){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 13, 0}, \ + {0xE3, (uint8_t[]){0x00, 0x00, 0x11, 0x00}, 4, 0}, \ + {0xE4, (uint8_t[]){0x22, 0x00}, 2, 0}, \ + {0xE5, (uint8_t[]){0x05, 0xEC, 0xF6, 0xCA, 0x07, 0xEE, 0xF6, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 16, 0}, \ + {0xE6, (uint8_t[]){0x00, 0x00, 0x11, 0x00}, 4, 0}, \ + {0xE7, (uint8_t[]){0x22, 0x00}, 2, 0}, \ + {0xE8, (uint8_t[]){0x06, 0xED, 0xF6, 0xCA, 0x08, 0xEF, 0xF6, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 16, 0}, \ + {0xE9, (uint8_t[]){0x36, 0x00}, 2, 0}, \ + {0xEB, (uint8_t[]){0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00}, 1, 0}, \ + {0xED, (uint8_t[]){0xFF, 0xFF, 0xFF, 0xBA, 0x0A, 0xFF, 0x45, 0xFF, 0xFF, 0x54, 0xFF, 0xA0, 0xAB, 0xFF, 0xFF, 0xFF}, 16, 0}, \ + {0xEF, (uint8_t[]){0x08, 0x08, 0x08, 0x45, 0x3F, 0x54}, 6, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x0E}, 2, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x00}, 5, 0}, \ + {0x11, (uint8_t[]){0x00}, 1, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x0C}, 2, 0}, \ + {0xE8, (uint8_t[]){0x00, 0x00}, 2, 0}, \ + {0xFF, (uint8_t[]){0x77, 0x01, 0x00, 0x00, 0x00}, 5, 0}, \ + {0x36, (uint8_t[]){0x00}, 1, 0}, \ + {0x3A, (uint8_t[]){0x66}, 1, 0}, \ + {0x29, (uint8_t[]){0x00}, 1, 0},\ + } + +/** + * @brief LCD specific flags configuration + * + * These flags are specific to the "3-wire SPI + RGB" bus. + */ +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB) && ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL +/** + * @brief Enable IO multiplex + * + * Set to 1 if the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs. Then, the control panel + * and its pins (except CS signal) will be released after LCD call `init()`. All `*_by_cmd` flags will be invalid. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX (1) // typically set to 0 +/** + * @brief Mirror by command + * + * Set to 1 if the `mirror()` function will be implemented by LCD command. Otherwise, the function will be implemented by + * software. Only valid when `ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX` is 0. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX) +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB888) + // 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 (8) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 (0) + +#if ESP_PANEL_BOARD_USE_TOUCH +/** + * @brief Touch controller selection + */ +#define ESP_PANEL_BOARD_TOUCH_CONTROLLER CST816S + +/** + * @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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (15) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (16) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (7) // Output GPIO pin number + #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (0) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX48480028_MD80ET.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480028_MD80ET.h new file mode 100644 index 00000000..c09e851b --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX48480028_MD80ET.h @@ -0,0 +1,378 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_UEDX48480028_MD80ET.h + * @brief Configuration file for Viewe UEDX48480028-MD80ET + * @author Viewe@VIEWESMART + * @link + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX48480028-MD80ET" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (480) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (480) // 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 GC9503 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) + +/** + * @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_RGB + + /** + * @brief RGB bus + */ + /** + * Set to 0 if using simple "RGB" interface which does not contain "3-wire SPI" interface. + */ + #define ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL (1) // 0/1. Typically set to 1 + + #if ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For control panel (3wire-SPI) */ + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_CS (18) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SCK (13) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_IO_SDA (12) + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CS_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SCL_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_SDA_USE_EXPNADER (0) // Set to 1 if the signal is controlled by an IO expander + #define ESP_PANEL_BOARD_LCD_RGB_SPI_MODE (0) // 0-3, typically set to 0 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_CMD_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_PARAM_BYTES (1) // Typically set to 8 + #define ESP_PANEL_BOARD_LCD_RGB_SPI_USE_DC_BIT (1) // 0/1. Typically set to 1 +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + /* For refresh panel (RGB) */ + #define ESP_PANEL_BOARD_LCD_RGB_CLK_HZ (16 * 1000 * 1000) + // To increase the upper limit of the PCLK, see: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#how-can-i-increase-the-upper-limit-of-pclk-settings-on-esp32-s3-while-ensuring-normal-rgb-screen-display + #define ESP_PANEL_BOARD_LCD_RGB_HPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_HBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_HFP (40) + #define ESP_PANEL_BOARD_LCD_RGB_VPW (8) + #define ESP_PANEL_BOARD_LCD_RGB_VBP (20) + #define ESP_PANEL_BOARD_LCD_RGB_VFP (50) + #define ESP_PANEL_BOARD_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge. Typically set to 0 + // The following sheet shows the valid combinations of + // data width and pixel bits: + // ┏---------------------------------┳- -------------------------------┓ + #define ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH (16) // | 16 | 8 | + #define ESP_PANEL_BOARD_LCD_RGB_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) // | ESP_PANEL_LCD_COLOR_BITS_RGB565 | ESP_PANEL_LCD_COLOR_BITS_RGB888 | + // ┗---------------------------------┻---------------------------------┛ + // To understand color format of RGB LCD, see: https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html#color-formats + #define ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_BOARD_WIDTH * 10) + // Bounce buffer size in bytes. It is used to avoid screen drift + // for ESP32-S3. Typically set to `ESP_PANEL_BOARD_WIDTH * 10` + // The size should satisfy `size * N = LCD_width * LCD_height`, + // where N is an even number. + // For more details, see: https://github.com/esp-arduino-libs/ESP32_Display_Panel/blob/master/docs/FAQ.md#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3 + #define ESP_PANEL_BOARD_LCD_RGB_IO_HSYNC (46) + #define ESP_PANEL_BOARD_LCD_RGB_IO_VSYNC (3) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DE (17) // -1 if not used + #define ESP_PANEL_BOARD_LCD_RGB_IO_PCLK (9) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DISP (-1) // -1 if not used. Typically set to -1 + + // The following sheet shows the mapping of ESP GPIOs to + // LCD data pins with different data width and color format: + // ┏------┳- ------------┳--------------------------┓ + // | ESP: | 8-bit RGB888 | 16-bit RGB565 | + // |------|--------------|--------------------------| + // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | + // ┗------|--------------|--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (10) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (11) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (12) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (13) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (14) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (21) // | D5 | G0 | G0 | G0-2 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (47) // | D6 | G1 | G1 | G3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (48) // | D7 | G2 | G2 | G4 | +#if ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH > 8 // ┗--------------┫--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (45) // | G3 | G3 | G5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (38) // | G4 | G4 | G6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (39) // | G5 | G5 | G7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (40) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (41) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (42) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (2) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (1) // | R4 | R5 | R7 | + // ┗--------┻--------┻--------┛ +#endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +#define ESP_PANEL_BOARD_LCD_VENDOR_INIT_CMD() \ + { \ + {0xFF, (uint8_t []){0x77,0x01,0x00,0x00,0x13}, 5, 0},\ + {0xEF, (uint8_t []){0x08}, 1, 0},\ + {0xFF, (uint8_t []){0x77,0x01,0x00,0x00,0x10}, 5, 0},\ + {0xC0, (uint8_t []){0x3B,0x00}, 2, 0},\ + {0xC1, (uint8_t []){0x10,0x0C}, 2, 0},\ + {0xC2, (uint8_t []){0x07,0x0A}, 2, 0},\ + {0xC7, (uint8_t []){0x00}, 1, 0},\ + {0xCC, (uint8_t []){0x10}, 1, 0},\ + {0xCD, (uint8_t []){0x08}, 1, 0},\ + {0xB0, (uint8_t []){0x05,0x12,0x98,0x0E,0x0F,0x07,0x07,0x09,0x09,0x23,0x05,0x52,0x0F,0x67,0x2C,0x11} , 16, 0},\ + {0xB1, (uint8_t []){0x0B,0x11,0x97,0x0C,0x12,0x06,0x06,0x08,0x08,0x22,0x03,0x51,0x11,0x66,0x2B,0x0F} , 16, 0},\ + {0xFF, (uint8_t []){0x77,0x01,0x00,0x00,0x11}, 5, 0},\ + {0xB0, (uint8_t []){0x5D}, 1, 0},\ + {0xB1, (uint8_t []){0x2D}, 1, 0},\ + {0xB2, (uint8_t []){0x81}, 1, 0},\ + {0xB3, (uint8_t []){0x80}, 1, 0},\ + {0xB5, (uint8_t []){0x4E}, 1, 0},\ + {0xB7, (uint8_t []){0x85}, 1, 0},\ + {0xB8, (uint8_t []){0x20}, 1, 0},\ + {0xC0, (uint8_t []){0x09}, 1, 0},\ + {0xC1, (uint8_t []){0x78}, 1, 0},\ + {0xC2, (uint8_t []){0x78}, 1, 0},\ + {0xD0, (uint8_t []){0x88}, 1, 0},\ + {0xE0, (uint8_t []){0x00,0x00,0x02}, 3, 0},\ + {0xE1, (uint8_t []){0x06,0x30,0x08,0x30,0x05,0x30,0x07,0x30,0x00,0x33,0x33}, 11, 0},\ + {0xE2, (uint8_t []){0x11,0x11,0x33,0x33,0xF4,0x00,0x00,0x00,0xF4,0x00,0x00,0x00}, 12, 0},\ + {0xE3, (uint8_t []){0x00,0x00,0x11,0x11}, 4, 0},\ + {0xE4, (uint8_t []){0x44,0x44}, 2, 0},\ + {0xE5, (uint8_t []){0x0D,0xF5,0x30,0xF0,0x0F,0xF7,0x30,0xF0,0x09,0xF1,0x30,0xF0,0x0B,0xF3,0x30,0xF0}, 16, 0},\ + {0xE6, (uint8_t []){0x00,0x00,0x11,0x11}, 4, 0},\ + {0xE7, (uint8_t []){0x44,0x44}, 2, 0},\ + {0xE8, (uint8_t []){0x0C,0xF4,0x30,0xF0,0x0E,0xF6,0x30,0xF0,0x08,0xF0,0x30,0xF0,0x0A,0xF2,0x30,0xF0}, 16, 0},\ + {0xE9, (uint8_t []){0x36, 0x01}, 2, 0},\ + {0xEB, (uint8_t []){0x00,0x01,0xE4,0xE4,0x44,0x88,0x40}, 7, 0},\ + {0xED, (uint8_t []){0xFF,0x10,0xAF,0x76,0x54,0x2B,0xCF,0xFF,0xFF,0xFC,0xB2,0x45,0x67,0xFA,0x01,0xFF} , 16, 0},\ + {0xEF, (uint8_t []){0x08,0x08,0x08,0x45,0x3F,0x54}, 6, 0},\ + {0xFF, (uint8_t []){0x77,0x01,0x00,0x00,0x00}, 5, 0},\ + {0x11, (uint8_t []){0X00}, 1, 0},\ + {0x3A, (uint8_t []){0x66}, 1, 0},\ + {0x36, (uint8_t []){0x00}, 1, 0},\ + {0x35, (uint8_t []){0x00}, 1, 0},\ + {0x29, (uint8_t []){0x00}, 1, 0},\ + {0x00, (uint8_t []){0x00}, 0xff},\ + } + +/** + * @brief LCD specific flags configuration + * + * These flags are specific to the "3-wire SPI + RGB" bus. + */ +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB) && ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL +/** + * @brief Enable IO multiplex + * + * Set to 1 if the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs. Then, the control panel + * and its pins (except CS signal) will be released after LCD call `init()`. All `*_by_cmd` flags will be invalid. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX (1) // typically set to 0 +/** + * @brief Mirror by command + * + * Set to 1 if the `mirror()` function will be implemented by LCD command. Otherwise, the function will be implemented by + * software. Only valid when `ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX` is 0. + */ +#define ESP_PANEL_BOARD_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_BOARD_LCD_FLAGS_ENABLE_IO_MULTIPLEX) +#endif // ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB888) + // 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 (8) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 CST820 + +/** + * @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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (15) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (16) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (7) // Output GPIO pin number + #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (0) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/BOARD_VIEWE_UEDX80480050E_AC_A.h b/src/board/supported/viewe/BOARD_VIEWE_UEDX80480050E_AC_A.h new file mode 100644 index 00000000..6f30ea6e --- /dev/null +++ b/src/board/supported/viewe/BOARD_VIEWE_UEDX80480050E_AC_A.h @@ -0,0 +1,296 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_UEDX80480050E_AC_A.h + * @brief Configuration file for Viewe UEDX80480050E-AC-A + * @author Viewe@VIEWESMART + * @link https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Viewe:UEDX80480050E-AC-A" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (800) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (480) // 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 ST7262 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_RGB) + +/** + * @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_RGB + + /** + * @brief RGB bus + */ + /** + * Set to 0 if using simple "RGB" interface which does not contain "3-wire SPI" interface. + */ + #define ESP_PANEL_BOARD_LCD_RGB_USE_CONTROL_PANEL (0) // 0/1. Typically set to 1 + + /* For refresh panel (RGB) */ + #define ESP_PANEL_BOARD_LCD_RGB_CLK_HZ (20 * 1000 * 1000) + // To increase the upper limit of the PCLK, see: https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/lcd.html#how-can-i-increase-the-upper-limit-of-pclk-settings-on-esp32-s3-while-ensuring-normal-rgb-screen-display + #define ESP_PANEL_BOARD_LCD_RGB_HPW (1) + #define ESP_PANEL_BOARD_LCD_RGB_HBP (42) + #define ESP_PANEL_BOARD_LCD_RGB_HFP (20) + #define ESP_PANEL_BOARD_LCD_RGB_VPW (10) + #define ESP_PANEL_BOARD_LCD_RGB_VBP (12) + #define ESP_PANEL_BOARD_LCD_RGB_VFP (4) + #define ESP_PANEL_BOARD_LCD_RGB_PCLK_ACTIVE_NEG (1) // 0: rising edge, 1: falling edge. Typically set to 0 + // The following sheet shows the valid combinations of + // data width and pixel bits: + // ┏---------------------------------┳- -------------------------------┓ + #define ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH (16) // | 16 | 8 | + #define ESP_PANEL_BOARD_LCD_RGB_PIXEL_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB565) // | ESP_PANEL_LCD_COLOR_BITS_RGB565 | ESP_PANEL_LCD_COLOR_BITS_RGB888 | + // ┗---------------------------------┻---------------------------------┛ + // To understand color format of RGB LCD, see: https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html#color-formats + #define ESP_PANEL_BOARD_LCD_RGB_BOUNCE_BUF_SIZE (ESP_PANEL_BOARD_WIDTH * 10) + // Bounce buffer size in bytes. It is used to avoid screen drift + // for ESP32-S3. Typically set to `ESP_PANEL_BOARD_WIDTH * 10` + // The size should satisfy `size * N = LCD_width * LCD_height`, + // where N is an even number. + // For more details, see: https://github.com/esp-arduino-libs/ESP32_Display_Panel/blob/master/docs/FAQ.md#how-to-fix-screen-drift-issue-when-driving-rgb-lcd-with-esp32-s3 + #define ESP_PANEL_BOARD_LCD_RGB_IO_HSYNC (6) + #define ESP_PANEL_BOARD_LCD_RGB_IO_VSYNC (5) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DE (4) // -1 if not used + #define ESP_PANEL_BOARD_LCD_RGB_IO_PCLK (7) + #define ESP_PANEL_BOARD_LCD_RGB_IO_DISP (39) // -1 if not used. Typically set to -1 + + // The following sheet shows the mapping of ESP GPIOs to + // LCD data pins with different data width and color format: + // ┏------┳- ------------┳--------------------------┓ + // | ESP: | 8-bit RGB888 | 16-bit RGB565 | + // |------|--------------|--------------------------| + // | LCD: | RGB888 | RGB565 | RGB666 | RGB888 | + // ┗------|--------------|--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA0 (14) // | D0 | B0 | B0-1 | B0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA1 (13) // | D1 | B1 | B2 | B4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA2 (12) // | D2 | B2 | B3 | B5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA3 (9) // | D3 | B3 | B4 | B6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA4 (8) // | D4 | B4 | B5 | B7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA5 (20) // | D5 | G0 | G0 | G0-2 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA6 (19) // | D6 | G1 | G1 | G3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA7 (18) // | D7 | G2 | G2 | G4 | +#if ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH > 8 // ┗--------------┫--------|--------|--------| + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA8 (17) // | G3 | G3 | G5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA9 (16) // | G4 | G4 | G6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA10 (15) // | G5 | G5 | G7 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA11 (38) // | R0 | R0-1 | R0-3 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA12 (47) // | R1 | R2 | R4 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA13 (48) // | R2 | R3 | R5 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA14 (41) // | R3 | R4 | R6 | + #define ESP_PANEL_BOARD_LCD_RGB_IO_DATA15 (21) // | R4 | R5 | R7 | + // ┗--------┻--------┻--------┛ +#endif // ESP_PANEL_BOARD_LCD_RGB_DATA_WIDTH + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +/** + * @brief LCD color configuration + */ +#define ESP_PANEL_BOARD_LCD_COLOR_BITS (ESP_PANEL_LCD_COLOR_BITS_RGB888) + // 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 (-1) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 (0) + +#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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (20) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (19) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (-1) // 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_PWM_LEDC) + +#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 (40) // 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/viewe/Kconfig.viewe b/src/board/supported/viewe/Kconfig.viewe index b7e51b28..82c4ed66 100644 --- a/src/board/supported/viewe/Kconfig.viewe +++ b/src/board/supported/viewe/Kconfig.viewe @@ -1,3 +1,36 @@ +config BOARD_VIEWE_SMARTRING + bool "SMARTRING" + help + https://github.com/VIEWESMART/SMARTRING/tree/main/information + +config BOARD_VIEWE_UEDX24240013_MD50E + bool "UEDX24240013-MD50E" + help + https://github.com/VIEWESMART/UEDX24240013-MD50ESP32_1.3inch-Knob/tree/main/information + +config BOARD_VIEWE_UEDX46460015_MD50ET + bool "UEDX46460015-MD50ET" + help + https://github.com/VIEWESMART/UEDX46460015-MD50ESP32-1.5inch-Touch-Knob-Display/tree/main/datasheet + +config BOARD_VIEWE_UEDX48480021_MD80E + bool "UEDX48480021_MD80E" + help + https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob/tree/main/information + +config BOARD_VIEWE_UEDX48480021_MD80E_V2 + bool "UEDX48480021_MD80E_V2" + help + https://github.com/VIEWESMART/UEDX48480021-MD80ESP32_2.1inch-Knob/tree/main/information + +config BOARD_VIEWE_UEDX48480021_MD80ET + bool "UEDX48480021_MD80ET" + help + https://github.com/VIEWESMART/UEDX48480021-MD80ESP32-2.1inch-Touch-Knob-Display/tree/main/information + +config BOARD_VIEWE_UEDX48480028_MD80ET + bool "UEDX48480028_MD80ET" + config BOARD_VIEWE_UEDX24320024E_WB_A bool "UEDX24320024E-WB-A" help @@ -38,6 +71,11 @@ config BOARD_VIEWE_UEDX80480050E_WB_A help https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ +config BOARD_VIEWE_UEDX80480050E_AC_A + bool "UEDX80480050E-AC-A" + help + https://viewedisplay.com/product/esp32-5-inch-800x480-rgb-ips-tft-display-touch-screen-arduino-lvgl/ + config BOARD_VIEWE_UEDX80480050E_WB_A_2 bool "UEDX80480050E-WB-A-2" help diff --git a/src/board/supported/waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C.h b/src/board/supported/waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C.h new file mode 100644 index 00000000..ed055636 --- /dev/null +++ b/src/board/supported/waveshare/BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C.h @@ -0,0 +1,338 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @file BOARD_ESP32_S3_TOUCH_LCD_1_85_C.h + * @brief Configuration file for Waveshare ESP32_S3_TOUCH_LCD_1_85_C + * @author @martinroger & Waveshare@H-sw123 + * @link https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm + */ + +#pragma once + +// *INDENT-OFF* + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////// Please update the following macros to configure general panel ///////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Board name + */ +#define ESP_PANEL_BOARD_NAME "Waveshare:ESP32_S3_TOUCH_LCD_1_85_C" + +/** + * @brief Panel resolution configuration in pixels + */ +#define ESP_PANEL_BOARD_WIDTH (360) // Panel width (horizontal, in pixels) +#define ESP_PANEL_BOARD_HEIGHT (360) // 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 ST77916 + +/** + * @brief LCD bus type selection + */ +#define ESP_PANEL_BOARD_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_QSPI) + +#if (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI) || \ + (ESP_PANEL_BOARD_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI) +/** + * 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_LCD_BUS_SKIP_INIT_HOST (0) // 0/1. Typically set to 0 +#endif + +/** + * @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_QSPI + + /** + * @brief QSPI bus + */ + /* For general */ + #define ESP_PANEL_BOARD_LCD_QSPI_HOST_ID (2) +#if !ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST + /* For host */ + #define ESP_PANEL_BOARD_LCD_QSPI_IO_SCK (40) + #define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA0 (46) + #define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA1 (45) + #define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA2 (42) + #define ESP_PANEL_BOARD_LCD_QSPI_IO_DATA3 (41) +#endif // ESP_PANEL_BOARD_LCD_BUS_SKIP_INIT_HOST + /* For panel */ + #define ESP_PANEL_BOARD_LCD_QSPI_IO_CS (21) // -1 if not used + #define ESP_PANEL_BOARD_LCD_QSPI_MODE (0) // 0-3, typically set to 0 + #define ESP_PANEL_BOARD_LCD_QSPI_CLK_HZ (80 * 1000 * 1000) + // Should be an integer divisor of 80M, typically set to 40M + #define ESP_PANEL_BOARD_LCD_QSPI_CMD_BITS (32) // Typically set to 32 + #define ESP_PANEL_BOARD_LCD_QSPI_PARAM_BITS (8) // Typically set to 8 + +#endif // ESP_PANEL_BOARD_LCD_BUS_TYPE + +/** + * @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 (1) // 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 (-1) // Reset pin, -1 if not used +#define ESP_PANEL_BOARD_LCD_RST_LEVEL (0) // 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 CST816S + +/** + * @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 (1) // 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 (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_SDA_PULLUP (1) // 0/1. Typically set to 1 + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SCL (10) + #define ESP_PANEL_BOARD_TOUCH_I2C_IO_SDA (11) +#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 (0) // 0/1 +#define ESP_PANEL_BOARD_TOUCH_MIRROR_Y (0) // 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 (0) // Reset active level, 0: low, 1: high +#define ESP_PANEL_BOARD_TOUCH_INT_IO (4) // 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_PWM_LEDC) + +#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 (5) // 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 (1) + +#if ESP_PANEL_BOARD_USE_EXPANDER +/** + * @brief IO expander chip selection + */ +#define ESP_PANEL_BOARD_EXPANDER_CHIP TCA95XX_8BIT + +/** + * @brief IO expander I2C bus parameters configuration + */ +/** + * 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 devices, please set the macro to `1` ensure that the + * host is initialized only once. + */ +#define ESP_PANEL_BOARD_EXPANDER_SKIP_INIT_HOST (0) // 0/1 +/* For general */ +#define ESP_PANEL_BOARD_EXPANDER_I2C_HOST_ID (0) // Typically set to 0 +/* For host */ +#if !ESP_PANEL_BOARD_EXPANDER_SKIP_INIT_HOST +#define ESP_PANEL_BOARD_EXPANDER_I2C_CLK_HZ (400 * 1000) + // Typically set to 400K +#define ESP_PANEL_BOARD_EXPANDER_I2C_SCL_PULLUP (0) // 0/1. Typically set to 1 +#define ESP_PANEL_BOARD_EXPANDER_I2C_SDA_PULLUP (0) // 0/1. Typically set to 1 +#define ESP_PANEL_BOARD_EXPANDER_I2C_IO_SCL (10) +#define ESP_PANEL_BOARD_EXPANDER_I2C_IO_SDA (11) +#endif // ESP_PANEL_BOARD_EXPANDER_SKIP_INIT_HOST +/* For device */ +#define ESP_PANEL_BOARD_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 +#endif // ESP_PANEL_BOARD_USE_EXPANDER + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////// Please utilize the following macros to execute any additional code if required ///////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @brief Pre-begin function for LCD initialization + * + * @param[in] p Pointer to the board object + * @return true on success, false on failure + */ +#define ESP_PANEL_BOARD_LCD_PRE_BEGIN_FUNCTION(p) \ + { \ + constexpr int LCD_RST = 1; \ + auto board = static_cast(p); \ + auto expander = board->getIO_Expander()->getBase(); \ + /* LCD reset */ \ + expander->pinMode(LCD_RST, OUTPUT); \ + expander->digitalWrite(LCD_RST, LOW); \ + vTaskDelay(pdMS_TO_TICKS(10)); \ + expander->digitalWrite(LCD_RST, HIGH); \ + vTaskDelay(pdMS_TO_TICKS(100)); \ + return true; \ + } + +/** + * @brief Pre-begin function for touch panel initialization + * + * @param[in] p Pointer to the board object + * @return true on success, false on failure + */ +#define ESP_PANEL_BOARD_TOUCH_PRE_BEGIN_FUNCTION(p) \ + { \ + constexpr int TP_RST = 0; \ + auto board = static_cast(p); \ + auto expander = board->getIO_Expander()->getBase(); \ + /* Touch reset */ \ + expander->pinMode(TP_RST, OUTPUT); \ + expander->digitalWrite(TP_RST, LOW); \ + vTaskDelay(pdMS_TO_TICKS(30)); \ + expander->digitalWrite(TP_RST, HIGH); \ + vTaskDelay(pdMS_TO_TICKS(50)); \ + return true; \ + } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// 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 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 + +// *INDENT-ON* diff --git a/src/board/supported/waveshare/Kconfig.waveshare b/src/board/supported/waveshare/Kconfig.waveshare index e993d3aa..9d533dde 100644 --- a/src/board/supported/waveshare/Kconfig.waveshare +++ b/src/board/supported/waveshare/Kconfig.waveshare @@ -3,6 +3,11 @@ config BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85 help https://www.waveshare.com/esp32-s3-touch-lcd-1.85.htm +config BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C + bool "ESP32_S3_TOUCH_LCD_1_85_C" + help + https://www.waveshare.com/esp32-s3-touch-lcd-1.85c.htm + config BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_2_1 bool "ESP32_S3_TOUCH_LCD_2_1" help diff --git a/src/drivers/lcd/esp_panel_lcd_st7701.cpp b/src/drivers/lcd/esp_panel_lcd_st7701.cpp index 0c07c499..c999b920 100644 --- a/src/drivers/lcd/esp_panel_lcd_st7701.cpp +++ b/src/drivers/lcd/esp_panel_lcd_st7701.cpp @@ -61,7 +61,7 @@ bool LCD_ST7701::init() // Process the device on initialization ESP_UTILS_CHECK_FALSE_RETURN(processDeviceOnInit(_bus_specifications), false, "Process device on init failed"); -#if ESP_PANEL_DRIVERS_BUS_ENABLE_RGB +#if ESP_PANEL_DRIVERS_BUS_ENABLE_RGB || ESP_PANEL_DRIVERS_BUS_ENABLE_MIPI_DSI // Create refresh panel ESP_UTILS_CHECK_ERROR_RETURN( esp_lcd_new_panel_st7701( @@ -70,8 +70,8 @@ bool LCD_ST7701::init() ); ESP_UTILS_LOGD("Create refresh panel(@%p)", refresh_panel); #else - ESP_UTILS_CHECK_FALSE_RETURN(false, false, "MIPI-DSI is not supported"); -#endif // ESP_PANEL_DRIVERS_BUS_ENABLE_RGB + ESP_UTILS_CHECK_FALSE_RETURN(false, false, "Neither RGB nor MIPI-DSI is supported"); +#endif // ESP_PANEL_DRIVERS_BUS_ENABLE_RGB || ESP_PANEL_DRIVERS_BUS_ENABLE_MIPI_DSI /* Disable control panel if enable `auto_del_panel_io/enable_io_multiplex` flag */ if (getConfig().getVendorFullConfig()->flags.auto_del_panel_io) { diff --git a/src/drivers/touch/Kconfig.touch b/src/drivers/touch/Kconfig.touch index 3b47060d..de8afa9d 100644 --- a/src/drivers/touch/Kconfig.touch +++ b/src/drivers/touch/Kconfig.touch @@ -31,6 +31,10 @@ menu "Touch" bool "Use CST816S" default n + config ESP_PANEL_DRIVERS_TOUCH_USE_CST820 + bool "Use CST820" + default n + config ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 bool "Use FT5x06" default n diff --git a/src/drivers/touch/esp_panel_touch_conf_internal.h b/src/drivers/touch/esp_panel_touch_conf_internal.h index df2ad46b..28659aaf 100644 --- a/src/drivers/touch/esp_panel_touch_conf_internal.h +++ b/src/drivers/touch/esp_panel_touch_conf_internal.h @@ -226,6 +226,14 @@ #endif #endif +#ifndef ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 + #if ESP_PANEL_DRIVERS_TOUCH_COMPILE_UNUSED_DRIVERS || ESP_PANEL_DRIVERS_TOUCH_USE_CST820 + #define ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 (1) + #else + #define ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 (0) + #endif +#endif + #ifndef ESP_PANEL_DRIVERS_TOUCH_ENABLE_FT5x06 #if ESP_PANEL_DRIVERS_TOUCH_COMPILE_UNUSED_DRIVERS || ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 #define ESP_PANEL_DRIVERS_TOUCH_ENABLE_FT5x06 (1) diff --git a/src/drivers/touch/esp_panel_touch_cst820.cpp b/src/drivers/touch/esp_panel_touch_cst820.cpp new file mode 100644 index 00000000..0464701d --- /dev/null +++ b/src/drivers/touch/esp_panel_touch_cst820.cpp @@ -0,0 +1,52 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_panel_touch_conf_internal.h" +#if ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 + +#include "utils/esp_panel_utils_log.h" +#include "esp_panel_touch_cst820.hpp" + +namespace esp_panel::drivers { + +TouchCST820::~TouchCST820() +{ + ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS(); + + ESP_UTILS_CHECK_FALSE_EXIT(del(), "Delete failed"); + + ESP_UTILS_LOG_TRACE_EXIT_WITH_THIS(); +} + +bool TouchCST820::begin() +{ + ESP_UTILS_LOG_TRACE_ENTER_WITH_THIS(); + + ESP_UTILS_CHECK_FALSE_RETURN(!isOverState(State::BEGIN), false, "Already begun"); + + // Initialize the touch if not initialized + if (!isOverState(State::INIT)) { + ESP_UTILS_CHECK_FALSE_RETURN(init(), false, "Init failed"); + } + + // Create touch panel + ESP_UTILS_CHECK_ERROR_RETURN( + esp_lcd_touch_new_i2c_cst820( + getBus()->getControlPanelHandle(), getConfig().getDeviceFullConfig(), &touch_panel + ), false, "Create touch panel failed" + ); + ESP_UTILS_LOGD("Create touch panel(@%p)", touch_panel); + + setState(State::BEGIN); + + ESP_UTILS_LOG_TRACE_EXIT_WITH_THIS(); + + return true; +} + +} // namespace esp_panel::drivers + +#endif // ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 diff --git a/src/drivers/touch/esp_panel_touch_cst820.hpp b/src/drivers/touch/esp_panel_touch_cst820.hpp new file mode 100644 index 00000000..324f848f --- /dev/null +++ b/src/drivers/touch/esp_panel_touch_cst820.hpp @@ -0,0 +1,80 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "port/esp_lcd_touch_cst820.h" +#include "esp_panel_touch_conf_internal.h" +#include "esp_panel_touch.hpp" + +namespace esp_panel::drivers { + +/** + * @brief CST820 touch controller + * + * This class provides implementation for CST820 touch controller, inheriting from + * the base Touch class to provide common touch functionality + */ +class TouchCST820 : public Touch { +public: + /** + * @brief Default basic attributes for CST820 + */ + static constexpr BasicAttributes BASIC_ATTRIBUTES_DEFAULT = { + .name = "CST820", + .max_points_num = 1, + }; + + /** + * @brief Construct a touch device instance with individual configuration parameters + * + * @param bus Bus interface for communicating with the touch device + * @param width Panel width in pixels + * @param height Panel height in pixels + * @param rst_io Reset GPIO pin number (-1 if unused) + * @param int_io Interrupt GPIO pin number (-1 if unused) + */ + TouchCST820(Bus *bus, uint16_t width, uint16_t height, int rst_io = -1, int int_io = -1): + Touch(BASIC_ATTRIBUTES_DEFAULT, bus, width, height, rst_io, int_io) + { + } + + /** + * @brief Construct a touch device instance with configuration + * + * @param[in] bus Pointer to the bus interface for communicating with the touch device + * @param[in] config Configuration structure containing device settings and parameters + */ + TouchCST820(Bus *bus, const Config &config): Touch(BASIC_ATTRIBUTES_DEFAULT, bus, config) {} + + /** + * @brief Construct a touch device instance with bus configuration and device configuration + * + * @param[in] bus_config Bus configuration + * @param[in] touch_config Touch configuration + * @note This constructor creates a new bus instance using the provided bus configuration + */ + TouchCST820(const BusFactory::Config &bus_config, const Config &touch_config): + Touch(BASIC_ATTRIBUTES_DEFAULT, bus_config, touch_config) + { + } + + /** + * @brief Destruct touch device + */ + ~TouchCST820() override; + + /** + * @brief Startup the touch device + * + * @return `true` if success, otherwise false + * + * @note This function should be called after `init()` + */ + bool begin() override; +}; + +} // namespace esp_panel::drivers diff --git a/src/drivers/touch/esp_panel_touch_factory.cpp b/src/drivers/touch/esp_panel_touch_factory.cpp index 19999f02..331c0412 100644 --- a/src/drivers/touch/esp_panel_touch_factory.cpp +++ b/src/drivers/touch/esp_panel_touch_factory.cpp @@ -33,6 +33,9 @@ const utils::unordered_map To #if ESP_PANEL_DRIVERS_TOUCH_USE_CST816S MAP_ITEM(CST816S), #endif // CONFIG_ESP_PANEL_TOUCH_CST816S +#if ESP_PANEL_DRIVERS_TOUCH_USE_CST820 + MAP_ITEM(CST820), +#endif // CONFIG_ESP_PANEL_TOUCH_CST820 #if ESP_PANEL_DRIVERS_TOUCH_USE_FT5x06 MAP_ITEM(FT5x06), #endif // CONFIG_ESP_PANEL_TOUCH_FT5x06 diff --git a/src/drivers/touch/esp_panel_touch_factory.hpp b/src/drivers/touch/esp_panel_touch_factory.hpp index 901e8386..565245d2 100644 --- a/src/drivers/touch/esp_panel_touch_factory.hpp +++ b/src/drivers/touch/esp_panel_touch_factory.hpp @@ -13,6 +13,7 @@ #include "esp_panel_touch_axs15231b.hpp" #include "esp_panel_touch_chsc6540.hpp" #include "esp_panel_touch_cst816s.hpp" +#include "esp_panel_touch_cst820.hpp" #include "esp_panel_touch_ft5x06.hpp" #include "esp_panel_touch_gt911.hpp" #include "esp_panel_touch_gt1151.hpp" diff --git a/src/drivers/touch/port/esp_lcd_touch_cst820.c b/src/drivers/touch/port/esp_lcd_touch_cst820.c new file mode 100644 index 00000000..70f7e72e --- /dev/null +++ b/src/drivers/touch/port/esp_lcd_touch_cst820.c @@ -0,0 +1,214 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * @file esp_lcd_touch_cst820.c + * @brief ESP LCD touch: CST820 + * @author Viewe@VIEWESMART + */ + +#include "../esp_panel_touch_conf_internal.h" +#if ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 + +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.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 "utils/esp_panel_utils_log.h" +#include "esp_utils_helpers.h" +#include "esp_lcd_touch_cst820.h" + +#define POINT_NUM_MAX (1) + +#define DATA_START_REG (0x00) +#define CHIP_ID_REG (0xA7) + +static const char *TAG = "CST820"; + +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_cst820(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *tp) +{ + ESP_LOGI(TAG, "version: %d.%d.%d", ESP_LCD_TOUCH_CST820_VER_MAJOR, ESP_LCD_TOUCH_CST820_VER_MINOR, + ESP_LCD_TOUCH_CST820_VER_PATCH); + 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"); + + /* Prepare main structure */ + esp_err_t ret = ESP_OK; + esp_lcd_touch_handle_t cst820 = calloc(1, sizeof(esp_lcd_touch_t)); + ESP_GOTO_ON_FALSE(cst820, ESP_ERR_NO_MEM, err, TAG, "Touch handle malloc failed"); + + /* Communication interface */ + cst820->io = io; + /* Only supported callbacks are set */ + cst820->read_data = read_data; + cst820->get_xy = get_xy; + cst820->del = del; + /* Mutex */ + cst820->data.lock.owner = portMUX_FREE_VAL; + /* Save config */ + memcpy(&cst820->config, config, sizeof(esp_lcd_touch_config_t)); + + /* Prepare pin for touch interrupt */ + if (cst820->config.int_gpio_num != GPIO_NUM_NC) { + const gpio_config_t int_gpio_config = { + .mode = GPIO_MODE_INPUT, + .intr_type = (cst820->config.levels.interrupt ? GPIO_INTR_POSEDGE : GPIO_INTR_NEGEDGE), + .pin_bit_mask = BIT64(cst820->config.int_gpio_num) + }; + ESP_GOTO_ON_ERROR(gpio_config(&int_gpio_config), err, TAG, "GPIO intr config failed"); + + /* Register interrupt callback */ + if (cst820->config.interrupt_callback) { + esp_lcd_touch_register_interrupt_callback(cst820, cst820->config.interrupt_callback); + } + } + /* Prepare pin for touch controller reset */ + if (cst820->config.rst_gpio_num != GPIO_NUM_NC) { + const gpio_config_t rst_gpio_config = { + .mode = GPIO_MODE_OUTPUT, + .pin_bit_mask = BIT64(cst820->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(cst820), err, TAG, "Reset failed"); + /* Read product id */ + ESP_GOTO_ON_ERROR(read_id(cst820), err, TAG, "Read version failed"); + *tp = cst820; + + return ESP_OK; +err: + if (cst820) { + del(cst820); + } + 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; + // ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, DATA_START_REG, (uint8_t *)&point, sizeof(data_t)), TAG, "I2C read failed"); + + /*CST820 */ + uint8_t lvalue[15] = {0}; + // uint8_t gesture_id=0; + uint16_t x = 0; + uint16_t y = 0; + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, DATA_START_REG, (uint8_t *)lvalue, sizeof(lvalue)), TAG, "I2C read failed"); + // gesture_id = lvalue[1]; + point.num = lvalue[2]; + x = (((uint16_t)(lvalue[3] & 0x0f)) << 8) | lvalue[4]; + y = (((uint16_t)(lvalue[5] & 0x0f)) << 8) | lvalue[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); +} + +#endif // ESP_PANEL_DRIVERS_TOUCH_ENABLE_CST820 diff --git a/src/drivers/touch/port/esp_lcd_touch_cst820.h b/src/drivers/touch/port/esp_lcd_touch_cst820.h new file mode 100644 index 00000000..cbde1d9a --- /dev/null +++ b/src/drivers/touch/port/esp_lcd_touch_cst820.h @@ -0,0 +1,62 @@ +/* + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file esp_lcd_touch_cst820.h + * @brief ESP LCD touch: CST820 + * @author Viewe@VIEWESMART + */ + +#pragma once + +#include "esp_lcd_touch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ESP_LCD_TOUCH_CST820_VER_MAJOR (0) +#define ESP_LCD_TOUCH_CST820_VER_MINOR (1) +#define ESP_LCD_TOUCH_CST820_VER_PATCH (0) + +/** + * @brief Create a new CST820 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_cst820(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 CST820 controller + * + */ +#define ESP_LCD_TOUCH_IO_I2C_CST820_ADDRESS (0x15) + +/** + * @brief Touch IO configuration structure + * + */ +#define ESP_LCD_TOUCH_IO_I2C_CST820_CONFIG() \ + { \ + .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST820_ADDRESS, \ + .control_phase_bytes = 1, \ + .dc_bit_offset = 0, \ + .lcd_cmd_bits = 8, \ + .flags = \ + { \ + .disable_control_phase = 1, \ + } \ + } + +#ifdef __cplusplus +} +#endif diff --git a/src/esp_panel_versions.h b/src/esp_panel_versions.h index 648505fd..ebb3f1b5 100644 --- a/src/esp_panel_versions.h +++ b/src/esp_panel_versions.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,15 +12,15 @@ /* File `esp_panel_drivers_conf.h` */ #define ESP_PANEL_DRIVERS_CONF_VERSION_MAJOR 1 -#define ESP_PANEL_DRIVERS_CONF_VERSION_MINOR 0 +#define ESP_PANEL_DRIVERS_CONF_VERSION_MINOR 1 #define ESP_PANEL_DRIVERS_CONF_VERSION_PATCH 0 /* File `esp_panel_board_custom_conf.h` */ #define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 2 #define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0 /* File `esp_panel_board_supported_conf.h` */ #define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 1 #define ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH 0 diff --git a/template_files/lv_conf.h b/template_files/lv_conf.h index 57b48ac8..e27d5834 100644 --- a/template_files/lv_conf.h +++ b/template_files/lv_conf.h @@ -360,7 +360,7 @@ *===================*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ + *https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_8 1 #define LV_FONT_MONTSERRAT_10 1 #define LV_FONT_MONTSERRAT_12 1 @@ -451,7 +451,7 @@ /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ #define LV_USE_BIDI 0 #if LV_USE_BIDI /*Set the default direction. Supported values: @@ -469,7 +469,7 @@ * WIDGET USAGE *================*/ -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #define LV_USE_ARC 1 diff --git a/template_files/lvgl_v8_port.cpp b/template_files/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/template_files/lvgl_v8_port.cpp +++ b/template_files/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/test_apps/board/waveshare/sdkconfig.ci.BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C b/test_apps/board/waveshare/sdkconfig.ci.BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C new file mode 100644 index 00000000..553f654a --- /dev/null +++ b/test_apps/board/waveshare/sdkconfig.ci.BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C @@ -0,0 +1,5 @@ +CONFIG_IDF_TARGET="esp32s3" +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y +CONFIG_SPIRAM_MODE_OCT=y + +CONFIG_BOARD_WAVESHARE_ESP32_S3_TOUCH_LCD_1_85_C=y diff --git a/test_apps/drivers/touch/i2c/main/test_i2c_touch.cpp b/test_apps/drivers/touch/i2c/main/test_i2c_touch.cpp index 35cba6b7..cbbbf19f 100644 --- a/test_apps/drivers/touch/i2c/main/test_i2c_touch.cpp +++ b/test_apps/drivers/touch/i2c/main/test_i2c_touch.cpp @@ -142,6 +142,7 @@ decltype(auto) create_touch_impl(Bus *bus, std::nullptr_t) CREATE_TEST_CASE(AXS15231B) CREATE_TEST_CASE(CHSC6540) CREATE_TEST_CASE(CST816S) +CREATE_TEST_CASE(CST820) CREATE_TEST_CASE(FT5x06) CREATE_TEST_CASE(GT1151) CREATE_TEST_CASE(GT911) diff --git a/test_apps/gui/lvgl_v8_port/main/lvgl_v8_port.cpp b/test_apps/gui/lvgl_v8_port/main/lvgl_v8_port.cpp index 8c6042f3..e9f71dca 100644 --- a/test_apps/gui/lvgl_v8_port/main/lvgl_v8_port.cpp +++ b/test_apps/gui/lvgl_v8_port/main/lvgl_v8_port.cpp @@ -4,6 +4,8 @@ * SPDX-License-Identifier: CC0-1.0 */ +#include "freertos/FreeRTOS.h" + #include "esp_timer.h" #undef ESP_UTILS_LOG_TAG #define ESP_UTILS_LOG_TAG "LvPort" @@ -638,10 +640,18 @@ static lv_disp_t *display_init(LCD *lcd) return lv_disp_drv_register(&disp_drv); } +static SemaphoreHandle_t touch_detected; + static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) { Touch *tp = (Touch *)indev_drv->user_data; TouchPoint point; + data->state = LV_INDEV_STATE_RELEASED; + + /* if we are interrupt driven wait for the ISR to fire */ + if ( tp->isInterruptEnabled() && (xSemaphoreTake( touch_detected, 0 ) == pdFALSE) ) { + return; + } /* Read data from touch controller */ int read_touch_result = tp->readPoints(&point, 1, 0); @@ -649,11 +659,17 @@ static void touchpad_read(lv_indev_drv_t *indev_drv, lv_indev_data_t *data) data->point.x = point.x; data->point.y = point.y; data->state = LV_INDEV_STATE_PRESSED; - } else { - data->state = LV_INDEV_STATE_RELEASED; } } +static bool onTouchInterruptCallback(void *user_data) +{ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + xSemaphoreGiveFromISR( touch_detected, &xHigherPriorityTaskWoken ); + portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); + return false; +} + static lv_indev_t *indev_init(Touch *tp) { ESP_UTILS_CHECK_FALSE_RETURN(tp != nullptr, nullptr, "Invalid touch device"); @@ -661,6 +677,10 @@ static lv_indev_t *indev_init(Touch *tp) static lv_indev_drv_t indev_drv_tp; + if (tp->isInterruptEnabled()) { + touch_detected = xSemaphoreCreateBinary(); + tp->attachInterruptCallback(onTouchInterruptCallback, tp); + } ESP_UTILS_LOGD("Register input driver to LVGL"); lv_indev_drv_init(&indev_drv_tp); indev_drv_tp.type = LV_INDEV_TYPE_POINTER; diff --git a/tools/check_file_version.py b/tools/check_file_version.py index 99148ccd..b6f02c4d 100644 --- a/tools/check_file_version.py +++ b/tools/check_file_version.py @@ -86,7 +86,7 @@ def is_in_directory(file_path, directory): def extract_file_version(file_path, version_dict): file_contents = [] content_str = '' - with open(file_path, 'r') as file: + with open(file_path, 'r', encoding='utf-8') as file: file_contents.append(file.readlines()) for content in file_contents: content_str = ''.join(content) @@ -105,7 +105,7 @@ def extract_file_version(file_path, version_dict): def extract_arduino_version(file_path): file_contents = [] content_str = '' - with open(file_path, 'r') as file: + with open(file_path, 'r', encoding='utf-8') as file: file_contents.append(file.readlines()) for content in file_contents: content_str = ''.join(content) diff --git a/tools/sync_conf_files.py b/tools/sync_conf_files.py index 46197479..2238c093 100644 --- a/tools/sync_conf_files.py +++ b/tools/sync_conf_files.py @@ -40,7 +40,7 @@ def is_same_file(file1, file2): if not os.path.exists(file1) or not os.path.exists(file2): return False - with open(file1, 'r') as f1, open(file2, 'r') as f2: + with open(file1, 'r', encoding='utf-8') as f1, open(file2, 'r', encoding='utf-8') as f2: file1_content = f1.read() file2_content = f2.read()