mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(psram): enable psram power xpd
This commit is contained in:
committed by
Armando (Dou Yiwen)
parent
315b6547ff
commit
669be4a664
@@ -18,6 +18,7 @@
|
||||
#include "hal/assert.h"
|
||||
#include "hal/misc.h"
|
||||
#include "hal/config.h"
|
||||
#include "soc/pmu_reg.h"
|
||||
#include "soc/spi_mem_s_struct.h"
|
||||
#include "soc/spi_mem_s_reg.h"
|
||||
#include "soc/spi1_mem_s_reg.h"
|
||||
@@ -61,6 +62,21 @@ extern "C" {
|
||||
#define PSRAM_CTRLR_LL_INTR_EVENT_SUPPORTED 1
|
||||
#define PSRAM_CTRLR_LL_DEDICATED_LDO 1
|
||||
|
||||
/**
|
||||
* @brief Enable PSRAM power
|
||||
*
|
||||
* @param en enable / disable
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline void psram_ctrlr_ll_enable_power(bool en)
|
||||
{
|
||||
if (en) {
|
||||
REG_SET_BIT(PMU_PSRAM_CFG_REG, PMU_PSRAM_XPD);
|
||||
} else {
|
||||
REG_CLR_BIT(PMU_PSRAM_CFG_REG, PMU_PSRAM_XPD);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set PSRAM write cmd
|
||||
*
|
||||
|
||||
@@ -413,6 +413,8 @@ static void s_configure_psram_ecc(void)
|
||||
|
||||
esp_err_t esp_psram_impl_enable(void)
|
||||
{
|
||||
psram_ctrlr_ll_enable_power(true);
|
||||
|
||||
#if PSRAM_CTRLR_LL_DEDICATED_LDO
|
||||
esp_psram_power_cfg_t config = {
|
||||
.voltage_mv = CONFIG_SPIRAM_LDO_VOLTAGE_DOMAIN,
|
||||
|
||||
Reference in New Issue
Block a user