STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches
pwr_reg.h File Reference

PWR registers: regulator voltage scaling and over-drive (RM0390 section 5.4). More...

#include <stdint.h>
Include dependency graph for pwr_reg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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.
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.

Typedefs

typedef struct PwrRegisters_t PwrRegisters_t
 PWR register block.

Detailed Description

PWR registers: regulator voltage scaling and over-drive (RM0390 section 5.4).

The voltage scale sets the maximum HCLK, and flash latency must match the resulting SYSCLK (RM0390 Table 5). See Clock bring-up order.

Definition in file pwr_reg.h.