From 7028df2c777932e3197e718147e60f3d6c01111c Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Tue, 26 Mar 2024 10:23:26 +0800 Subject: [PATCH 1/2] change(mipi_dsi): use public esp_ldo regulator driver for enabling and configuring the LDO power required by MIPI DPHY --- bsp/esp32_p4_function_ev_board/README.md | 4 ++-- .../esp32_p4_function_ev_board.c | 20 ++++++++----------- .../idf_component.yml | 4 ++-- .../include/bsp/display.h | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/bsp/esp32_p4_function_ev_board/README.md b/bsp/esp32_p4_function_ev_board/README.md index aeb908e0..5150bc7f 100644 --- a/bsp/esp32_p4_function_ev_board/README.md +++ b/bsp/esp32_p4_function_ev_board/README.md @@ -2,7 +2,7 @@ [![Component Registry](https://components.espressif.com/components/espressif/esp32_p4_function_ev_board/badge.svg)](https://components.espressif.com/components/espressif/esp32_p4_function_ev_board) -ESP32-P4 Function EV Board is internal Espressif board for testing features on ESP32P4 chip. +ESP32-P4 Function EV Board is internal Espressif board for testing features on ESP32P4 chip. ### Dependencies @@ -11,6 +11,6 @@ ESP32-P4 Function EV Board is internal Espressif board for testing features on E | [espressif/esp_lcd_ili9881c](https://components.espressif.com/components/espressif/esp_lcd_ili9881c) |>=0.2.0| |[espressif/esp_lcd_touch_gt911](https://components.espressif.com/components/espressif/esp_lcd_touch_gt911)| ^1 | | [espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port) | ^2 | -| idf | >=5.2 | +| idf | >=5.3 | | [lvgl/lvgl](https://components.espressif.com/components/lvgl/lvgl) | ^8 | diff --git a/bsp/esp32_p4_function_ev_board/esp32_p4_function_ev_board.c b/bsp/esp32_p4_function_ev_board/esp32_p4_function_ev_board.c index 355c30ad..a24206ab 100644 --- a/bsp/esp32_p4_function_ev_board/esp32_p4_function_ev_board.c +++ b/bsp/esp32_p4_function_ev_board/esp32_p4_function_ev_board.c @@ -12,7 +12,7 @@ #include "esp_spiffs.h" #include "esp_lcd_panel_ops.h" #include "esp_lcd_mipi_dsi.h" -#include "esp_private/esp_ldo.h" +#include "esp_ldo_regulator.h" #include "esp_lcd_ili9881c.h" #include "esp_vfs_fat.h" #include "usb/usb_host.h" @@ -192,20 +192,16 @@ esp_err_t bsp_display_backlight_on(void) static esp_err_t bsp_enable_dsi_phy_power(void) { +#if BSP_MIPI_DSI_PHY_PWR_LDO_CHAN > 0 // Turn on the power for MIPI DSI PHY, so it can go from "No Power" state to "Shutdown" state - esp_ldo_unit_handle_t phy_pwr_unit = NULL; -#if BSP_MIPI_DSI_PHY_PWR_LDO_UNIT > 0 - esp_ldo_unit_init_cfg_t ldo_cfg = { - .unit_id = BSP_MIPI_DSI_PHY_PWR_LDO_UNIT, - .cfg = { - .voltage_mv = BSP_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV, - }, + static esp_ldo_channel_handle_t phy_pwr_chan = NULL; + esp_ldo_channel_config_t ldo_cfg = { + .chan_id = BSP_MIPI_DSI_PHY_PWR_LDO_CHAN, + .voltage_mv = BSP_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV, }; - ESP_RETURN_ON_ERROR(esp_ldo_init_unit(&ldo_cfg, &phy_pwr_unit), TAG, "LDO init failed"); - ESP_RETURN_ON_ERROR(esp_ldo_enable_unit(phy_pwr_unit), TAG, "LDO enable failed"); - + ESP_RETURN_ON_ERROR(esp_ldo_acquire_channel(&ldo_cfg, &phy_pwr_chan), TAG, "Acquire LDO channel for DPHY failed"); ESP_LOGI(TAG, "MIPI DSI PHY Powered on"); -#endif +#endif // BSP_MIPI_DSI_PHY_PWR_LDO_CHAN > 0 return ESP_OK; } diff --git a/bsp/esp32_p4_function_ev_board/idf_component.yml b/bsp/esp32_p4_function_ev_board/idf_component.yml index eed65801..009c572d 100644 --- a/bsp/esp32_p4_function_ev_board/idf_component.yml +++ b/bsp/esp32_p4_function_ev_board/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.0" +version: "1.1.0" description: Board Support Package (BSP) for ESP32-P4 Function EV Board (preview) url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp32_p4_function_ev_board @@ -9,7 +9,7 @@ tags: - bsp dependencies: - idf: ">=5.2" + idf: ">=5.3" esp_lcd_ili9881c: ">=0.2.0" esp_lcd_touch_gt911: "^1" lvgl/lvgl: "^8" diff --git a/bsp/esp32_p4_function_ev_board/include/bsp/display.h b/bsp/esp32_p4_function_ev_board/include/bsp/display.h index db898c1c..1efd896c 100644 --- a/bsp/esp32_p4_function_ev_board/include/bsp/display.h +++ b/bsp/esp32_p4_function_ev_board/include/bsp/display.h @@ -44,7 +44,7 @@ #define BSP_LCD_MIPI_DSI_LANE_NUM (2) // 2 data lanes #define BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS (1000) // 1Gbps -#define BSP_MIPI_DSI_PHY_PWR_LDO_UNIT (3) // LDO_VO3 is connected to VDD_MIPI_DPHY +#define BSP_MIPI_DSI_PHY_PWR_LDO_CHAN (3) // LDO_VO3 is connected to VDD_MIPI_DPHY #define BSP_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV (2500) #ifdef __cplusplus From b08d391fee8a90defaee04a61394a3ab86e6db74 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Sun, 7 Apr 2024 10:36:33 +0800 Subject: [PATCH 2/2] fix(ci): disable build for esp32c5 esp32c5 is not ready yet in esp-idf. We can consider reeanbling the build test for esp32c5 when "SPI,I2C,UART" drivers are ready there. --- .github/workflows/build_example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_example.yml b/.github/workflows/build_example.yml index a1584b65..ab760547 100644 --- a/.github/workflows/build_example.yml +++ b/.github/workflows/build_example.yml @@ -36,7 +36,7 @@ jobs: - name: Build ESP-BSP examples shell: bash env: - extra_arguments: "${{ matrix.idf_ver == 'latest' && '--default-build-targets esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c5 esp32c6 esp32h2 esp32p4' || '' }}" + extra_arguments: "${{ matrix.idf_ver == 'latest' && '--default-build-targets esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4' || '' }}" run: | export IDF_EXTRA_ACTIONS_PATH=${GITHUB_WORKSPACE}/examples . ${IDF_PATH}/export.sh