PWR driver modules.
More...
|
#define | CR_DS_MASK ((uint32_t)0xFFFFFFFC) |
|
#define | CR_PLS_MASK ((uint32_t)0xFFFFFF1F) |
|
PWR driver modules.
void PWR_BackupAccessCmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables access to the Backup domain registers.
- Note
- If the HSE divided by 32 is used as the RTC clock, the Backup Domain Access should be kept enabled.
- Parameters
-
NewState,: | new state of the access to the Backup domain registers. This parameter can be: ENABLE or DISABLE. |
- Return values
-
void PWR_ClearFlag |
( |
uint32_t |
PWR_FLAG | ) |
|
Clears the PWR's pending flags.
- Parameters
-
PWR_FLAG,: | specifies the flag to clear. This parameter can be one of the following values:
- PWR_FLAG_WU: Wake Up flag
- PWR_FLAG_SB: StandBy flag
|
- Return values
-
Deinitializes the PWR peripheral registers to their default reset values.
- Parameters
-
- Return values
-
void PWR_EnterSleepMode |
( |
uint8_t |
PWR_SLEEPEntry | ) |
|
Enters Sleep mode.
- Note
- In Sleep mode, all I/O pins keep the same state as in Run mode.
- Parameters
-
PWR_SLEEPEntry,: | specifies if SLEEP mode in entered with WFI or WFE instruction. This parameter can be one of the following values:
- PWR_SLEEPEntry_WFI: enter SLEEP mode with WFI instruction
- PWR_SLEEPEntry_WFE: enter SLEEP mode with WFE instruction
|
- Return values
-
void PWR_EnterSTANDBYMode |
( |
void |
| ) |
|
Enters STANDBY mode.
- Note
- In Standby mode, all I/O pins are high impedance except for:
- Reset pad (still available)
- RTC_AF1 pin (PC13) if configured for Wakeup pin 2 (WKUP2), tamper, time-stamp, RTC Alarm out, or RTC clock calibration out.
- WKUP pin 1 (PA0) if enabled.
- Parameters
-
- Return values
-
void PWR_EnterSTOPMode |
( |
uint32_t |
PWR_Regulator, |
|
|
uint8_t |
PWR_STOPEntry |
|
) |
| |
Enters STOP mode.
- Note
- In Stop mode, all I/O pins keep the same state as in Run mode.
-
When exiting Stop mode by issuing an interrupt or a wakeup event, the HSI RC oscillator is selected as system clock.
-
When the voltage regulator operates in low power mode, an additional startup delay is incurred when waking up from Stop mode. By keeping the internal regulator ON during Stop mode, the consumption is higher although the startup time is reduced.
- Parameters
-
PWR_Regulator,: | specifies the regulator state in STOP mode. This parameter can be one of the following values:
- PWR_Regulator_ON: STOP mode with regulator ON
- PWR_Regulator_LowPower: STOP mode with regulator in low power mode
|
PWR_STOPEntry,: | specifies if STOP mode in entered with WFI or WFE instruction. This parameter can be one of the following values:
- PWR_STOPEntry_WFI: enter STOP mode with WFI instruction
- PWR_STOPEntry_WFE: enter STOP mode with WFE instruction
|
- Return values
-
FlagStatus PWR_GetFlagStatus |
( |
uint32_t |
PWR_FLAG | ) |
|
Checks whether the specified PWR flag is set or not.
- Parameters
-
PWR_FLAG,: | specifies the flag to check. This parameter can be one of the following values:
- PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event was received from the WKUP pin or from the RTC alarm (Alarm A or Alarm B), RTC Tamper event or RTC TimeStamp event.
- PWR_FLAG_SB: StandBy flag. This flag indicates that the system was resumed from StandBy mode.
- PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled by the PWR_PVDCmd() function.
- PWR_FLAG_VREFINTRDY: Internal Voltage Reference Ready flag. This flag indicates the state of the internal voltage reference, VREFINT.
|
- Return values
-
The | new state of PWR_FLAG (SET or RESET). |
void PWR_PVDCmd |
( |
FunctionalState |
NewState | ) |
|
Enables or disables the Power Voltage Detector(PVD).
- Parameters
-
NewState,: | new state of the PVD. This parameter can be: ENABLE or DISABLE. |
- Return values
-
void PWR_PVDLevelConfig |
( |
uint32_t |
PWR_PVDLevel | ) |
|
Configures the voltage threshold detected by the Power Voltage Detector(PVD).
- Parameters
-
PWR_PVDLevel,: | specifies the PVD detection level This parameter can be one of the following values:
- PWR_PVDLevel_0
- PWR_PVDLevel_1
- PWR_PVDLevel_2
- PWR_PVDLevel_3
- PWR_PVDLevel_4
- PWR_PVDLevel_5
- PWR_PVDLevel_6
- PWR_PVDLevel_7
|
- Note
- Refer to the electrical characteristics of your device datasheet for more details about the voltage threshold corresponding to each detection level.
- Return values
-
void PWR_WakeUpPinCmd |
( |
uint32_t |
PWR_WakeUpPin, |
|
|
FunctionalState |
NewState |
|
) |
| |
Enables or disables the WakeUp Pin functionality.
- Parameters
-
PWR_WakeUpPin,: | specifies the WakeUpPin. This parameter can be: PWR_WakeUpPin_1 or PWR_WakeUpPin_2. |
NewState,: | new state of the WakeUp Pin functionality. This parameter can be: ENABLE or DISABLE. |
- Return values
-