提交 | 用户 | age
|
8b51c7
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file stm32f0xx_hal_pwr_ex.h |
|
4 |
* @author MCD Application Team |
|
5 |
* @brief Header file of PWR HAL Extension module. |
|
6 |
****************************************************************************** |
|
7 |
* @attention |
|
8 |
* |
|
9 |
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
|
10 |
* |
|
11 |
* Redistribution and use in source and binary forms, with or without modification, |
|
12 |
* are permitted provided that the following conditions are met: |
|
13 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
14 |
* this list of conditions and the following disclaimer. |
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
16 |
* this list of conditions and the following disclaimer in the documentation |
|
17 |
* and/or other materials provided with the distribution. |
|
18 |
* 3. Neither the name of STMicroelectronics nor the names of its contributors |
|
19 |
* may be used to endorse or promote products derived from this software |
|
20 |
* without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
23 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
24 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
25 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|
26 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
27 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
28 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
29 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
30 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
31 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
* |
|
33 |
****************************************************************************** |
|
34 |
*/ |
|
35 |
|
|
36 |
/* Define to prevent recursive inclusion -------------------------------------*/ |
|
37 |
#ifndef __STM32F0xx_HAL_PWR_EX_H |
|
38 |
#define __STM32F0xx_HAL_PWR_EX_H |
|
39 |
|
|
40 |
#ifdef __cplusplus |
|
41 |
extern "C" { |
|
42 |
#endif |
|
43 |
|
|
44 |
/* Includes ------------------------------------------------------------------*/ |
|
45 |
#include "stm32f0xx_hal_def.h" |
|
46 |
|
|
47 |
/** @addtogroup STM32F0xx_HAL_Driver |
|
48 |
* @{ |
|
49 |
*/ |
|
50 |
|
|
51 |
/** @addtogroup PWREx |
|
52 |
* @{ |
|
53 |
*/ |
|
54 |
|
|
55 |
/* Exported types ------------------------------------------------------------*/ |
|
56 |
|
|
57 |
/** @defgroup PWREx_Exported_Types PWREx Exported Types |
|
58 |
* @{ |
|
59 |
*/ |
|
60 |
|
|
61 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
62 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
63 |
defined (STM32F091xC) |
|
64 |
|
|
65 |
/** |
|
66 |
* @brief PWR PVD configuration structure definition |
|
67 |
*/ |
|
68 |
typedef struct |
|
69 |
{ |
|
70 |
uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level |
|
71 |
This parameter can be a value of @ref PWREx_PVD_detection_level */ |
|
72 |
|
|
73 |
uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins. |
|
74 |
This parameter can be a value of @ref PWREx_PVD_Mode */ |
|
75 |
}PWR_PVDTypeDef; |
|
76 |
|
|
77 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
78 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
79 |
/* defined (STM32F091xC) */ |
|
80 |
/** |
|
81 |
* @} |
|
82 |
*/ |
|
83 |
/* Exported constants --------------------------------------------------------*/ |
|
84 |
|
|
85 |
/** @defgroup PWREx_Exported_Constants PWREx Exported Constants |
|
86 |
* @{ |
|
87 |
*/ |
|
88 |
|
|
89 |
|
|
90 |
/** @defgroup PWREx_WakeUp_Pins PWREx Wakeup Pins |
|
91 |
* @{ |
|
92 |
*/ |
|
93 |
#if defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
94 |
defined (STM32F091xC) || defined (STM32F098xx) |
|
95 |
#define PWR_WAKEUP_PIN1 ((uint32_t)PWR_CSR_EWUP1) |
|
96 |
#define PWR_WAKEUP_PIN2 ((uint32_t)PWR_CSR_EWUP2) |
|
97 |
#define PWR_WAKEUP_PIN3 ((uint32_t)PWR_CSR_EWUP3) |
|
98 |
#define PWR_WAKEUP_PIN4 ((uint32_t)PWR_CSR_EWUP4) |
|
99 |
#define PWR_WAKEUP_PIN5 ((uint32_t)PWR_CSR_EWUP5) |
|
100 |
#define PWR_WAKEUP_PIN6 ((uint32_t)PWR_CSR_EWUP6) |
|
101 |
#define PWR_WAKEUP_PIN7 ((uint32_t)PWR_CSR_EWUP7) |
|
102 |
#define PWR_WAKEUP_PIN8 ((uint32_t)PWR_CSR_EWUP8) |
|
103 |
|
|
104 |
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \ |
|
105 |
((PIN) == PWR_WAKEUP_PIN2) || \ |
|
106 |
((PIN) == PWR_WAKEUP_PIN3) || \ |
|
107 |
((PIN) == PWR_WAKEUP_PIN4) || \ |
|
108 |
((PIN) == PWR_WAKEUP_PIN5) || \ |
|
109 |
((PIN) == PWR_WAKEUP_PIN6) || \ |
|
110 |
((PIN) == PWR_WAKEUP_PIN7) || \ |
|
111 |
((PIN) == PWR_WAKEUP_PIN8)) |
|
112 |
|
|
113 |
#elif defined(STM32F030xC) || defined (STM32F070xB) |
|
114 |
#define PWR_WAKEUP_PIN1 ((uint32_t)PWR_CSR_EWUP1) |
|
115 |
#define PWR_WAKEUP_PIN2 ((uint32_t)PWR_CSR_EWUP2) |
|
116 |
#define PWR_WAKEUP_PIN4 ((uint32_t)PWR_CSR_EWUP4) |
|
117 |
#define PWR_WAKEUP_PIN5 ((uint32_t)PWR_CSR_EWUP5) |
|
118 |
#define PWR_WAKEUP_PIN6 ((uint32_t)PWR_CSR_EWUP6) |
|
119 |
#define PWR_WAKEUP_PIN7 ((uint32_t)PWR_CSR_EWUP7) |
|
120 |
|
|
121 |
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \ |
|
122 |
((PIN) == PWR_WAKEUP_PIN2) || \ |
|
123 |
((PIN) == PWR_WAKEUP_PIN4) || \ |
|
124 |
((PIN) == PWR_WAKEUP_PIN5) || \ |
|
125 |
((PIN) == PWR_WAKEUP_PIN6) || \ |
|
126 |
((PIN) == PWR_WAKEUP_PIN7)) |
|
127 |
|
|
128 |
#elif defined(STM32F042x6) || defined (STM32F048xx) |
|
129 |
#define PWR_WAKEUP_PIN1 ((uint32_t)PWR_CSR_EWUP1) |
|
130 |
#define PWR_WAKEUP_PIN2 ((uint32_t)PWR_CSR_EWUP2) |
|
131 |
#define PWR_WAKEUP_PIN4 ((uint32_t)PWR_CSR_EWUP4) |
|
132 |
#define PWR_WAKEUP_PIN6 ((uint32_t)PWR_CSR_EWUP6) |
|
133 |
#define PWR_WAKEUP_PIN7 ((uint32_t)PWR_CSR_EWUP7) |
|
134 |
|
|
135 |
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \ |
|
136 |
((PIN) == PWR_WAKEUP_PIN2) || \ |
|
137 |
((PIN) == PWR_WAKEUP_PIN4) || \ |
|
138 |
((PIN) == PWR_WAKEUP_PIN6) || \ |
|
139 |
((PIN) == PWR_WAKEUP_PIN7)) |
|
140 |
|
|
141 |
#else |
|
142 |
#define PWR_WAKEUP_PIN1 ((uint32_t)PWR_CSR_EWUP1) |
|
143 |
#define PWR_WAKEUP_PIN2 ((uint32_t)PWR_CSR_EWUP2) |
|
144 |
|
|
145 |
|
|
146 |
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \ |
|
147 |
((PIN) == PWR_WAKEUP_PIN2)) |
|
148 |
|
|
149 |
#endif |
|
150 |
|
|
151 |
/** |
|
152 |
* @} |
|
153 |
*/ |
|
154 |
|
|
155 |
/** @defgroup PWREx_EXTI_Line PWREx EXTI Line |
|
156 |
* @{ |
|
157 |
*/ |
|
158 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
159 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
160 |
defined (STM32F091xC) |
|
161 |
|
|
162 |
#define PWR_EXTI_LINE_PVD ((uint32_t)EXTI_IMR_MR16) /*!< External interrupt line 16 Connected to the PVD EXTI Line */ |
|
163 |
|
|
164 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
165 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
166 |
/* defined (STM32F091xC) */ |
|
167 |
|
|
168 |
#if defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
169 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
170 |
defined (STM32F091xC) || defined (STM32F098xx) |
|
171 |
|
|
172 |
#define PWR_EXTI_LINE_VDDIO2 ((uint32_t)EXTI_IMR_MR31) /*!< External interrupt line 31 Connected to the Vddio2 Monitor EXTI Line */ |
|
173 |
|
|
174 |
#endif /* defined (STM32F042x6) || defined (STM32F048xx) ||\ |
|
175 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
176 |
defined (STM32F091xC) || defined (STM32F098xx) ||*/ |
|
177 |
/** |
|
178 |
* @} |
|
179 |
*/ |
|
180 |
|
|
181 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
182 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
183 |
defined (STM32F091xC) |
|
184 |
/** @defgroup PWREx_PVD_detection_level PWREx PVD detection level |
|
185 |
* @{ |
|
186 |
*/ |
|
187 |
#define PWR_PVDLEVEL_0 PWR_CR_PLS_LEV0 |
|
188 |
#define PWR_PVDLEVEL_1 PWR_CR_PLS_LEV1 |
|
189 |
#define PWR_PVDLEVEL_2 PWR_CR_PLS_LEV2 |
|
190 |
#define PWR_PVDLEVEL_3 PWR_CR_PLS_LEV3 |
|
191 |
#define PWR_PVDLEVEL_4 PWR_CR_PLS_LEV4 |
|
192 |
#define PWR_PVDLEVEL_5 PWR_CR_PLS_LEV5 |
|
193 |
#define PWR_PVDLEVEL_6 PWR_CR_PLS_LEV6 |
|
194 |
#define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7 |
|
195 |
#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \ |
|
196 |
((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \ |
|
197 |
((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \ |
|
198 |
((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7)) |
|
199 |
/** |
|
200 |
* @} |
|
201 |
*/ |
|
202 |
|
|
203 |
/** @defgroup PWREx_PVD_Mode PWREx PVD Mode |
|
204 |
* @{ |
|
205 |
*/ |
|
206 |
#define PWR_PVD_MODE_NORMAL (0x00000000U) /*!< basic mode is used */ |
|
207 |
#define PWR_PVD_MODE_IT_RISING (0x00010001U) /*!< External Interrupt Mode with Rising edge trigger detection */ |
|
208 |
#define PWR_PVD_MODE_IT_FALLING (0x00010002U) /*!< External Interrupt Mode with Falling edge trigger detection */ |
|
209 |
#define PWR_PVD_MODE_IT_RISING_FALLING (0x00010003U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ |
|
210 |
#define PWR_PVD_MODE_EVENT_RISING (0x00020001U) /*!< Event Mode with Rising edge trigger detection */ |
|
211 |
#define PWR_PVD_MODE_EVENT_FALLING (0x00020002U) /*!< Event Mode with Falling edge trigger detection */ |
|
212 |
#define PWR_PVD_MODE_EVENT_RISING_FALLING (0x00020003U) /*!< Event Mode with Rising/Falling edge trigger detection */ |
|
213 |
|
|
214 |
#define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \ |
|
215 |
((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \ |
|
216 |
((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \ |
|
217 |
((MODE) == PWR_PVD_MODE_NORMAL)) |
|
218 |
/** |
|
219 |
* @} |
|
220 |
*/ |
|
221 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
222 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
223 |
/* defined (STM32F091xC) */ |
|
224 |
|
|
225 |
/** @defgroup PWREx_Flag PWREx Flag |
|
226 |
* @{ |
|
227 |
*/ |
|
228 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
229 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
230 |
defined (STM32F091xC) |
|
231 |
|
|
232 |
#define PWR_FLAG_WU PWR_CSR_WUF |
|
233 |
#define PWR_FLAG_SB PWR_CSR_SBF |
|
234 |
#define PWR_FLAG_PVDO PWR_CSR_PVDO |
|
235 |
#define PWR_FLAG_VREFINTRDY PWR_CSR_VREFINTRDYF |
|
236 |
#elif defined (STM32F070x6) || defined (STM32F070xB) || defined (STM32F030xC) |
|
237 |
#define PWR_FLAG_WU PWR_CSR_WUF |
|
238 |
#define PWR_FLAG_SB PWR_CSR_SBF |
|
239 |
#define PWR_FLAG_VREFINTRDY PWR_CSR_VREFINTRDYF |
|
240 |
#else |
|
241 |
#define PWR_FLAG_WU PWR_CSR_WUF |
|
242 |
#define PWR_FLAG_SB PWR_CSR_SBF |
|
243 |
|
|
244 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
245 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
246 |
/* defined (STM32F091xC) */ |
|
247 |
/** |
|
248 |
* @} |
|
249 |
*/ |
|
250 |
|
|
251 |
/** |
|
252 |
* @} |
|
253 |
*/ |
|
254 |
|
|
255 |
/* Exported macro ------------------------------------------------------------*/ |
|
256 |
/** @defgroup PWREx_Exported_Macros PWREx Exported Macros |
|
257 |
* @{ |
|
258 |
*/ |
|
259 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
260 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
261 |
defined (STM32F091xC) |
|
262 |
/** |
|
263 |
* @brief Enable interrupt on PVD Exti Line 16. |
|
264 |
* @retval None. |
|
265 |
*/ |
|
266 |
#define __HAL_PWR_PVD_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_PVD)) |
|
267 |
|
|
268 |
/** |
|
269 |
* @brief Disable interrupt on PVD Exti Line 16. |
|
270 |
* @retval None. |
|
271 |
*/ |
|
272 |
#define __HAL_PWR_PVD_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD)) |
|
273 |
|
|
274 |
/** |
|
275 |
* @brief Enable event on PVD Exti Line 16. |
|
276 |
* @retval None. |
|
277 |
*/ |
|
278 |
#define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() (EXTI->EMR |= (PWR_EXTI_LINE_PVD)) |
|
279 |
|
|
280 |
/** |
|
281 |
* @brief Disable event on PVD Exti Line 16. |
|
282 |
* @retval None. |
|
283 |
*/ |
|
284 |
#define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD)) |
|
285 |
|
|
286 |
/** |
|
287 |
* @brief Disable the PVD Extended Interrupt Rising Trigger. |
|
288 |
* @retval None. |
|
289 |
*/ |
|
290 |
#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD) |
|
291 |
|
|
292 |
/** |
|
293 |
* @brief Disable the PVD Extended Interrupt Falling Trigger. |
|
294 |
* @retval None. |
|
295 |
*/ |
|
296 |
#define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD) |
|
297 |
|
|
298 |
/** |
|
299 |
* @brief Disable the PVD Extended Interrupt Rising & Falling Trigger. |
|
300 |
* @retval None |
|
301 |
*/ |
|
302 |
#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); |
|
303 |
|
|
304 |
|
|
305 |
/** |
|
306 |
* @brief PVD EXTI line configuration: set falling edge trigger. |
|
307 |
* @retval None. |
|
308 |
*/ |
|
309 |
#define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (PWR_EXTI_LINE_PVD) |
|
310 |
|
|
311 |
/** |
|
312 |
* @brief PVD EXTI line configuration: set rising edge trigger. |
|
313 |
* @retval None. |
|
314 |
*/ |
|
315 |
#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() EXTI->RTSR |= (PWR_EXTI_LINE_PVD) |
|
316 |
|
|
317 |
/** |
|
318 |
* @brief Enable the PVD Extended Interrupt Rising & Falling Trigger. |
|
319 |
* @retval None |
|
320 |
*/ |
|
321 |
#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); |
|
322 |
|
|
323 |
/** |
|
324 |
* @brief Check whether the specified PVD EXTI interrupt flag is set or not. |
|
325 |
* @retval EXTI PVD Line Status. |
|
326 |
*/ |
|
327 |
#define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD)) |
|
328 |
|
|
329 |
/** |
|
330 |
* @brief Clear the PVD EXTI flag. |
|
331 |
* @retval None. |
|
332 |
*/ |
|
333 |
#define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD)) |
|
334 |
|
|
335 |
/** |
|
336 |
* @brief Generate a Software interrupt on selected EXTI line. |
|
337 |
* @retval None. |
|
338 |
*/ |
|
339 |
#define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_PVD)) |
|
340 |
|
|
341 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
342 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
343 |
/* defined (STM32F091xC) */ |
|
344 |
|
|
345 |
|
|
346 |
#if defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
347 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
348 |
defined (STM32F091xC) || defined (STM32F098xx) |
|
349 |
/** |
|
350 |
* @brief Enable interrupt on Vddio2 Monitor Exti Line 31. |
|
351 |
* @retval None. |
|
352 |
*/ |
|
353 |
#define __HAL_PWR_VDDIO2_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_VDDIO2)) |
|
354 |
|
|
355 |
/** |
|
356 |
* @brief Disable interrupt on Vddio2 Monitor Exti Line 31. |
|
357 |
* @retval None. |
|
358 |
*/ |
|
359 |
#define __HAL_PWR_VDDIO2_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_VDDIO2)) |
|
360 |
|
|
361 |
/** |
|
362 |
* @brief Vddio2 Monitor EXTI line configuration: clear falling edge and rising edge trigger. |
|
363 |
* @retval None. |
|
364 |
*/ |
|
365 |
#define __HAL_PWR_VDDIO2_EXTI_DISABLE_FALLING_EDGE() \ |
|
366 |
do{ \ |
|
367 |
EXTI->FTSR &= ~(PWR_EXTI_LINE_VDDIO2); \ |
|
368 |
EXTI->RTSR &= ~(PWR_EXTI_LINE_VDDIO2); \ |
|
369 |
} while(0) |
|
370 |
|
|
371 |
/** |
|
372 |
* @brief Vddio2 Monitor EXTI line configuration: set falling edge trigger. |
|
373 |
* @retval None. |
|
374 |
*/ |
|
375 |
#define __HAL_PWR_VDDIO2_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (PWR_EXTI_LINE_VDDIO2) |
|
376 |
|
|
377 |
/** |
|
378 |
* @brief Check whether the specified VDDIO2 monitor EXTI interrupt flag is set or not. |
|
379 |
* @retval EXTI VDDIO2 Monitor Line Status. |
|
380 |
*/ |
|
381 |
#define __HAL_PWR_VDDIO2_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_VDDIO2)) |
|
382 |
|
|
383 |
/** |
|
384 |
* @brief Clear the VDDIO2 Monitor EXTI flag. |
|
385 |
* @retval None. |
|
386 |
*/ |
|
387 |
#define __HAL_PWR_VDDIO2_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_VDDIO2)) |
|
388 |
|
|
389 |
/** |
|
390 |
* @brief Generate a Software interrupt on selected EXTI line. |
|
391 |
* @retval None. |
|
392 |
*/ |
|
393 |
#define __HAL_PWR_VDDIO2_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_VDDIO2)) |
|
394 |
|
|
395 |
|
|
396 |
#endif /* defined (STM32F042x6) || defined (STM32F048xx) ||\ |
|
397 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
398 |
defined (STM32F091xC) || defined (STM32F098xx) */ |
|
399 |
|
|
400 |
/** |
|
401 |
* @} |
|
402 |
*/ |
|
403 |
|
|
404 |
/* Exported functions --------------------------------------------------------*/ |
|
405 |
|
|
406 |
/** @addtogroup PWREx_Exported_Functions PWREx Exported Functions |
|
407 |
* @{ |
|
408 |
*/ |
|
409 |
|
|
410 |
/** @addtogroup PWREx_Exported_Functions_Group1 |
|
411 |
* @{ |
|
412 |
*/ |
|
413 |
/* I/O operation functions ***************************************************/ |
|
414 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
415 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
416 |
defined (STM32F091xC) |
|
417 |
void HAL_PWR_PVD_IRQHandler(void); |
|
418 |
void HAL_PWR_PVDCallback(void); |
|
419 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
420 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
421 |
/* defined (STM32F091xC) */ |
|
422 |
|
|
423 |
#if defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
424 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
425 |
defined (STM32F091xC) || defined (STM32F098xx) |
|
426 |
void HAL_PWREx_Vddio2Monitor_IRQHandler(void); |
|
427 |
void HAL_PWREx_Vddio2MonitorCallback(void); |
|
428 |
#endif /* defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
429 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
430 |
defined (STM32F091xC) || defined (STM32F098xx) */ |
|
431 |
|
|
432 |
/* Peripheral Control functions **********************************************/ |
|
433 |
#if defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || \ |
|
434 |
defined (STM32F071xB) || defined (STM32F072xB) || \ |
|
435 |
defined (STM32F091xC) |
|
436 |
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD); |
|
437 |
void HAL_PWR_EnablePVD(void); |
|
438 |
void HAL_PWR_DisablePVD(void); |
|
439 |
#endif /* defined (STM32F031x6) || defined (STM32F042x6) || defined (STM32F051x8) || */ |
|
440 |
/* defined (STM32F071xB) || defined (STM32F072xB) || */ |
|
441 |
/* defined (STM32F091xC) */ |
|
442 |
|
|
443 |
#if defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
444 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
445 |
defined (STM32F091xC) || defined (STM32F098xx) |
|
446 |
void HAL_PWREx_EnableVddio2Monitor(void); |
|
447 |
void HAL_PWREx_DisableVddio2Monitor(void); |
|
448 |
#endif /* defined (STM32F042x6) || defined (STM32F048xx) || \ |
|
449 |
defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
|
450 |
defined (STM32F091xC) || defined (STM32F098xx) */ |
|
451 |
|
|
452 |
/** |
|
453 |
* @} |
|
454 |
*/ |
|
455 |
|
|
456 |
/** |
|
457 |
* @} |
|
458 |
*/ |
|
459 |
|
|
460 |
/** |
|
461 |
* @} |
|
462 |
*/ |
|
463 |
|
|
464 |
/** |
|
465 |
* @} |
|
466 |
*/ |
|
467 |
|
|
468 |
#ifdef __cplusplus |
|
469 |
} |
|
470 |
#endif |
|
471 |
|
|
472 |
#endif /* __STM32F0xx_HAL_PWR_EX_H */ |
|
473 |
|
|
474 |
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
|
475 |
|