40#define DBGMCU_IDCODE_DEV_ID_STM32H74X_5X 0x450
41#define DBGMCU_IDCODE_DEV_ID_STM32H7A3_B3_B0 0x480
55 uint32_t cr3_mask, cr3_set;
61 if (supply_external) {
112 uint32_t pwr_cr1_reg =
PWR_CR1;
118 static const uint8_t srdcr_vos_values[] = {
124 static const uint8_t d3cr_vos_values[] = {
#define DBGMCU_IDCODE_DEV_ID_MASK
#define cm3_assert(expr)
Check if assertion is true.
#define PWR_CR3_SMPSLEVEL_VOS
#define PWR_SRDCR_VOS_SHIFT
#define PWR_D3CR_VOS_SCALE_0
VOS0 is implemented on STM32H72x/3x with simple VOS setting.
#define PWR_CR3_SMPSEXTHP
SMPS step-down converter external power delivery selection.
#define PWR_SRDCR_VOS_MASK
#define PWR_D3CR_VOSRDY
D3CR Register Bits.
#define PWR_CR1_SVOS_SHIFT
VOS[15:14]: Regulator voltage scaling output selection.
#define PWR_CR3_SMPSLEVEL_SHIFT
#define PWR_D3CR_VOS_MASK
#define PWR_D3CR_VOS_SHIFT
#define PWR_CSR1_ACTVOSRDY
#define PWR_D3CR_VOS_SCALE_1
#define PWR_CR1_SVOS_MASK
#define PWR_SRDCR_VOS_SCALE_3
#define PWR_SRDCR_VOS_SCALE_2
#define PWR_SRDCR_VOS_SCALE_1
#define PWR_CR3_SMPSLEVEL_MASK
#define PWR_D3CR_VOS_SCALE_3
#define PWR_D3CR_VOS_SCALE_2
#define PWR_SRDCR_VOS_SCALE_0
@ PWR_VOS_SCALE_UNDEFINED
@ PWR_SYS_SMPS_DIRECT
Disable LDO, apply SMPS direct to CPU using VOS.
@ PWR_SYS_EXT_SMPS_LDO
SMPS supplies external power, and CPU through LDO.
@ PWR_SYS_SMPS_LDO
SMPS supplies internal LDO.
@ PWR_SYS_SCU_LDO
STM32H742/43/50/53 has special SCUEN handling, use for LDO.
@ PWR_SYS_LDO
Devices with SMPS use this to run from LDO only.
@ PWR_SYS_EXT_SMPS_LDO_BYP
SMPS supplies external power, bypasses LDO (e.g.
@ PWR_SYS_BYPASS
Disable all internal power supplies.
@ PWR_SYS_SCU_BYPASS
STM32H742/43/50/53 has special SCUEN handling, use for bypass.
void pwr_set_svos_scale(enum pwr_svos_scale scale)
Set the voltage scaling/strength for the internal SMPS/LDO when in Stop mode.
void pwr_set_mode_ldo(void)
Set power subsystem to utilize the LDO for CPU.
void pwr_set_vos_scale(enum pwr_vos_scale scale)
Set the voltage scaling/strength for the internal SMPS/LDO while running.
void pwr_set_mode_bypass(void)
Set power subsystem to bypass all internal supplies.
void pwr_set_mode_scu_bypass(void)
Specific STM32H742/43/50/53 Bypsass mode setting.
void pwr_set_mode_smps_ldo(bool supply_external, uint32_t smps_level, bool use_ldo)
Set power subsystem to utilize the SMPS run through the LDO for CPU.
void pwr_set_mode_scu_ldo(void)
Specific STM32H742/43/50/53 LDO mode setting.
void pwr_set_mode(enum pwr_sys_mode mode, uint8_t smps_level)
Set power system based on "System Supply Configurations" table in reference manual.
#define PWR_D3CR
D3 Domain Power Control register.
#define PWR_CR1
Power control register.
#define PWR_CSR1
Power control/status register.
#define PWR_CR3
Power control register 3.
void rcc_periph_clock_enable(enum rcc_periph_clken clken)
Enable Peripheral Clock in running mode.
#define SYSCFG_PWRCR_ODEN
#define DBGMCU_IDCODE_DEV_ID_STM32H74X_5X
libopencm3 STM32H7xx Power Control
#define DBGMCU_IDCODE_DEV_ID_STM32H7A3_B3_B0