diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5596415..34472d45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: prepare: name: Determine variants to build runs-on: ubuntu-latest + container: + image: espressif/idf:v6.0.1 outputs: variants: ${{ steps.select.outputs.variants }} steps: @@ -25,7 +27,7 @@ jobs: fetch-depth: 0 - name: Install jq - run: sudo apt-get update && sudo apt-get install -y jq + run: apt-get update && apt-get install -y jq - id: list name: Get all variant list @@ -34,6 +36,7 @@ jobs: - id: select name: Select variants based on changes + shell: bash env: ALL_VARIANTS: ${{ steps.list.outputs.all_variants }} run: | @@ -92,7 +95,7 @@ jobs: include: ${{ fromJson(needs.prepare.outputs.variants) }} runs-on: ubuntu-latest container: - image: espressif/idf:v5.5.2 + image: espressif/idf:v6.0.1 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 69d9c311..eb94cf8b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,5 +9,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) # "Trim" the build. Include the minimal set of components, main, and anything it depends on. idf_build_set_property(MINIMAL_BUILD ON) -set(PROJECT_VER "2.3.0") +set(PROJECT_VER "2.4.0") project(xiaozhi) diff --git a/docs/esp-idf-6-migration.md b/docs/esp-idf-6-migration.md new file mode 100644 index 00000000..190f9e9f --- /dev/null +++ b/docs/esp-idf-6-migration.md @@ -0,0 +1,262 @@ +# ESP-IDF 6.0 Migration and Board Compatibility Status + +> Last updated: 2026-07-16 +> Validated SDK: ESP-IDF v6.0.1 +> Scope: 137 board directories and 157 supported build variants defined by `main/boards/**/config.json`. + +## Current Status + +The migration baseline is reproducible from committed project files and published Component Registry packages. All 157 IDF 6 variants are now build-compatible with ESP-IDF 6.0.1: 156 passed the last complete GitHub Actions matrix, and `esp-vocat` subsequently passed a local full build after rebasing onto upstream commit `467b96a` and fixing two IDF 6/C++26 ST77916 initialization errors. A new complete matrix is pending. Fourteen legacy ESP32-P4 Rev < 3 variants are excluded from the IDF 6 matrix but remain available when building with ESP-IDF < 6. + +| Status | Variants | Meaning | +|---|---:|---| +| โœ… Build-compatible | 157 | 156 clean full builds completed in GitHub Actions and `esp-vocat` completed locally with ESP-IDF 6.0.1; this does not imply hardware or complete peripheral validation | +| ๐ŸŸก Feature-degraded subset | 1 | `esp-vocat` builds on IDF 6, but its PCB capacitive slider/button support is disabled pending compatible touch-sensor components | +| ๐Ÿ”ด Build-blocked | 0 | No supported release variant remains blocked at compile or link time | + +There are no remaining IDF 6 build blockers. [`78/esp_lcd_nv3023 1.0.1`](https://components.espressif.com/components/78/esp_lcd_nv3023/versions/1.0.1) and [`wvirgil123/sscma_client 1.0.3`](https://components.espressif.com/components/wvirgil123/sscma_client/versions/1.0.3/readme) are consumed directly from the Component Registry, so local copies under the ignored `components/` directory are not required. ESP32-P4 Rev < 3 remains on the ESP-IDF 5.5 legacy build path, while the IDF 6 matrix supports ESP32-P4 v3.x. + +Representative local full-build results are shown below. Firmware size and free space are reported by ESP-IDF 6.0.1 `check_sizes.py`. The authoritative per-variant compatibility result is the full GitHub Actions matrix in the next section. + +| Chip | Build variant | Application size | Free space in smallest app partition | +|---|---|---:|---:| +| ESP32 | `bread-compact-esp32` | `0x240560` | 23% | +| ESP32-C3 | `esp-hi` | `0x20ef10` | 30% | +| ESP32-C3 | `xmini-c3` | `0x2370f0` | 44% | +| ESP32-C5 | `waveshare-esp32-c5-touch-lcd-1.69` | `0x27cd30` | 37% | +| ESP32-C6 | `waveshare-esp32-c6-lcd-0.85` | `0x280ee0` | 15% | +| ESP32-S3 | `doit-s3-aibox` | `0x21edf0` | 46% | +| ESP32-S3 | `lilygo-t-display-s3-pro-mvsrlora` | `0x2adce0` | 32% | +| ESP32-S3 | `lilygo-t-circle-s3` | `0x2a32f0` | 33% | +| ESP32-S3 | `zhengchen-1.54tft-wifi` | `0x2abdc0` | 32% | +| ESP32-S3 | `kevin-yuying-313lcd` | `0x2c4990` | 30% | +| ESP32-S3 | `otto-robot` | `0x37ff70` | 11% | +| ESP32-S3 | `esp-vocat` | `0x2742f0` | 38% | +| ESP32-S3 | `sensecap-watcher` | `0x2faff0` | 25% | +| ESP32-P4 v3.x | `esp-p4-function-ev-board-p4x` | `0x385420` | 11% | +| ESP32-P4 v3.x | `m5stack-tab5-p4x` | `0x380790` | 11% | + +As a negative test, `esp-p4-function-ev-board` (legacy P4 Rev < 3) was rejected as expected by `esp-sr 2.4.6` during IDF 6.0.1 configuration. Legacy P4 variants are therefore version-gated to ESP-IDF < 6 instead of being carried as permanent IDF 6 blockers. + +For backward-compatibility regression coverage, `xmini-c3` also completed a full build with ESP-IDF 5.5.4 (application size `0x234920`, 44% free in the smallest app partition). This confirms that the compatibility changes for I2S port numbering, LCD I2C configuration, and the UHCI DMA dependency did not break the existing 5.5 build chain. + +## Full-Matrix CI Validation + +GitHub Actions run [29477593880](https://github.com/78/xiaozhi-esp32/actions/runs/29477593880) built the complete matrix with the `espressif/idf:v6.0.1` container and only committed files plus published registry components. The matrix-generation job and 156 board jobs passed; exactly 1 board job failed at the then-current configure-time guard for unsupported touch-sensor components. The table below records that historical run; `esp-vocat` has since passed locally and the replacement full-matrix run is pending. + +Results by chip target: + +| Chip target | Variants | Passed | Blocked | +|---|---:|---:|---:| +| ESP32 | 7 | 7 | 0 | +| ESP32-C3 | 9 | 9 | 0 | +| ESP32-C5 | 4 | 4 | 0 | +| ESP32-C6 | 9 | 9 | 0 | +| ESP32-S3 | 114 | 113 | 1 | +| ESP32-P4 v3.x | 14 | 14 | 0 | +| **Total** | **157** | **156** | **1** | + +The failure in that run and its current resolution are: + +| Build variant | Failure in run 29477593880 | Current resolution | +|---|---|---| +| `esp-vocat` | `touch_slider_sensor` and `touch_button_sensor` require IDF < 6.0 | IDF 6 builds omit the PCB capacitive slider/button path; CST816 display touch remains enabled. A local full build passed after the mainline change and ST77916 compatibility fixes | + +## ESP32-P4 Silicon Scope and Naming + +The IDF 6 release matrix supports only ESP32-P4 v3.x silicon. Each legacy Rev < 3 build keeps its original name and contains `idf_version: "<6.0"`. Variant selection behaves as follows: + +| SDK | ESP32-P4 Rev < 3 | ESP32-P4 Rev >= 3 | +|---|---|---| +| ESP-IDF < 6 | Original name without a suffix; adds `CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y` and `CONFIG_ESP32P4_REV_MIN_100=y` | Original name plus `-p4x` | +| ESP-IDF >= 6 | Not listed or built | `-p4x` | + +This restores the historical artifact names and keeps the IDF 6 matrix at 157 variants. The IDF 5.5 selection contains 171 variants: 14 P4 `-p4x` artifacts, 14 legacy-P4 artifacts with their original unsuffixed names, and 143 non-P4 variants. + +Espressif's current chip-identification table lists v0.0, v1.0, v1.3, v3.0, v3.1, and v3.2, with no v4.0 revision. The public errata history added v3.0/v3.1 information on 2026-02-12 and v3.2 information on 2026-04-20. ESP-IDF 6.0 release notes explicitly describe support for "ESP32-P4 Version3 silicon." See the official [chip revision identification](https://docs.espressif.com/projects/esp-chip-errata/en/latest/esp32p4/01-chip-identification/index.html), [errata revision history](https://docs.espressif.com/projects/esp-chip-errata/en/latest/esp32p4/revision-history/index.html), and [ESP-IDF releases](https://github.com/espressif/esp-idf/releases). + +## Component Compatibility + +| Component/module | Version or approach for IDF 6 | Status | Notes | +|---|---|---|---| +| `78/uart-uhci` | `0.3.2` | โœ… Upstream support | The registry release compiles under IDF 6.0.1 in GitHub Actions | +| `78/uart-eth-modem` | `0.6.1` | โœ… Upstream support | Updated for the new event callback and depends on `uart-uhci 0.3.x` | +| `espressif/mqtt` | `1.0.0` | โœ… Upstream support | MQTT moved from a built-in SDK component to a Component Manager dependency in IDF 6 | +| `78/esp-ml307` | `3.6.6` + project-level `espressif/mqtt` | โœ… Builds in CI | The upstream source compiles under IDF 6.0.1 when the project supplies the MQTT component moved out of IDF | +| `espressif/esp_hosted` / `esp_wifi_remote` | `2.12.11` / `1.6.2` | โœ… Upstream support | Used for ESP32-P4 Hosted Wi-Fi | +| `espressif/esp_video` | `^2.0.1` | โœ… Upstream support | Currently resolves to 2.3.0 on S3 and 2.0.1 on P4 due to BSP constraints | +| P4 BSP / LCD drivers | BSP `5.2.3`, EK79007/ST7701 `2.0.x` | โœ… Upstream support | Resolves IDF 6 DPI, color-field, and split-driver-component issues | +| `espressif/esp_lcd_st77916` | `2.0.2` | โœ… Upstream support | Major version 2 uses the IDF 6 panel I/O definitions | +| `espressif/esp_lcd_spd2010` | `^2.0.0` (resolved `2.0.0~1`) | โœ… Upstream support | Major version 2 declares ESP-IDF 6 compatibility | +| `espressif/esp_lcd_co5300` | `2.1.0` | โœ… Upstream support | Used with explicit IDF 6-compatible QSPI I/O configuration in board code | +| `esp_emote_expression` | `1.0.2` | โœ… Upstream support | Replaces the previous dependency on the built-in `json` component | +| `wvirgil123/sscma_client` | [`1.0.3`](https://components.espressif.com/components/wvirgil123/sscma_client/versions/1.0.3/readme) | โœ… Upstream support | Uses `espressif/cjson` and the split driver components on IDF 6 while retaining the legacy component names on older IDF releases | +| `espressif/servo` / `espfriends/servo_dog_ctrl` | `1.0.0` / `0.2.0` | โœ… Upstream support | Uses official registry releases; compilation and linking were validated in the full IDF 6.0.1 build of `esp-hi`, with no local override required | +| `78/esp_lcd_nv3023` | [`1.0.1`](https://components.espressif.com/components/78/esp_lcd_nv3023/versions/1.0.1) | โœ… Upstream-based registry release | Mirrors MakerM0 upstream commit `15dae953`; adds IDF 6 color-order and GPIO compatibility while retaining older IDF branches; validated through the registry in a clean `magiclick-c3` full build | +| `llgok/cpp_bus_driver` | Excluded from the IDF 6 baseline | โšช Waiting for upstream | Version `2.1.0` still requires local patches for IDF 6. It is used only by the `LILYGO T-Display-P4` source, and that board has no release `config.json`, so the component has been removed until upstream support is available | +| MQTT protocol AES-CTR | PSA Crypto | โœ… Ported | Replaces the legacy AES context API removed by IDF 6 / Mbed TLS 4 | +| BluFi security negotiation (conditional path) | Legacy Mbed TLS DHM/AES API | โšช Not yet migrated | None of the 157 supported release variants enables it. IDF 6 removed `mbedtls/dhm.h`; compatibility of the official PSA FFDH + AES-CTR approach with the existing mobile-client protocol must be evaluated | +| `espressif/bmi270_sensor` | [`0.1.2`](https://components.espressif.com/components/espressif/bmi270_sensor/versions/0.1.2/readme?language=en) | โœ… Upstream support | Provides IDF 6.0 prebuilt libraries for ESP32-C5 and ESP32-S3; validated by a full `esp-spot-c5` build | +| `touch_slider_sensor` / `touch_button_sensor` | Disabled for IDF 6 | ๐ŸŸก Feature gap | Their manifests require IDF < 6.0, so ESP Vocat omits its PCB capacitive slider/button path on IDF 6. CST816 display touch is unaffected | +| ESP32-P4 Rev < 3 / `espressif/esp-sr` | Version-gated to IDF < 6 | ๐ŸŸก Legacy SDK path | The 14 legacy variants are restored for IDF 5.5 builds. They remain excluded from IDF 6 because `esp-sr 2.4.6` rejects the old-silicon configuration; ESP32-P4 v3.x is unaffected | + +## Per-Board Progress + +In the table below, "Board" is the source directory and "Build variant" is the firmware name used by the release script. Different chip revisions of the same board may have different status, so they are split into separate rows when necessary. + +| Chip | Board | Build variant | IDF 6.0 status | Current validation | Blocker/next step | +|---|---|---|---|---|---| +| `esp32` | `atommatrix-echo-base` | `atommatrix-echo-base` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32` | `bread-compact-esp32` | `bread-compact-esp32` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32` | `bread-compact-esp32` | `bread-compact-esp32-128x32` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32` | `bread-compact-esp32-lcd` | `bread-compact-esp32-lcd` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32` | `esp32-cgc` | `esp32-cgc` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32` | `esp32-cgc-144` | `esp32-cgc-144` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32` | `waveshare/esp32-touch-lcd-3.5` | `waveshare-esp32-touch-lcd-3.5` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `esp-hi` | `esp-hi` | โœ… Full build passed | IDF 6.0.1 `idf.py build`; `servo_dog_ctrl 0.2.0` | Hardware smoke, servo, and audio peripheral regression pending | +| `esp32c3` | `kevin-c3` | `kevin-c3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `lichuang-c3-dev` | `lichuang-c3-dev` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `magiclick-c3` | `magiclick-c3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `magiclick-c3-v2` | `magiclick-c3-v2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `surfer-c3-1.14tft` | `surfer-c3-1.14tft` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `xmini-c3` | `xmini-c3` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32c3` | `xmini-c3-4g` | `xmini-c3-4g` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c3` | `xmini-c3-v3` | `xmini-c3-v3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c5` | `esp-sensairshuttle` | `esp-sensairshuttle` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c5` | `esp-spot` | `esp-spot-c5` | โœ… Full build passed | IDF 6.0.1 `idf.py build`; `bmi270_sensor 0.1.2` | Hardware smoke, BMI270, audio, and power-management regression pending | +| `esp32c5` | `movecall-moji2-esp32c5` | `movecall-moji2-esp32c5` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c5` | `waveshare/esp32-c5-touch-lcd-1.69` | `waveshare-esp32-c5-touch-lcd-1.69` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-lcd-0.85` | `waveshare-esp32-c6-lcd-0.85` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-lcd-1.69` | `waveshare-esp32-c6-lcd-1.69` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-amoled-1.32` | `waveshare-esp32-c6-touch-amoled-1.32` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-amoled-1.43` | `waveshare-esp32-c6-touch-amoled-1.43` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-amoled-1.8` | `waveshare-esp32-c6-touch-amoled-1.8` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-amoled-2.06` | `waveshare-esp32-c6-touch-amoled-2.06` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-amoled-2.16` | `waveshare-esp32-c6-touch-amoled-2.16` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-lcd-1.54` | `waveshare-esp32-c6-touch-lcd-1.54` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32c6` | `waveshare/esp32-c6-touch-lcd-1.83` | `waveshare-esp32-c6-touch-lcd-1.83` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `aipi-lite` | `aipi-lite` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3` | `atk-dnesp32s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3-box` | `atk-dnesp32s3-box` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3-box0` | `atk-dnesp32s3-box0` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3-box2-4g` | `atk-dnesp32s3-box2-4g` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3-box2-wifi` | `atk-dnesp32s3-box2-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atk-dnesp32s3-box3` | `atk-dnesp32s3-box3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atom-echos3r` | `atom-echos3r` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atoms3-echo-base` | `atoms3-echo-base` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atoms3r-cam-m12-echo-base` | `atoms3r-cam-m12-echo-base` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atoms3r-echo-base` | `atoms3r-echo-base` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `atoms3r-echo-pyramid` | `atoms3r-echo-pyramid` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `bread-compact-ml307` | `bread-compact-ml307`
`bread-compact-ml307-128x64` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `bread-compact-nt26` | `bread-compact-nt26` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `bread-compact-wifi` | `bread-compact-wifi`
`bread-compact-wifi-128x64` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `df-k10` | `df-k10` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `df-s3-ai-cam` | `df-s3-ai-cam` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `doit-s3-aibox` | `doit-s3-aibox` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32s3` | `du-chatx` | `du-chatx` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `electron-bot` | `electron-bot` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-box` | `esp-box` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-box-3` | `esp-box-3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-box-lite` | `esp-box-lite` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-s3-lcd-ev-board` | `esp-s3-lcd-ev-board-1p4`
`esp-s3-lcd-ev-board-1p5` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-s3-lcd-ev-board-2` | `esp-s3-lcd-ev-board-2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-sparkbot` | `esp-sparkbot` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp-vocat` | `esp-vocat` | ๐ŸŸก Full build passed; feature-degraded | Local ESP-IDF 6.0.1 full build after rebasing onto `origin/main` | PCB capacitive slider/button disabled on IDF 6; CST816 display touch remains enabled; hardware regression pending | +| `esp32s3` | `esp32s3-korvo2-v3` | `esp32s3-korvo2-v3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `esp32s3-korvo2-v3-rndis` | `esp32s3-korvo2-v3-rndis` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `freenove-esp32s3-display-2.8-lcd` | `freenove-esp32s3-display-2.8-lcd` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `genjutech-s3-1.54tft` | `genjutech-s3-1.54tft` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `hu-087` | `hu-087` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `jiuchuan-s3` | `jiuchuan-s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `kevin-box-2` | `kevin-box-2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `kevin-sp-v4-dev` | `kevin-sp-v4-dev` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `kevin-yuying-313lcd` | `kevin-yuying-313lcd` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `labplus-ledong-v2` | `labplus-ledong-v2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `labplus-mpython-v3` | `labplus-mpython-v3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lceda-course-examples/eda-robot-pro` | `lceda-course-examples-eda-robot-pro` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lceda-course-examples/eda-super-bear` | `lceda-course-examples-eda-super-bear` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lceda-course-examples/eda-tv-pro` | `lceda-course-examples-eda-tv-pro` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lichuang-dev` | `lichuang-dev` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lilygo-t-cameraplus-s3` | `lilygo-t-cameraplus-s3`
`lilygo-t-cameraplus-s3_v1_2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lilygo-t-circle-s3` | `lilygo-t-circle-s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `lilygo-t-display-s3-pro-mvsrlora` | `lilygo-t-display-s3-pro-mvsrlora` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `m5stack-cardputer-adv` | `m5stack-cardputer-adv` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `m5stack-core-s3` | `m5stack-core-s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `m5stack-stick-s3` | `m5stack-stick-s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `m5stack-stopwatch` | `m5stack-stopwatch` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `magiclick-2p4` | `magiclick-2p4` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `magiclick-2p5` | `magiclick-2p5` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `minsi-k08-dual` | `minsi-k08-dual` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `mixgo-nova` | `mixgo-nova` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `movecall-cuican-esp32s3` | `movecall-cuican-esp32s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `movecall-moji-esp32s3` | `movecall-moji-esp32s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `nulllab-ai-vox-v3` | `nulllab-ai-vox-v3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `otto-robot` | `otto-robot` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `quandong-s3-dev` | `quandong-s3-dev` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `rymcu/bigsmart` | `rymcu-bigsmart` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `sensecap-watcher` | `sensecap-watcher` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `sp-esp32-s3-1.28-box` | `sp-esp32-s3-1.28-box` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `sp-esp32-s3-1.54-muma` | `sp-esp32-s3-1.54-muma` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `taiji-pi-s3` | `taiji-pi-s3`
`taiji-pi-s3-pdm` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `tudouzi` | `tudouzi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-audio-board` | `waveshare-esp32-s3-audio-board` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-cam` | `waveshare-esp32-s3-cam-2`
`waveshare-esp32-s3-cam-2.8`
`waveshare-esp32-s3-cam-3.5`
`waveshare-esp32-s3-cam-1.83` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-epaper-1.54` | `waveshare-esp32-s3-epaper-1.54-v2`
`waveshare-esp32-s3-epaper-1.54-v1` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-epaper-3.97` | `waveshare-esp32-s3-epaper-3.97` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-lcd-0.85` | `waveshare-esp32-s3-lcd-0.85` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-rgb-matrix` | `waveshare-esp32-s3-rgb-matrix` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-rlcd-4.2` | `waveshare-esp32-s3-rlcd-4.2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-1.32` | `waveshare-esp32-s3-touch-amoled-1.32` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-1.43c` | `waveshare-esp32-s3-touch-amoled-1.43c` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-1.75` | `waveshare-esp32-s3-touch-amoled-1.75`
`waveshare-esp32-s3-touch-amoled-1.75c` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-1.8` | `waveshare-esp32-s3-touch-amoled-1.8` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-1.8-v2` | `waveshare-esp32-s3-touch-amoled-1.8-v2` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-2.06` | `waveshare-esp32-s3-touch-amoled-2.06` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-amoled-2.16` | `waveshare-esp32-s3-touch-amoled-2.16` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.46` | `waveshare-esp32-s3-touch-lcd-1.46` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.54` | `waveshare-esp32-s3-touch-lcd-1.54` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.83` | `waveshare-esp32-s3-touch-lcd-1.83` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.85` | `waveshare-esp32-s3-touch-lcd-1.85` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.85b` | `waveshare-esp32-s3-touch-lcd-1.85b` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-1.85c` | `waveshare-esp32-s3-touch-lcd-1.85c` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-3.49` | `waveshare-esp32-s3-touch-lcd-3.49` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-3.5` | `waveshare-esp32-s3-touch-lcd-3.5` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-3.5b` | `waveshare-esp32-s3-touch-lcd-3.5b` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-4.3c` | `waveshare-esp32-s3-touch-lcd-4.3c` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-4b` | `waveshare-esp32-s3-touch-lcd-4b` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `waveshare/esp32-s3-touch-lcd-7c` | `waveshare-esp32-s3-touch-lcd-7c` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-abs-2.0` | `xingzhi-abs-2.0` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-0.85tft-ml307` | `xingzhi-cube-0.85tft-ml307` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-0.85tft-wifi` | `xingzhi-cube-0.85tft-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-0.96oled-ml307` | `xingzhi-cube-0.96oled-ml307` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-0.96oled-wifi` | `xingzhi-cube-0.96oled-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-1.54tft-ml307` | `xingzhi-cube-1.54tft-ml307`
`xingzhi-cube-1.54tft-ml307-wechatui` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-cube-1.54tft-wifi` | `xingzhi-cube-1.54tft-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `xingzhi-metal-1.54-wifi` | `xingzhi-metal-1.54-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `yunliao-s3` | `yunliao-s3` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `zhengchen-1.54tft-ml307` | `zhengchen-1.54tft-ml307` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `zhengchen-1.54tft-wifi` | `zhengchen-1.54tft-wifi` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `zhengchen-cam` | `zhengchen-cam` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32s3` | `zhengchen-cam-ml307` | `zhengchen-cam-ml307` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32p4` | `esp-p4-function-ev-board` | `esp-p4-function-ev-board-p4x` | โœ… Full build passed | IDF 6.0.1 `idf.py build` | Hardware smoke/peripheral regression pending | +| `esp32p4` | `m5stack-tab5` | `m5stack-tab5-p4x` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32p4` | `waveshare/esp32-p4-nano` | `waveshare-esp32-p4-nano-10.1-a-p4x` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32p4` | `waveshare/esp32-p4-wifi6-touch-lcd` | `waveshare-esp32-p4-wifi6-touch-lcd-4b-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-4.3-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-5-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-7b-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-3.4c-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-4c-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-7-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-8-p4x`
`waveshare-esp32-p4-wifi6-touch-lcd-10.1-p4x` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32p4` | `waveshare/esp32-p4-wifi6-touch-lcd-3.5` | `waveshare-esp32-p4-wifi6-touch-lcd-3.5-p4x` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | +| `esp32p4` | `wireless-tag-wtp4c5mp07s` | `wireless-tag-wtp4c5mp07s-p4x` | โœ… Full build passed | GitHub Actions IDF 6.0.1 full build | Hardware smoke/peripheral regression pending | + +## Next Steps and Acceptance Criteria + +1. Run the complete 157-variant IDF 6 GitHub Actions matrix on the rebased branch, and add an IDF 5.5 legacy job to build and hardware-test at least one P4 v1.3 device. When IDF 6-compatible releases of `touch_slider_sensor` and `touch_button_sensor` become available, re-enable and hardware-test the ESP Vocat PCB capacitive slider/button path. +2. For every green variant, complete a minimal hardware smoke test covering boot, networking, audio input/output, display/touch when present, camera when present, and 4G/Ethernet when present. +3. Perform a physical negative test for the `xmini-c3`/`xmini-c3-v3` firmware guard. CI proves that both images compile; it does not prove that a wrong image is safely rejected. Acceptance requires flashing each wrong image to a sacrificial or recoverable board and verifying that startup stops before any board-specific power or peripheral initialization can cause damage. +4. Keep third-party experiments under the ignored `components/` directory out of the migration branch. The reproducible baseline must use the published `78/esp_lcd_nv3023 1.0.1` and `wvirgil123/sscma_client 1.0.3` packages. `espfriends/servo_dog_ctrl 0.2.0` is an upstream registry dependency and needs no local override. + +## Reproduction + +```bash +source ~/.espressif/v6.0.1/esp-idf/export.sh +python scripts/release.py --name +``` + +This document is a migration-status snapshot. Build compatibility and hardware compatibility are tracked separately. Add "hardware validated" to a board only after validation on physical hardware is complete. diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index d5c90782..a9ef3dc2 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1040,13 +1040,17 @@ if(BOARD_TYPE STREQUAL "m5stack-stick-s3") m5stack__m5pm1 ) endif() -if(CONFIG_BOARD_TYPE_ESP_VOCAT) +if(CONFIG_BOARD_TYPE_ESP_SPOT_S3 OR CONFIG_BOARD_TYPE_ESP_SPOT_C5 OR CONFIG_BOARD_TYPE_ESP_VOCAT) + list(APPEND MAIN_PRIV_REQUIRES_EXTRA + espressif__bmi270_sensor + ) +endif() +if(CONFIG_BOARD_TYPE_ESP_VOCAT AND IDF_VERSION_MAJOR LESS 6) list(APPEND MAIN_PRIV_REQUIRES_EXTRA espressif__touch_slider_sensor espressif__touch_button_sensor ) endif() - idf_component_register(SRCS ${SOURCES} EMBED_FILES ${LANG_SOUNDS} ${COMMON_SOUNDS} INCLUDE_DIRS ${INCLUDE_DIRS} @@ -1061,11 +1065,14 @@ idf_component_register(SRCS ${SOURCES} esp_driver_spi esp_driver_i2c esp_driver_i2s + esp_driver_ledc esp_driver_jpeg esp_driver_ppa + esp_driver_tsens esp_app_format app_update spi_flash + mbedtls console efuse bt diff --git a/main/application.cc b/main/application.cc index d54ac6b9..8615b5ab 100644 --- a/main/application.cc +++ b/main/application.cc @@ -83,6 +83,9 @@ void Application::Initialize() { callbacks.on_vad_change = [this](bool speaking) { xEventGroupSetBits(event_group_, MAIN_EVENT_VAD_CHANGE); }; + callbacks.on_playback_drained = [this]() { + xEventGroupSetBits(event_group_, MAIN_EVENT_PLAYBACK_DRAINED); + }; audio_service_.SetCallbacks(callbacks); // Add state change listeners @@ -179,7 +182,8 @@ void Application::Run() { MAIN_EVENT_START_LISTENING | MAIN_EVENT_STOP_LISTENING | MAIN_EVENT_ACTIVATION_DONE | - MAIN_EVENT_STATE_CHANGED; + MAIN_EVENT_STATE_CHANGED | + MAIN_EVENT_PLAYBACK_DRAINED; while (true) { auto bits = xEventGroupWaitBits(event_group_, ALL_EVENTS, pdTRUE, pdFALSE, portMAX_DELAY); @@ -205,6 +209,16 @@ void Application::Run() { HandleStateChangedEvent(); } + if (bits & MAIN_EVENT_PLAYBACK_DRAINED) { + // Deferred listening start (auto mode): the playback queue has + // drained, so it is now safe to enable voice processing. + if (pending_listening_start_ && GetDeviceState() == kDeviceStateListening && + audio_service_.IsPlaybackIdle()) { + pending_listening_start_ = false; + StartListeningAudio(); + } + } + if (bits & MAIN_EVENT_TOGGLE_CHAT) { HandleToggleChatEvent(); } @@ -220,6 +234,11 @@ void Application::Run() { if (bits & MAIN_EVENT_SEND_AUDIO) { while (auto packet = audio_service_.PopPacketFromSendQueue()) { if (protocol_ && !protocol_->SendAudio(std::move(packet))) { + // Drop the remaining packets. Leaving them in the queue would + // stall the Opus codec task (it waits for queue space), which in + // turn deadlocks the whole audio input pipeline, as no new + // MAIN_EVENT_SEND_AUDIO event would ever be triggered again. + while (audio_service_.PopPacketFromSendQueue()); break; } } @@ -253,6 +272,8 @@ void Application::Run() { // Print debug info every 10 seconds if (clock_ticks_ % 10 == 0) { SystemInfo::PrintHeapStats(); + // SystemInfo::PrintTaskList(); + // SystemInfo::PrintTaskCpuUsage(pdMS_TO_TICKS(1000)); } } } @@ -860,6 +881,9 @@ void Application::ContinueWakeWordInvoke(const std::string& wake_word) { void Application::HandleStateChangedEvent() { DeviceState new_state = state_machine_.GetState(); clock_ticks_ = 0; + // Any state change invalidates a pending deferred listening start; + // the Listening case below re-arms it when needed. + pending_listening_start_ = false; auto& board = Board::GetInstance(); auto display = board.GetDisplay(); @@ -886,29 +910,17 @@ void Application::HandleStateChangedEvent() { // Make sure the audio processor is running if (play_popup_on_listening_ || !audio_service_.IsAudioProcessorRunning()) { - // For auto mode, wait for playback queue to be empty before enabling voice processing - // This prevents audio truncation when STOP arrives late due to network jitter - if (listening_mode_ == kListeningModeAutoStop) { - audio_service_.WaitForPlaybackQueueEmpty(); + // For auto mode, wait for the playback queue to drain before enabling + // voice processing. This prevents audio truncation when STOP arrives + // late due to network jitter. Instead of blocking the main loop here, + // defer the start until MAIN_EVENT_PLAYBACK_DRAINED arrives. + if (listening_mode_ == kListeningModeAutoStop && !audio_service_.IsPlaybackIdle()) { + pending_listening_start_ = true; + } else { + StartListeningAudio(); } - - // Send the start listening command - protocol_->SendStartListening(listening_mode_); - audio_service_.EnableVoiceProcessing(true); - } - -#ifdef CONFIG_WAKE_WORD_DETECTION_IN_LISTENING - // Enable wake word detection in listening mode (configured via Kconfig) - audio_service_.EnableWakeWordDetection(audio_service_.IsAfeWakeWord()); -#else - // Disable wake word detection in listening mode - audio_service_.EnableWakeWordDetection(false); -#endif - - // Play popup sound after ResetDecoder (in EnableVoiceProcessing) has been called - if (play_popup_on_listening_) { - play_popup_on_listening_ = false; - audio_service_.PlaySound(Lang::Sounds::OGG_POPUP); + } else { + ConfigureWakeWordForListening(); } break; case kDeviceStateSpeaking: @@ -931,6 +943,36 @@ void Application::HandleStateChangedEvent() { } } +void Application::StartListeningAudio() { + // Runs in the main loop, either directly from HandleStateChangedEvent or + // deferred via MAIN_EVENT_PLAYBACK_DRAINED once the playback queue drains. + if (GetDeviceState() != kDeviceStateListening) { + return; + } + + // Send the start listening command + protocol_->SendStartListening(listening_mode_); + audio_service_.EnableVoiceProcessing(true); + + ConfigureWakeWordForListening(); + + // Play popup sound after ResetDecoder (in EnableVoiceProcessing) has been called + if (play_popup_on_listening_) { + play_popup_on_listening_ = false; + audio_service_.PlaySound(Lang::Sounds::OGG_POPUP); + } +} + +void Application::ConfigureWakeWordForListening() { +#ifdef CONFIG_WAKE_WORD_DETECTION_IN_LISTENING + // Enable wake word detection in listening mode (configured via Kconfig) + audio_service_.EnableWakeWordDetection(audio_service_.IsAfeWakeWord()); +#else + // Disable wake word detection in listening mode + audio_service_.EnableWakeWordDetection(false); +#endif +} + void Application::Schedule(std::function&& callback) { { std::lock_guard lock(mutex_); diff --git a/main/application.h b/main/application.h index cb635d4e..464140f0 100644 --- a/main/application.h +++ b/main/application.h @@ -32,6 +32,7 @@ #define MAIN_EVENT_START_LISTENING (1 << 10) #define MAIN_EVENT_STOP_LISTENING (1 << 11) #define MAIN_EVENT_STATE_CHANGED (1 << 12) +#define MAIN_EVENT_PLAYBACK_DRAINED (1 << 13) enum AecMode { @@ -144,6 +145,7 @@ private: bool aborted_ = false; bool assets_version_checked_ = false; bool play_popup_on_listening_ = false; // Flag to play popup sound after state changes to listening + bool pending_listening_start_ = false; // Waiting for playback to drain before starting listening (auto mode) int clock_ticks_ = 0; TaskHandle_t activation_task_handle_ = nullptr; @@ -159,6 +161,8 @@ private: void HandleWakeWordDetectedEvent(); void ContinueOpenAudioChannel(ListeningMode mode); void ContinueWakeWordInvoke(const std::string& wake_word); + void StartListeningAudio(); + void ConfigureWakeWordForListening(); // Activation task (runs in background) void ActivationTask(); diff --git a/main/audio/audio_codec.h b/main/audio/audio_codec.h index 819e6462..a267dbbb 100644 --- a/main/audio/audio_codec.h +++ b/main/audio/audio_codec.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -14,6 +15,15 @@ #define AUDIO_CODEC_DMA_DESC_NUM 6 #define AUDIO_CODEC_DMA_FRAME_NUM 240 +// ESP-IDF 6 removed i2s_port_t and changed i2s_chan_config_t::id to an integer. +// Keep numeric I2S controller IDs usable on targets where IDF 5 does not expose +// every value through the target-specific i2s_port_t enum (for example ESP32-C3). +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) +#define XIAOZHI_I2S_PORT(port) (port) +#else +#define XIAOZHI_I2S_PORT(port) static_cast(port) +#endif + class AudioCodec { public: AudioCodec(); diff --git a/main/audio/audio_service.cc b/main/audio/audio_service.cc index 24cc2727..b761be84 100644 --- a/main/audio/audio_service.cc +++ b/main/audio/audio_service.cc @@ -121,7 +121,8 @@ void AudioService::Initialize(AudioCodec* codec) { void AudioService::Start() { service_stopped_ = false; - xEventGroupClearBits(event_group_, AS_EVENT_AUDIO_TESTING_RUNNING | AS_EVENT_WAKE_WORD_RUNNING | AS_EVENT_AUDIO_PROCESSOR_RUNNING); + xEventGroupClearBits(event_group_, AS_EVENT_AUDIO_TESTING_RUNNING | AS_EVENT_WAKE_WORD_RUNNING | + AS_EVENT_AUDIO_PROCESSOR_RUNNING | AS_EVENT_AUDIO_INPUT_STOP_REQUEST); esp_timer_start_periodic(audio_power_timer_, 1000000); @@ -170,12 +171,17 @@ void AudioService::Stop() { AS_EVENT_WAKE_WORD_RUNNING | AS_EVENT_AUDIO_PROCESSOR_RUNNING); - std::lock_guard lock(audio_queue_mutex_); - audio_encode_queue_.clear(); - audio_decode_queue_.clear(); - audio_playback_queue_.clear(); - audio_testing_queue_.clear(); - audio_queue_cv_.notify_all(); + { + std::lock_guard lock(audio_queue_mutex_); + audio_encode_queue_.clear(); + audio_decode_queue_.clear(); + audio_playback_queue_.clear(); + audio_testing_queue_.clear(); + audio_queue_cv_.notify_all(); + } + if (callbacks_.on_playback_drained) { + callbacks_.on_playback_drained(); + } } bool AudioService::ReadAudioData(std::vector& data, int sample_rate, int samples) { @@ -225,14 +231,34 @@ bool AudioService::ReadAudioData(std::vector& data, int sample_rate, in } void AudioService::AudioInputTask() { + constexpr EventBits_t kAudioInputActiveBits = AS_EVENT_AUDIO_TESTING_RUNNING | + AS_EVENT_WAKE_WORD_RUNNING | AS_EVENT_AUDIO_PROCESSOR_RUNNING; + while (true) { - EventBits_t bits = xEventGroupWaitBits(event_group_, AS_EVENT_AUDIO_TESTING_RUNNING | - AS_EVENT_WAKE_WORD_RUNNING | AS_EVENT_AUDIO_PROCESSOR_RUNNING, + EventBits_t bits = xEventGroupWaitBits(event_group_, kAudioInputActiveBits | + AS_EVENT_AUDIO_INPUT_STOP_REQUEST, pdFALSE, pdFALSE, portMAX_DELAY); if (service_stopped_) { + // ADC continuous mode keeps its hardware mutex from start until stop, + // so the input task that started it must also stop it before exiting. + if (codec_->input_enabled()) { + codec_->EnableInput(false); + } break; } + + if (bits & AS_EVENT_AUDIO_INPUT_STOP_REQUEST) { + xEventGroupClearBits(event_group_, AS_EVENT_AUDIO_INPUT_STOP_REQUEST); + + // Recheck the active state in this task. Audio capture may have been + // enabled after the timer posted the stop request. + if ((xEventGroupGetBits(event_group_) & kAudioInputActiveBits) == 0 && + codec_->input_enabled()) { + codec_->EnableInput(false); + } + } + if (audio_input_need_warmup_) { audio_input_need_warmup_ = false; vTaskDelay(pdMS_TO_TICKS(120)); @@ -289,6 +315,7 @@ void AudioService::AudioOutputTask() { auto task = std::move(audio_playback_queue_.front()); audio_playback_queue_.pop_front(); + const bool playback_drained = audio_playback_queue_.empty() && audio_decode_queue_.empty(); audio_queue_cv_.notify_all(); lock.unlock(); @@ -304,6 +331,10 @@ void AudioService::AudioOutputTask() { last_output_time_ = std::chrono::steady_clock::now(); debug_statistics_.playback_count++; + if (playback_drained && callbacks_.on_playback_drained) { + callbacks_.on_playback_drained(); + } + #if CONFIG_USE_SERVER_AEC /* Record the timestamp for server AEC */ if (task->timestamp > 0) { @@ -321,7 +352,7 @@ void AudioService::OpusCodecTask() { std::unique_lock lock(audio_queue_mutex_); audio_queue_cv_.wait(lock, [this]() { return service_stopped_ || - (!audio_encode_queue_.empty() && audio_send_queue_.size() < MAX_SEND_PACKETS_IN_QUEUE) || + !audio_encode_queue_.empty() || (!audio_decode_queue_.empty() && audio_playback_queue_.size() < MAX_PLAYBACK_TASKS_IN_QUEUE); }); if (service_stopped_) { @@ -382,9 +413,15 @@ void AudioService::OpusCodecTask() { lock.lock(); } debug_statistics_.decode_count++; + /* If decoding failed and nothing is left to play, report the drain + * here since AudioOutputTask will not see this packet. */ + if (audio_decode_queue_.empty() && audio_playback_queue_.empty() && + callbacks_.on_playback_drained) { + callbacks_.on_playback_drained(); + } } /* Encode the audio to send queue */ - if (!audio_encode_queue_.empty() && audio_send_queue_.size() < MAX_SEND_PACKETS_IN_QUEUE) { + if (!audio_encode_queue_.empty()) { auto task = std::move(audio_encode_queue_.front()); audio_encode_queue_.pop_front(); audio_queue_cv_.notify_all(); @@ -413,6 +450,11 @@ void AudioService::OpusCodecTask() { if (task->type == kAudioTaskTypeEncodeToSendQueue) { { std::lock_guard lock2(audio_queue_mutex_); + /* Never let a full send queue stall encoding: stale realtime + * audio is useless to the server, so drop the oldest packet. */ + if (audio_send_queue_.size() >= MAX_SEND_PACKETS_IN_QUEUE) { + audio_send_queue_.pop_front(); + } audio_send_queue_.push_back(std::move(packet)); } if (callbacks_.on_send_queue_available) { @@ -477,22 +519,44 @@ void AudioService::PushTaskToEncodeQueue(AudioTaskType type, std::vector(); task->type = type; task->pcm = std::move(pcm); - /* Push the task to the encode queue */ - std::unique_lock lock(audio_queue_mutex_); - /* If the task is to send queue, we need to set the timestamp */ - if (type == kAudioTaskTypeEncodeToSendQueue && !timestamp_queue_.empty()) { - if (timestamp_queue_.size() <= MAX_TIMESTAMPS_IN_QUEUE) { - task->timestamp = timestamp_queue_.front(); - } else { - ESP_LOGW(TAG, "Timestamp queue (%u) is full, dropping timestamp", timestamp_queue_.size()); + uint32_t dropped_total = 0; + { + /* Push the task to the encode queue */ + std::unique_lock lock(audio_queue_mutex_); + + /* If the task is to send queue, we need to set the timestamp */ + if (type == kAudioTaskTypeEncodeToSendQueue && !timestamp_queue_.empty()) { + if (timestamp_queue_.size() <= MAX_TIMESTAMPS_IN_QUEUE) { + task->timestamp = timestamp_queue_.front(); + } else { + ESP_LOGW(TAG, "Timestamp queue (%u) is full, dropping timestamp", timestamp_queue_.size()); + } + timestamp_queue_.pop_front(); } - timestamp_queue_.pop_front(); + + /* Microphone audio is realtime, so drop the oldest frame instead of blocking. + * Blocking here would stall the audio engine task (AFE fetch) and deadlock the + * whole input pipeline when the send queue stops being drained (e.g. network + * congestion or a failed UDP send). */ + if (audio_encode_queue_.size() >= MAX_ENCODE_TASKS_IN_QUEUE) { + audio_encode_queue_.pop_front(); + dropped_total = ++debug_statistics_.encode_drop_count; + } + audio_encode_queue_.push_back(std::move(task)); + audio_queue_cv_.notify_all(); } - audio_queue_cv_.wait(lock, [this]() { return audio_encode_queue_.size() < MAX_ENCODE_TASKS_IN_QUEUE; }); - audio_encode_queue_.push_back(std::move(task)); - audio_queue_cv_.notify_all(); + /* Log outside the lock (UART writes are slow and would starve the codec task), + * at most once per second. */ + if (dropped_total > 0) { + int64_t now = esp_timer_get_time(); + if (now - last_encode_drop_log_time_ >= 1000000) { + last_encode_drop_log_time_ = now; + ESP_LOGW(TAG, "Encode queue is full, dropping oldest frame (dropped %lu so far)", + (unsigned long)dropped_total); + } + } } bool AudioService::PushPacketToDecodeQueue(std::unique_ptr packet, bool wait) { @@ -643,25 +707,28 @@ bool AudioService::IsIdle() { return audio_encode_queue_.empty() && audio_decode_queue_.empty() && audio_playback_queue_.empty() && audio_testing_queue_.empty(); } -void AudioService::WaitForPlaybackQueueEmpty() { - std::unique_lock lock(audio_queue_mutex_); - audio_queue_cv_.wait(lock, [this]() { - return service_stopped_ || (audio_decode_queue_.empty() && audio_playback_queue_.empty()); - }); +bool AudioService::IsPlaybackIdle() { + std::lock_guard lock(audio_queue_mutex_); + return audio_decode_queue_.empty() && audio_playback_queue_.empty(); } void AudioService::ResetDecoder() { - std::lock_guard lock(audio_queue_mutex_); - std::unique_lock decoder_lock(decoder_mutex_); - if (opus_decoder_ != nullptr) { - esp_opus_dec_reset(opus_decoder_); + { + std::lock_guard lock(audio_queue_mutex_); + std::unique_lock decoder_lock(decoder_mutex_); + if (opus_decoder_ != nullptr) { + esp_opus_dec_reset(opus_decoder_); + } + decoder_lock.unlock(); + timestamp_queue_.clear(); + audio_decode_queue_.clear(); + audio_playback_queue_.clear(); + audio_testing_queue_.clear(); + audio_queue_cv_.notify_all(); + } + if (callbacks_.on_playback_drained) { + callbacks_.on_playback_drained(); } - decoder_lock.unlock(); - timestamp_queue_.clear(); - audio_decode_queue_.clear(); - audio_playback_queue_.clear(); - audio_testing_queue_.clear(); - audio_queue_cv_.notify_all(); } void AudioService::CheckAndUpdateAudioPowerState() { @@ -669,7 +736,9 @@ void AudioService::CheckAndUpdateAudioPowerState() { auto input_elapsed = std::chrono::duration_cast(now - last_input_time_).count(); auto output_elapsed = std::chrono::duration_cast(now - last_output_time_).count(); if (input_elapsed > AUDIO_POWER_TIMEOUT_MS && codec_->input_enabled()) { - codec_->EnableInput(false); + // ADC continuous start/stop must run in the same task. Wake the audio + // input task instead of closing the codec from the esp_timer task. + xEventGroupSetBits(event_group_, AS_EVENT_AUDIO_INPUT_STOP_REQUEST); } if (output_elapsed > AUDIO_POWER_TIMEOUT_MS && codec_->output_enabled()) { // Keep TX clock when duplex RX is active; otherwise RX may stall on some boards. diff --git a/main/audio/audio_service.h b/main/audio/audio_service.h index c3afa134..e1624227 100644 --- a/main/audio/audio_service.h +++ b/main/audio/audio_service.h @@ -50,6 +50,7 @@ #define AS_EVENT_WAKE_WORD_RUNNING (1 << 1) #define AS_EVENT_AUDIO_PROCESSOR_RUNNING (1 << 2) #define AS_EVENT_PLAYBACK_NOT_EMPTY (1 << 3) +#define AS_EVENT_AUDIO_INPUT_STOP_REQUEST (1 << 4) #define AS_OPUS_GET_FRAME_DRU_ENUM(duration_ms) \ ((duration_ms) == 5 ? ESP_OPUS_ENC_FRAME_DURATION_5_MS : \ @@ -79,6 +80,8 @@ struct AudioServiceCallbacks { std::function on_wake_word_detected; std::function on_vad_change; std::function on_audio_testing_queue_full; + // Fired when both the decode and playback queues become empty + std::function on_playback_drained; }; @@ -99,6 +102,7 @@ struct DebugStatistics { uint32_t decode_count = 0; uint32_t encode_count = 0; uint32_t playback_count = 0; + uint32_t encode_drop_count = 0; }; class AudioService { @@ -114,7 +118,7 @@ public: const std::string& GetLastWakeWord() const; bool IsVoiceDetected() const { return voice_detected_; } bool IsIdle(); - void WaitForPlaybackQueueEmpty(); + bool IsPlaybackIdle(); bool IsWakeWordRunning() const { return xEventGroupGetBits(event_group_) & AS_EVENT_WAKE_WORD_RUNNING; } bool IsAudioProcessorRunning() const { return xEventGroupGetBits(event_group_) & AS_EVENT_AUDIO_PROCESSOR_RUNNING; } bool IsAfeWakeWord(); @@ -154,6 +158,7 @@ private: int decoder_duration_ms_ = OPUS_FRAME_DURATION_MS; int decoder_frame_size_ = 0; DebugStatistics debug_statistics_; + int64_t last_encode_drop_log_time_ = 0; srmodel_list_t* models_list_ = nullptr; EventGroupHandle_t event_group_; diff --git a/main/audio/codecs/es8311_audio_codec.cc b/main/audio/codecs/es8311_audio_codec.cc index 12ecd623..ec18cec1 100644 --- a/main/audio/codecs/es8311_audio_codec.cc +++ b/main/audio/codecs/es8311_audio_codec.cc @@ -88,7 +88,8 @@ void Es8311AudioCodec::UpdateDeviceState() { ESP_ERROR_CHECK(esp_codec_dev_set_in_gain(dev_, input_gain_)); ESP_ERROR_CHECK(esp_codec_dev_set_out_vol(dev_, output_volume_)); } else if (!input_enabled_ && !output_enabled_ && dev_ != nullptr) { - esp_codec_dev_close(dev_); + ESP_ERROR_CHECK(esp_codec_dev_close(dev_)); + esp_codec_dev_delete(dev_); dev_ = nullptr; } if (pa_pin_ != GPIO_NUM_NC) { @@ -199,4 +200,4 @@ int Es8311AudioCodec::Write(const int16_t* data, int samples) { ESP_ERROR_CHECK_WITHOUT_ABORT(esp_codec_dev_write(dev_, (void*)data, samples * sizeof(int16_t))); } return samples; -} \ No newline at end of file +} diff --git a/main/audio/codecs/es8374_audio_codec.h b/main/audio/codecs/es8374_audio_codec.h index 7533c222..e36a44b5 100644 --- a/main/audio/codecs/es8374_audio_codec.h +++ b/main/audio/codecs/es8374_audio_codec.h @@ -3,7 +3,7 @@ #include "audio_codec.h" -#include +#include #include #include #include diff --git a/main/audio/codecs/es8388_audio_codec.cc b/main/audio/codecs/es8388_audio_codec.cc index 821db78d..c1db3c91 100644 --- a/main/audio/codecs/es8388_audio_codec.cc +++ b/main/audio/codecs/es8388_audio_codec.cc @@ -176,14 +176,17 @@ void Es8388AudioCodec::EnableOutput(bool enable) { return; } if (enable) { - esp_codec_dev_sample_info_t fs = { - .bits_per_sample = 16, - .channel = 1, - .channel_mask = 0, - .sample_rate = (uint32_t)output_sample_rate_, - .mclk_multiple = 0, - }; - ESP_ERROR_CHECK(esp_codec_dev_open(output_dev_, &fs)); + if (!output_device_opened_) { + esp_codec_dev_sample_info_t fs = { + .bits_per_sample = 16, + .channel = 1, + .channel_mask = 0, + .sample_rate = (uint32_t)output_sample_rate_, + .mclk_multiple = 0, + }; + ESP_ERROR_CHECK(esp_codec_dev_open(output_dev_, &fs)); + output_device_opened_ = true; + } ESP_ERROR_CHECK(esp_codec_dev_set_out_vol(output_dev_, output_volume_)); // Set analog output volume to 0dB, default is -45dB @@ -193,11 +196,17 @@ void Es8388AudioCodec::EnableOutput(bool enable) { ctrl_if_->write_reg(ctrl_if_, reg, 1, ®_val, 1); } + ESP_ERROR_CHECK(esp_codec_dev_set_out_mute(output_dev_, false)); if (pa_pin_ != GPIO_NUM_NC) { gpio_set_level(pa_pin_, 1); } } else { - ESP_ERROR_CHECK(esp_codec_dev_close(output_dev_)); + // Keep TX open because the paired RX channel may use it as the clock + // source. Reopening the shared duplex interface after WiFi provisioning + // can otherwise leave playback silent on ESP-IDF 6. + if (output_device_opened_) { + ESP_ERROR_CHECK(esp_codec_dev_set_out_mute(output_dev_, true)); + } if (pa_pin_ != GPIO_NUM_NC) { gpio_set_level(pa_pin_, 0); } diff --git a/main/audio/codecs/es8388_audio_codec.h b/main/audio/codecs/es8388_audio_codec.h index 316dfce5..f8c1c8c6 100644 --- a/main/audio/codecs/es8388_audio_codec.h +++ b/main/audio/codecs/es8388_audio_codec.h @@ -18,6 +18,7 @@ private: esp_codec_dev_handle_t output_dev_ = nullptr; esp_codec_dev_handle_t input_dev_ = nullptr; + bool output_device_opened_ = false; gpio_num_t pa_pin_ = GPIO_NUM_NC; std::mutex data_if_mutex_; diff --git a/main/audio/codecs/es8389_audio_codec.cc b/main/audio/codecs/es8389_audio_codec.cc index 48820f36..fc5519ea 100644 --- a/main/audio/codecs/es8389_audio_codec.cc +++ b/main/audio/codecs/es8389_audio_codec.cc @@ -169,21 +169,32 @@ void Es8389AudioCodec::EnableOutput(bool enable) { return; } if (enable) { - // Play 16bit 1 channel - esp_codec_dev_sample_info_t fs = { - .bits_per_sample = 16, - .channel = 1, - .channel_mask = 0, - .sample_rate = (uint32_t)output_sample_rate_, - .mclk_multiple = 0, - }; - ESP_ERROR_CHECK(esp_codec_dev_open(output_dev_, &fs)); + if (!output_device_opened_) { + // Play 16bit 1 channel + esp_codec_dev_sample_info_t fs = { + .bits_per_sample = 16, + .channel = 1, + .channel_mask = 0, + .sample_rate = (uint32_t)output_sample_rate_, + .mclk_multiple = 0, + }; + ESP_ERROR_CHECK(esp_codec_dev_open(output_dev_, &fs)); + output_device_opened_ = true; + } ESP_ERROR_CHECK(esp_codec_dev_set_out_vol(output_dev_, output_volume_)); + ESP_ERROR_CHECK(esp_codec_dev_set_out_mute(output_dev_, false)); if (pa_pin_ != GPIO_NUM_NC) { gpio_set_level(pa_pin_, 1); } } else { - ESP_ERROR_CHECK(esp_codec_dev_close(output_dev_)); + // Keep the ES8389 TX data interface open. On ESP32-S3 the RX channel + // uses the paired TX channel as its clock source, and reopening TX via + // esp_codec_dev after it has been closed can leave the IDF 6 duplex + // channel silent even though esp_codec_dev_open reports success. + // Muting preserves the logical power state without reconfiguring I2S. + if (output_device_opened_) { + ESP_ERROR_CHECK(esp_codec_dev_set_out_mute(output_dev_, true)); + } if (pa_pin_ != GPIO_NUM_NC) { gpio_set_level(pa_pin_, 0); } @@ -203,4 +214,4 @@ int Es8389AudioCodec::Write(const int16_t* data, int samples) { ESP_ERROR_CHECK_WITHOUT_ABORT(esp_codec_dev_write(output_dev_, (void*)data, samples * sizeof(int16_t))); } return samples; -} \ No newline at end of file +} diff --git a/main/audio/codecs/es8389_audio_codec.h b/main/audio/codecs/es8389_audio_codec.h index b55b4273..e52efd6d 100644 --- a/main/audio/codecs/es8389_audio_codec.h +++ b/main/audio/codecs/es8389_audio_codec.h @@ -3,7 +3,7 @@ #include "audio_codec.h" -#include +#include #include #include #include @@ -18,6 +18,7 @@ private: esp_codec_dev_handle_t output_dev_ = nullptr; esp_codec_dev_handle_t input_dev_ = nullptr; + bool output_device_opened_ = false; gpio_num_t pa_pin_ = GPIO_NUM_NC; std::mutex data_if_mutex_; diff --git a/main/audio/codecs/no_audio_codec.cc b/main/audio/codecs/no_audio_codec.cc index 4d63ed04..cf39afa5 100644 --- a/main/audio/codecs/no_audio_codec.cc +++ b/main/audio/codecs/no_audio_codec.cc @@ -22,7 +22,7 @@ NoAudioCodecDuplex::NoAudioCodecDuplex(int input_sample_rate, int output_sample_ output_sample_rate_ = output_sample_rate; i2s_chan_config_t chan_cfg = { - .id = I2S_NUM_0, + .id = XIAOZHI_I2S_PORT(0), .role = I2S_ROLE_MASTER, .dma_desc_num = AUDIO_CODEC_DMA_DESC_NUM, .dma_frame_num = AUDIO_CODEC_DMA_FRAME_NUM, @@ -83,7 +83,7 @@ NoAudioCodecSimplex::NoAudioCodecSimplex(int input_sample_rate, int output_sampl // Create a new channel for speaker i2s_chan_config_t chan_cfg = { - .id = (i2s_port_t)0, + .id = XIAOZHI_I2S_PORT(0), .role = I2S_ROLE_MASTER, .dma_desc_num = AUDIO_CODEC_DMA_DESC_NUM, .dma_frame_num = AUDIO_CODEC_DMA_FRAME_NUM, @@ -134,7 +134,7 @@ NoAudioCodecSimplex::NoAudioCodecSimplex(int input_sample_rate, int output_sampl ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle_, &std_cfg)); // Create a new channel for MIC - chan_cfg.id = (i2s_port_t)1; + chan_cfg.id = XIAOZHI_I2S_PORT(1); ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, nullptr, &rx_handle_)); std_cfg.clk_cfg.sample_rate_hz = (uint32_t)input_sample_rate_; std_cfg.gpio_cfg.bclk = mic_sck; @@ -152,7 +152,7 @@ NoAudioCodecSimplex::NoAudioCodecSimplex(int input_sample_rate, int output_sampl // Create a new channel for speaker i2s_chan_config_t chan_cfg = { - .id = (i2s_port_t)0, + .id = XIAOZHI_I2S_PORT(0), .role = I2S_ROLE_MASTER, .dma_desc_num = AUDIO_CODEC_DMA_DESC_NUM, .dma_frame_num = AUDIO_CODEC_DMA_FRAME_NUM, @@ -203,7 +203,7 @@ NoAudioCodecSimplex::NoAudioCodecSimplex(int input_sample_rate, int output_sampl ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle_, &std_cfg)); // Create a new channel for MIC - chan_cfg.id = (i2s_port_t)1; + chan_cfg.id = XIAOZHI_I2S_PORT(1); ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, nullptr, &rx_handle_)); std_cfg.clk_cfg.sample_rate_hz = (uint32_t)input_sample_rate_; std_cfg.slot_cfg.slot_mask = mic_slot_mask; @@ -293,7 +293,7 @@ NoAudioCodecSimplexPdm::NoAudioCodecSimplexPdm(int input_sample_rate, int output output_sample_rate_ = output_sample_rate; // Create a new channel for speaker - i2s_chan_config_t tx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG((i2s_port_t)1, I2S_ROLE_MASTER); + i2s_chan_config_t tx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(1), I2S_ROLE_MASTER); tx_chan_cfg.dma_desc_num = AUDIO_CODEC_DMA_DESC_NUM; tx_chan_cfg.dma_frame_num = AUDIO_CODEC_DMA_FRAME_NUM; tx_chan_cfg.auto_clear_after_cb = true; @@ -343,7 +343,7 @@ NoAudioCodecSimplexPdm::NoAudioCodecSimplexPdm(int input_sample_rate, int output ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle_, &tx_std_cfg)); #if SOC_I2S_SUPPORTS_PDM_RX // Create a new channel for MIC in PDM mode - i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG((i2s_port_t)0, I2S_ROLE_MASTER); + i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(0), I2S_ROLE_MASTER); ESP_ERROR_CHECK(i2s_new_channel(&rx_chan_cfg, NULL, &rx_handle_)); i2s_pdm_rx_config_t pdm_rx_cfg = { .clk_cfg = I2S_PDM_RX_CLK_DEFAULT_CONFIG((uint32_t)input_sample_rate_), diff --git a/main/audio/engines/afe_audio_engine.cc b/main/audio/engines/afe_audio_engine.cc index d32b6579..0138efd7 100644 --- a/main/audio/engines/afe_audio_engine.cc +++ b/main/audio/engines/afe_audio_engine.cc @@ -217,18 +217,16 @@ void AfeAudioEngine::EnableWakeWordDetection(bool enable) { return; } + // WakeNet enable/disable on the AFE instance is applied by ProcessingTask + // (see ApplyAfeControls), driven by the kWakeWordEnabled bit. if (enable) { - if (wake_detector_ == WakeDetector::kWakeNet) { - afe_iface_->enable_wakenet(afe_data_); - } else { + if (wake_detector_ == WakeDetector::kMultiNet) { custom_wake_word_->Start(); } xEventGroupSetBits(event_group_, kWakeWordEnabled); } else { xEventGroupClearBits(event_group_, kWakeWordEnabled); - if (wake_detector_ == WakeDetector::kWakeNet) { - afe_iface_->disable_wakenet(afe_data_); - } else { + if (wake_detector_ == WakeDetector::kMultiNet) { custom_wake_word_->Stop(); } } @@ -293,32 +291,65 @@ void AfeAudioEngine::UpdateActiveState() { std::lock_guard lock(input_buffer_mutex_); input_buffer_.clear(); if (afe_data_ != nullptr) { - afe_iface_->reset_buffer(afe_data_); + // Don't call reset_buffer() here: this runs in the main task while + // ProcessingTask may be inside fetch_with_delay() on the same AFE + // instance, and a concurrent reset corrupts the ring buffer state. + // Defer the reset to ProcessingTask, which owns the fetch side. + reset_pending_ = true; } } if ((bits & kVoiceProcessingEnabled) == 0) { - output_buffer_.clear(); + // output_buffer_ is owned by the task that produces output frames, + // so let that task clear it instead of racing with it here. + output_reset_pending_ = true; } - UpdateAecState(); + afe_control_dirty_ = true; } void AfeAudioEngine::UpdateAecState() { if (afe_data_ == nullptr || codec_ == nullptr || !codec_->input_reference()) { return; } + afe_control_dirty_ = true; +} + +void AfeAudioEngine::ApplyAfeControls() { EventBits_t bits = xEventGroupGetBits(event_group_); - const bool enable = (bits & kWakeWordEnabled) || - (device_aec_enabled_ && (bits & kVoiceProcessingEnabled)); - if (enable) { - afe_iface_->enable_aec(afe_data_); - } else { - afe_iface_->disable_aec(afe_data_); + if (wake_detector_ == WakeDetector::kWakeNet) { + if (bits & kWakeWordEnabled) { + afe_iface_->enable_wakenet(afe_data_); + } else { + afe_iface_->disable_wakenet(afe_data_); + } + } + if (codec_->input_reference()) { + const bool enable_aec = (bits & kWakeWordEnabled) || + (device_aec_enabled_ && (bits & kVoiceProcessingEnabled)); + if (enable_aec) { + afe_iface_->enable_aec(afe_data_); + } else { + afe_iface_->disable_aec(afe_data_); + } } } void AfeAudioEngine::ProcessingTask() { while (true) { xEventGroupWaitBits(event_group_, kAfeActive, pdFALSE, pdTRUE, portMAX_DELAY); + if (reset_pending_.exchange(false)) { + // Discard audio recorded before (re)activation. Holding + // input_buffer_mutex_ serializes the reset against Feed(); the + // fetch side cannot race as it only runs in this task. + std::lock_guard lock(input_buffer_mutex_); + input_buffer_.clear(); + afe_iface_->reset_buffer(afe_data_); + continue; + } + if (afe_control_dirty_.exchange(false)) { + // WakeNet/AEC toggles are not safe against a concurrent fetch, + // so they are applied here, in the task that owns the fetch side. + ApplyAfeControls(); + } auto* result = afe_iface_->fetch_with_delay(afe_data_, portMAX_DELAY); if ((xEventGroupGetBits(event_group_) & kAfeActive) == 0) { continue; @@ -362,7 +393,8 @@ void AfeAudioEngine::HandleWakeWordResult(const afe_fetch_result_t* result) { last_detected_wake_word_ = wake_words_[model_index]; xEventGroupClearBits(event_group_, kWakeWordEnabled); - afe_iface_->disable_wakenet(afe_data_); + // UpdateActiveState marks the AFE controls dirty; the next loop iteration + // of ProcessingTask disables WakeNet via ApplyAfeControls. UpdateActiveState(); if (wake_word_detected_callback_) { wake_word_detected_callback_(last_detected_wake_word_); @@ -370,6 +402,9 @@ void AfeAudioEngine::HandleWakeWordResult(const afe_fetch_result_t* result) { } void AfeAudioEngine::HandleVoiceResult(const afe_fetch_result_t* result) { + if (output_reset_pending_.exchange(false)) { + output_buffer_.clear(); + } if (vad_state_change_callback_) { if (result->vad_state == VAD_SPEECH && !is_speaking_) { is_speaking_ = true; @@ -402,6 +437,9 @@ void AfeAudioEngine::OutputRawAudio(const std::vector& data) { if (!output_callback_ || codec_ == nullptr) { return; } + if (output_reset_pending_.exchange(false)) { + output_buffer_.clear(); + } const size_t channels = codec_->input_channels(); if (channels <= 1) { output_buffer_.insert(output_buffer_.end(), data.begin(), data.end()); diff --git a/main/audio/engines/afe_audio_engine.h b/main/audio/engines/afe_audio_engine.h index 65385e44..539c14f3 100644 --- a/main/audio/engines/afe_audio_engine.h +++ b/main/audio/engines/afe_audio_engine.h @@ -1,6 +1,7 @@ #ifndef AFE_AUDIO_ENGINE_H #define AFE_AUDIO_ENGINE_H +#include #include #include #include @@ -66,6 +67,12 @@ private: int frame_samples_ = 0; bool is_speaking_ = false; bool device_aec_enabled_ = false; + // Deferred AFE buffer reset, performed by ProcessingTask (see UpdateActiveState) + std::atomic reset_pending_{false}; + // Deferred WakeNet/AEC toggles, applied by ProcessingTask (see ApplyAfeControls) + std::atomic afe_control_dirty_{false}; + // Deferred output_buffer_ clear, performed by the output-producing task + std::atomic output_reset_pending_{false}; WakeDetector wake_detector_ = WakeDetector::kNone; std::unique_ptr custom_wake_word_; @@ -90,6 +97,7 @@ private: void ProcessingTask(); void UpdateActiveState(); void UpdateAecState(); + void ApplyAfeControls(); void OutputRawAudio(const std::vector& data); void HandleWakeWordResult(const afe_fetch_result_t* result); void HandleVoiceResult(const afe_fetch_result_t* result); diff --git a/main/audio/wake_words/custom_wake_word.h b/main/audio/wake_words/custom_wake_word.h index 7267c043..83283d95 100644 --- a/main/audio/wake_words/custom_wake_word.h +++ b/main/audio/wake_words/custom_wake_word.h @@ -2,6 +2,8 @@ #define CUSTOM_WAKE_WORD_H #include +#include +#include #include #include #include diff --git a/main/boards/atk-dnesp32s3-box/atk_dnesp32s3_box.cc b/main/boards/atk-dnesp32s3-box/atk_dnesp32s3_box.cc index c025389f..dc599e94 100644 --- a/main/boards/atk-dnesp32s3-box/atk_dnesp32s3_box.cc +++ b/main/boards/atk-dnesp32s3-box/atk_dnesp32s3_box.cc @@ -192,8 +192,7 @@ private: }, .bus_width = 8, .max_transfer_bytes = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t), - .psram_trans_align = 64, - .sram_trans_align = 4, + .dma_burst_size = 64, }; ESP_ERROR_CHECK(esp_lcd_new_i80_bus(&bus_config, &i80_bus)); @@ -217,11 +216,10 @@ private: }; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i80(i80_bus, &io_config, &panel_io)); - esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = LCD_NUM_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = LCD_NUM_RST; ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/atk-dnesp32s3-box2-4g/atk_dnesp32s3_box2.cc b/main/boards/atk-dnesp32s3-box2-4g/atk_dnesp32s3_box2.cc index 7e888a77..06d6617b 100644 --- a/main/boards/atk-dnesp32s3-box2-4g/atk_dnesp32s3_box2.cc +++ b/main/boards/atk-dnesp32s3-box2-4g/atk_dnesp32s3_box2.cc @@ -347,8 +347,7 @@ private: }, .bus_width = 8, .max_transfer_bytes = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t), - .psram_trans_align = 64, - .sram_trans_align = 4, + .dma_burst_size = 64, }; ESP_ERROR_CHECK(esp_lcd_new_i80_bus(&bus_config, &i80_bus)); @@ -374,11 +373,10 @@ private: }; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i80(i80_bus, &io_config, &panel_io)); - esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = LCD_PIN_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = LCD_PIN_RST; ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); @@ -437,7 +435,8 @@ public: AUDIO_I2S_GPIO_DOUT, AUDIO_I2S_GPIO_DIN, GPIO_NUM_NC, - AUDIO_CODEC_ES8389_ADDR + AUDIO_CODEC_ES8389_ADDR, + AUDIO_CODEC_USE_MCLK ); return &audio_codec; } diff --git a/main/boards/atk-dnesp32s3-box2-4g/config.h b/main/boards/atk-dnesp32s3-box2-4g/config.h index 70e9d4d8..aa687f48 100644 --- a/main/boards/atk-dnesp32s3-box2-4g/config.h +++ b/main/boards/atk-dnesp32s3-box2-4g/config.h @@ -9,8 +9,8 @@ enum PowerSupply { kDeviceBatterySupply, }; -#define AUDIO_INPUT_SAMPLE_RATE 16000 -#define AUDIO_OUTPUT_SAMPLE_RATE 16000 +#define AUDIO_INPUT_SAMPLE_RATE 24000 +#define AUDIO_OUTPUT_SAMPLE_RATE 24000 #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_38 #define AUDIO_I2S_GPIO_WS GPIO_NUM_42 @@ -21,6 +21,7 @@ enum PowerSupply { #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_48 #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_47 #define AUDIO_CODEC_ES8389_ADDR ES8389_CODEC_DEFAULT_ADDR +#define AUDIO_CODEC_USE_MCLK true #define SPISD_PIN_MOSI GPIO_NUM_16 #define SPISD_PIN_MISO GPIO_NUM_18 @@ -77,4 +78,3 @@ enum PowerSupply { #define Module_4G_TX_PIN GPIO_NUM_43 #endif // _BOARD_CONFIG_H_ - diff --git a/main/boards/atk-dnesp32s3-box2-wifi/atk_dnesp32s3_box2.cc b/main/boards/atk-dnesp32s3-box2-wifi/atk_dnesp32s3_box2.cc index bddd343e..2f07b3b4 100644 --- a/main/boards/atk-dnesp32s3-box2-wifi/atk_dnesp32s3_box2.cc +++ b/main/boards/atk-dnesp32s3-box2-wifi/atk_dnesp32s3_box2.cc @@ -327,8 +327,7 @@ private: }, .bus_width = 8, .max_transfer_bytes = DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(uint16_t), - .psram_trans_align = 64, - .sram_trans_align = 4, + .dma_burst_size = 64, }; ESP_ERROR_CHECK(esp_lcd_new_i80_bus(&bus_config, &i80_bus)); @@ -354,11 +353,10 @@ private: }; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i80(i80_bus, &io_config, &panel_io)); - esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = LCD_PIN_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = LCD_PIN_RST; ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); @@ -417,7 +415,7 @@ public: AUDIO_I2S_GPIO_DIN, GPIO_NUM_NC, AUDIO_CODEC_ES8389_ADDR, - false); + AUDIO_CODEC_USE_MCLK); return &audio_codec; } diff --git a/main/boards/atk-dnesp32s3-box2-wifi/config.h b/main/boards/atk-dnesp32s3-box2-wifi/config.h index a12384c1..74f8888a 100644 --- a/main/boards/atk-dnesp32s3-box2-wifi/config.h +++ b/main/boards/atk-dnesp32s3-box2-wifi/config.h @@ -8,8 +8,8 @@ enum PowerSupply { kDeviceBatterySupply, }; -#define AUDIO_INPUT_SAMPLE_RATE 16000 -#define AUDIO_OUTPUT_SAMPLE_RATE 16000 +#define AUDIO_INPUT_SAMPLE_RATE 24000 +#define AUDIO_OUTPUT_SAMPLE_RATE 24000 #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_38 #define AUDIO_I2S_GPIO_WS GPIO_NUM_42 @@ -20,6 +20,7 @@ enum PowerSupply { #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_48 #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_47 #define AUDIO_CODEC_ES8389_ADDR ES8389_CODEC_DEFAULT_ADDR +#define AUDIO_CODEC_USE_MCLK true #define R_BUTTON_GPIO GPIO_NUM_0 @@ -68,4 +69,3 @@ enum PowerSupply { #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false #endif // _BOARD_CONFIG_H_ - diff --git a/main/boards/atoms3-echo-base/atoms3_echo_base.cc b/main/boards/atoms3-echo-base/atoms3_echo_base.cc index f7f01b3f..8f83143e 100644 --- a/main/boards/atoms3-echo-base/atoms3_echo_base.cc +++ b/main/boards/atoms3-echo-base/atoms3_echo_base.cc @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -292,7 +293,11 @@ private: esp_lcd_panel_handle_t panel_handle = nullptr; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = LCD_RST_GPIO; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) if (config.type == LcdPanelType::kGc9107) { diff --git a/main/boards/atoms3r-echo-base/atoms3r_echo_base.cc b/main/boards/atoms3r-echo-base/atoms3r_echo_base.cc index 5ed99aa9..2575bea3 100644 --- a/main/boards/atoms3r-echo-base/atoms3r_echo_base.cc +++ b/main/boards/atoms3r-echo-base/atoms3r_echo_base.cc @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,11 @@ private: esp_lcd_panel_handle_t panel_handle = nullptr; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = LCD_RST_GPIO; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) if (config.type == LcdPanelType::kGc9107) { diff --git a/main/boards/atoms3r-echo-pyramid/atoms3r_echo_pyramid.cc b/main/boards/atoms3r-echo-pyramid/atoms3r_echo_pyramid.cc index 86ace342..cd2bf204 100644 --- a/main/boards/atoms3r-echo-pyramid/atoms3r_echo_pyramid.cc +++ b/main/boards/atoms3r-echo-pyramid/atoms3r_echo_pyramid.cc @@ -816,7 +816,7 @@ private: #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; #else - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; #endif panel_config.bits_per_pixel = 16; diff --git a/main/boards/bread-compact-esp32/esp32_bread_board.cc b/main/boards/bread-compact-esp32/esp32_bread_board.cc index 0dac72fc..fb8b32c9 100644 --- a/main/boards/bread-compact-esp32/esp32_bread_board.cc +++ b/main/boards/bread-compact-esp32/esp32_bread_board.cc @@ -47,24 +47,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/bread-compact-ml307/compact_ml307_board.cc b/main/boards/bread-compact-ml307/compact_ml307_board.cc index 15b25f4e..0bf6a11a 100644 --- a/main/boards/bread-compact-ml307/compact_ml307_board.cc +++ b/main/boards/bread-compact-ml307/compact_ml307_board.cc @@ -48,24 +48,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/bread-compact-nt26/compact_nt26_board.cc b/main/boards/bread-compact-nt26/compact_nt26_board.cc index 88128efd..6283e6e4 100644 --- a/main/boards/bread-compact-nt26/compact_nt26_board.cc +++ b/main/boards/bread-compact-nt26/compact_nt26_board.cc @@ -47,24 +47,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/bread-compact-wifi/compact_wifi_board.cc b/main/boards/bread-compact-wifi/compact_wifi_board.cc index 04d71910..28b8c569 100644 --- a/main/boards/bread-compact-wifi/compact_wifi_board.cc +++ b/main/boards/bread-compact-wifi/compact_wifi_board.cc @@ -52,24 +52,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/common/esp_video.cc b/main/boards/common/esp_video.cc index 9fd4b121..5c44be8f 100644 --- a/main/boards/common/esp_video.cc +++ b/main/boards/common/esp_video.cc @@ -57,8 +57,7 @@ #define TAG "EspVideo" #if defined(CONFIG_CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER) || defined(CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP) -#warning \ - "CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER or CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP is enabled, which may cause image corruption in YUV422 format!" +#pragma message("CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER or CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP is enabled; verify YUV422 image integrity") #endif #if CONFIG_XIAOZHI_ENABLE_CAMERA_DEBUG_MODE @@ -191,7 +190,8 @@ EspVideo::EspVideo(const esp_video_init_config_t& config) { uint32_t best_fmt = 0; int best_rank = 1 << 30; // large number - // ๆณจ: ๅฝ“ๅ‰็‰ˆๆœฌ esp_video ไธญ YUV422P ๅฎž้™…่พ“ๅ‡บไธบ YUYVใ€‚ + // esp_video 2.x uses the packed YUYV/UYVY FOURCC values. Keep YUV422P + // for compatibility with esp_video 1.x, where it was used for YUYV data. #if defined(CONFIG_XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE) && defined(CONFIG_SOC_PPA_SUPPORTED) auto get_rank = [](uint32_t fmt) -> int { switch (fmt) { @@ -203,6 +203,9 @@ EspVideo::EspVideo(const esp_video_init_config_t& config) { case V4L2_PIX_FMT_YUV420: // ่ฝฏไปถ JPEG ็ผ–็ ๅ™จไธๆ”ฏๆŒ YUV420 ๆ ผๅผ return 2; #endif // CONFIG_XIAOZHI_ENABLE_HARDWARE_JPEG_ENCODER + case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: + return 3; case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_YUV422P: default: @@ -212,6 +215,8 @@ EspVideo::EspVideo(const esp_video_init_config_t& config) { #else auto get_rank = [](uint32_t fmt) -> int { switch (fmt) { + case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_YUV422P: return 10; case V4L2_PIX_FMT_RGB565: @@ -433,6 +438,7 @@ bool EspVideo::Capture() { case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_GREY: #ifdef CONFIG_XIAOZHI_CAMERA_ALLOW_JPEG_INPUT @@ -517,6 +523,9 @@ bool EspVideo::Capture() { rotate_cfg.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB565_LE; break; case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: + // Rotate packed YUV422 as opaque 16-bit pixels. The rotation + // operation only needs the pixel size and does not convert color. rotate_cfg.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB565_LE; break; case V4L2_PIX_FMT_GREY: @@ -584,8 +593,9 @@ bool EspVideo::Capture() { rotate_src = (uint8_t*)frame_.data; ppa_color_mode = PPA_SRM_COLOR_MODE_RGB888; break; - case V4L2_PIX_FMT_YUYV: { - ESP_LOGW(TAG, "YUYV format is not supported for PPA rotation, using software conversion to RGB888"); + case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: { + ESP_LOGW(TAG, "YUV422 format is not supported for PPA rotation, using software conversion to RGB888"); rotate_src = (uint8_t*)heap_caps_malloc(frame_.width * frame_.height * 3, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); if (rotate_src == nullptr) { @@ -598,7 +608,7 @@ bool EspVideo::Capture() { esp_imgfx_color_convert_cfg_t convert_cfg = { .in_res = {.width = static_cast(frame_.width), .height = static_cast(frame_.height)}, - .in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_YUYV, + .in_pixel_fmt = static_cast(frame_.format), .out_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888, }; esp_imgfx_color_convert_handle_t convert_handle = nullptr; @@ -746,6 +756,7 @@ bool EspVideo::Capture() { switch (frame_.format) { // LVGL ๆ˜พ็คบ YUV ็ณป็š„ๅ›พๅƒไผผไนŽ้ƒฝๆœ‰้—ฎ้ข˜๏ผŒๆš‚ๆ—ถ่ฝฌๆขไธบ RGB565 ๆ˜พ็คบ case V4L2_PIX_FMT_YUYV: + case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_RGB24: { color_format = LV_COLOR_FORMAT_RGB565; diff --git a/main/boards/common/nt26_board.cc b/main/boards/common/nt26_board.cc index f239cdf0..9279869b 100644 --- a/main/boards/common/nt26_board.cc +++ b/main/boards/common/nt26_board.cc @@ -79,7 +79,7 @@ void Nt26Board::StartNetwork() { modem_ = std::make_unique(config); modem_->SetDebug(false); - modem_->SetNetworkEventCallback([this](UartEthModem::UartEthModemEvent event) { + modem_->SetNetworkEventCallback([this](UartEthModem::UartEthModemEvent event, const std::string& detail) { switch (event) { case UartEthModem::UartEthModemEvent::Connected: esp_timer_stop(network_ready_timer_); @@ -105,11 +105,14 @@ void Nt26Board::StartNetwork() { case UartEthModem::UartEthModemEvent::ErrorNoCarrier: esp_timer_stop(network_ready_timer_); ScheduleAsyncStop(); - OnNetworkEvent(NetworkEvent::ModemErrorInitFailed); + OnNetworkEvent(NetworkEvent::ModemErrorInitFailed, detail); break; case UartEthModem::UartEthModemEvent::InFlightMode: ESP_LOGW(TAG, "Modem in flight mode"); break; + case UartEthModem::UartEthModemEvent::RfTestReady: + ESP_LOGI(TAG, "Modem RF test mode ready"); + break; case UartEthModem::UartEthModemEvent::RequestingPdpContext: break; } diff --git a/main/boards/common/sleep_timer.cc b/main/boards/common/sleep_timer.cc index 3490f6ce..33a4af15 100644 --- a/main/boards/common/sleep_timer.cc +++ b/main/boards/common/sleep_timer.cc @@ -7,6 +7,8 @@ #include #include #include +#include +#include #define TAG "SleepTimer" @@ -99,11 +101,21 @@ void SleepTimer::CheckTimer() { esp_light_sleep_start(); lvgl_port_resume(); +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + // IDF 6 deprecates esp_sleep_get_wakeup_cause() in favor of + // the bitmap-based API that can report simultaneous sources. + auto wakeup_causes = esp_sleep_get_wakeup_causes(); + ESP_LOGI(TAG, "Wake up from light sleep, wakeup_causes: 0x%" PRIx32, wakeup_causes); + if (!(wakeup_causes & (1UL << ESP_SLEEP_WAKEUP_TIMER))) { + break; + } +#else auto wakeup_reason = esp_sleep_get_wakeup_cause(); ESP_LOGI(TAG, "Wake up from light sleep, wakeup_reason: %d", wakeup_reason); if (wakeup_reason != ESP_SLEEP_WAKEUP_TIMER) { break; } +#endif } WakeUp(); }); diff --git a/main/boards/df-k10/df_k10_board.cc b/main/boards/df-k10/df_k10_board.cc index 9844e013..385ac3ec 100644 --- a/main/boards/df-k10/df_k10_board.cc +++ b/main/boards/df-k10/df_k10_board.cc @@ -12,6 +12,7 @@ #include "assets/lang_config.h" #include +#include #include #include #include @@ -233,7 +234,11 @@ private: esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 16; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else panel_config.color_space = ESP_LCD_COLOR_SPACE_BGR; +#endif ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(panel_io, &panel_config, &panel)); ESP_ERROR_CHECK(esp_lcd_panel_reset(panel)); diff --git a/main/boards/electron-bot/electron_bot.cc b/main/boards/electron-bot/electron_bot.cc index e958b36d..4cf15f98 100644 --- a/main/boards/electron-bot/electron_bot.cc +++ b/main/boards/electron-bot/electron_bot.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include "application.h" #include "codecs/no_audio_codec.h" @@ -59,7 +60,11 @@ private: esp_lcd_panel_handle_t panel_handle = NULL; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = DISPLAY_SPI_RESET_PIN; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; // LCD_RGB_ENDIAN_RGB; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(io_handle, &panel_config, &panel_handle)); diff --git a/main/boards/esp-hi/adc_pdm_audio_codec.cc b/main/boards/esp-hi/adc_pdm_audio_codec.cc index 24182d46..18780af9 100644 --- a/main/boards/esp-hi/adc_pdm_audio_codec.cc +++ b/main/boards/esp-hi/adc_pdm_audio_codec.cc @@ -236,7 +236,8 @@ void AdcPdmAudioCodec::Start() { output_volume_ = 10; } - EnableInput(true); + // Input is opened lazily by AudioService::AudioInputTask. ESP-IDF's ADC + // continuous driver requires start and stop to run in the same task. EnableOutput(true); ESP_LOGI(TAG, "Audio codec started"); } diff --git a/main/boards/esp-p4-function-ev-board/config.json b/main/boards/esp-p4-function-ev-board/config.json index 3790accd..4afb5514 100644 --- a/main/boards/esp-p4-function-ev-board/config.json +++ b/main/boards/esp-p4-function-ev-board/config.json @@ -3,6 +3,7 @@ "builds": [ { "name": "esp-p4-function-ev-board", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SLAVE_IDF_TARGET_ESP32C6=y", "CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y", diff --git a/main/boards/esp-s3-lcd-ev-board-2/esp-s3-lcd-ev-board-2.cc b/main/boards/esp-s3-lcd-ev-board-2/esp-s3-lcd-ev-board-2.cc index 4bd5cb26..917cc352 100644 --- a/main/boards/esp-s3-lcd-ev-board-2/esp-s3-lcd-ev-board-2.cc +++ b/main/boards/esp-s3-lcd-ev-board-2/esp-s3-lcd-ev-board-2.cc @@ -69,7 +69,8 @@ private: //add support ev board .timings = GC9503_800_480_PANEL_60HZ_RGB_TIMING(), .data_width = 16, // RGB565 in parallel mode, thus 16bit in width - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = GC9503V_LCD_RGB_BUFFER_NUMS, .bounce_buffer_size_px = GC9503V_LCD_H_RES * GC9503V_LCD_RGB_BOUNCE_BUFFER_HEIGHT, .dma_burst_size = 64, @@ -110,14 +111,12 @@ private: .auto_del_panel_io = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = -1, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - // .bits_per_pixel = 16, - //add surpport ev board - .bits_per_pixel = 18, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + // The GC9503V accepts 18-bit panel data while the RGB framebuffer is RGB565. + panel_config.bits_per_pixel = 18; + panel_config.reset_gpio_num = GPIO_NUM_NC; + panel_config.vendor_config = &vendor_config; (esp_lcd_new_panel_gc9503(panel_io, &panel_config, &panel_handle)); (esp_lcd_panel_reset(panel_handle)); (esp_lcd_panel_init(panel_handle)); diff --git a/main/boards/esp-s3-lcd-ev-board-2/pin_config.h b/main/boards/esp-s3-lcd-ev-board-2/pin_config.h index 233b08ed..8659312f 100644 --- a/main/boards/esp-s3-lcd-ev-board-2/pin_config.h +++ b/main/boards/esp-s3-lcd-ev-board-2/pin_config.h @@ -45,7 +45,7 @@ #define GC9503V_PIN_NUM_DATA14 GPIO_NUM_2 // R3 #define GC9503V_PIN_NUM_DATA15 GPIO_NUM_1 // R4 -#define GC9503V_PIN_NUM_DISP_EN -1 +#define GC9503V_PIN_NUM_DISP_EN GPIO_NUM_NC #define GC9503V_LCD_IO_SPI_CS_1 (IO_EXPANDER_PIN_NUM_1) #define GC9503V_LCD_IO_SPI_SCL_1 (IO_EXPANDER_PIN_NUM_2) diff --git a/main/boards/esp-s3-lcd-ev-board/esp-s3-lcd-ev-board.cc b/main/boards/esp-s3-lcd-ev-board/esp-s3-lcd-ev-board.cc index 2562df3e..5fcd1af8 100644 --- a/main/boards/esp-s3-lcd-ev-board/esp-s3-lcd-ev-board.cc +++ b/main/boards/esp-s3-lcd-ev-board/esp-s3-lcd-ev-board.cc @@ -68,7 +68,8 @@ private: //add support ev board .timings = GC9503_480_480_PANEL_60HZ_RGB_TIMING(), .data_width = 16, // RGB565 in parallel mode, thus 16bit in width - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = GC9503V_LCD_RGB_BUFFER_NUMS, .bounce_buffer_size_px = GC9503V_LCD_H_RES * GC9503V_LCD_RGB_BOUNCE_BUFFER_HEIGHT, .dma_burst_size = 64, @@ -109,14 +110,12 @@ private: .auto_del_panel_io = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = -1, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - // .bits_per_pixel = 16, - //add surpport ev board - .bits_per_pixel = 18, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + // The GC9503V accepts 18-bit panel data while the RGB framebuffer is RGB565. + panel_config.bits_per_pixel = 18; + panel_config.reset_gpio_num = GPIO_NUM_NC; + panel_config.vendor_config = &vendor_config; (esp_lcd_new_panel_gc9503(panel_io, &panel_config, &panel_handle)); (esp_lcd_panel_reset(panel_handle)); (esp_lcd_panel_init(panel_handle)); diff --git a/main/boards/esp-s3-lcd-ev-board/pin_config.h b/main/boards/esp-s3-lcd-ev-board/pin_config.h index a69fff92..0f9bb8b5 100644 --- a/main/boards/esp-s3-lcd-ev-board/pin_config.h +++ b/main/boards/esp-s3-lcd-ev-board/pin_config.h @@ -55,8 +55,8 @@ #define GC9503V_PIN_NUM_DATA14 GPIO_NUM_2 // R3 #define GC9503V_PIN_NUM_DATA15 GPIO_NUM_1 // R4 -#define GC9503V_PIN_NUM_DISP_EN -1 +#define GC9503V_PIN_NUM_DISP_EN GPIO_NUM_NC #define GC9503V_LCD_IO_SPI_CS_1 (IO_EXPANDER_PIN_NUM_1) #define GC9503V_LCD_IO_SPI_SCL_1 (IO_EXPANDER_PIN_NUM_2) -#define GC9503V_LCD_IO_SPI_SDO_1 (IO_EXPANDER_PIN_NUM_3) \ No newline at end of file +#define GC9503V_LCD_IO_SPI_SDO_1 (IO_EXPANDER_PIN_NUM_3) diff --git a/main/boards/esp-sensairshuttle/adc_pdm_audio_codec.cc b/main/boards/esp-sensairshuttle/adc_pdm_audio_codec.cc index def028fb..50177eb5 100644 --- a/main/boards/esp-sensairshuttle/adc_pdm_audio_codec.cc +++ b/main/boards/esp-sensairshuttle/adc_pdm_audio_codec.cc @@ -236,7 +236,8 @@ void AdcPdmAudioCodec::Start() { output_volume_ = 10; } - EnableInput(true); + // Input is opened lazily by AudioService::AudioInputTask. ESP-IDF's ADC + // continuous driver requires start and stop to run in the same task. EnableOutput(true); ESP_LOGI(TAG, "Audio codec started"); } diff --git a/main/boards/esp-vocat/esp_vocat.cc b/main/boards/esp-vocat/esp_vocat.cc index 852684cd..d7e4fce3 100644 --- a/main/boards/esp-vocat/esp_vocat.cc +++ b/main/boards/esp-vocat/esp_vocat.cc @@ -914,8 +914,15 @@ private: esp_lcd_panel_io_handle_t panel_io = nullptr; esp_lcd_panel_handle_t panel = nullptr; - const esp_lcd_panel_io_spi_config_t io_config = - ST77916_PANEL_IO_QSPI_CONFIG(QSPI_PIN_NUM_LCD_CS, NULL, NULL); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = QSPI_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)QSPI_LCD_HOST, &io_config, &panel_io)); st77916_vendor_config_t vendor_config = { @@ -926,16 +933,12 @@ private: .use_qspi_interface = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, - .flags = - { - .reset_active_high = pcb_version, - }, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; + panel_config.flags.reset_active_high = pcb_version; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/hu-087/hu_087_board.cc b/main/boards/hu-087/hu_087_board.cc index a4ad5ce7..8fda6a1b 100644 --- a/main/boards/hu-087/hu_087_board.cc +++ b/main/boards/hu-087/hu_087_board.cc @@ -46,26 +46,26 @@ class Hu087Board : public WifiBoard { // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; ESP_ERROR_CHECK( - esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/jiuchuan-s3/jiuchuan_dev_board.cc b/main/boards/jiuchuan-s3/jiuchuan_dev_board.cc index 76c522e8..ce67bd24 100644 --- a/main/boards/jiuchuan-s3/jiuchuan_dev_board.cc +++ b/main/boards/jiuchuan-s3/jiuchuan_dev_board.cc @@ -311,7 +311,7 @@ private: ESP_LOGI(TAG, "Install LCD driver"); esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = GPIO_NUM_NC; - panel_config.rgb_ele_order = LCD_RGB_ENDIAN_BGR; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; panel_config.bits_per_pixel = 16; esp_lcd_new_panel_gc9309na(panel_io, &panel_config, &panel); diff --git a/main/boards/kevin-box-2/kevin_box_board.cc b/main/boards/kevin-box-2/kevin_box_board.cc index 0e068a05..67970d23 100644 --- a/main/boards/kevin-box-2/kevin_box_board.cc +++ b/main/boards/kevin-box-2/kevin_box_board.cc @@ -99,24 +99,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { @@ -267,4 +267,4 @@ public: } }; -DECLARE_BOARD(KevinBoxBoard); \ No newline at end of file +DECLARE_BOARD(KevinBoxBoard); diff --git a/main/boards/kevin-yuying-313lcd/kevin_yuying_313lcd.cc b/main/boards/kevin-yuying-313lcd/kevin_yuying_313lcd.cc index e116f84d..d94907f6 100644 --- a/main/boards/kevin-yuying-313lcd/kevin_yuying_313lcd.cc +++ b/main/boards/kevin-yuying-313lcd/kevin_yuying_313lcd.cc @@ -46,7 +46,8 @@ private: .clk_src = LCD_CLK_SRC_PLL160M, .timings = GC9503_376_960_PANEL_60HZ_RGB_TIMING(), .data_width = 16, // RGB565 in parallel mode, thus 16bit in width - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = GC9503V_LCD_RGB_BUFFER_NUMS, .bounce_buffer_size_px = GC9503V_LCD_H_RES * GC9503V_LCD_RGB_BOUNCE_BUFFER_HEIGHT, .dma_burst_size = 64, @@ -87,12 +88,11 @@ private: .auto_del_panel_io = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = -1, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = GPIO_NUM_NC; + panel_config.vendor_config = &vendor_config; (esp_lcd_new_panel_gc9503(panel_io, &panel_config, &panel_handle)); (esp_lcd_panel_reset(panel_handle)); (esp_lcd_panel_init(panel_handle)); diff --git a/main/boards/kevin-yuying-313lcd/pin_config.h b/main/boards/kevin-yuying-313lcd/pin_config.h index 0bcd0594..41fba2cd 100644 --- a/main/boards/kevin-yuying-313lcd/pin_config.h +++ b/main/boards/kevin-yuying-313lcd/pin_config.h @@ -16,32 +16,32 @@ #define GC9503V_LCD_BK_LIGHT_ON_LEVEL 1 #define GC9503V_LCD_BK_LIGHT_OFF_LEVEL !GC9503V_LCD_BK_LIGHT_ON_LEVEL #define GC9503V_PIN_NUM_BK_LIGHT GPIO_NUM_4 -#define GC9503V_PIN_NUM_HSYNC 6 -#define GC9503V_PIN_NUM_VSYNC 5 -#define GC9503V_PIN_NUM_DE 15 -#define GC9503V_PIN_NUM_PCLK 7 +#define GC9503V_PIN_NUM_HSYNC GPIO_NUM_6 +#define GC9503V_PIN_NUM_VSYNC GPIO_NUM_5 +#define GC9503V_PIN_NUM_DE GPIO_NUM_15 +#define GC9503V_PIN_NUM_PCLK GPIO_NUM_7 -#define GC9503V_PIN_NUM_DATA0 47 // B0 -#define GC9503V_PIN_NUM_DATA1 21 // B1 -#define GC9503V_PIN_NUM_DATA2 14 // B2 -#define GC9503V_PIN_NUM_DATA3 13 // B3 -#define GC9503V_PIN_NUM_DATA4 12 // B4 +#define GC9503V_PIN_NUM_DATA0 GPIO_NUM_47 // B0 +#define GC9503V_PIN_NUM_DATA1 GPIO_NUM_21 // B1 +#define GC9503V_PIN_NUM_DATA2 GPIO_NUM_14 // B2 +#define GC9503V_PIN_NUM_DATA3 GPIO_NUM_13 // B3 +#define GC9503V_PIN_NUM_DATA4 GPIO_NUM_12 // B4 -#define GC9503V_PIN_NUM_DATA5 11 // G0 -#define GC9503V_PIN_NUM_DATA6 10 // G1 -#define GC9503V_PIN_NUM_DATA7 9 // G2 -#define GC9503V_PIN_NUM_DATA8 46 // G3 -#define GC9503V_PIN_NUM_DATA9 3 // G4 -#define GC9503V_PIN_NUM_DATA10 20 // G5 +#define GC9503V_PIN_NUM_DATA5 GPIO_NUM_11 // G0 +#define GC9503V_PIN_NUM_DATA6 GPIO_NUM_10 // G1 +#define GC9503V_PIN_NUM_DATA7 GPIO_NUM_9 // G2 +#define GC9503V_PIN_NUM_DATA8 GPIO_NUM_46 // G3 +#define GC9503V_PIN_NUM_DATA9 GPIO_NUM_3 // G4 +#define GC9503V_PIN_NUM_DATA10 GPIO_NUM_20 // G5 -#define GC9503V_PIN_NUM_DATA11 19 // R0 -#define GC9503V_PIN_NUM_DATA12 8 // R1 -#define GC9503V_PIN_NUM_DATA13 18 // R2 -#define GC9503V_PIN_NUM_DATA14 17 // R3 -#define GC9503V_PIN_NUM_DATA15 16 // R4 +#define GC9503V_PIN_NUM_DATA11 GPIO_NUM_19 // R0 +#define GC9503V_PIN_NUM_DATA12 GPIO_NUM_8 // R1 +#define GC9503V_PIN_NUM_DATA13 GPIO_NUM_18 // R2 +#define GC9503V_PIN_NUM_DATA14 GPIO_NUM_17 // R3 +#define GC9503V_PIN_NUM_DATA15 GPIO_NUM_16 // R4 -#define GC9503V_PIN_NUM_DISP_EN -1 +#define GC9503V_PIN_NUM_DISP_EN GPIO_NUM_NC #define GC9503V_LCD_IO_SPI_CS_1 (GPIO_NUM_48) #define GC9503V_LCD_IO_SPI_SCL_1 (GPIO_NUM_17) -#define GC9503V_LCD_IO_SPI_SDO_1 (GPIO_NUM_16) \ No newline at end of file +#define GC9503V_LCD_IO_SPI_SDO_1 (GPIO_NUM_16) diff --git a/main/boards/lceda-course-examples/eda-robot-pro/eda_robot_pro.cc b/main/boards/lceda-course-examples/eda-robot-pro/eda_robot_pro.cc index e96f1b1f..d7a47cdf 100644 --- a/main/boards/lceda-course-examples/eda-robot-pro/eda_robot_pro.cc +++ b/main/boards/lceda-course-examples/eda-robot-pro/eda_robot_pro.cc @@ -45,24 +45,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { @@ -130,4 +130,4 @@ public: } }; -DECLARE_BOARD(EDARobotPro); \ No newline at end of file +DECLARE_BOARD(EDARobotPro); diff --git a/main/boards/lilygo-t-circle-s3/esp_lcd_gc9d01n.c b/main/boards/lilygo-t-circle-s3/esp_lcd_gc9d01n.c index 25a78674..eb74992d 100644 --- a/main/boards/lilygo-t-circle-s3/esp_lcd_gc9d01n.c +++ b/main/boards/lilygo-t-circle-s3/esp_lcd_gc9d01n.c @@ -10,6 +10,7 @@ #include "driver/gpio.h" #include "esp_log.h" #include "esp_check.h" +#include "esp_idf_version.h" #include "esp_lcd_gc9d01n.h" @@ -66,7 +67,7 @@ esp_err_t esp_lcd_new_panel_gc9d01n(const esp_lcd_panel_io_handle_t io, const es ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported color space"); break; } -#else +#elif ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0) switch (panel_dev_config->rgb_endian){ case LCD_RGB_ENDIAN_RGB: gc9d01n->madctl_val = 0; @@ -78,6 +79,18 @@ esp_err_t esp_lcd_new_panel_gc9d01n(const esp_lcd_panel_io_handle_t io, const es ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported rgb endian"); break; } +#else + switch (panel_dev_config->rgb_ele_order){ + case LCD_RGB_ELEMENT_ORDER_RGB: + gc9d01n->madctl_val = 0; + break; + case LCD_RGB_ELEMENT_ORDER_BGR: + gc9d01n->madctl_val |= LCD_CMD_BGR_BIT; + break; + default: + ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported RGB element order"); + break; + } #endif switch (panel_dev_config->bits_per_pixel){ diff --git a/main/boards/lilygo-t-circle-s3/lilygo-t-circle-s3.cc b/main/boards/lilygo-t-circle-s3/lilygo-t-circle-s3.cc index 795898b9..ccbee00e 100644 --- a/main/boards/lilygo-t-circle-s3/lilygo-t-circle-s3.cc +++ b/main/boards/lilygo-t-circle-s3/lilygo-t-circle-s3.cc @@ -156,8 +156,8 @@ private: ESP_LOGD(TAG, "Install panel IO"); esp_lcd_panel_io_spi_config_t io_config = {}; - io_config.cs_gpio_num = DISPLAY_CS; - io_config.dc_gpio_num = DISPLAY_DC; + io_config.cs_gpio_num = static_cast(DISPLAY_CS); + io_config.dc_gpio_num = static_cast(DISPLAY_DC); io_config.spi_mode = 0; io_config.pclk_hz = 40 * 1000 * 1000; io_config.trans_queue_depth = 10; @@ -167,7 +167,7 @@ private: ESP_LOGD(TAG, "Install LCD driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = DISPLAY_RST; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; panel_config.bits_per_pixel = 16; ESP_ERROR_CHECK(esp_lcd_new_panel_gc9d01n(panel_io, &panel_config, &panel)); diff --git a/main/boards/lilygo-t-circle-s3/tcircles3_audio_codec.cc b/main/boards/lilygo-t-circle-s3/tcircles3_audio_codec.cc index 5fe3ea79..2f4c2722 100644 --- a/main/boards/lilygo-t-circle-s3/tcircles3_audio_codec.cc +++ b/main/boards/lilygo-t-circle-s3/tcircles3_audio_codec.cc @@ -46,9 +46,9 @@ Tcircles3AudioCodec::~Tcircles3AudioCodec() { void Tcircles3AudioCodec::CreateVoiceHardware(gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data, gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data) { - i2s_chan_config_t mic_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(i2s_port_t(0), I2S_ROLE_MASTER); + i2s_chan_config_t mic_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(0), I2S_ROLE_MASTER); mic_chan_config.auto_clear = true; // Auto clear the legacy data in the DMA buffer - i2s_chan_config_t spkr_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(i2s_port_t(1), I2S_ROLE_MASTER); + i2s_chan_config_t spkr_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(1), I2S_ROLE_MASTER); spkr_chan_config.auto_clear = true; // Auto clear the legacy data in the DMA buffer ESP_ERROR_CHECK(i2s_new_channel(&mic_chan_config, NULL, &rx_handle_)); diff --git a/main/boards/lilygo-t-display-p4/lilygo-t-display-p4.cc b/main/boards/lilygo-t-display-p4/lilygo-t-display-p4.cc index 1ba35eb0..cd3bf714 100644 --- a/main/boards/lilygo-t-display-p4/lilygo-t-display-p4.cc +++ b/main/boards/lilygo-t-display-p4/lilygo-t-display-p4.cc @@ -206,7 +206,7 @@ public: }, }; esp_lcd_panel_dev_config_t dev_config = { - .reset_gpio_num = -1, + .reset_gpio_num = GPIO_NUM_NC, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = SCREEN_BITS_PER_PIXEL, .vendor_config = &vendor_config, @@ -220,7 +220,7 @@ public: }, }; esp_lcd_panel_dev_config_t dev_config = { - .reset_gpio_num = -1, + .reset_gpio_num = GPIO_NUM_NC, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = SCREEN_BITS_PER_PIXEL, .vendor_config = &vendor_config, diff --git a/main/boards/lilygo-t-display-s3-pro-mvsrlora/lilygo-t-display-s3-pro-mvsrlora.cc b/main/boards/lilygo-t-display-s3-pro-mvsrlora/lilygo-t-display-s3-pro-mvsrlora.cc index b18d27af..7f3798eb 100644 --- a/main/boards/lilygo-t-display-s3-pro-mvsrlora/lilygo-t-display-s3-pro-mvsrlora.cc +++ b/main/boards/lilygo-t-display-s3-pro-mvsrlora/lilygo-t-display-s3-pro-mvsrlora.cc @@ -180,8 +180,8 @@ private: ESP_LOGD(TAG, "Install panel IO"); esp_lcd_panel_io_spi_config_t io_config = {}; - io_config.cs_gpio_num = DISPLAY_CS; - io_config.dc_gpio_num = DISPLAY_DC; + io_config.cs_gpio_num = static_cast(DISPLAY_CS); + io_config.dc_gpio_num = static_cast(DISPLAY_DC); io_config.spi_mode = 0; io_config.pclk_hz = 40 * 1000 * 1000; io_config.trans_queue_depth = 10; @@ -191,7 +191,7 @@ private: ESP_LOGD(TAG, "Install LCD driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = DISPLAY_RST; + panel_config.reset_gpio_num = static_cast(DISPLAY_RST); panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; panel_config.bits_per_pixel = 16; ESP_ERROR_CHECK(esp_lcd_new_panel_st7796(panel_io, &panel_config, &panel)); diff --git a/main/boards/lilygo-t-display-s3-pro-mvsrlora/tdisplays3promvsrlora_audio_codec.cc b/main/boards/lilygo-t-display-s3-pro-mvsrlora/tdisplays3promvsrlora_audio_codec.cc index 0beec452..85dc99be 100644 --- a/main/boards/lilygo-t-display-s3-pro-mvsrlora/tdisplays3promvsrlora_audio_codec.cc +++ b/main/boards/lilygo-t-display-s3-pro-mvsrlora/tdisplays3promvsrlora_audio_codec.cc @@ -60,9 +60,9 @@ Tdisplays3promvsrloraAudioCodec::~Tdisplays3promvsrloraAudioCodec() { void Tdisplays3promvsrloraAudioCodec::CreateVoiceHardware(gpio_num_t mic_bclk, gpio_num_t mic_ws, gpio_num_t mic_data, gpio_num_t spkr_bclk, gpio_num_t spkr_lrclk, gpio_num_t spkr_data) { - i2s_chan_config_t mic_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(i2s_port_t(0), I2S_ROLE_MASTER); + i2s_chan_config_t mic_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(0), I2S_ROLE_MASTER); mic_chan_config.auto_clear = true; // Auto clear the legacy data in the DMA buffer - i2s_chan_config_t spkr_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(i2s_port_t(1), I2S_ROLE_MASTER); + i2s_chan_config_t spkr_chan_config = I2S_CHANNEL_DEFAULT_CONFIG(XIAOZHI_I2S_PORT(1), I2S_ROLE_MASTER); spkr_chan_config.auto_clear = true; // Auto clear the legacy data in the DMA buffer ESP_ERROR_CHECK(i2s_new_channel(&mic_chan_config, NULL, &rx_handle_)); diff --git a/main/boards/m5stack-core-s3/config.h b/main/boards/m5stack-core-s3/config.h index e0037829..69ba581d 100644 --- a/main/boards/m5stack-core-s3/config.h +++ b/main/boards/m5stack-core-s3/config.h @@ -5,7 +5,7 @@ #include -#define AUDIO_INPUT_REFERENCE true +#define AUDIO_INPUT_REFERENCE false #define AUDIO_INPUT_SAMPLE_RATE 24000 #define AUDIO_OUTPUT_SAMPLE_RATE 24000 diff --git a/main/boards/m5stack-stopwatch/m5stack_stopwatch.cc b/main/boards/m5stack-stopwatch/m5stack_stopwatch.cc index 1ed89897..aa0a6192 100644 --- a/main/boards/m5stack-stopwatch/m5stack_stopwatch.cc +++ b/main/boards/m5stack-stopwatch/m5stack_stopwatch.cc @@ -167,8 +167,15 @@ private: esp_lcd_panel_io_handle_t panel_io = nullptr; esp_lcd_panel_handle_t panel = nullptr; - esp_lcd_panel_io_spi_config_t io_config = CO5300_PANEL_IO_QSPI_CONFIG( - DISPLAY_QSPI_CS, nullptr, nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = DISPLAY_QSPI_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(DISPLAY_QSPI_HOST, &io_config, &panel_io)); co5300_vendor_config_t vendor_config = { diff --git a/main/boards/m5stack-tab5/README.md b/main/boards/m5stack-tab5/README.md index a0cd891e..f5adf817 100644 --- a/main/boards/m5stack-tab5/README.md +++ b/main/boards/m5stack-tab5/README.md @@ -12,12 +12,12 @@ * No dependency override needed โ€” the project already specifies the correct `esp_video` and `esp_ipa` versions in `main/idf_component.yml`. Do NOT change the dependency versions unless you are also modifying the source code to match the older API. -้’ˆๅฏน ESP32-P4 Rev <3.0 ็”จๆˆท: -็กฎไฟไฝ ็š„ sdkconfig.defaults ๅŒ…ๅซ: +`release.py` ไผšๆ นๆฎๅฝ“ๅ‰ ESP-IDF ็‰ˆๆœฌ้€‰ๆ‹ฉ่Šฏ็‰‡็‰ˆๆœฌ๏ผš -CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y +- ESP-IDF < 6๏ผš`m5stack-tab5` ้ขๅ‘ Rev < 3๏ผŒๅนถๅŒ…ๅซ `CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y` ๅ’Œ `CONFIG_ESP32P4_REV_MIN_100=y`๏ผ›`m5stack-tab5-p4x` ้ขๅ‘ Rev >= 3ใ€‚ +- ESP-IDF >= 6๏ผšๅชๆไพ›้ขๅ‘ Rev >= 3 ็š„ `m5stack-tab5-p4x`ใ€‚ -ๅฆๅˆ™็ƒงๅ†™็š„ๆ—ถๅ€™ไผšๅ‡บ็Žฐ๏ผš'bootloader/bootloader.bin' requires chip revision in range [v3.0 - v3.99] (this chip is revision v1.x) +ไธ่ฆๆŠŠ IDF 6 ็”Ÿๆˆ็š„ๅ›บไปถๅผบๅˆถๅˆทๅ…ฅ Rev 1.x ่Šฏ็‰‡๏ผ›ๆญฃๅธธๆƒ…ๅ†ตไธ‹็ƒงๅฝ•ๅทฅๅ…ทไผšๆŠฅๅ‘Š๏ผš`bootloader/bootloader.bin requires chip revision in range [v3.0 - v3.99] (this chip is revision v1.x)`ใ€‚ 1. ไฝฟ็”จ release.py ็ผ–่ฏ‘ diff --git a/main/boards/m5stack-tab5/config.json b/main/boards/m5stack-tab5/config.json index 2f915f89..a0c42ea2 100644 --- a/main/boards/m5stack-tab5/config.json +++ b/main/boards/m5stack-tab5/config.json @@ -3,6 +3,7 @@ "builds": [ { "name": "m5stack-tab5", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_BOARD_TYPE_M5STACK_CORE_TAB5=y", "CONFIG_CAMERA_SC202CS=y", diff --git a/main/boards/m5stack-tab5/m5stack_tab5.cc b/main/boards/m5stack-tab5/m5stack_tab5.cc index 43ed5b57..dfe2ff87 100644 --- a/main/boards/m5stack-tab5/m5stack_tab5.cc +++ b/main/boards/m5stack-tab5/m5stack_tab5.cc @@ -228,7 +228,8 @@ private: .virtual_channel = 0, .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 60, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 2, .video_timing = { .h_size = DISPLAY_WIDTH, @@ -240,9 +241,6 @@ private: .vsync_back_porch = 20, .vsync_front_porch = 20, }, - .flags = { - .use_dma2d = false, - }, }; ili9881c_vendor_config_t vendor_config = { @@ -257,7 +255,7 @@ private: esp_lcd_panel_dev_config_t lcd_dev_config = {}; lcd_dev_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; - lcd_dev_config.reset_gpio_num = -1; + lcd_dev_config.reset_gpio_num = GPIO_NUM_NC; lcd_dev_config.bits_per_pixel = 16; lcd_dev_config.vendor_config = &vendor_config; @@ -317,7 +315,8 @@ private: dpi_config.virtual_channel = 0; dpi_config.dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT; dpi_config.dpi_clock_freq_mhz = 70; // ST7123 DPI clock frequency - dpi_config.pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565; + dpi_config.in_color_format = LCD_COLOR_FMT_RGB565; + dpi_config.out_color_format = LCD_COLOR_FMT_RGB565; dpi_config.num_fbs = 1; dpi_config.video_timing.h_size = 720; dpi_config.video_timing.v_size = 1280; @@ -327,7 +326,6 @@ private: dpi_config.video_timing.vsync_pulse_width = 2; dpi_config.video_timing.vsync_back_porch = 8; dpi_config.video_timing.vsync_front_porch = 220; - dpi_config.flags.use_dma2d = true; vendor_config.init_cmds = st7123_vendor_specific_init_default; vendor_config.init_cmds_size = sizeof(st7123_vendor_specific_init_default) / sizeof(st7123_vendor_specific_init_default[0]); @@ -335,7 +333,7 @@ private: vendor_config.mipi_config.dpi_config = &dpi_config; vendor_config.mipi_config.lane_num = 2; - lcd_dev_config.reset_gpio_num = -1; + lcd_dev_config.reset_gpio_num = GPIO_NUM_NC; lcd_dev_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; lcd_dev_config.data_endian = LCD_RGB_DATA_ENDIAN_LITTLE; lcd_dev_config.bits_per_pixel = 24; @@ -407,14 +405,13 @@ private: }, }; esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = 0x55, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 8, - .scl_speed_hz = 100000, - }; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = 0x55; + tp_io_config.scl_speed_hz = 100000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 8; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_st7123(tp_io_handle, &tp_cfg, &touch_)); } @@ -571,4 +568,3 @@ public: DECLARE_BOARD(M5StackTab5Board); - diff --git a/main/boards/movecall-cuican-esp32s3/movecall_cuican_esp32s3.cc b/main/boards/movecall-cuican-esp32s3/movecall_cuican_esp32s3.cc index ce72cc5a..b03ed54e 100644 --- a/main/boards/movecall-cuican-esp32s3/movecall_cuican_esp32s3.cc +++ b/main/boards/movecall-cuican-esp32s3/movecall_cuican_esp32s3.cc @@ -7,6 +7,7 @@ #include "led/single_led.h" #include +#include #include #include @@ -64,7 +65,11 @@ private: esp_lcd_panel_handle_t panel_handle = NULL; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = DISPLAY_SPI_RESET_PIN; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; //LCD_RGB_ENDIAN_RGB; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(io_handle, &panel_config, &panel_handle)); diff --git a/main/boards/movecall-moji-esp32s3/movecall_moji_esp32s3.cc b/main/boards/movecall-moji-esp32s3/movecall_moji_esp32s3.cc index a1a993b1..89b4eed3 100644 --- a/main/boards/movecall-moji-esp32s3/movecall_moji_esp32s3.cc +++ b/main/boards/movecall-moji-esp32s3/movecall_moji_esp32s3.cc @@ -7,6 +7,7 @@ #include "led/single_led.h" #include +#include #include #include @@ -91,7 +92,11 @@ private: esp_lcd_panel_handle_t panel_handle = NULL; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = DISPLAY_SPI_RESET_PIN; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; //LCD_RGB_ENDIAN_RGB; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(io_handle, &panel_config, &panel_handle)); diff --git a/main/boards/movecall-moji2-esp32c5/movecall_moji2_esp32s3.cc b/main/boards/movecall-moji2-esp32c5/movecall_moji2_esp32s3.cc index 93152ee8..7680dbff 100644 --- a/main/boards/movecall-moji2-esp32c5/movecall_moji2_esp32s3.cc +++ b/main/boards/movecall-moji2-esp32c5/movecall_moji2_esp32s3.cc @@ -285,8 +285,15 @@ private: esp_lcd_panel_handle_t panel = nullptr; ESP_LOGI(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = ST77916_PANEL_IO_QSPI_CONFIG(DISPLAY_QSPI_CS_PIN, NULL, NULL); - // io_config.pclk_hz = DISPLAY_SPI_SCLK_HZ; + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = DISPLAY_QSPI_CS_PIN; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)DISPLAY_QSPI_HOST, &io_config, &panel_io)); @@ -298,12 +305,11 @@ private: .use_qspi_interface = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = DISPLAY_QSPI_RESET_PIN, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = DISPLAY_QSPI_BIT_PER_PIXEL, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = DISPLAY_QSPI_BIT_PER_PIXEL; + panel_config.reset_gpio_num = DISPLAY_QSPI_RESET_PIN; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/otto-robot/config.h b/main/boards/otto-robot/config.h index bb0f456a..b7dc1561 100644 --- a/main/boards/otto-robot/config.h +++ b/main/boards/otto-robot/config.h @@ -1,7 +1,7 @@ #ifndef _BOARD_CONFIG_H_ #define _BOARD_CONFIG_H_ -#include +#include #include #define OTTO_VERSION_AUTO 0 diff --git a/main/boards/sensecap-watcher/sensecap_watcher.cc b/main/boards/sensecap-watcher/sensecap_watcher.cc index f0695911..6d0d08da 100644 --- a/main/boards/sensecap-watcher/sensecap_watcher.cc +++ b/main/boards/sensecap-watcher/sensecap_watcher.cc @@ -334,7 +334,7 @@ private: ESP_LOGI(TAG, "Install panel IO"); const esp_lcd_panel_io_spi_config_t io_config = { .cs_gpio_num = BSP_LCD_SPI_CS, - .dc_gpio_num = -1, + .dc_gpio_num = GPIO_NUM_NC, .spi_mode = 3, .pclk_hz = DRV_LCD_PIXEL_CLK_HZ, .trans_queue_depth = 2, @@ -352,12 +352,11 @@ private: esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, &panel_io_); ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_GPIO_RST, // Shared with Touch reset - .rgb_ele_order = DRV_LCD_RGB_ELEMENT_ORDER, - .bits_per_pixel = DRV_LCD_BITS_PER_PIXEL, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = DRV_LCD_RGB_ELEMENT_ORDER; + panel_config.bits_per_pixel = DRV_LCD_BITS_PER_PIXEL; + panel_config.reset_gpio_num = BSP_LCD_GPIO_RST; // Shared with Touch reset + panel_config.vendor_config = &vendor_config; esp_lcd_new_panel_spd2010(panel_io_, &panel_config, &panel_); esp_lcd_panel_reset(panel_); diff --git a/main/boards/sp-esp32-s3-1.28-box/power_manager.h b/main/boards/sp-esp32-s3-1.28-box/power_manager.h index 36e8ca97..871e46cf 100644 --- a/main/boards/sp-esp32-s3-1.28-box/power_manager.h +++ b/main/boards/sp-esp32-s3-1.28-box/power_manager.h @@ -5,7 +5,6 @@ #include #include #include -#include #include class PowerManager { @@ -186,4 +185,4 @@ public: void OnChargingStatusChanged(std::function callback) { on_charging_status_changed_ = callback; } -}; \ No newline at end of file +}; diff --git a/main/boards/sp-esp32-s3-1.28-box/sp-esp32-s3-1.28-box.cc b/main/boards/sp-esp32-s3-1.28-box/sp-esp32-s3-1.28-box.cc index 12822ef0..fd060858 100644 --- a/main/boards/sp-esp32-s3-1.28-box/sp-esp32-s3-1.28-box.cc +++ b/main/boards/sp-esp32-s3-1.28-box/sp-esp32-s3-1.28-box.cc @@ -7,6 +7,7 @@ #include "led/single_led.h" #include "assets/lang_config.h" #include +#include #include #include @@ -335,7 +336,11 @@ private: esp_lcd_panel_handle_t panel_handle = NULL; esp_lcd_panel_dev_config_t panel_config = {}; panel_config.reset_gpio_num = DISPLAY_SPI_RESET_PIN; // Set to -1 if not use - panel_config.rgb_endian = LCD_RGB_ENDIAN_BGR; //LCD_RGB_ENDIAN_RGB; +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#else + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR; +#endif panel_config.bits_per_pixel = 16; ESP_ERROR_CHECK(esp_lcd_new_panel_gc9a01(io_handle, &panel_config, &panel_handle)); diff --git a/main/boards/taiji-pi-s3/taiji_pi_s3.cc b/main/boards/taiji-pi-s3/taiji_pi_s3.cc index 06635a79..bec27a6a 100644 --- a/main/boards/taiji-pi-s3/taiji_pi_s3.cc +++ b/main/boards/taiji-pi-s3/taiji_pi_s3.cc @@ -562,7 +562,15 @@ private: ESP_LOGI(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = ST77916_PANEL_IO_QSPI_CONFIG(QSPI_PIN_NUM_LCD_CS, NULL, NULL); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = QSPI_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)QSPI_LCD_HOST, &io_config, &panel_io)); ESP_LOGI(TAG, "Install ST77916 panel driver"); @@ -574,12 +582,11 @@ private: .use_qspi_interface = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; // Implemented by LCD command `36h` + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; // Implemented by LCD command `3Ah` (16/18) + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/tudouzi/kevin_box_board.cc b/main/boards/tudouzi/kevin_box_board.cc index d6cb5b23..8253b396 100644 --- a/main/boards/tudouzi/kevin_box_board.cc +++ b/main/boards/tudouzi/kevin_box_board.cc @@ -102,24 +102,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { @@ -252,4 +252,4 @@ public: } }; -DECLARE_BOARD(KevinBoxBoard); \ No newline at end of file +DECLARE_BOARD(KevinBoxBoard); diff --git a/main/boards/waveshare/esp32-c6-touch-amoled-1.32/esp32-c6-touch-amoled-1.32.cc b/main/boards/waveshare/esp32-c6-touch-amoled-1.32/esp32-c6-touch-amoled-1.32.cc index a6d5e4e4..f499b114 100644 --- a/main/boards/waveshare/esp32-c6-touch-amoled-1.32/esp32-c6-touch-amoled-1.32.cc +++ b/main/boards/waveshare/esp32-c6-touch-amoled-1.32/esp32-c6-touch-amoled-1.32.cc @@ -141,7 +141,7 @@ class CustomBoard : public WifiBoard { void InitializeLcdDisplay() { esp_lcd_panel_io_spi_config_t io_config = {}; io_config.cs_gpio_num = LCD_CS; - io_config.dc_gpio_num = -1; + io_config.dc_gpio_num = GPIO_NUM_NC; io_config.spi_mode = 0; io_config.pclk_hz = 40 * 1000 * 1000; io_config.trans_queue_depth = 8; diff --git a/main/boards/waveshare/esp32-c6-touch-amoled-1.43/esp32-c6-touch-amoled-1.43.cc b/main/boards/waveshare/esp32-c6-touch-amoled-1.43/esp32-c6-touch-amoled-1.43.cc index ae8e145d..9719f431 100644 --- a/main/boards/waveshare/esp32-c6-touch-amoled-1.43/esp32-c6-touch-amoled-1.43.cc +++ b/main/boards/waveshare/esp32-c6-touch-amoled-1.43/esp32-c6-touch-amoled-1.43.cc @@ -122,7 +122,7 @@ private: void InitializeLcdDisplay() { const esp_lcd_panel_io_spi_config_t io_config = { .cs_gpio_num = LCD_CS, - .dc_gpio_num = -1, + .dc_gpio_num = GPIO_NUM_NC, .spi_mode = 0, .pclk_hz = 40 * 1000 * 1000, .trans_queue_depth = 4, @@ -143,12 +143,11 @@ private: .use_qspi_interface = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = 16, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; // Implemented by LCD command `36h` + panel_config.bits_per_pixel = 16; // Implemented by LCD command `3Ah` (16/18) + panel_config.reset_gpio_num = LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_sh8601(io_handle, &panel_config, &panel_handle)); esp_lcd_panel_set_gap(panel_handle,0x06,0x00); ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); @@ -289,4 +288,4 @@ public: }; -DECLARE_BOARD(CustomBoard); \ No newline at end of file +DECLARE_BOARD(CustomBoard); diff --git a/main/boards/waveshare/esp32-c6-touch-amoled-1.8/esp32-c6-touch-amoled-1.8.cc b/main/boards/waveshare/esp32-c6-touch-amoled-1.8/esp32-c6-touch-amoled-1.8.cc index 4c79cd24..f46aba27 100644 --- a/main/boards/waveshare/esp32-c6-touch-amoled-1.8/esp32-c6-touch-amoled-1.8.cc +++ b/main/boards/waveshare/esp32-c6-touch-amoled-1.8/esp32-c6-touch-amoled-1.8.cc @@ -210,11 +210,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr - ); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-c6-touch-amoled-2.06/esp32-c6-touch-amoled-2.06.cc b/main/boards/waveshare/esp32-c6-touch-amoled-2.06/esp32-c6-touch-amoled-2.06.cc index 4e224d1f..02fbdf48 100644 --- a/main/boards/waveshare/esp32-c6-touch-amoled-2.06/esp32-c6-touch-amoled-2.06.cc +++ b/main/boards/waveshare/esp32-c6-touch-amoled-2.06/esp32-c6-touch-amoled-2.06.cc @@ -216,10 +216,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-c6-touch-amoled-2.16/esp32-c6-touch-amoled-2.16.cc b/main/boards/waveshare/esp32-c6-touch-amoled-2.16/esp32-c6-touch-amoled-2.16.cc index 7053b04b..0c766dc9 100644 --- a/main/boards/waveshare/esp32-c6-touch-amoled-2.16/esp32-c6-touch-amoled-2.16.cc +++ b/main/boards/waveshare/esp32-c6-touch-amoled-2.16/esp32-c6-touch-amoled-2.16.cc @@ -230,8 +230,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = - SH8601_PANEL_IO_QSPI_CONFIG(LCD_CS, nullptr, nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-c6-touch-lcd-1.54/esp32-c6-touch-lcd-1.54.cc b/main/boards/waveshare/esp32-c6-touch-lcd-1.54/esp32-c6-touch-lcd-1.54.cc index 454b753b..1c987a9a 100644 --- a/main/boards/waveshare/esp32-c6-touch-lcd-1.54/esp32-c6-touch-lcd-1.54.cc +++ b/main/boards/waveshare/esp32-c6-touch-lcd-1.54/esp32-c6-touch-lcd-1.54.cc @@ -121,21 +121,14 @@ private: esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, - .on_color_trans_done = 0, - .user_ctx = 0, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 0, - .flags = - { - .dc_low_on_data = 0, - .disable_control_phase = 1, - }, - }; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS; tp_io_config.scl_speed_hz = 100000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 0; + tp_io_config.flags.disable_control_phase = 1; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); esp_lcd_touch_config_t tp_cfg = { diff --git a/main/boards/waveshare/esp32-c6-touch-lcd-1.83/esp32-c6-touch-lcd-1.83.cc b/main/boards/waveshare/esp32-c6-touch-lcd-1.83/esp32-c6-touch-lcd-1.83.cc index 4e7a8a49..4e2127ee 100644 --- a/main/boards/waveshare/esp32-c6-touch-lcd-1.83/esp32-c6-touch-lcd-1.83.cc +++ b/main/boards/waveshare/esp32-c6-touch-lcd-1.83/esp32-c6-touch-lcd-1.83.cc @@ -171,21 +171,14 @@ private: }, }; esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, - .on_color_trans_done = 0, - .user_ctx = 0, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 0, - .flags = - { - .dc_low_on_data = 0, - .disable_control_phase = 1, - }, - }; - tp_io_config.scl_speed_hz = 400* 1000; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS; + tp_io_config.scl_speed_hz = 400 * 1000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 0; + tp_io_config.flags.disable_control_phase = 1; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); ESP_LOGI(TAG, "Initialize touch controller"); ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_cst816s(tp_io_handle, &tp_cfg, &tp)); diff --git a/main/boards/waveshare/esp32-p4-nano/config.json b/main/boards/waveshare/esp32-p4-nano/config.json index 2027658f..70c42c87 100644 --- a/main/boards/waveshare/esp32-p4-nano/config.json +++ b/main/boards/waveshare/esp32-p4-nano/config.json @@ -4,6 +4,7 @@ "builds": [ { "name": "esp32-p4-nano-10.1-a", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_USE_WECHAT_MESSAGE_STYLE=y", "CONFIG_CAMERA_OV5647=y", diff --git a/main/boards/waveshare/esp32-p4-nano/esp32-p4-nano.cc b/main/boards/waveshare/esp32-p4-nano/esp32-p4-nano.cc index 438ff2cd..48580654 100644 --- a/main/boards/waveshare/esp32-p4-nano/esp32-p4-nano.cc +++ b/main/boards/waveshare/esp32-p4-nano/esp32-p4-nano.cc @@ -151,7 +151,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 80, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = 800, @@ -163,9 +164,6 @@ private: .vsync_back_porch = 4, .vsync_front_porch = 30, }, - .flags = { - .use_dma2d = true, - }, }; jd9365_vendor_config_t vendor_config = { @@ -179,9 +177,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_jd9365(io, &lcd_dev_config, &disp_panel); diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json index c544f599..0c622d04 100644 --- a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json @@ -4,6 +4,7 @@ "builds": [ { "name": "esp32-p4-wifi6-touch-lcd-3.5", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc index f042611d..ebd0dc30 100644 --- a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/esp32-p4-wifi6-touch-lcd-3.5.cc @@ -10,6 +10,7 @@ #include "esp_lcd_st7796.h" #include "config.h" #include +#include #include #include #include "esp_lcd_touch_ft5x06.h" @@ -66,9 +67,13 @@ private: io_config.trans_queue_depth = 10; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)SPI2_HOST, &io_config, &io)); const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR, +#else .color_space = ESP_LCD_COLOR_SPACE_BGR, +#endif .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, }; ESP_ERROR_CHECK(esp_lcd_new_panel_st7796(io, &lcd_dev_config, &disp_panel)); ESP_ERROR_CHECK(esp_lcd_panel_reset(disp_panel)); diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json index cc8c21dc..2c37ea1c 100644 --- a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json @@ -4,6 +4,7 @@ "builds": [ { "name": "esp32-p4-wifi6-touch-lcd-4b", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -34,6 +35,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-4.3", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -64,6 +66,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-5", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -94,6 +97,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-7b", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -130,6 +134,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-3.4c", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -160,6 +165,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-4c", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -190,6 +196,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-7", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -220,6 +227,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-8", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", @@ -250,6 +258,7 @@ }, { "name": "esp32-p4-wifi6-touch-lcd-10.1", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0", "CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y", diff --git a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/esp32-p4-wifi6-touch-lcd.cc b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/esp32-p4-wifi6-touch-lcd.cc index 5a7f76ea..1268f7a4 100644 --- a/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/esp32-p4-wifi6-touch-lcd.cc +++ b/main/boards/waveshare/esp32-p4-wifi6-touch-lcd/esp32-p4-wifi6-touch-lcd.cc @@ -106,7 +106,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 46, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = 720, @@ -118,9 +119,6 @@ private: .vsync_back_porch = 12, .vsync_front_porch = 30, }, - .flags = { - .use_dma2d = true, - }, }; st7703_vendor_config_t vendor_config = { @@ -134,9 +132,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_st7703(io, &lcd_dev_config, &disp_panel); @@ -144,7 +142,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 30, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = 480, @@ -156,9 +155,6 @@ private: .vsync_back_porch = 2, .vsync_front_porch = 60, }, - .flags = { - .use_dma2d = true, - }, }; st7701_vendor_config_t vendor_config = { .init_cmds = vendor_specific_init_default, @@ -174,9 +170,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_st7701(io, &lcd_dev_config, &disp_panel); @@ -184,7 +180,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 58, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = DISPLAY_WIDTH, @@ -196,9 +193,6 @@ private: .vsync_back_porch = 10, .vsync_front_porch = 24, }, - .flags = { - .use_dma2d = true, - }, }; hx8394_vendor_config_t vendor_config = { .mipi_config = { @@ -209,20 +203,21 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, + .vendor_config = &vendor_config, .flags = { .reset_active_high = true, }, - .vendor_config = &vendor_config, }; esp_lcd_new_panel_hx8394(io, &lcd_dev_config, &disp_panel); #elif CONFIG_BOARD_TYPE_WAVESHARE_ESP32_P4_WIFI6_TOUCH_LCD_7B esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 52, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = 1024, @@ -234,9 +229,6 @@ private: .vsync_back_porch = 23, .vsync_front_porch = 12, }, - .flags = { - .use_dma2d = true, - }, }; ek79007_vendor_config_t vendor_config = { .mipi_config = { @@ -246,9 +238,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_ek79007(io, &lcd_dev_config, &disp_panel); @@ -256,7 +248,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 46, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = DISPLAY_WIDTH, @@ -268,9 +261,6 @@ private: .vsync_back_porch = 12, .vsync_front_porch = 24, }, - .flags = { - .use_dma2d = true, - }, }; jd9365_vendor_config_t vendor_config = { .init_cmds = lcd_init_cmds, @@ -283,9 +273,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_jd9365(io, &lcd_dev_config, &disp_panel); @@ -293,7 +283,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 52, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = DISPLAY_WIDTH, @@ -305,9 +296,6 @@ private: .vsync_back_porch = 10, .vsync_front_porch = 30, }, - .flags = { - .use_dma2d = true, - }, }; jd9365_vendor_config_t vendor_config = { .init_cmds = lcd_init_cmds, @@ -320,9 +308,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_jd9365(io, &lcd_dev_config, &disp_panel); @@ -330,7 +318,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 80, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = DISPLAY_WIDTH, @@ -342,9 +331,6 @@ private: .vsync_back_porch = 20, .vsync_front_porch = 2, }, - .flags = { - .use_dma2d = true, - }, }; ili9881c_vendor_config_t vendor_config = { .init_cmds = lcd_init_cmds, @@ -357,9 +343,9 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, .vendor_config = &vendor_config, }; esp_lcd_new_panel_ili9881c(io, &lcd_dev_config, &disp_panel); diff --git a/main/boards/waveshare/esp32-s3-audio-board/esp_lcd_jd9853.c b/main/boards/waveshare/esp32-s3-audio-board/esp_lcd_jd9853.c index dea68f2e..5d7dd211 100644 --- a/main/boards/waveshare/esp32-s3-audio-board/esp_lcd_jd9853.c +++ b/main/boards/waveshare/esp32-s3-audio-board/esp_lcd_jd9853.c @@ -18,6 +18,7 @@ #include "driver/gpio.h" #include "esp_log.h" #include "esp_check.h" +#include "esp_idf_version.h" static const char *TAG = "JD9853"; @@ -76,7 +77,7 @@ esp_err_t esp_lcd_new_panel_jd9853(const esp_lcd_panel_io_handle_t io, const esp ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported color space"); break; } -#else +#elif ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0) switch (panel_dev_config->rgb_endian) { case LCD_RGB_ENDIAN_RGB: @@ -89,6 +90,19 @@ esp_err_t esp_lcd_new_panel_jd9853(const esp_lcd_panel_io_handle_t io, const esp ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported rgb endian"); break; } +#else + switch (panel_dev_config->rgb_ele_order) + { + case LCD_RGB_ELEMENT_ORDER_RGB: + jd9853->madctl_val = 0; + break; + case LCD_RGB_ELEMENT_ORDER_BGR: + jd9853->madctl_val |= LCD_CMD_BGR_BIT; + break; + default: + ESP_GOTO_ON_FALSE(false, ESP_ERR_NOT_SUPPORTED, err, TAG, "unsupported RGB element order"); + break; + } #endif switch (panel_dev_config->bits_per_pixel) diff --git a/main/boards/waveshare/esp32-s3-rlcd-4.2/custom_lcd_display.cc b/main/boards/waveshare/esp32-s3-rlcd-4.2/custom_lcd_display.cc index ba5d81d2..ee2817cb 100644 --- a/main/boards/waveshare/esp32-s3-rlcd-4.2/custom_lcd_display.cc +++ b/main/boards/waveshare/esp32-s3-rlcd-4.2/custom_lcd_display.cc @@ -62,8 +62,8 @@ height_(height) ret = spi_bus_initialize(spi_host, &buscfg, SPI_DMA_CH_AUTO); ESP_ERROR_CHECK(ret); esp_lcd_panel_io_spi_config_t io_config = {}; - io_config.dc_gpio_num = dc_; - io_config.cs_gpio_num = cs_; + io_config.dc_gpio_num = static_cast(dc_); + io_config.cs_gpio_num = static_cast(cs_); io_config.pclk_hz = 40 * 1000 * 1000; io_config.lcd_cmd_bits = 8; io_config.lcd_param_bits = 8; diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-1.32/esp32-s3-touch-amoled-1.32.cc b/main/boards/waveshare/esp32-s3-touch-amoled-1.32/esp32-s3-touch-amoled-1.32.cc index 031eaa02..e8ed8b14 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-1.32/esp32-s3-touch-amoled-1.32.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-1.32/esp32-s3-touch-amoled-1.32.cc @@ -141,7 +141,7 @@ class CustomBoard : public WifiBoard { void InitializeLcdDisplay() { esp_lcd_panel_io_spi_config_t io_config = {}; io_config.cs_gpio_num = LCD_CS; - io_config.dc_gpio_num = -1; + io_config.dc_gpio_num = GPIO_NUM_NC; io_config.spi_mode = 0; io_config.pclk_hz = 40 * 1000 * 1000; io_config.trans_queue_depth = 8; diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-1.43c/esp32-s3-touch-amoled-1.43c.cc b/main/boards/waveshare/esp32-s3-touch-amoled-1.43c/esp32-s3-touch-amoled-1.43c.cc index e383d638..37321e3d 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-1.43c/esp32-s3-touch-amoled-1.43c.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-1.43c/esp32-s3-touch-amoled-1.43c.cc @@ -132,7 +132,7 @@ class CustomBoard : public WifiBoard { void InitializeLcdDisplay() { esp_lcd_panel_io_spi_config_t io_config = {}; io_config.cs_gpio_num = LCD_CS_PIN; - io_config.dc_gpio_num = -1; + io_config.dc_gpio_num = GPIO_NUM_NC; io_config.spi_mode = 0; io_config.pclk_hz = 40 * 1000 * 1000; io_config.trans_queue_depth = 8; diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-1.75/esp32-s3-touch-amoled-1.75.cc b/main/boards/waveshare/esp32-s3-touch-amoled-1.75/esp32-s3-touch-amoled-1.75.cc index ed24fda3..ab96681a 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-1.75/esp32-s3-touch-amoled-1.75.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-1.75/esp32-s3-touch-amoled-1.75.cc @@ -229,10 +229,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = CO5300_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-1.8-v2/esp32-s3-touch-amoled-1.8-v2.cc b/main/boards/waveshare/esp32-s3-touch-amoled-1.8-v2/esp32-s3-touch-amoled-1.8-v2.cc index 9329eafd..88b2d830 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-1.8-v2/esp32-s3-touch-amoled-1.8-v2.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-1.8-v2/esp32-s3-touch-amoled-1.8-v2.cc @@ -288,10 +288,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = CO5300_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ @@ -338,21 +343,14 @@ private: }, }; esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, - .on_color_trans_done = 0, - .user_ctx = 0, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 0, - .flags = - { - .dc_low_on_data = 0, - .disable_control_phase = 1, - }, - }; - tp_io_config.scl_speed_hz = 400* 1000; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS; + tp_io_config.scl_speed_hz = 400 * 1000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 0; + tp_io_config.flags.disable_control_phase = 1; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(codec_i2c_bus_, &tp_io_config, &tp_io_handle)); ESP_LOGI(TAG, "Initialize touch controller"); ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_cst816s(tp_io_handle, &tp_cfg, &tp)); diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-1.8/esp32-s3-touch-amoled-1.8.cc b/main/boards/waveshare/esp32-s3-touch-amoled-1.8/esp32-s3-touch-amoled-1.8.cc index 2dcb3642..9a6ec975 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-1.8/esp32-s3-touch-amoled-1.8.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-1.8/esp32-s3-touch-amoled-1.8.cc @@ -282,11 +282,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr - ); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-2.06/esp32-s3-touch-amoled-2.06.cc b/main/boards/waveshare/esp32-s3-touch-amoled-2.06/esp32-s3-touch-amoled-2.06.cc index 8dafd1d5..7ef1ae72 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-2.06/esp32-s3-touch-amoled-2.06.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-2.06/esp32-s3-touch-amoled-2.06.cc @@ -216,10 +216,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = SH8601_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-s3-touch-amoled-2.16/esp32-s3-touch-amoled-2.16.cc b/main/boards/waveshare/esp32-s3-touch-amoled-2.16/esp32-s3-touch-amoled-2.16.cc index c6a4852a..ff17a56d 100644 --- a/main/boards/waveshare/esp32-s3-touch-amoled-2.16/esp32-s3-touch-amoled-2.16.cc +++ b/main/boards/waveshare/esp32-s3-touch-amoled-2.16/esp32-s3-touch-amoled-2.16.cc @@ -230,10 +230,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = CO5300_PANEL_IO_QSPI_CONFIG( - EXAMPLE_PIN_NUM_LCD_CS, - nullptr, - nullptr); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = EXAMPLE_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 0; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc index ea8b1b4e..1fde8f70 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.46/esp32-s3-touch-lcd-1.46.cc @@ -120,7 +120,15 @@ private: ESP_LOGI(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = SPD2010_PANEL_IO_QSPI_CONFIG(QSPI_PIN_NUM_LCD_CS, NULL, NULL); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = QSPI_PIN_NUM_LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 3; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)QSPI_LCD_HOST, &io_config, &panel_io)); ESP_LOGI(TAG, "Install SPD2010 panel driver"); @@ -130,12 +138,11 @@ private: .use_qspi_interface = 1, }, }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_spd2010(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.54/esp32-s3-touch-lcd-1.54.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.54/esp32-s3-touch-lcd-1.54.cc index ecd271f4..4fd6788f 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.54/esp32-s3-touch-lcd-1.54.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.54/esp32-s3-touch-lcd-1.54.cc @@ -122,21 +122,14 @@ private: esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, - .on_color_trans_done = 0, - .user_ctx = 0, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 0, - .flags = - { - .dc_low_on_data = 0, - .disable_control_phase = 1, - }, - }; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS; tp_io_config.scl_speed_hz = 100000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 0; + tp_io_config.flags.disable_control_phase = 1; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); esp_lcd_touch_config_t tp_cfg = { diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.83/esp32-s3-touch-lcd-1.83.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.83/esp32-s3-touch-lcd-1.83.cc index f0d4b2ef..0c88e2d9 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.83/esp32-s3-touch-lcd-1.83.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.83/esp32-s3-touch-lcd-1.83.cc @@ -172,21 +172,14 @@ private: }, }; esp_lcd_panel_io_handle_t tp_io_handle = NULL; - esp_lcd_panel_io_i2c_config_t tp_io_config = { - .dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS, - .on_color_trans_done = 0, - .user_ctx = 0, - .control_phase_bytes = 1, - .dc_bit_offset = 0, - .lcd_cmd_bits = 8, - .lcd_param_bits = 0, - .flags = - { - .dc_low_on_data = 0, - .disable_control_phase = 1, - }, - }; - tp_io_config.scl_speed_hz = 400* 1000; + esp_lcd_panel_io_i2c_config_t tp_io_config = {}; + tp_io_config.dev_addr = ESP_LCD_TOUCH_IO_I2C_CST816S_ADDRESS; + tp_io_config.scl_speed_hz = 400 * 1000; + tp_io_config.control_phase_bytes = 1; + tp_io_config.dc_bit_offset = 0; + tp_io_config.lcd_cmd_bits = 8; + tp_io_config.lcd_param_bits = 0; + tp_io_config.flags.disable_control_phase = 1; ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_, &tp_io_config, &tp_io_handle)); ESP_LOGI(TAG, "Initialize touch controller"); ESP_ERROR_CHECK(esp_lcd_touch_new_i2c_cst816s(tp_io_handle, &tp_cfg, &tp)); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc index 16d4e9a6..38372c30 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.85/esp32-s3-touch-lcd-1.85.cc @@ -276,7 +276,7 @@ private: esp_lcd_panel_io_spi_config_t io_config = { .cs_gpio_num = QSPI_PIN_NUM_LCD_CS, - .dc_gpio_num = -1, + .dc_gpio_num = GPIO_NUM_NC, .spi_mode = 0, .pclk_hz = 3 * 1000 * 1000, .trans_queue_depth = 10, @@ -338,12 +338,11 @@ private: } printf("------------------------------------- End of version selection------------------------------------- \r\n"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.85b/esp32-s3-touch-lcd-1.85b.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.85b/esp32-s3-touch-lcd-1.85b.cc index df06bcba..395910e2 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.85b/esp32-s3-touch-lcd-1.85b.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.85b/esp32-s3-touch-lcd-1.85b.cc @@ -495,7 +495,7 @@ private: esp_lcd_panel_io_spi_config_t io_config = { .cs_gpio_num = QSPI_PIN_NUM_LCD_CS, - .dc_gpio_num = -1, + .dc_gpio_num = GPIO_NUM_NC, .spi_mode = 0, .pclk_hz = 3 * 1000 * 1000, .trans_queue_depth = 10, @@ -558,12 +558,11 @@ private: } printf("------------------------------------- End of version selection------------------------------------- \r\n"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-1.85c/esp32-s3-touch-lcd-1.85c.cc b/main/boards/waveshare/esp32-s3-touch-lcd-1.85c/esp32-s3-touch-lcd-1.85c.cc index b73abb3d..a4e1b901 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-1.85c/esp32-s3-touch-lcd-1.85c.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-1.85c/esp32-s3-touch-lcd-1.85c.cc @@ -275,7 +275,7 @@ private: esp_lcd_panel_io_spi_config_t io_config = { .cs_gpio_num = QSPI_PIN_NUM_LCD_CS, - .dc_gpio_num = -1, + .dc_gpio_num = GPIO_NUM_NC, .spi_mode = 0, .pclk_hz = 3 * 1000 * 1000, .trans_queue_depth = 10, @@ -337,12 +337,11 @@ private: } printf("------------------------------------- End of version selection------------------------------------- \r\n"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = QSPI_PIN_NUM_LCD_RST, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h` - .bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL, // Implemented by LCD command `3Ah` (16/18) - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = QSPI_LCD_BIT_PER_PIXEL; + panel_config.reset_gpio_num = QSPI_PIN_NUM_LCD_RST; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st77916(panel_io, &panel_config, &panel)); esp_lcd_panel_reset(panel); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-3.49/waveshare-s3-touch-lcd-3.49.cc b/main/boards/waveshare/esp32-s3-touch-lcd-3.49/waveshare-s3-touch-lcd-3.49.cc index 870fed91..4b24e8b4 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-3.49/waveshare-s3-touch-lcd-3.49.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-3.49/waveshare-s3-touch-lcd-3.49.cc @@ -96,10 +96,15 @@ private: // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGI(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = AXS15231B_PANEL_IO_QSPI_CONFIG( - LCD_CS, - NULL, - NULL); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = LCD_CS; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 3; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI3_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ @@ -111,12 +116,11 @@ private: .use_qspi_interface = 1, }, }; - esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = -1, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - .vendor_config = (void *)&vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = GPIO_NUM_NC; + panel_config.vendor_config = (void *)&vendor_config; esp_lcd_new_panel_axs15231b(panel_io, &panel_config, &panel); gpio_set_level(LCD_RST,1); @@ -250,4 +254,4 @@ public: } }; -DECLARE_BOARD(CustomBoard); \ No newline at end of file +DECLARE_BOARD(CustomBoard); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc b/main/boards/waveshare/esp32-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc index fc2d360e..0ec5b183 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-3.5b/waveshare-s3-touch-lcd-3.5b.cc @@ -221,10 +221,15 @@ private: esp_lcd_panel_handle_t panel = nullptr; // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGI(TAG, "Install panel IO"); - esp_lcd_panel_io_spi_config_t io_config = AXS15231B_PANEL_IO_QSPI_CONFIG( - DISPLAY_CS_PIN, - NULL, - NULL); + esp_lcd_panel_io_spi_config_t io_config = {}; + io_config.cs_gpio_num = DISPLAY_CS_PIN; + io_config.dc_gpio_num = GPIO_NUM_NC; + io_config.spi_mode = 3; + io_config.pclk_hz = 40 * 1000 * 1000; + io_config.trans_queue_depth = 10; + io_config.lcd_cmd_bits = 32; + io_config.lcd_param_bits = 8; + io_config.flags.quad_mode = true; ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_config, &panel_io)); // ๅˆๅง‹ๅŒ–ๆถฒๆ™ถๅฑ้ฉฑๅŠจ่Šฏ็‰‡ @@ -236,12 +241,11 @@ private: .use_qspi_interface = 1, }, }; - esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = DISPLAY_RST_PIN, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 16, - .vendor_config = (void *)&vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 16; + panel_config.reset_gpio_num = DISPLAY_RST_PIN; + panel_config.vendor_config = (void *)&vendor_config; esp_lcd_new_panel_axs15231b(panel_io, &panel_config, &panel); esp_lcd_panel_reset(panel); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-4.3c/esp32_s3_touch_lcd_4.3c.cc b/main/boards/waveshare/esp32-s3-touch-lcd-4.3c/esp32_s3_touch_lcd_4.3c.cc index f9a41a08..98c18303 100755 --- a/main/boards/waveshare/esp32-s3-touch-lcd-4.3c/esp32_s3_touch_lcd_4.3c.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-4.3c/esp32_s3_touch_lcd_4.3c.cc @@ -119,10 +119,11 @@ private: } }, .data_width = 16, - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 2, .bounce_buffer_size_px = BSP_LCD_H_RES * 10, - .psram_trans_align = 64, + .dma_burst_size = 64, .hsync_gpio_num = BSP_LCD_HSYNC, .vsync_gpio_num = BSP_LCD_VSYNC, .de_gpio_num = BSP_LCD_DE, diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-4b/esp32-s3-touch-lcd-4b.cc b/main/boards/waveshare/esp32-s3-touch-lcd-4b/esp32-s3-touch-lcd-4b.cc index 3f5531f9..9ab65351 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-4b/esp32-s3-touch-lcd-4b.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-4b/esp32-s3-touch-lcd-4b.cc @@ -193,10 +193,11 @@ private: } }, .data_width = 16, - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 2, .bounce_buffer_size_px = 480 * 20, - .psram_trans_align = 64, + .dma_burst_size = 64, .hsync_gpio_num = BSP_LCD_HSYNC, .vsync_gpio_num = BSP_LCD_VSYNC, .de_gpio_num = BSP_LCD_DE, @@ -224,12 +225,11 @@ private: .auto_del_panel_io = 1, } }; - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = GPIO_NUM_NC, - .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, - .bits_per_pixel = 18, - .vendor_config = &vendor_config, - }; + esp_lcd_panel_dev_config_t panel_config = {}; + panel_config.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB; + panel_config.bits_per_pixel = 18; + panel_config.reset_gpio_num = GPIO_NUM_NC; + panel_config.vendor_config = &vendor_config; ESP_ERROR_CHECK(esp_lcd_new_panel_st7701(panel_io, &panel_config, &panel_handle)); esp_lcd_panel_init(panel_handle); diff --git a/main/boards/waveshare/esp32-s3-touch-lcd-7c/esp32_s3_touch_lcd_7c.cc b/main/boards/waveshare/esp32-s3-touch-lcd-7c/esp32_s3_touch_lcd_7c.cc index a9049a68..3886fa72 100644 --- a/main/boards/waveshare/esp32-s3-touch-lcd-7c/esp32_s3_touch_lcd_7c.cc +++ b/main/boards/waveshare/esp32-s3-touch-lcd-7c/esp32_s3_touch_lcd_7c.cc @@ -185,10 +185,11 @@ private: } }, .data_width = 16, - .bits_per_pixel = 16, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 2, .bounce_buffer_size_px = BSP_LCD_H_RES * 10, - .psram_trans_align = 64, + .dma_burst_size = 64, .hsync_gpio_num = BSP_LCD_HSYNC, .vsync_gpio_num = BSP_LCD_VSYNC, .de_gpio_num = BSP_LCD_DE, diff --git a/main/boards/wireless-tag-wtp4c5mp07s/config.json b/main/boards/wireless-tag-wtp4c5mp07s/config.json index 6cbe9d62..e4501e47 100644 --- a/main/boards/wireless-tag-wtp4c5mp07s/config.json +++ b/main/boards/wireless-tag-wtp4c5mp07s/config.json @@ -3,6 +3,7 @@ "builds": [ { "name": "wireless-tag-wtp4c5mp07s", + "idf_version": "<6.0", "sdkconfig_append": [ "CONFIG_USE_WECHAT_MESSAGE_STYLE=n", "CONFIG_SLAVE_IDF_TARGET_ESP32C5=y", diff --git a/main/boards/wireless-tag-wtp4c5mp07s/wireless-tag-wtp4c5mp07s.cc b/main/boards/wireless-tag-wtp4c5mp07s/wireless-tag-wtp4c5mp07s.cc index 88fe91e5..1082fdc6 100644 --- a/main/boards/wireless-tag-wtp4c5mp07s/wireless-tag-wtp4c5mp07s.cc +++ b/main/boards/wireless-tag-wtp4c5mp07s/wireless-tag-wtp4c5mp07s.cc @@ -84,7 +84,8 @@ private: esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 52, - .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, + .in_color_format = LCD_COLOR_FMT_RGB565, + .out_color_format = LCD_COLOR_FMT_RGB565, .num_fbs = 1, .video_timing = { .h_size = 1024, @@ -96,9 +97,6 @@ private: .vsync_back_porch = 23, .vsync_front_porch = 12, }, - .flags = { - .use_dma2d = true, - }, }; ek79007_vendor_config_t vendor_config = { .mipi_config = { @@ -108,13 +106,13 @@ private: }; const esp_lcd_panel_dev_config_t lcd_dev_config = { - .reset_gpio_num = PIN_NUM_LCD_RST, .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, .bits_per_pixel = 16, + .reset_gpio_num = PIN_NUM_LCD_RST, + .vendor_config = &vendor_config, .flags = { .reset_active_high = true, }, - .vendor_config = &vendor_config, }; esp_lcd_new_panel_ek79007(io, &lcd_dev_config, &disp_panel); esp_lcd_panel_reset(disp_panel); diff --git a/main/boards/xingzhi-cube-0.96oled-ml307/xingzhi-cube-0.96oled-ml307.cc b/main/boards/xingzhi-cube-0.96oled-ml307/xingzhi-cube-0.96oled-ml307.cc index 3ba9643a..5a096931 100644 --- a/main/boards/xingzhi-cube-0.96oled-ml307/xingzhi-cube-0.96oled-ml307.cc +++ b/main/boards/xingzhi-cube-0.96oled-ml307/xingzhi-cube-0.96oled-ml307.cc @@ -85,24 +85,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/xingzhi-cube-0.96oled-wifi/xingzhi-cube-0.96oled-wifi.cc b/main/boards/xingzhi-cube-0.96oled-wifi/xingzhi-cube-0.96oled-wifi.cc index 27bf76a4..ac1d3b91 100644 --- a/main/boards/xingzhi-cube-0.96oled-wifi/xingzhi-cube-0.96oled-wifi.cc +++ b/main/boards/xingzhi-cube-0.96oled-wifi/xingzhi-cube-0.96oled-wifi.cc @@ -86,24 +86,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(display_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(display_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/xmini-c3-4g/xmini_c3_4g_board.cc b/main/boards/xmini-c3-4g/xmini_c3_4g_board.cc index 634ebbe9..a9083996 100644 --- a/main/boards/xmini-c3-4g/xmini_c3_4g_board.cc +++ b/main/boards/xmini-c3-4g/xmini_c3_4g_board.cc @@ -90,24 +90,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(codec_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(codec_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/xmini-c3-v3/xmini_c3_board.cc b/main/boards/xmini-c3-v3/xmini_c3_board.cc index af267648..d47cca68 100644 --- a/main/boards/xmini-c3-v3/xmini_c3_board.cc +++ b/main/boards/xmini-c3-v3/xmini_c3_board.cc @@ -82,24 +82,24 @@ private: // SSD1306 config esp_lcd_panel_io_i2c_config_t io_config = { .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, + .scl_speed_hz = 400 * 1000, .control_phase_bytes = 1, .dc_bit_offset = 6, .lcd_cmd_bits = 8, .lcd_param_bits = 8, + .on_color_trans_done = nullptr, + .user_ctx = nullptr, .flags = { .dc_low_on_data = 0, .disable_control_phase = 0, }, - .scl_speed_hz = 400 * 1000, }; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(codec_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(codec_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { diff --git a/main/boards/xmini-c3/xmini_c3_board.cc b/main/boards/xmini-c3/xmini_c3_board.cc index 6bb08fe7..f9e7a93f 100644 --- a/main/boards/xmini-c3/xmini_c3_board.cc +++ b/main/boards/xmini-c3/xmini_c3_board.cc @@ -94,26 +94,25 @@ private: void InitializeSsd1306Display() { // SSD1306 config - esp_lcd_panel_io_i2c_config_t io_config = { - .dev_addr = 0x3C, - .on_color_trans_done = nullptr, - .user_ctx = nullptr, - .control_phase_bytes = 1, - .dc_bit_offset = 6, - .lcd_cmd_bits = 8, - .lcd_param_bits = 8, - .flags = { - .dc_low_on_data = 0, - .disable_control_phase = 0, - }, - .scl_speed_hz = 400 * 1000, - }; + // IDF 5.5 and 6.0 declare these fields in a different order. Assign + // them individually so C++ designated-initializer ordering is irrelevant. + esp_lcd_panel_io_i2c_config_t io_config = {}; + io_config.dev_addr = 0x3C; + io_config.scl_speed_hz = 400 * 1000; + io_config.control_phase_bytes = 1; + io_config.dc_bit_offset = 6; + io_config.lcd_cmd_bits = 8; + io_config.lcd_param_bits = 8; + io_config.on_color_trans_done = nullptr; + io_config.user_ctx = nullptr; + io_config.flags.dc_low_on_data = 0; + io_config.flags.disable_control_phase = 0; - ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c_v2(codec_i2c_bus_, &io_config, &panel_io_)); + ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(codec_i2c_bus_, &io_config, &panel_io_)); ESP_LOGI(TAG, "Install SSD1306 driver"); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = -1; + panel_config.reset_gpio_num = GPIO_NUM_NC; panel_config.bits_per_pixel = 1; esp_lcd_panel_ssd1306_config_t ssd1306_config = { @@ -178,10 +177,6 @@ public: InitializePowerSaveTimer(); InitializeTools(); - while (true) { - ESP_LOGI(TAG, "Waiting for boot button to be pressed"); - vTaskDelay(1000 / portTICK_PERIOD_MS); - } // ้ฟๅ…ไฝฟ็”จ้”™่ฏฏ็š„ๅ›บไปถ๏ผŒๆŠŠ EFUSE ๆ“ไฝœๆ”พๅœจๆœ€ๅŽ // ๆŠŠ ESP32C3 ็š„ VDD SPI ๅผ•่„šไฝœไธบๆ™ฎ้€š GPIO ๅฃไฝฟ็”จ esp_efuse_write_field_bit(ESP_EFUSE_VDD_SPI_AS_GPIO); diff --git a/main/boards/yunliao-s3/power_manager.h b/main/boards/yunliao-s3/power_manager.h index 47139d7e..52697367 100644 --- a/main/boards/yunliao-s3/power_manager.h +++ b/main/boards/yunliao-s3/power_manager.h @@ -7,6 +7,7 @@ #include "freertos/task.h" #include "freertos/queue.h" #include "freertos/timers.h" +#include "esp_timer.h" class PowerManager{ public: @@ -42,4 +43,4 @@ private: static void BtTask(void *arg); }; -#endif \ No newline at end of file +#endif diff --git a/main/boards/yunliao-s3/yunliao_s3.cc b/main/boards/yunliao-s3/yunliao_s3.cc index 56f57bff..ab69161e 100644 --- a/main/boards/yunliao-s3/yunliao_s3.cc +++ b/main/boards/yunliao-s3/yunliao_s3.cc @@ -136,8 +136,8 @@ class YunliaoS3 : public DualNetworkBoard { // ๆถฒๆ™ถๅฑๆŽงๅˆถIOๅˆๅง‹ๅŒ– ESP_LOGD(TAG, "Install panel IO"); esp_lcd_panel_io_spi_config_t io_config = {}; - io_config.cs_gpio_num = DISPLAY_SPI_PIN_LCD_CS; - io_config.dc_gpio_num = DISPLAY_SPI_PIN_LCD_DC; + io_config.cs_gpio_num = static_cast(DISPLAY_SPI_PIN_LCD_CS); + io_config.dc_gpio_num = static_cast(DISPLAY_SPI_PIN_LCD_DC); io_config.spi_mode = 3; io_config.pclk_hz = DISPLAY_SPI_CLOCK_HZ; io_config.trans_queue_depth = 10; @@ -151,7 +151,7 @@ class YunliaoS3 : public DualNetworkBoard { Settings settings("display", false); bool currentIpsMode = settings.GetBool("ips_mode", DISPLAY_INVERT_COLOR); esp_lcd_panel_dev_config_t panel_config = {}; - panel_config.reset_gpio_num = DISPLAY_SPI_PIN_LCD_RST; + panel_config.reset_gpio_num = static_cast(DISPLAY_SPI_PIN_LCD_RST); panel_config.rgb_ele_order = DISPLAY_RGB_ORDER_COLOR; panel_config.bits_per_pixel = 16; ESP_ERROR_CHECK( diff --git a/main/display/lvgl_display/jpg/image_to_jpeg.h b/main/display/lvgl_display/jpg/image_to_jpeg.h index 27c5d313..f788df4c 100644 --- a/main/display/lvgl_display/jpg/image_to_jpeg.h +++ b/main/display/lvgl_display/jpg/image_to_jpeg.h @@ -7,11 +7,9 @@ #include #include -#if defined(CONFIG_IDF_TARGET_ESP32P4) || defined(CONFIG_IDF_TARGET_ESP32S3) -// ESP32-P4 ไฝฟ็”จ esp_video ็ป„ไปถๆไพ›็š„ V4L2 ๅคดๆ–‡ไปถ -#include -#else -// ESP32-S3 ็ญ‰ๅ…ถไป–่Šฏ็‰‡๏ผšๅฎšไน‰ๅธธ็”จ็š„ V4L2 ๅƒ็ด ๆ ผๅผ +// Keep this lightweight header independent from esp_video's Linux compatibility +// headers. esp_video 2.0.x and lwIP both define ioctl macros under ESP-IDF 6. +#ifndef V4L2_PIX_FMT_RGB565 #define V4L2_PIX_FMT_RGB565 0x50424752 // 'RGBP' #define V4L2_PIX_FMT_RGB565X 0x52474250 // 'PRGB' #define V4L2_PIX_FMT_RGB24 0x33424752 // 'RGB3' diff --git a/main/idf_component.yml b/main/idf_component.yml index bd7bf3d7..3cfb2d33 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -2,30 +2,30 @@ dependencies: waveshare/esp_lcd_sh8601: 1.0.2 espressif/esp_lcd_co5300: ^2.0.3 - espressif/esp_lcd_ili9341: ==1.2.0 + espressif/esp_lcd_ili9341: ^2.0.2 espressif/esp_lcd_gc9a01: ~2.0.4 - espressif/esp_lcd_st77916: ^1.0.1 - espressif/esp_lcd_axs15231b: ^1.0.0 + espressif/esp_lcd_st77916: ^2.0.2 + espressif/esp_lcd_axs15231b: ^2.1.0 espressif/esp_lcd_st7701: - version: ^1.1.4 + version: ^2.0.2 rules: - if: target in [esp32s3, esp32p4] espressif/esp_lcd_st7796: version: 1.3.5 rules: - if: target in [esp32, esp32s2, esp32s3, esp32p4] - espressif/esp_lcd_spd2010: ==1.0.2 + espressif/esp_lcd_spd2010: ^2.0.0 espressif/esp_io_expander_tca9554: ~2.0.3 - waveshare/custom_io_expander_ch32v003: ^1.0.0 + waveshare/custom_io_expander_ch32v003: ^2.0.0 espressif/esp_lcd_panel_io_additions: ^1.0.1 - 78/esp_lcd_nv3023: ~1.0.0 + 78/esp_lcd_nv3023: ==1.0.1 78/esp-wifi-connect: ~3.2.2 espressif/esp_audio_effects: ~1.3.0 espressif/esp_audio_codec: ~2.5.0 - 78/esp-ml307: ~3.6.5 + 78/esp-ml307: ~3.6.6 78/uart-eth-modem: - version: ~0.4.2 + version: ^0.6.1 rules: - if: target not in [esp32] 78/xiaozhi-fonts: ~1.6.0 @@ -43,7 +43,7 @@ dependencies: rules: - if: target in [esp32s3] espressif/esp_video: - version: ==1.3.1 # for compatibility. update version may need to modify this project code. + version: ^2.0.1 rules: - if: target in [esp32p4, esp32s3] @@ -60,7 +60,7 @@ dependencies: esp_lvgl_port: ~2.8.0 espressif/esp_io_expander_tca95xx_16bit: ^2.0.0 espressif2022/image_player: ^1.1.1 - espressif2022/esp_emote_expression: ^0.1.0 + espressif2022/esp_emote_expression: ^1.0.2 espressif/esp_mmap_assets: ^1.3.2 txp666/otto-emoji-gif-component: version: ^1.3.0 @@ -71,7 +71,7 @@ dependencies: # SenseCAP Watcher Board wvirgil123/sscma_client: - version: 1.0.2 + version: ==1.0.3 rules: - if: target in [esp32s3] @@ -89,7 +89,7 @@ dependencies: rules: - if: target in [esp32p4] espressif/esp32_p4_function_ev_board: - version: ^5.0.3 + version: ^5.2.3 rules: - if: target in [esp32p4] espressif/esp_lcd_ili9881c: @@ -97,29 +97,24 @@ dependencies: rules: - if: target in [esp32p4] espressif/esp_lcd_ek79007: - version: ^1.0.3 + version: ^2.0.2 rules: - if: target in [esp32p4] espressif/esp_hosted: - version: 2.0.17 + version: ^2.12.11 rules: - if: target in [esp32h2, esp32p4] espressif/esp_wifi_remote: - version: '*' + version: ^1.6.2 rules: - if: target in [esp32p4] espfriends/servo_dog_ctrl: - version: ^0.1.8 + version: ^0.2.0 rules: - if: target in [esp32c3] - llgok/cpp_bus_driver: - version: 1.1.0 - rules: - - if: target in [esp32p4] - espressif/bmi270_sensor: - version: ^0.1.0 + version: ^0.1.2 rules: - if: target in [esp32s3, esp32c5] diff --git a/main/led/circular_strip.h b/main/led/circular_strip.h index 8d931aae..fe9af0fb 100644 --- a/main/led/circular_strip.h +++ b/main/led/circular_strip.h @@ -2,6 +2,8 @@ #define _CIRCULAR_STRIP_H_ #include "led.h" +#include +#include #include #include #include diff --git a/main/led/single_led.h b/main/led/single_led.h index b949f747..db1b07af 100644 --- a/main/led/single_led.h +++ b/main/led/single_led.h @@ -2,6 +2,8 @@ #define _SINGLE_LED_H_ #include "led.h" +#include +#include #include #include #include diff --git a/main/protocols/mqtt_protocol.cc b/main/protocols/mqtt_protocol.cc index d95d0038..c9f38b6f 100644 --- a/main/protocols/mqtt_protocol.cc +++ b/main/protocols/mqtt_protocol.cc @@ -46,6 +46,11 @@ MqttProtocol::~MqttProtocol() { udp_.reset(); mqtt_.reset(); + + if (aes_key_id_ != PSA_KEY_ID_NULL) { + psa_destroy_key(aes_key_id_); + aes_key_id_ = PSA_KEY_ID_NULL; + } if (event_group_handle_ != nullptr) { vEventGroupDelete(event_group_handle_); @@ -178,10 +183,9 @@ bool MqttProtocol::SendAudio(std::unique_ptr packet) { encrypted.resize(aes_nonce_.size() + packet->payload.size()); memcpy(encrypted.data(), nonce.data(), nonce.size()); - size_t nc_off = 0; - uint8_t stream_block[16] = {0}; - if (mbedtls_aes_crypt_ctr(&aes_ctx_, packet->payload.size(), &nc_off, (uint8_t*)nonce.c_str(), stream_block, - (uint8_t*)packet->payload.data(), (uint8_t*)&encrypted[nonce.size()]) != 0) { + if (!CryptAesCtr(reinterpret_cast(packet->payload.data()), packet->payload.size(), + reinterpret_cast(nonce.data()), + reinterpret_cast(&encrypted[nonce.size()]))) { ESP_LOGE(TAG, "Failed to encrypt audio data"); return false; } @@ -265,8 +269,6 @@ bool MqttProtocol::OpenAudioChannel() { } size_t decrypted_size = data.size() - aes_nonce_.size(); - size_t nc_off = 0; - uint8_t stream_block[16] = {0}; auto nonce = (uint8_t*)data.data(); auto encrypted = (uint8_t*)data.data() + aes_nonce_.size(); auto packet = std::make_unique(); @@ -274,9 +276,8 @@ bool MqttProtocol::OpenAudioChannel() { packet->frame_duration = server_frame_duration_; packet->timestamp = timestamp; packet->payload.resize(decrypted_size); - int ret = mbedtls_aes_crypt_ctr(&aes_ctx_, decrypted_size, &nc_off, nonce, stream_block, encrypted, (uint8_t*)packet->payload.data()); - if (ret != 0) { - ESP_LOGE(TAG, "Failed to decrypt audio data, ret: %d", ret); + if (!CryptAesCtr(encrypted, decrypted_size, nonce, reinterpret_cast(packet->payload.data()))) { + ESP_LOGE(TAG, "Failed to decrypt audio data"); return; } if (on_incoming_audio_ != nullptr) { @@ -358,13 +359,71 @@ void MqttProtocol::ParseServerHello(const cJSON* root) { // auto encryption = cJSON_GetObjectItem(udp, "encryption")->valuestring; // ESP_LOGI(TAG, "UDP server: %s, port: %d, encryption: %s", udp_server_.c_str(), udp_port_, encryption); aes_nonce_ = DecodeHexString(nonce); - mbedtls_aes_init(&aes_ctx_); - mbedtls_aes_setkey_enc(&aes_ctx_, (const unsigned char*)DecodeHexString(key).c_str(), 128); + const std::string aes_key = DecodeHexString(key); + if (aes_nonce_.size() != 16 || aes_key.size() != 16) { + ESP_LOGE(TAG, "Invalid AES key or nonce length"); + return; + } + + if (aes_key_id_ != PSA_KEY_ID_NULL) { + psa_destroy_key(aes_key_id_); + aes_key_id_ = PSA_KEY_ID_NULL; + } + + psa_status_t status = psa_crypto_init(); + if (status != PSA_SUCCESS) { + ESP_LOGE(TAG, "Failed to initialize PSA Crypto, status: %ld", static_cast(status)); + return; + } + + psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; + psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT); + psa_set_key_algorithm(&attributes, PSA_ALG_CTR); + psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); + psa_set_key_bits(&attributes, 128); + status = psa_import_key(&attributes, reinterpret_cast(aes_key.data()), + aes_key.size(), &aes_key_id_); + psa_reset_key_attributes(&attributes); + if (status != PSA_SUCCESS) { + ESP_LOGE(TAG, "Failed to import AES key, status: %ld", static_cast(status)); + aes_key_id_ = PSA_KEY_ID_NULL; + return; + } local_sequence_ = 0; remote_sequence_ = 0; xEventGroupSetBits(event_group_handle_, MQTT_PROTOCOL_SERVER_HELLO_EVENT); } +bool MqttProtocol::CryptAesCtr(const uint8_t* input, size_t input_size, const uint8_t* nonce, uint8_t* output) { + if (aes_key_id_ == PSA_KEY_ID_NULL || input == nullptr || nonce == nullptr || output == nullptr) { + return false; + } + + psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; + psa_status_t status = psa_cipher_encrypt_setup(&operation, aes_key_id_, PSA_ALG_CTR); + if (status == PSA_SUCCESS) { + status = psa_cipher_set_iv(&operation, nonce, 16); + } + + size_t output_len = 0; + if (status == PSA_SUCCESS) { + status = psa_cipher_update(&operation, input, input_size, output, input_size, &output_len); + } + + uint8_t finish_output[16]; + size_t finish_len = 0; + if (status == PSA_SUCCESS) { + status = psa_cipher_finish(&operation, finish_output, sizeof(finish_output), &finish_len); + } + psa_cipher_abort(&operation); + + if (status != PSA_SUCCESS || output_len != input_size || finish_len != 0) { + ESP_LOGE(TAG, "AES-CTR operation failed, status: %ld", static_cast(status)); + return false; + } + return true; +} + static const char hex_chars[] = "0123456789ABCDEF"; // ่พ…ๅŠฉๅ‡ฝๆ•ฐ๏ผŒๅฐ†ๅ•ไธชๅๅ…ญ่ฟ›ๅˆถๅญ—็ฌฆ่ฝฌๆขไธบๅฏนๅบ”็š„ๆ•ฐๅ€ผ static inline uint8_t CharToHex(char c) { diff --git a/main/protocols/mqtt_protocol.h b/main/protocols/mqtt_protocol.h index 90963dbf..a70939bc 100644 --- a/main/protocols/mqtt_protocol.h +++ b/main/protocols/mqtt_protocol.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ private: std::mutex channel_mutex_; std::unique_ptr mqtt_; std::unique_ptr udp_; - mbedtls_aes_context aes_ctx_; + psa_key_id_t aes_key_id_ = PSA_KEY_ID_NULL; std::string aes_nonce_; std::string udp_server_; int udp_port_; @@ -56,6 +56,7 @@ private: bool StartMqttClient(bool report_error=false); void ParseServerHello(const cJSON* root); std::string DecodeHexString(const std::string& hex_string); + bool CryptAesCtr(const uint8_t* input, size_t input_size, const uint8_t* nonce, uint8_t* output); bool SendText(const std::string& text) override; std::string GetHelloMessage(); diff --git a/scripts/release.py b/scripts/release.py index 90929626..da28a875 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -4,6 +4,7 @@ import json import zipfile import argparse import re +import subprocess from pathlib import Path from typing import Optional @@ -71,7 +72,74 @@ def _get_manufacturer(cfg: dict) -> Optional[str]: _BOARDS_DIR = Path("main/boards") -def _collect_variants(config_filename: str = "config.json") -> list[dict[str, str]]: + +def _parse_version(value: str) -> tuple[int, int, int]: + """Parse an ESP-IDF version string such as 5.5.4 or v6.0.""" + match = re.search(r"v?(\d+)\.(\d+)(?:\.(\d+))?", value) + if not match: + raise ValueError(f"Invalid ESP-IDF version: {value}") + return tuple(int(part or 0) for part in match.groups()) + + +def _detect_idf_version() -> tuple[int, int, int]: + """Resolve the active ESP-IDF version for version-gated build variants.""" + idf_path = os.environ.get("IDF_PATH") + if idf_path: + version_file = Path(idf_path) / "tools/cmake/version.cmake" + if version_file.exists(): + values: dict[str, int] = {} + for line in version_file.read_text(encoding="utf-8").splitlines(): + match = re.match(r"set\(IDF_VERSION_(MAJOR|MINOR|PATCH)\s+(\d+)\)", line) + if match: + values[match.group(1)] = int(match.group(2)) + if all(part in values for part in ("MAJOR", "MINOR", "PATCH")): + return values["MAJOR"], values["MINOR"], values["PATCH"] + + try: + output = subprocess.run( + ["idf.py", "--version"], + check=True, + capture_output=True, + text=True, + ).stdout + return _parse_version(output) + except (FileNotFoundError, subprocess.CalledProcessError, ValueError) as error: + raise RuntimeError( + "ESP-IDF version was not detected. Source export.sh before running release.py." + ) from error + + +def _version_matches(version: tuple[int, int, int], expression: str) -> bool: + """Evaluate a single comparison such as '<6.0' or '>=6.0.1'.""" + match = re.fullmatch(r"\s*(<=|>=|<|>|==)\s*(v?\d+\.\d+(?:\.\d+)?)\s*", expression) + if not match: + raise ValueError(f"Invalid ESP-IDF version expression: {expression}") + operator, expected_text = match.groups() + expected = _parse_version(expected_text) + return { + "<": version < expected, + "<=": version <= expected, + ">": version > expected, + ">=": version >= expected, + "==": version == expected, + }[operator] + + +def _get_builds_for_idf(cfg: dict, idf_version: tuple[int, int, int]) -> list[dict]: + """Return build entries whose optional ESP-IDF version rule matches.""" + builds: list[dict] = [] + for build in cfg.get("builds", []): + expression = build.get("idf_version") + if expression and not _version_matches(idf_version, expression): + continue + builds.append(dict(build)) + return builds + + +def _collect_variants( + config_filename: str = "config.json", + idf_version: tuple[int, int, int] = (6, 0, 0), +) -> list[dict[str, str]]: """Traverse all boards under main/boards, collect variant information. Return example: @@ -116,7 +184,7 @@ def _collect_variants(config_filename: str = "config.json") -> list[dict[str, st f"please move board to main/boards/{manufacturer}/{board}/" ) - for build in cfg.get("builds", []): + for build in _get_builds_for_idf(cfg, idf_version): name = build["name"] full_name = f"{manufacturer}-{name}" if manufacturer else name variants.append({ @@ -304,7 +372,13 @@ def _board_type_exists(board_type: str) -> bool: # Compile implementation ################################################################################ -def release(board_type: str, config_filename: str = "config.json", *, filter_name: Optional[str] = None) -> None: +def release( + board_type: str, + config_filename: str = "config.json", + *, + filter_name: Optional[str] = None, + idf_version: tuple[int, int, int] = (6, 0, 0), +) -> None: """Compile and package all/specified variants of the specified board_type Args: @@ -325,7 +399,7 @@ def release(board_type: str, config_filename: str = "config.json", *, filter_nam target = cfg["target"] manufacturer = _get_manufacturer(cfg) - builds = cfg.get("builds", []) + builds = _get_builds_for_idf(cfg, idf_version) if filter_name: builds = [b for b in builds if b["name"] == filter_name] if not builds: @@ -405,10 +479,11 @@ if __name__ == "__main__": parser.add_argument("--name", help="Variant name to compile (original name without manufacturer prefix)") args = parser.parse_args() + idf_version = _detect_idf_version() # List mode if args.list_boards: - variants = _collect_variants(config_filename=args.config) + variants = _collect_variants(config_filename=args.config, idf_version=idf_version) if args.json: print(json.dumps(variants)) else: @@ -436,7 +511,7 @@ if __name__ == "__main__": print(f"[ERROR] board_type {board_type_input} not found in main/CMakeLists.txt", file=sys.stderr) sys.exit(1) - variants_all = _collect_variants(config_filename=args.config) + variants_all = _collect_variants(config_filename=args.config, idf_version=idf_version) # Filter board_type list target_board_types: set[str] @@ -453,4 +528,9 @@ if __name__ == "__main__": if bt == board_type_input and not cfg_path.exists(): print(f"Board {bt} has no {args.config} config file, skipping") sys.exit(0) - release(bt, config_filename=args.config, filter_name=name_filter if bt == board_type_input else None) + release( + bt, + config_filename=args.config, + filter_name=name_filter if bt == board_type_input else None, + idf_version=idf_version, + )