|
STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
|
Power control: voltage scaling and over-drive. More...
Data Structures | |
| struct | PwrRegisters_t |
| PWR register block. More... | |
Macros | |
| #define | PWR_BASE (0x40007000UL) |
| PWR base address (APB1). | |
| #define | PWR ((PwrRegisters_t *)PWR_BASE) |
| The PWR instance. | |
Typedefs | |
| typedef struct PwrRegisters_t | PwrRegisters_t |
| PWR register block. | |
CR - power control (0x00) | |
| #define | PWR_CR_LPDS_Pos (0U) |
| Bit 0. | |
| #define | PWR_CR_LPDS ((uint32_t)1U << PWR_CR_LPDS_Pos) |
| rw Low-power regulator in Stop mode. | |
| #define | PWR_CR_PDDS_Pos (1U) |
| Bit 1. | |
| #define | PWR_CR_PDDS ((uint32_t)1U << PWR_CR_PDDS_Pos) |
| rw Enter Standby instead of Stop on deep sleep. | |
| #define | PWR_CR_CWUF_Pos (2U) |
| Bit 2. | |
| #define | PWR_CR_CWUF ((uint32_t)1U << PWR_CR_CWUF_Pos) |
| rc_w1 Clear the wakeup flag. | |
| #define | PWR_CR_CSBF_Pos (3U) |
| Bit 3. | |
| #define | PWR_CR_CSBF ((uint32_t)1U << PWR_CR_CSBF_Pos) |
| rc_w1 Clear the standby flag. | |
| #define | PWR_CR_PVDE_Pos (4U) |
| Bit 4. | |
| #define | PWR_CR_PVDE ((uint32_t)1U << PWR_CR_PVDE_Pos) |
| rw Enable the programmable voltage detector. | |
| #define | PWR_CR_PLS_Pos (5U) |
| Bits 7:5. | |
| #define | PWR_CR_PLS_Msk ((uint32_t)0x7U << PWR_CR_PLS_Pos) |
| rw PVD threshold level. | |
| #define | PWR_CR_DBP_Pos (8U) |
| Bit 8. | |
| #define | PWR_CR_DBP ((uint32_t)1U << PWR_CR_DBP_Pos) |
| rw Disable backup-domain write protection. | |
| #define | PWR_CR_VOS_Pos (14U) |
| Bits 15:14. | |
| #define | PWR_CR_VOS_Msk ((uint32_t)0x3U << PWR_CR_VOS_Pos) |
| rw Regulator voltage scale; values below. | |
| #define | PWR_CR_ODEN_Pos (16U) |
| Bit 16. | |
| #define | PWR_CR_ODEN ((uint32_t)1U << PWR_CR_ODEN_Pos) |
| rw Enable over-drive. | |
| #define | PWR_CR_ODSWEN_Pos (17U) |
| Bit 17. | |
| #define | PWR_CR_ODSWEN ((uint32_t)1U << PWR_CR_ODSWEN_Pos) |
| rw Switch the regulator to over-drive. | |
CR.VOS values | |
Maximum HCLK per scale: RM0390 section 3.4.1. | |
| #define | PWR_CR_VOS_SCALE3 (0x1U) |
| Scale 3: lowest power, lowest maximum frequency. | |
| #define | PWR_CR_VOS_SCALE2 (0x2U) |
| Scale 2. | |
| #define | PWR_CR_VOS_SCALE1 (0x3U) |
| Scale 1: highest maximum frequency (reset value). | |
CSR - power control/status (0x04) | |
| #define | PWR_CSR_WUF_Pos (0U) |
| Bit 0. | |
| #define | PWR_CSR_WUF ((uint32_t)1U << PWR_CSR_WUF_Pos) |
| ro A wakeup event occurred. | |
| #define | PWR_CSR_SBF_Pos (1U) |
| Bit 1. | |
| #define | PWR_CSR_SBF ((uint32_t)1U << PWR_CSR_SBF_Pos) |
| ro The device was in Standby. | |
| #define | PWR_CSR_PVDO_Pos (2U) |
| Bit 2. | |
| #define | PWR_CSR_PVDO ((uint32_t)1U << PWR_CSR_PVDO_Pos) |
| ro VDD is below the PVD threshold. | |
| #define | PWR_CSR_VOSRDY_Pos (14U) |
| Bit 14. | |
| #define | PWR_CSR_VOSRDY ((uint32_t)1U << PWR_CSR_VOSRDY_Pos) |
| ro Voltage scaling is ready. | |
| #define | PWR_CSR_ODRDY_Pos (16U) |
| Bit 16. | |
| #define | PWR_CSR_ODRDY ((uint32_t)1U << PWR_CSR_ODRDY_Pos) |
| ro Over-drive is ready. | |
| #define | PWR_CSR_ODSWRDY_Pos (17U) |
| Bit 17. | |
| #define | PWR_CSR_ODSWRDY ((uint32_t)1U << PWR_CSR_ODSWRDY_Pos) |
| ro The over-drive switch is complete. | |
Power control: voltage scaling and over-drive.
| #define PWR ((PwrRegisters_t *)PWR_BASE) |
| #define PWR_CR_LPDS ((uint32_t)1U << PWR_CR_LPDS_Pos) |
| #define PWR_CR_PDDS ((uint32_t)1U << PWR_CR_PDDS_Pos) |
| #define PWR_CR_CWUF ((uint32_t)1U << PWR_CR_CWUF_Pos) |
| #define PWR_CR_CSBF ((uint32_t)1U << PWR_CR_CSBF_Pos) |
| #define PWR_CR_PVDE ((uint32_t)1U << PWR_CR_PVDE_Pos) |
| #define PWR_CR_PLS_Msk ((uint32_t)0x7U << PWR_CR_PLS_Pos) |
| #define PWR_CR_DBP ((uint32_t)1U << PWR_CR_DBP_Pos) |
| #define PWR_CR_VOS_Pos (14U) |
| #define PWR_CR_VOS_Msk ((uint32_t)0x3U << PWR_CR_VOS_Pos) |
rw Regulator voltage scale; values below.
Writable only with the PLL off.
Definition at line 55 of file pwr_reg.h.
Referenced by pwrSetVoltageScale().
| #define PWR_CR_ODEN ((uint32_t)1U << PWR_CR_ODEN_Pos) |
| #define PWR_CR_ODSWEN ((uint32_t)1U << PWR_CR_ODSWEN_Pos) |
rw Switch the regulator to over-drive.
Definition at line 61 of file pwr_reg.h.
Referenced by pwrEnableOverdrive().
| #define PWR_CR_VOS_SCALE3 (0x1U) |
Scale 3: lowest power, lowest maximum frequency.
Definition at line 67 of file pwr_reg.h.
Referenced by pwrSetVoltageScale().
| #define PWR_CR_VOS_SCALE2 (0x2U) |
| #define PWR_CR_VOS_SCALE1 (0x3U) |
Scale 1: highest maximum frequency (reset value).
Definition at line 69 of file pwr_reg.h.
Referenced by bspClockInit(), and pwrSetVoltageScale().
| #define PWR_CSR_WUF ((uint32_t)1U << PWR_CSR_WUF_Pos) |
| #define PWR_CSR_SBF ((uint32_t)1U << PWR_CSR_SBF_Pos) |
| #define PWR_CSR_PVDO ((uint32_t)1U << PWR_CSR_PVDO_Pos) |
| #define PWR_CSR_VOSRDY ((uint32_t)1U << PWR_CSR_VOSRDY_Pos) |
ro Voltage scaling is ready.
Sets only once the PLL is on.
Definition at line 85 of file pwr_reg.h.
Referenced by pwrWaitVoltageScaleReady().
| #define PWR_CSR_ODRDY ((uint32_t)1U << PWR_CSR_ODRDY_Pos) |
ro Over-drive is ready.
Definition at line 88 of file pwr_reg.h.
Referenced by pwrEnableOverdrive().
| #define PWR_CSR_ODSWRDY ((uint32_t)1U << PWR_CSR_ODSWRDY_Pos) |
ro The over-drive switch is complete.
Definition at line 91 of file pwr_reg.h.
Referenced by pwrEnableOverdrive().