STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches

Power control: voltage scaling and over-drive. More...

Collaboration diagram for PWR:

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.

Detailed Description

Power control: voltage scaling and over-drive.

Macro Definition Documentation

◆ PWR_BASE

#define PWR_BASE   (0x40007000UL)

PWR base address (APB1).

Definition at line 19 of file pwr_reg.h.

◆ PWR

#define PWR   ((PwrRegisters_t *)PWR_BASE)

The PWR instance.

Definition at line 28 of file pwr_reg.h.

◆ PWR_CR_LPDS_Pos

#define PWR_CR_LPDS_Pos   (0U)

Bit 0.

Definition at line 32 of file pwr_reg.h.

◆ PWR_CR_LPDS

#define PWR_CR_LPDS   ((uint32_t)1U << PWR_CR_LPDS_Pos)

rw Low-power regulator in Stop mode.

Definition at line 34 of file pwr_reg.h.

◆ PWR_CR_PDDS_Pos

#define PWR_CR_PDDS_Pos   (1U)

Bit 1.

Definition at line 35 of file pwr_reg.h.

◆ PWR_CR_PDDS

#define PWR_CR_PDDS   ((uint32_t)1U << PWR_CR_PDDS_Pos)

rw Enter Standby instead of Stop on deep sleep.

Definition at line 37 of file pwr_reg.h.

◆ PWR_CR_CWUF_Pos

#define PWR_CR_CWUF_Pos   (2U)

Bit 2.

Definition at line 38 of file pwr_reg.h.

◆ PWR_CR_CWUF

#define PWR_CR_CWUF   ((uint32_t)1U << PWR_CR_CWUF_Pos)

rc_w1 Clear the wakeup flag.

Definition at line 40 of file pwr_reg.h.

◆ PWR_CR_CSBF_Pos

#define PWR_CR_CSBF_Pos   (3U)

Bit 3.

Definition at line 41 of file pwr_reg.h.

◆ PWR_CR_CSBF

#define PWR_CR_CSBF   ((uint32_t)1U << PWR_CR_CSBF_Pos)

rc_w1 Clear the standby flag.

Definition at line 43 of file pwr_reg.h.

◆ PWR_CR_PVDE_Pos

#define PWR_CR_PVDE_Pos   (4U)

Bit 4.

Definition at line 44 of file pwr_reg.h.

◆ PWR_CR_PVDE

#define PWR_CR_PVDE   ((uint32_t)1U << PWR_CR_PVDE_Pos)

rw Enable the programmable voltage detector.

Definition at line 46 of file pwr_reg.h.

◆ PWR_CR_PLS_Pos

#define PWR_CR_PLS_Pos   (5U)

Bits 7:5.

Definition at line 47 of file pwr_reg.h.

◆ PWR_CR_PLS_Msk

#define PWR_CR_PLS_Msk   ((uint32_t)0x7U << PWR_CR_PLS_Pos)

rw PVD threshold level.

Definition at line 49 of file pwr_reg.h.

◆ PWR_CR_DBP_Pos

#define PWR_CR_DBP_Pos   (8U)

Bit 8.

Definition at line 50 of file pwr_reg.h.

◆ PWR_CR_DBP

#define PWR_CR_DBP   ((uint32_t)1U << PWR_CR_DBP_Pos)

rw Disable backup-domain write protection.

Definition at line 52 of file pwr_reg.h.

◆ PWR_CR_VOS_Pos

#define PWR_CR_VOS_Pos   (14U)

Bits 15:14.

Definition at line 53 of file pwr_reg.h.

Referenced by pwrSetVoltageScale().

◆ PWR_CR_VOS_Msk

#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().

◆ PWR_CR_ODEN_Pos

#define PWR_CR_ODEN_Pos   (16U)

Bit 16.

Definition at line 56 of file pwr_reg.h.

◆ PWR_CR_ODEN

#define PWR_CR_ODEN   ((uint32_t)1U << PWR_CR_ODEN_Pos)

rw Enable over-drive.

Definition at line 58 of file pwr_reg.h.

Referenced by pwrEnableOverdrive().

◆ PWR_CR_ODSWEN_Pos

#define PWR_CR_ODSWEN_Pos   (17U)

Bit 17.

Definition at line 59 of file pwr_reg.h.

◆ PWR_CR_ODSWEN

#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().

◆ PWR_CR_VOS_SCALE3

#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().

◆ PWR_CR_VOS_SCALE2

#define PWR_CR_VOS_SCALE2   (0x2U)

Scale 2.

Definition at line 68 of file pwr_reg.h.

Referenced by pwrSetVoltageScale().

◆ PWR_CR_VOS_SCALE1

#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().

◆ PWR_CSR_WUF_Pos

#define PWR_CSR_WUF_Pos   (0U)

Bit 0.

Definition at line 74 of file pwr_reg.h.

◆ PWR_CSR_WUF

#define PWR_CSR_WUF   ((uint32_t)1U << PWR_CSR_WUF_Pos)

ro A wakeup event occurred.

Definition at line 76 of file pwr_reg.h.

◆ PWR_CSR_SBF_Pos

#define PWR_CSR_SBF_Pos   (1U)

Bit 1.

Definition at line 77 of file pwr_reg.h.

◆ PWR_CSR_SBF

#define PWR_CSR_SBF   ((uint32_t)1U << PWR_CSR_SBF_Pos)

ro The device was in Standby.

Definition at line 79 of file pwr_reg.h.

◆ PWR_CSR_PVDO_Pos

#define PWR_CSR_PVDO_Pos   (2U)

Bit 2.

Definition at line 80 of file pwr_reg.h.

◆ PWR_CSR_PVDO

#define PWR_CSR_PVDO   ((uint32_t)1U << PWR_CSR_PVDO_Pos)

ro VDD is below the PVD threshold.

Definition at line 82 of file pwr_reg.h.

◆ PWR_CSR_VOSRDY_Pos

#define PWR_CSR_VOSRDY_Pos   (14U)

Bit 14.

Definition at line 83 of file pwr_reg.h.

◆ PWR_CSR_VOSRDY

#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().

◆ PWR_CSR_ODRDY_Pos

#define PWR_CSR_ODRDY_Pos   (16U)

Bit 16.

Definition at line 86 of file pwr_reg.h.

◆ PWR_CSR_ODRDY

#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().

◆ PWR_CSR_ODSWRDY_Pos

#define PWR_CSR_ODSWRDY_Pos   (17U)

Bit 17.

Definition at line 89 of file pwr_reg.h.

◆ PWR_CSR_ODSWRDY

#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().