MG32F10x Standard Peripherals Firmware Library

mg32f10x_pwr.h
浏览该文件的文档.
1
10 /* Define to prevent recursive inclusion -------------------------------------*/
11 #ifndef __MG32F10x_PWR_H
12 #define __MG32F10x_PWR_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* Includes ------------------------------------------------------------------*/
19 #include "mg32f10x.h"
20
29 /* Exported types ------------------------------------------------------------*/
30 /* Exported constants --------------------------------------------------------*/
31
39 #define PWR_EntryMode_WFI ((uint8_t)0x01)
40 #define PWR_EntryMode_WFE ((uint8_t)0x02)
41
48 #define PWR_FCLK_NoChange 0x00
49 #define PWR_FCLK_Div2 0x01
50
57 #define PWR_STOPMode_LP1 0x0001
58 #define PWR_STOPMode_LP2 0x0002
59 #define PWR_STOPMode_LP3_S32KON 0x0003
60 #define PWR_STOPMode_LP3_S32KOFF 0x0103
61 #define PWR_STOPMode_LP4_S32KON 0x0004
62 #define PWR_STOPMode_LP4_S32KOFF 0x0104
63
70 #define PWR_FLAG_PVDO ((uint32_t)0x00000001)
71 #define PWR_FLAG_WU ((uint32_t)0x00000101)
72 #define PWR_FLAG_SB ((uint32_t)0x00000102)
73 #define PWR_FLAG_SP ((uint32_t)0x00000104)
74 #define PWR_FLAG_CK ((uint32_t)0x00000108)
75
83 /* Exported macro ------------------------------------------------------------*/
84 /* Exported functions --------------------------------------------------------*/
85
86 void PWR_BackupAccessCmd(FunctionalState NewState);
87 void PWR_WakeUpPinCmd(FunctionalState NewState);
88 void PWR_EnterSLEEPMode(uint8_t PWR_FCLK, uint8_t PWR_EntryMode);
89 void PWR_EnterSTOPMode(uint16_t PWR_STOPMode, uint8_t PWR_EntryMode);
90 void PWR_EnterSTANDBYMode(void);
91 FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
92 void PWR_ClearFlag(uint32_t PWR_FLAG);
93 void PWR_UnlockANA(void);
94 void PWR_LockANA(void);
95
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif /* __MG32F10x_PWR_H */
PWR_GetFlagStatus
FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG)
Checks whether the specified PWR flag is set or not.
Definition: mg32f10x_pwr.c:236
PWR_BackupAccessCmd
void PWR_BackupAccessCmd(FunctionalState NewState)
Enables or disables access to the RTC and backup registers.
Definition: mg32f10x_pwr.c:56
PWR_EnterSTANDBYMode
void PWR_EnterSTANDBYMode(void)
Enters STANDBY mode.
Definition: mg32f10x_pwr.c:201
PWR_LockANA
void PWR_LockANA(void)
Enable ANCTL register write-protection function.
Definition: mg32f10x_pwr.c:296
PWR_EnterSTOPMode
void PWR_EnterSTOPMode(uint16_t PWR_STOPMode, uint8_t PWR_EntryMode)
Enters STOP mode.
Definition: mg32f10x_pwr.c:134
PWR_UnlockANA
void PWR_UnlockANA(void)
Disable ANCTL register write-protection function.
Definition: mg32f10x_pwr.c:284
PWR_EnterSLEEPMode
void PWR_EnterSLEEPMode(uint8_t PWR_FCLK, uint8_t PWR_EntryMode)
Enters SLEEP mode.
Definition: mg32f10x_pwr.c:84
PWR_WakeUpPinCmd
void PWR_WakeUpPinCmd(FunctionalState NewState)
Enables or disables the WakeUp Pin functionality.
Definition: mg32f10x_pwr.c:67
PWR_ClearFlag
void PWR_ClearFlag(uint32_t PWR_FLAG)
Clears the PWR's pending flags.
Definition: mg32f10x_pwr.c:274