MG32F10x Standard Peripherals Firmware Library
Modules | Macros | Functions

PWR driver modules. More...

Modules

 PWR_Exported_Constants
 
 PWR_Private_Defines
 
 PWR_Private_Functions
 

Macros

#define PRE_LP()   ((void(*)(void))((unsigned int)(pre_lp_code) | 0x01))()
 
#define POST_LP()   ((void(*)(void))((unsigned int)(post_lp_code) | 0x01))()
 

Functions

void PWR_BackupAccessCmd (FunctionalState NewState)
 Enables or disables access to the RTC and backup registers. More...
 
void PWR_WakeUpPinCmd (FunctionalState NewState)
 Enables or disables the WakeUp Pin functionality. More...
 
void PWR_EnterSLEEPMode (uint8_t PWR_FCLK, uint8_t PWR_EntryMode)
 Enters SLEEP mode. More...
 
void PWR_EnterSTOPMode (uint16_t PWR_STOPMode, uint8_t PWR_EntryMode)
 Enters STOP mode. More...
 
void PWR_EnterSTANDBYMode (void)
 Enters STANDBY mode. More...
 
FlagStatus PWR_GetFlagStatus (uint32_t PWR_FLAG)
 Checks whether the specified PWR flag is set or not. More...
 
void PWR_ClearFlag (uint32_t PWR_FLAG)
 Clears the PWR's pending flags. More...
 
void PWR_UnlockANA (void)
 Disable ANCTL register write-protection function. More...
 
void PWR_LockANA (void)
 Enable ANCTL register write-protection function. More...
 

Detailed Description

PWR driver modules.

Function Documentation

◆ PWR_BackupAccessCmd()

void PWR_BackupAccessCmd ( FunctionalState  NewState)

Enables or disables access to the RTC and backup registers.

Parameters
NewStatenew state of the access to the RTC and backup registers. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ PWR_ClearFlag()

void PWR_ClearFlag ( uint32_t  PWR_FLAG)

Clears the PWR's pending flags.

Parameters
PWR_FLAGspecifies the flag to clear. This parameter can be one of the following values:
  • PWR_FLAG_WU: Wake Up flag
  • PWR_FLAG_SB: StandBy flag
  • PWR_FLAG_SP: Stop flag
  • PWR_FLAG_CK: Clock configuration reset flag
Returns
None

◆ PWR_EnterSLEEPMode()

void PWR_EnterSLEEPMode ( uint8_t  PWR_FCLK,
uint8_t  PWR_EntryMode 
)

Enters SLEEP mode.

Parameters
PWR_FCLKspecifies the M3 FCLK frequency in SLEEP mode. This parameter can be one of the following values:
  • PWR_FCLK_NoChange: the M3 FCLK frequency not change when enter SLEEP mode.
  • PWR_FCLK_Div2: the M3 FCLK frequency divide by 2 when enter SLEEP mode.
PWR_EntryModespecifies enter SLEEP mode with WFI or WFE instruction. This parameter can be one of the following values:
  • PWR_EntryMode_WFI: enter SLEEP mode with WFI instruction
  • PWR_EntryMode_WFE: enter SLEEP mode with WFE instruction
Returns
None

◆ PWR_EnterSTANDBYMode()

void PWR_EnterSTANDBYMode ( void  )

Enters STANDBY mode.

Parameters
None
Returns
None

◆ PWR_EnterSTOPMode()

void PWR_EnterSTOPMode ( uint16_t  PWR_STOPMode,
uint8_t  PWR_EntryMode 
)

Enters STOP mode.

Parameters
PWR_STOPModespecifies the STOP mode. This parameter can be one of the following values:
  • PWR_STOPMode_LP1: STOP LP1 mode.
  • PWR_STOPMode_LP2: STOP LP2 mode.
  • PWR_STOPMode_LP3_S32KON: STOP LP3 mode with 32K SRAM on.
  • PWR_STOPMode_LP3_S32KOFF: STOP LP3 mode with 32K SRAM off.
  • PWR_STOPMode_LP4_S32KON: STOP LP4 mode with 32K SRAM on.
  • PWR_STOPMode_LP4_S32KOFF: STOP LP4 mode with 32K SRAM off.
PWR_EntryModespecifies enter STOP mode with WFI or WFE instruction. This parameter can be one of the following values:
  • PWR_EntryMode_WFI: enter STOP mode with WFI instruction
  • PWR_EntryMode_WFE: enter STOP mode with WFE instruction
Returns
None

◆ PWR_GetFlagStatus()

FlagStatus PWR_GetFlagStatus ( uint32_t  PWR_FLAG)

Checks whether the specified PWR flag is set or not.

Parameters
PWR_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • PWR_FLAG_PVDO: PVD Output
  • PWR_FLAG_WU: Wake Up flag
  • PWR_FLAG_SB: StandBy flag
  • PWR_FLAG_SP: Stop flag
  • PWR_FLAG_CK: Clock configuration reset flag
Returns
The new state of PWR_FLAG (SET or RESET).

◆ PWR_LockANA()

void PWR_LockANA ( void  )

Enable ANCTL register write-protection function.

Parameters
None
Returns
None

◆ PWR_UnlockANA()

void PWR_UnlockANA ( void  )

Disable ANCTL register write-protection function.

Parameters
None
Returns
None

◆ PWR_WakeUpPinCmd()

void PWR_WakeUpPinCmd ( FunctionalState  NewState)

Enables or disables the WakeUp Pin functionality.

Parameters
NewStatenew state of the WakeUp Pin functionality. This parameter can be: ENABLE or DISABLE.
Returns
None