]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_STM32F407ZG-SK/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_STM32F407ZG-SK / Libraries / STM32F4xx_StdPeriph_Driver / inc / stm32f4xx_pwr.h
1 /**\r
2   ******************************************************************************\r
3   * @file    stm32f4xx_pwr.h\r
4   * @author  MCD Application Team\r
5   * @version V1.0.0\r
6   * @date    30-September-2011\r
7   * @brief   This file contains all the functions prototypes for the PWR firmware \r
8   *          library.\r
9   ******************************************************************************\r
10   * @attention\r
11   *\r
12   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
13   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE\r
14   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY\r
15   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING\r
16   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE\r
17   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
18   *\r
19   * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>\r
20   ******************************************************************************\r
21   */ \r
22 \r
23 /* Define to prevent recursive inclusion -------------------------------------*/\r
24 #ifndef __STM32F4xx_PWR_H\r
25 #define __STM32F4xx_PWR_H\r
26 \r
27 #ifdef __cplusplus\r
28  extern "C" {\r
29 #endif\r
30 \r
31 /* Includes ------------------------------------------------------------------*/\r
32 #include "stm32f4xx.h"\r
33 \r
34 /** @addtogroup STM32F4xx_StdPeriph_Driver\r
35   * @{\r
36   */\r
37 \r
38 /** @addtogroup PWR\r
39   * @{\r
40   */ \r
41 \r
42 /* Exported types ------------------------------------------------------------*/\r
43 /* Exported constants --------------------------------------------------------*/\r
44 \r
45 /** @defgroup PWR_Exported_Constants\r
46   * @{\r
47   */ \r
48 \r
49 /** @defgroup PWR_PVD_detection_level \r
50   * @{\r
51   */ \r
52 \r
53 #define PWR_PVDLevel_0                  PWR_CR_PLS_LEV0\r
54 #define PWR_PVDLevel_1                  PWR_CR_PLS_LEV1\r
55 #define PWR_PVDLevel_2                  PWR_CR_PLS_LEV2\r
56 #define PWR_PVDLevel_3                  PWR_CR_PLS_LEV3\r
57 #define PWR_PVDLevel_4                  PWR_CR_PLS_LEV4\r
58 #define PWR_PVDLevel_5                  PWR_CR_PLS_LEV5\r
59 #define PWR_PVDLevel_6                  PWR_CR_PLS_LEV6\r
60 #define PWR_PVDLevel_7                  PWR_CR_PLS_LEV7\r
61 \r
62 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_0) || ((LEVEL) == PWR_PVDLevel_1)|| \\r
63                                  ((LEVEL) == PWR_PVDLevel_2) || ((LEVEL) == PWR_PVDLevel_3)|| \\r
64                                  ((LEVEL) == PWR_PVDLevel_4) || ((LEVEL) == PWR_PVDLevel_5)|| \\r
65                                  ((LEVEL) == PWR_PVDLevel_6) || ((LEVEL) == PWR_PVDLevel_7))\r
66 /**\r
67   * @}\r
68   */\r
69 \r
70   \r
71 /** @defgroup PWR_Regulator_state_in_STOP_mode \r
72   * @{\r
73   */\r
74 \r
75 #define PWR_Regulator_ON                ((uint32_t)0x00000000)\r
76 #define PWR_Regulator_LowPower          PWR_CR_LPDS\r
77 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \\r
78                                      ((REGULATOR) == PWR_Regulator_LowPower))\r
79 /**\r
80   * @}\r
81   */\r
82 \r
83 /** @defgroup PWR_STOP_mode_entry \r
84   * @{\r
85   */\r
86 \r
87 #define PWR_STOPEntry_WFI               ((uint8_t)0x01)\r
88 #define PWR_STOPEntry_WFE               ((uint8_t)0x02)\r
89 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))\r
90 \r
91 /** @defgroup PWR_Regulator_Voltage_Scale \r
92   * @{\r
93   */\r
94 \r
95 #define PWR_Regulator_Voltage_Scale1    ((uint32_t)0x00004000)\r
96 #define PWR_Regulator_Voltage_Scale2    ((uint32_t)0x00000000)\r
97 #define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE) (((VOLTAGE) == PWR_Regulator_Voltage_Scale1) || ((VOLTAGE) == PWR_Regulator_Voltage_Scale2))\r
98  \r
99 /**\r
100   * @}\r
101   */\r
102 \r
103 /** @defgroup PWR_Flag \r
104   * @{\r
105   */\r
106 \r
107 #define PWR_FLAG_WU                     PWR_CSR_WUF\r
108 #define PWR_FLAG_SB                     PWR_CSR_SBF\r
109 #define PWR_FLAG_PVDO                   PWR_CSR_PVDO\r
110 #define PWR_FLAG_BRR                    PWR_CSR_BRR\r
111 #define PWR_FLAG_VOSRDY                 PWR_CSR_VOSRDY\r
112 \r
113 /** @defgroup PWR_Flag_Legacy \r
114   * @{\r
115   */\r
116 #define PWR_FLAG_REGRDY                  PWR_FLAG_VOSRDY               \r
117 /**\r
118   * @}\r
119   */\r
120 \r
121 #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \\r
122                                ((FLAG) == PWR_FLAG_PVDO) || ((FLAG) == PWR_FLAG_BRR) || \\r
123                                ((FLAG) == PWR_FLAG_VOSRDY))\r
124 \r
125 #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))\r
126 /**\r
127   * @}\r
128   */\r
129 \r
130 /**\r
131   * @}\r
132   */\r
133 \r
134 /* Exported macro ------------------------------------------------------------*/\r
135 /* Exported functions --------------------------------------------------------*/ \r
136 \r
137 /* Function used to set the PWR configuration to the default reset state ******/ \r
138 void PWR_DeInit(void);\r
139 \r
140 /* Backup Domain Access function **********************************************/ \r
141 void PWR_BackupAccessCmd(FunctionalState NewState);\r
142 \r
143 /* PVD configuration functions ************************************************/ \r
144 void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);\r
145 void PWR_PVDCmd(FunctionalState NewState);\r
146 \r
147 /* WakeUp pins configuration functions ****************************************/ \r
148 void PWR_WakeUpPinCmd(FunctionalState NewState);\r
149 \r
150 /* Main and Backup Regulators configuration functions *************************/ \r
151 void PWR_BackupRegulatorCmd(FunctionalState NewState);\r
152 void PWR_MainRegulatorModeConfig(uint32_t PWR_Regulator_Voltage);\r
153 \r
154 /* FLASH Power Down configuration functions ***********************************/ \r
155 void PWR_FlashPowerDownCmd(FunctionalState NewState);\r
156 \r
157 /* Low Power modes configuration functions ************************************/ \r
158 void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry);\r
159 void PWR_EnterSTANDBYMode(void);\r
160 \r
161 /* Flags management functions *************************************************/ \r
162 FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);\r
163 void PWR_ClearFlag(uint32_t PWR_FLAG);\r
164 \r
165 #ifdef __cplusplus\r
166 }\r
167 #endif\r
168 \r
169 #endif /* __STM32F4xx_PWR_H */\r
170 \r
171 /**\r
172   * @}\r
173   */\r
174 \r
175 /**\r
176   * @}\r
177   */\r
178 \r
179 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/\r