mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-26 12:50:30 +00:00
feat(ldo): add ldo regulator driver for public use
This commit is contained in:
@@ -6,25 +6,21 @@
|
||||
|
||||
#include "unity.h"
|
||||
#include "test_mipi_dsi_board.h"
|
||||
#include "esp_private/esp_ldo.h"
|
||||
#include "esp_ldo_regulator.h"
|
||||
|
||||
static esp_ldo_unit_handle_t phy_pwr_unit = NULL;
|
||||
static esp_ldo_channel_handle_t ldo_phy_chan = NULL;
|
||||
|
||||
void test_bsp_enable_dsi_phy_power(void)
|
||||
{
|
||||
// Turn on the power for MIPI DSI PHY, so it can go from "No Power" state to "Shutdown" state
|
||||
esp_ldo_unit_init_cfg_t ldo_cfg = {
|
||||
.unit_id = TEST_MIPI_DSI_PHY_PWR_LDO_UNIT,
|
||||
.cfg = {
|
||||
.voltage_mv = TEST_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV,
|
||||
},
|
||||
esp_ldo_channel_config_t ldo_cfg = {
|
||||
.chan_id = TEST_MIPI_DSI_PHY_PWR_LDO_CHAN,
|
||||
.voltage_mv = TEST_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV,
|
||||
};
|
||||
TEST_ESP_OK(esp_ldo_init_unit(&ldo_cfg, &phy_pwr_unit));
|
||||
TEST_ESP_OK(esp_ldo_enable_unit(phy_pwr_unit));
|
||||
TEST_ESP_OK(esp_ldo_acquire_channel(&ldo_cfg, &ldo_phy_chan));
|
||||
}
|
||||
|
||||
void test_bsp_disable_dsi_phy_power(void)
|
||||
{
|
||||
TEST_ESP_OK(esp_ldo_disable_unit(phy_pwr_unit));
|
||||
TEST_ESP_OK(esp_ldo_deinit_unit(phy_pwr_unit));
|
||||
TEST_ESP_OK(esp_ldo_release_channel(ldo_phy_chan));
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
#define MIPI_DSI_LCD_VBP 16
|
||||
#define MIPI_DSI_LCD_VFP 16
|
||||
|
||||
#define TEST_MIPI_DSI_PHY_PWR_LDO_UNIT 3
|
||||
#define TEST_MIPI_DSI_PHY_PWR_LDO_CHAN 3
|
||||
#define TEST_MIPI_DSI_PHY_PWR_LDO_VOLTAGE_MV 2500
|
||||
|
||||
void test_bsp_enable_dsi_phy_power(void);
|
||||
|
||||
Reference in New Issue
Block a user