bf0_hal_pmu.h
Header file of RCC HAL module.
- Author
Sifli software development team
- Attention
Defines
-
PMU_HPSYS_LDO_VREF_DEFAULT
-
HAL_PMU_DISABLE_LPSYS_LDO()
-
PMUC_WSR_PIN_ALL
-
PMU_LPSYS_PSW_RET_LDO
-
PMU_LPSYS_PSW_BUCK2
-
PMU_LPSYS_PSW_LPSYS_LDO
-
PMU_BLESYS_PSW_RET_LDO
-
PMU_BLESYS_PSW_BUCK2
-
PMU_BLESYS_PSW_LPSYS_LDO
-
PMU_WAKEUP_SRC_RTC
wakeup source RTC
-
PMU_WAKEUP_SRC_PIN0
wakeup source PIN0
-
PMU_WAKEUP_SRC_PIN1
wakeup source PIN1
-
PMU_WAKEUP_SRC_PIN2
wakeup source PIN2
-
PMU_WAKEUP_SRC_PIN3
wakeup source PIN3
-
PMU_WAKEUP_SRC_PIN4
wakeup source PIN4
-
PMU_WAKEUP_SRC_PIN5
wakeup source PIN5
-
HAL_PMU_SELECT_LPSYS_PWR(psw)
Select LPSYS Power Switch.
- 参数:
psw – [in] power switch flag, see PMU_LPSYS_PSW
- 返回值:
None –
-
HAL_PMU_SELECT_BLESYS_PWR(psw)
Select LPSYS Power Switch.
- 参数:
psw – [in] power switch flag, see PMU_LPSYS_PSW
- 返回值:
None –
-
HAL_PMU_SET_BG1_VREF12(val)
Config bandgap1 VREF12.
- 参数:
val – [in] vandgap1 vref12 value
- 返回值:
None –
-
HAL_PMU_SET_HPSYS_LDO_VREF(val)
Config HPSYS LDO VREF.
- 参数:
val – [in] HPSYS LDO VREF value
- 返回值:
None –
-
HAL_PMU_SET_HPSYS_LDO_VREF2(val)
Config HPSYS LDO VREF2.
- 参数:
val – [in] HPSYS LDO VREF2 value
- 返回值:
None –
-
HAL_PMU_SET_BUCK1_CCH(val)
Config BUCK1 CCH.
- 参数:
val – [in] BUCK1 CCH value
- 返回值:
None –
-
HAL_PMU_HPSYS_POWER_OFF()
Turn off HCPU power switch entirely during standby.
- 返回值:
None –
-
HAL_PMU_HPSYS_POWER_ON()
Turn off HCPU power switch entirely during standby.
- 返回值:
None –
-
HAL_PMU_SWITCH_VRET()
Vret switch to 0.7v when standby.
- 返回值:
None –
-
HAL_PMU_SWITCH_VRET_LOWER()
Vret switch to 0.65v when standby.
- 返回值:
None –
-
HAL_PMU_SET_LDO_RDY_DELAY(delay)
Set the delay time of LDO ready.
- 返回值:
None –
-
HAL_PMU_SET_HXT3_RDY_DELAY(delay)
Set the delay time of xTal48M ready.
- 返回值:
None –
-
HAL_PMU_LXT_ENABLED()
Check weather LXT is enabled.
- 返回值:
True – if LXT enabled, False if using RC10k
-
HAL_PMU_LXT_DISABLED()
Check weather LXT is disabled.
- 返回值:
True – if using RC10k, False if using LXT
-
HAL_PMU_CLEAR_WSR(wsr)
Clear PMU wakeup source register.
- 参数:
wsr – [in]
- 返回值:
wsr – wakeup source register value
-
HAL_PMU_GET_WSR()
Get wakeup source.
- 返回值:
wsr – wakeup source register value
-
HAL_PMU_SET_BUCK2_LOW_VOLTAGE()
-
HAL_PMU_SET_BUCK2_HIGH_VOLTAGE()
-
HAL_PMU_ENABLE_BOR()
Enums
-
enum PMU_BootModeTypeDef
PMU boot mode
Values:
-
enumerator PMU_COLD_BOOT
code boot mode
-
enumerator PMU_HIBERNATE_BOOT
boot from hibernate mode, can be wakeup by RTC and PIN
-
enumerator PMU_SHUTDOWN_BOOT
boot from shutdown mode, can be wakeup by RTC and PIN, but RTC wakeup time is not precise
-
enumerator PMU_REBOOT_BOOT
boot from reboot
-
enumerator PMU_COLD_BOOT
Functions
-
HAL_StatusTypeDef HAL_PMU_EnablePinWakeup(uint8_t pin, uint8_t mode)
Enable pin wakeup for hibernate.
- 参数:
pin – pin number, its range differs from each chips, sf32lb55x: 0~5, others: 0~1
mode – pin wakeup mode, 0: high level, 1: low level, 2: positive edge, 3: negative edge
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_DisablePinWakeup(uint8_t pin)
Disable pin wakeup for hibernate.
- 参数:
pin – pin number, range: 0~5
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableRtcWakeup(void)
Enable RTC wakeup for hibernate.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_DisableRtcWakeup(void)
Disable RTC wakeup for hibernate.
- 返回值:
status –
-
void HAL_PMU_EnterHibernate(void)
Make system enter hibernate mode.
The function would wait for hibernation and not return. System can be woken up RTC and PIN precisely
- 返回值:
void –
-
void HAL_PMU_EnterShutdown(void)
Make system enter shutdown mode.
The function would wait for shutdown and not return. System can be woken up RTC and PIN, but RTC wakeup time is not accurate.
- 返回值:
void –
-
HAL_StatusTypeDef HAL_PMU_CheckBootMode(PMU_BootModeTypeDef *boot_mode, uint32_t *wakeup_src)
Check PMU boot mode.
It should be called only once after boot. PMU status would be cleared afterwards.
- 参数:
boot_mode – [out] boot mode
wakeup_src – [out] wakeup source if boot mode is PMU_HIBERNATE_BOOT or PMU_SHUTDOWN_BOOT, see PMU wakeup source
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableXTAL32(void)
Enable XTAL32K.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_DisableXTAL32(void)
Disable XTAL32K.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_RC10Kconfig(void)
Update RC10K configuration.
It should be called only once after boot. It will optimize RC10K performance for each chip.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_LXTReady(void)
Check whether Low power crystal is ready.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableRC32K(int enable)
Enable RC32K.
- 参数:
enable – [in] 1: enable RC32K , 0: disable RC32K
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_RC32KReady(void)
Check whether rc32k is ready.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_LpCLockSelect(PMU_LpClockTypeDef lp_clock)
Select low power clock.
- 参数:
lp_clock – [in] low power clock source
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableRC48(void)
Enable RC48M.
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableDLL(int enable)
Enable DLL buf, need by all DLLs, need to turn off when go low power, but need to make sure all DLL is turned off.
- 参数:
enable – [in] 1: enable DLL , 0: disable DLL
- 返回值:
status –
-
HAL_StatusTypeDef HAL_PMU_EnableAudio(int enable)
Enable audio buf, need to turn off when go low power.
- 参数:
enable – [in] 1: enable Audio , 0: disable Audio
- 返回值:
status –
-
void HAL_PMU_Reboot(void)
Reboot system.
Not support by Z0. The function would wait for reboot and not return. Need to call HAL_PMU_CheckBootMode to clear reboot bit after reboot. Boot mode is cold boot for reboot.
- 返回值:
void –
-
void HAL_PMU_SET_HXT_CBANK(uint32_t value)
Set CABANK SEL after crystal calibration.
- 参数:
value – [in] HXT CBANK register value
- 返回值:
void –
-
void HAL_PMU_SetWdt(uint32_t instance)
Enable watchdog as reboot cause.
- 参数:
instance – [in] Base address of watch dog
- 返回值:
void –
-
void HAL_PMU_ConfigDBL96(bool enabled)
Enable or disable DBL96.
the function should be put in RAM
- 参数:
enable – [in] true: enable dbl96, false: disable dbl96
- 返回值:
void –
-
void HAL_PMU_SaveCalData(FACTORY_CFG_VBK_LDO_T *cfg)
Save PMU calibration data.
- 返回:
void
-
HAL_StatusTypeDef HAL_PMU_ConfigHpsysLdoVolt(PMU_HpsysLdoVoltTypeDef volt)
Config HPSYS LDO Voltage.
- 返回:
status
-
void HAL_PMU_Init(void)
Init PMU.
- 返回值:
void –