mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
refactor(pmu): move PMU calibration efuse getters from efuse_ll.h to pmu_ll.h
Move the PMU internal voltage calibration related efuse read LL functions from efuse_ll.h into pmu_ll.h, renaming them with the pmu_ll prefix. efuse_ll.h should only contain efuse controller or system-global functions; other modules' private efuse bits belong to their own LL layer. Affected chips: esp32c5, esp32c6, esp32c61, esp32h2, esp32h4, esp32p4. Moved functions (renamed efuse_ll_get_* -> pmu_ll_get_*): - get_active_hp_dbias, get_active_lp_dbias - get_dbias_vol_gap - get_lslp_dbg, get_dslp_dbg (where present) - get_lslp_hp_dbias, get_dslp_lp_dbias (where present) - get_dslp_dbias (esp32h2)
This commit is contained in:
@@ -16,11 +16,47 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys3.active_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_lp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys3.active_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_dbg(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys3.lslp_hp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys3.lslp_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_dbg(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys3.dslp_lp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_lp_dbias(void)
|
||||
{
|
||||
return (EFUSE.rd_mac_sys4.dslp_lp_dbias_1 << 4) | EFUSE.rd_mac_sys3.dslp_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t pmu_ll_get_dbias_vol_gap(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys4.lp_hp_dbias_vol_gap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the power domain that needs to be powered down in the digital power
|
||||
*
|
||||
|
||||
@@ -16,11 +16,47 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.active_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_lp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.active_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t pmu_ll_get_dbias_vol_gap(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.dbias_vol_gap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_dbg(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.lslp_hp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_dbg(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.dslp_lp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.lslp_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_lp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_spi_sys_2.dslp_lp_dbias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the power domain that needs to be powered down in the digital power
|
||||
*
|
||||
|
||||
@@ -16,11 +16,47 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_hp_dbias(void)
|
||||
{
|
||||
return (EFUSE0.rd_mac_sys3.active_hp_dbias_1 << 3) | EFUSE0.rd_mac_sys2.active_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_lp_dbias(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.active_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t pmu_ll_get_dbias_vol_gap(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.lp_hp_dbias_vol_gap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_dbg(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.lslp_hp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_dbg(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.dslp_lp_dbg;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_lslp_hp_dbias(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.lslp_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_lp_dbias(void)
|
||||
{
|
||||
return EFUSE0.rd_mac_sys3.dslp_lp_dbias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the power domain that needs to be powered down in the digital power
|
||||
*
|
||||
|
||||
@@ -16,11 +16,32 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_2.active_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_lp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_2.active_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_dslp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_2.dslp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t pmu_ll_get_dbias_vol_gap(void)
|
||||
{
|
||||
return (EFUSE.rd_mac_sys_3.dbias_vol_gap_sign << 4) | (EFUSE.rd_mac_sys_3.dbias_vol_gap_value2 << 1) | EFUSE.rd_mac_sys_2.dbias_vol_gap_value1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the power domain that needs to be powered down in the digital power
|
||||
*
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -16,12 +16,28 @@
|
||||
#include "soc/pmu_struct.h"
|
||||
#include "hal/pmu_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "soc/efuse_struct.h"
|
||||
#include "hal/config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_hp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_4.active_hp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t pmu_ll_get_active_lp_dbias(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_4.active_lp_dbias;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int32_t pmu_ll_get_dbias_vol_gap(void)
|
||||
{
|
||||
return EFUSE.rd_mac_sys_5.lp_dcdc_dbias_vol_gap;
|
||||
}
|
||||
|
||||
FORCE_INLINE_ATTR uint32_t pmu_ll_lp_get_interrupt_raw(pmu_dev_t *hw)
|
||||
{
|
||||
return hw->lp_ext.int_raw.val;
|
||||
|
||||
Reference in New Issue
Block a user