diff --git a/.github/workflows/check_lib_versions.yml b/.github/workflows/check_lib_versions.yml index 48a48994..ebf83aad 100644 --- a/.github/workflows/check_lib_versions.yml +++ b/.github/workflows/check_lib_versions.yml @@ -26,4 +26,4 @@ jobs: echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" echo "url: ${{ steps.last_release.outputs.url }}" - name: Check & Compare versions - run: bash ./.github/scripts/check_lib_versions.sh --latest_version=${{ steps.last_release.outputs.tag_name }} + run: bash ./tools/check_lib_versions.sh --latest_version=${{ steps.last_release.outputs.tag_name }} diff --git a/.gitlab/tools/executable-list.txt b/.gitlab/tools/executable-list.txt deleted file mode 100644 index 22439eee..00000000 --- a/.gitlab/tools/executable-list.txt +++ /dev/null @@ -1,4 +0,0 @@ -.github/scripts/check_lib_versions.sh -.gitlab/tools/check_executables.py -.gitlab/tools/check_readme_links.py -.gitlab/tools/push_to_github.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21178af8..fa34ef28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,33 +77,33 @@ repos: hooks: - id: check-executables name: Check File Permissions - entry: .gitlab/tools/check_executables.py --action executables + entry: ./tools/check_executables.py --action executables language: python types: [executable] exclude: '\.pre-commit/.+' - id: check-executable-list name: Validate executable-list.txt - entry: .gitlab/tools/check_executables.py --action list + entry: ./tools/check_executables.py --action list language: python pass_filenames: false always_run: true - id: sync-conf-files name: Update when configuration files change - entry: python3 tools/sync_conf_files.py ./ ./ + entry: python3 ./tools/sync_conf_files.py ./ ./ language: system files: '.*esp_panel_(board_custom|board_supported|drivers)_conf\.h' - id: sync-template-files name: Update when template files change - entry: python3 tools/sync_conf_files.py ./template_files ./ + entry: python3 ./tools/sync_conf_files.py ./template_files ./ language: system files: '(.*esp_utils_conf\.h|.*lv_conf\.h|.*lvgl_v8_port\.cpp|.*lvgl_v8_port\.h)' - id: check-file-versions name: Update when versions change - entry: python3 tools/check_file_version.py ./ + entry: python3 ./tools/check_file_version.py ./ language: system files: '(.*esp_panel_(board_custom|board_supported|drivers)_conf\.h|library.properties|.*esp_panel_versions.h)' - id: check-library-versions name: Check library versions - entry: ./.github/scripts/check_lib_versions.sh + entry: ./tools/check_lib_versions.sh language: system files: '(idf_component.yml|library.properties)' diff --git a/CHANGELOG.md b/CHANGELOG.md index 490d02c2..535e92e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # ChangeLog +## v1.0.2 - 2025-04-23 + +### Enhancements: + +* feat(backlight): add PWM parameters configuration (#188) + +### Bugfixes: + +* fix(io_expander): remove incompatible header (#175) +* fix(pre-commit): update the pre-commit script +* fix(docs): update README +* fix(conf): update comments of custom config file +* fix(examples): enable CPU 240M and task WDT default in esp_idf/lvgl_v8_port +* fix(lcd): fix ST7701 mirror issue + ## v1.0.1 - 2025-03-13 ### Enhancements: diff --git a/README.md b/README.md index 5c6e8ada..8b6fb50f 100644 --- a/README.md +++ b/README.md @@ -115,9 +115,10 @@ The functional block diagram is shown below: * [How to select and configure supported boards in Arduino IDE?](./docs/envs/use_with_arduino.md#how-to-select-and-configure-supported-boards-in-arduino-ide) * [How to use SquareLine exported UI source files in Arduino IDE?](./docs/envs/use_with_arduino.md#how-to-use-squareline-exported-ui-source-files-in-arduino-ide) * [How to debug when the screen doesn't light up using the library in Arduino IDE?](./docs/envs/use_with_arduino.md#how-to-debug-when-the-screen-doesnt-light-up-using-the-library-in-arduino-ide) - * [How to reduce Flash usage and speed up compilation when using ESP32_Display_Panel in Arduino IDE?](./docs/envs/use_with_arduino.md#how-to-reduce-flash-usage-and-speed-up-compilation-when-using-esp32_display_panel-in-arduino-ide) - * [Can't see log messages or messages are incomplete in Arduino IDE's Serial Monitor, how to fix?](./docs/envs/use_with_arduino.md#can-t-see-log-messages-or-messages-are-incomplete-in-arduino-ides-serial-monitor-how-to-fix) + * [How to fix the issue that log messages are missing or incomplete in Arduino IDE's Serial Monitor?](./docs/envs/use_with_arduino.md#how-to-fix-the-issue-that-log-messages-are-missing-or-incomplete-in-arduino-ides-serial-monitor) * [Solution for screen drift issue when using ESP32-S3 to drive RGB LCD in Arduino IDE](./docs/envs/use_with_arduino.md#solution-for-screen-drift-issue-when-using-esp32-s3-to-drive-rgb-lcd-in-arduino-ide) + * [How to reduce Flash usage and speed up compilation when using ESP32_Display_Panel in Arduino IDE?](./docs/envs/use_with_arduino.md#how-to-reduce-flash-usage-and-speed-up-compilation-when-using-esp32_display_panel-in-arduino-ide) + * [How to avoid I2C re-initialization when using ESP32_Display_Panel in Arduino IDE (e.g., when using Wire library)?](./docs/envs/use_with_arduino.md#how-to-avoid-i2c-re-initialization-when-using-esp32_display_panel-in-arduino-ide-eg-when-using-wire-library) * [ESP-IDF](./docs/envs/use_with_idf.md#faq) diff --git a/README_CN.md b/README_CN.md index ae80d0e0..6a77b5b6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -118,6 +118,7 @@ ESP32_Display_Panel 的主要特性如下: * [在 Arduino IDE 中打开串口调试器看不到日志信息或日志信息显示不全,如何解决?](./docs/envs/use_with_arduino_cn.md#在-arduino-ide-中打开串口调试器看不到日志信息或日志信息显示不全如何解决) * [在 Arduino IDE 中使用 ESP32-S3 驱动 RGB LCD 时出现画面漂移问题的解决方案](./docs/envs/use_with_arduino_cn.md#在-arduino-ide-中使用-esp32-s3-驱动-rgb-lcd-时出现画面漂移问题的解决方案) * [在 Arduino IDE 中使用 ESP32_Display_Panel 时,如何降低其 Flash 占用及加快编译速度?](./docs/envs/use_with_arduino_cn.md#在-arduino-ide-中使用-esp32_display_panel-时如何降低其-flash-占用及加快编译速度) + * [在 Arduino IDE 中使用 ESP32_Display_Panel 时,如何避免 I2C 重复初始化(如使用 Wire 库)?](./docs/envs/use_with_arduino_cn.md#在-arduino-ide-中使用-esp32_display_panel-时如何避免-i2c-重复初始化如使用-wire-库) * [ESP-IDF](./docs/envs/use_with_idf_cn.md#常见问题及解答) diff --git a/docs/envs/use_with_arduino.md b/docs/envs/use_with_arduino.md index 5f5a0a0a..c127a60e 100644 --- a/docs/envs/use_with_arduino.md +++ b/docs/envs/use_with_arduino.md @@ -31,8 +31,8 @@ - [How to install ESP32\_Display\_Panel in Arduino IDE?](#how-to-install-esp32_display_panel-in-arduino-ide) - [How to select and configure supported boards in Arduino IDE?](#how-to-select-and-configure-supported-boards-in-arduino-ide) - [How to use SquareLine exported UI source files in Arduino IDE?](#how-to-use-squareline-exported-ui-source-files-in-arduino-ide) - - [Screen not working in Arduino IDE, how to debug?](#screen-not-working-in-arduino-ide-how-to-debug) - - [Can't see log messages or messages are incomplete in Arduino IDE's Serial Monitor, how to fix?](#cant-see-log-messages-or-messages-are-incomplete-in-arduino-ides-serial-monitor-how-to-fix) + - [How to debug when the screen doesn't light up using the library in Arduino IDE?](#how-to-debug-when-the-screen-doesnt-light-up-using-the-library-in-arduino-ide) + - [How to fix the issue that log messages are missing or incomplete in Arduino IDE's Serial Monitor?](#how-to-fix-the-issue-that-log-messages-are-missing-or-incomplete-in-arduino-ides-serial-monitor) - [Solution for screen drift issue when using ESP32-S3 to drive RGB LCD in Arduino IDE](#solution-for-screen-drift-issue-when-using-esp32-s3-to-drive-rgb-lcd-in-arduino-ide) - [How to reduce Flash usage and speed up compilation when using ESP32\_Display\_Panel in Arduino IDE?](#how-to-reduce-flash-usage-and-speed-up-compilation-when-using-esp32_display_panel-in-arduino-ide) - [How to avoid I2C re-initialization when using ESP32\_Display\_Panel in Arduino IDE (e.g., when using Wire library)?](#how-to-avoid-i2c-re-initialization-when-using-esp32_display_panel-in-arduino-ide-eg-when-using-wire-library) @@ -506,7 +506,7 @@ Please refer to [Configuring Arduino IDE](#configuring-arduino-ide). Please refer to [Porting SquareLine Projects](#porting-squareline-projects). -### Screen not working in Arduino IDE, how to debug? +### How to debug when the screen doesn't light up using the library in Arduino IDE? Please follow these steps to troubleshoot: @@ -515,7 +515,7 @@ Please follow these steps to troubleshoot: 3. Check detailed log information through the serial monitor to analyze the problem. 4. If the problem still cannot be solved through the above steps, please submit an issue report on [GitHub Issues](https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues) with complete log information. -### Can't see log messages or messages are incomplete in Arduino IDE's Serial Monitor, how to fix? +### How to fix the issue that log messages are missing or incomplete in Arduino IDE's Serial Monitor? Please follow these steps to resolve: @@ -553,7 +553,7 @@ Please follow these steps to resolve: c. **Configure LVGL Task** - - If using LVGL, setting the task that executes `lv_timer_handler()` to run on the same core as the RGB LCD initialization task can help mitigate the screen drift issue + - If using LVGL, setting the task that executes `lv_timer_handler()` to run on the same core as the task that executes `board->begin()` can help mitigate the screen drift issue 3. **Example Code** diff --git a/docs/envs/use_with_arduino_cn.md b/docs/envs/use_with_arduino_cn.md index 3b905d4d..87f9bea0 100644 --- a/docs/envs/use_with_arduino_cn.md +++ b/docs/envs/use_with_arduino_cn.md @@ -553,7 +553,7 @@ arduino-esp32 v3.x 版本的 SDK 位于默认安装路径下的 `tools > esp32-a c. **配置 LVGL 任务** - - 如果使用 LVGL,设置执行 `lv_timer_handler()` 任务与执行 RGB LCD 初始化任务在同一个核心上运行可以缓解画面漂移问题 + - 如果使用 LVGL,设置执行 `lv_timer_handler()` 的任务与执行 `board->begin()` 的任务在同一个核心上运行可以缓解画面漂移问题 3. **示例代码** diff --git a/docs/envs/use_with_idf.md b/docs/envs/use_with_idf.md index 25537644..6bdf9d05 100644 --- a/docs/envs/use_with_idf.md +++ b/docs/envs/use_with_idf.md @@ -106,7 +106,7 @@ Please follow these steps to resolve: c. **Configure LVGL Task** - - If using LVGL, setting the task that executes `lv_timer_handler()` to run on the same core as the RGB LCD initialization task can help mitigate the screen drift issue + - If using LVGL, setting the task that executes `lv_timer_handler()` to run on the same core as the task that executes `board->begin()` can help mitigate the screen drift issue 3. **Example Code** diff --git a/docs/envs/use_with_idf_cn.md b/docs/envs/use_with_idf_cn.md index 44d0c3fa..ed927b5f 100644 --- a/docs/envs/use_with_idf_cn.md +++ b/docs/envs/use_with_idf_cn.md @@ -106,7 +106,7 @@ ESP32_Display_Panel 已上传到 [Espressif 组件库](https://components.espres c. **配置 LVGL 任务** - - 如果使用 LVGL,设置执行 `lv_timer_handler()` 任务与执行 RGB LCD 初始化任务在同一个核心上运行可以缓解画面漂移问题 + - 如果使用 LVGL,设置执行 `lv_timer_handler()` 的任务与执行 `board->begin()` 的任务在同一个核心上运行可以缓解画面漂移问题 3. **示例代码** diff --git a/esp_panel_board_custom_conf.h b/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/esp_panel_board_custom_conf.h +++ b/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h b/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h +++ b/examples/arduino/board/board_static_config/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_port/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/simple_rotation/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_port/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h +++ b/examples/arduino/gui/lvgl_v8/squareline_wifi_clock/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults b/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults index 1cd128bb..8f3d26ec 100644 --- a/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults +++ b/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults @@ -1,4 +1,3 @@ -CONFIG_ESP_TASK_WDT_EN=n CONFIG_FREERTOS_HZ=1000 CONFIG_COMPILER_CXX_EXCEPTIONS=y diff --git a/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults.esp32s3 b/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults.esp32s3 index 8770213f..4a53adb8 100644 --- a/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults.esp32s3 +++ b/examples/esp_idf/lvgl_v8_port/sdkconfig.defaults.esp32s3 @@ -1,3 +1,5 @@ +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y + CONFIG_COMPILER_OPTIMIZATION_PERF=y CONFIG_SPIRAM=y diff --git a/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h b/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h index 1b119178..aa417d4b 100644 --- a/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h +++ b/examples/platformio/lvgl_v8_port/src/esp_panel_board_custom_conf.h @@ -476,6 +476,22 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM /** @@ -735,9 +751,9 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 -#endif // ESP_PANEL_BOARD_USE_CUSTOM +#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM // *INDENT-ON* diff --git a/idf_component.yml b/idf_component.yml index 2b04706c..0fd8af5f 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.1" +version: "1.0.2" description: ESP32_Display_Panel is a display driver and GUI porting library designed by Espressif specifically for ESP series SoCs (ESP32, ESP32-S3, ESP32-P4, etc.) url: https://github.com/esp-arduino-libs/ESP32_Display_Panel repository: https://github.com/esp-arduino-libs/ESP32_Display_Panel.git diff --git a/library.properties b/library.properties index 2733fd27..8cb346a2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ESP32_Display_Panel -version=1.0.1 +version=1.0.2 author=espressif maintainer=espressif sentence=ESP32_Display_Panel is a display driver and GUI porting library designed by Espressif specifically for ESP series SoCs (ESP32, ESP32-S3, ESP32-P4, etc.) diff --git a/src/board/custom/Kconfig.board_custom.backlight b/src/board/custom/Kconfig.board_custom.backlight index 9411de34..ffa5f5e5 100644 --- a/src/board/custom/Kconfig.board_custom.backlight +++ b/src/board/custom/Kconfig.board_custom.backlight @@ -57,6 +57,23 @@ if ESP_PANEL_BOARD_USE_BACKLIGHT Active level for backlight control. endmenu + menu "PWM parameters" + depends on ESP_PANEL_BOARD_BACKLIGHT_TYPE_PWM_LEDC + + config ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ + int "Frequency" + default 5000 + help + Frequency for PWM control. + + config ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION + int "Duty resolution" + default 10 + range 1 20 + help + Duty resolution for PWM control. + endmenu + config ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF bool "Idle off" default n diff --git a/src/board/custom/esp_panel_board_kconfig_custom_backlight.h b/src/board/custom/esp_panel_board_kconfig_custom_backlight.h index c9501fd5..ba6c8f94 100644 --- a/src/board/custom/esp_panel_board_kconfig_custom_backlight.h +++ b/src/board/custom/esp_panel_board_kconfig_custom_backlight.h @@ -42,6 +42,26 @@ #error "Missing configuration: ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL" #endif #endif + + #if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC) + #ifndef ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ + #ifdef CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ + #else + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ 5000 // Keep the backward compatibility + #endif + #endif + #endif + + #if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC) + #ifndef ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION + #ifdef CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION + #else + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION 10 // Keep the backward compatibility + #endif + #endif + #endif #endif #ifndef ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF diff --git a/src/board/esp_panel_board_default_config.cpp b/src/board/esp_panel_board_default_config.cpp index 4cdfe7c2..9733e64d 100644 --- a/src/board/esp_panel_board_default_config.cpp +++ b/src/board/esp_panel_board_default_config.cpp @@ -293,6 +293,10 @@ const BoardConfig ESP_PANEL_BOARD_DEFAULT_CONFIG = { }, #elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC .config = BacklightPWM_LEDC::Config{ + .ledc_timer = BacklightPWM_LEDC::LEDC_TimerPartialConfig{ + .freq_hz = ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ, + .duty_resolution = ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION, + }, .ledc_channel = BacklightPWM_LEDC::LEDC_ChannelPartialConfig{ .io_num = ESP_PANEL_BOARD_BACKLIGHT_IO, .on_level = ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL, diff --git a/src/board/supported/jingcai/BOARD_JINGCAI_ESP32_4848S040C_I_Y_3.h b/src/board/supported/jingcai/BOARD_JINGCAI_ESP32_4848S040C_I_Y_3.h index 20e78e1f..ec2c2004 100644 --- a/src/board/supported/jingcai/BOARD_JINGCAI_ESP32_4848S040C_I_Y_3.h +++ b/src/board/supported/jingcai/BOARD_JINGCAI_ESP32_4848S040C_I_Y_3.h @@ -345,6 +345,23 @@ #define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number #define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high + +#if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC + /** + * @brief PWM parameters configuration + */ + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (1000) // LEDC timer frequency. + // Different backlight driver chips may have different + // frequency limits, please refer to the datasheet of + // the specific chip. + // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188 + + #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution. + // The frequency and duty resolution of the LEDC timer + // need to be properly matched, please refer to: + // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions +#endif + #endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE /** @@ -381,7 +398,7 @@ * 3. Patch version mismatch: No impact on functionality */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 // *INDENT-ON* diff --git a/src/drivers/io_expander/esp_panel_io_expander_adapter.hpp b/src/drivers/io_expander/esp_panel_io_expander_adapter.hpp index 0c463cc8..521ffda8 100644 --- a/src/drivers/io_expander/esp_panel_io_expander_adapter.hpp +++ b/src/drivers/io_expander/esp_panel_io_expander_adapter.hpp @@ -5,7 +5,6 @@ */ #pragma once -#include #include "utils/esp_panel_utils_log.h" #include "utils/esp_panel_utils_cxx.hpp" #include "drivers/host/esp_panel_host_i2c.hpp" diff --git a/src/drivers/lcd/port/esp_lcd_st7701_rgb.c b/src/drivers/lcd/port/esp_lcd_st7701_rgb.c index d14a3cd0..36c26fb4 100644 --- a/src/drivers/lcd/port/esp_lcd_st7701_rgb.c +++ b/src/drivers/lcd/port/esp_lcd_st7701_rgb.c @@ -348,9 +348,20 @@ static esp_err_t panel_st7701_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool } else { st7701->madctl_val &= ~LCD_CMD_ML_BIT; } + + // Enable the Command2 BK0 + ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_CND2BKxSEL, (uint8_t []) { + ST7701_CMD_BKxSEL_BYTE0, ST7701_CMD_BKxSEL_BYTE1, ST7701_CMD_BKxSEL_BYTE2, ST7701_CMD_BKxSEL_BYTE3, + ST7701_CMD_BKxSEL_BK0 | ST7701_CMD_CN2_BIT, + }, 5), TAG, "send command failed"); ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_SDIR, (uint8_t[]) { sdir_val, }, 1), TAG, "send command failed");; + + // Disable Command2 + ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, ST7701_CMD_CND2BKxSEL, (uint8_t []) { + ST7701_CMD_BKxSEL_BYTE0, ST7701_CMD_BKxSEL_BYTE1, ST7701_CMD_BKxSEL_BYTE2, ST7701_CMD_BKxSEL_BYTE3, 0, + }, 5), TAG, "send command failed"); ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, LCD_CMD_MADCTL, (uint8_t[]) { st7701->madctl_val, }, 1), TAG, "send command failed");; diff --git a/src/esp_panel_versions.h b/src/esp_panel_versions.h index fb172c5b..81ff9553 100644 --- a/src/esp_panel_versions.h +++ b/src/esp_panel_versions.h @@ -8,7 +8,7 @@ /* Library Version */ #define ESP_PANEL_VERSION_MAJOR 1 #define ESP_PANEL_VERSION_MINOR 0 -#define ESP_PANEL_VERSION_PATCH 1 +#define ESP_PANEL_VERSION_PATCH 2 /* File `esp_panel_drivers_conf.h` */ #define ESP_PANEL_DRIVERS_CONF_VERSION_MAJOR 1 @@ -17,8 +17,8 @@ /* File `esp_panel_board_custom_conf.h` */ #define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 1 -#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 0 -#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 1 +#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1 +#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0 /* File `esp_panel_board_supported_conf.h` */ #define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 1 diff --git a/.gitlab/tools/check_executables.py b/tools/check_executables.py similarity index 96% rename from .gitlab/tools/check_executables.py rename to tools/check_executables.py index 64260f86..d959fa5f 100755 --- a/.gitlab/tools/check_executables.py +++ b/tools/check_executables.py @@ -25,7 +25,7 @@ def _strip_each_item(iterable: Iterable) -> List: COMPONENT_PATH = os.getenv('COMPONENT_PATH', os.getcwd()) -EXECUTABLE_LIST_FN = os.path.join(COMPONENT_PATH, '.gitlab/tools/executable-list.txt') +EXECUTABLE_LIST_FN = os.path.join(COMPONENT_PATH, 'tools/executable-list.txt') known_executables = _strip_each_item(open(EXECUTABLE_LIST_FN).readlines()) diff --git a/tools/check_file_version.py b/tools/check_file_version.py index 4f88afe3..99148ccd 100644 --- a/tools/check_file_version.py +++ b/tools/check_file_version.py @@ -7,6 +7,7 @@ exclude_dirs = [ './build', + './examples/platformio/lvgl_v8_port/.pio' ] internal_version_file = 'src/esp_panel_versions.h' include_files = [ diff --git a/.github/scripts/check_lib_versions.sh b/tools/check_lib_versions.sh similarity index 100% rename from .github/scripts/check_lib_versions.sh rename to tools/check_lib_versions.sh diff --git a/tools/executable-list.txt b/tools/executable-list.txt new file mode 100644 index 00000000..120e11ce --- /dev/null +++ b/tools/executable-list.txt @@ -0,0 +1,7 @@ +.gitlab/tools/check_readme_links.py +.gitlab/tools/push_to_github.sh + +tools/check_executables.py +tools/check_file_version.py +tools/check_lib_versions.sh +tools/sync_conf_files.py diff --git a/.gitlab/tools/idf_ci_utils.py b/tools/idf_ci_utils.py similarity index 100% rename from .gitlab/tools/idf_ci_utils.py rename to tools/idf_ci_utils.py diff --git a/tools/sync_conf_files.py b/tools/sync_conf_files.py index e14c6090..46197479 100644 --- a/tools/sync_conf_files.py +++ b/tools/sync_conf_files.py @@ -10,8 +10,8 @@ './examples/platformio/lvgl_v8_port/src/lv_conf.h', ] exclude_dirs = [ - './build', - './examples/platformio/lvgl_v8_port/.pio', + r'.*build.*', + r'.*pio.*', ] @@ -25,13 +25,21 @@ def is_same_path(path1, path2): def is_in_directory(file_path, directory): - directory = os.path.realpath(directory) + import re file_path = os.path.realpath(file_path) - return file_path.startswith(directory) + # Check if the file path matches any of the exclude directory patterns + for pattern in exclude_dirs: + if re.search(pattern, file_path): + return True + return False def is_same_file(file1, file2): + # Check if both files exist + if not os.path.exists(file1) or not os.path.exists(file2): + return False + with open(file1, 'r') as f1, open(file2, 'r') as f2: file1_content = f1.read() file2_content = f2.read() @@ -53,7 +61,7 @@ def replace_files(template_directory, search_directory, file_path): filename = os.path.basename(file_path) src_file = os.path.join(template_directory, filename) - if is_exclude_file(file_path): + if is_exclude_file(file_path) or not os.path.exists(src_file): print(f"Skip '{file_path}'") return