Skip to content

Commit

Permalink
Merge pull request #314 from suda-morris/feat/mipi_dphy_ldo_power_api
Browse files Browse the repository at this point in the history
change(mipi_dsi): use public esp_ldo regulator driver
  • Loading branch information
espzav authored Apr 8, 2024
2 parents 17b7757 + b08d391 commit 63504a1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bsp/esp32_p4_function_ev_board/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- Autogenerated start: Dependencies -->
### Dependencies
Expand All @@ -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 |
<!-- Autogenerated end: Dependencies -->
20 changes: 8 additions & 12 deletions bsp/esp32_p4_function_ev_board/esp32_p4_function_ev_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions bsp/esp32_p4_function_ev_board/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bsp/esp32_p4_function_ev_board/include/bsp/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63504a1

Please sign in to comment.