comparison Common/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h @ 128:c78bcbd5deda FlipDisplay

Added current STM32 standandard libraries in version independend folder structure
author Ideenmodellierer
date Sun, 17 Feb 2019 21:12:22 +0100
parents
children
comparison
equal deleted inserted replaced
127:1369f8660eaa 128:c78bcbd5deda
1 /**
2 ******************************************************************************
3 * @file stm32f4xx_ll_exti.h
4 * @author MCD Application Team
5 * @brief Header file of EXTI LL module.
6 ******************************************************************************
7 * @attention
8 *
9 * <h2><center>&copy; COPYRIGHT(c) 2017 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 __STM32F4xx_LL_EXTI_H
38 #define __STM32F4xx_LL_EXTI_H
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /* Includes ------------------------------------------------------------------*/
45 #include "stm32f4xx.h"
46
47 /** @addtogroup STM32F4xx_LL_Driver
48 * @{
49 */
50
51 #if defined (EXTI)
52
53 /** @defgroup EXTI_LL EXTI
54 * @{
55 */
56
57 /* Private types -------------------------------------------------------------*/
58 /* Private variables ---------------------------------------------------------*/
59 /* Private constants ---------------------------------------------------------*/
60 /* Private Macros ------------------------------------------------------------*/
61 #if defined(USE_FULL_LL_DRIVER)
62 /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros
63 * @{
64 */
65 /**
66 * @}
67 */
68 #endif /*USE_FULL_LL_DRIVER*/
69 /* Exported types ------------------------------------------------------------*/
70 #if defined(USE_FULL_LL_DRIVER)
71 /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure
72 * @{
73 */
74 typedef struct
75 {
76
77 uint32_t Line_0_31; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31
78 This parameter can be any combination of @ref EXTI_LL_EC_LINE */
79
80 FunctionalState LineCommand; /*!< Specifies the new state of the selected EXTI lines.
81 This parameter can be set either to ENABLE or DISABLE */
82
83 uint8_t Mode; /*!< Specifies the mode for the EXTI lines.
84 This parameter can be a value of @ref EXTI_LL_EC_MODE. */
85
86 uint8_t Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
87 This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
88 } LL_EXTI_InitTypeDef;
89
90 /**
91 * @}
92 */
93 #endif /*USE_FULL_LL_DRIVER*/
94
95 /* Exported constants --------------------------------------------------------*/
96 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
97 * @{
98 */
99
100 /** @defgroup EXTI_LL_EC_LINE LINE
101 * @{
102 */
103 #define LL_EXTI_LINE_0 EXTI_IMR_IM0 /*!< Extended line 0 */
104 #define LL_EXTI_LINE_1 EXTI_IMR_IM1 /*!< Extended line 1 */
105 #define LL_EXTI_LINE_2 EXTI_IMR_IM2 /*!< Extended line 2 */
106 #define LL_EXTI_LINE_3 EXTI_IMR_IM3 /*!< Extended line 3 */
107 #define LL_EXTI_LINE_4 EXTI_IMR_IM4 /*!< Extended line 4 */
108 #define LL_EXTI_LINE_5 EXTI_IMR_IM5 /*!< Extended line 5 */
109 #define LL_EXTI_LINE_6 EXTI_IMR_IM6 /*!< Extended line 6 */
110 #define LL_EXTI_LINE_7 EXTI_IMR_IM7 /*!< Extended line 7 */
111 #define LL_EXTI_LINE_8 EXTI_IMR_IM8 /*!< Extended line 8 */
112 #define LL_EXTI_LINE_9 EXTI_IMR_IM9 /*!< Extended line 9 */
113 #define LL_EXTI_LINE_10 EXTI_IMR_IM10 /*!< Extended line 10 */
114 #define LL_EXTI_LINE_11 EXTI_IMR_IM11 /*!< Extended line 11 */
115 #define LL_EXTI_LINE_12 EXTI_IMR_IM12 /*!< Extended line 12 */
116 #define LL_EXTI_LINE_13 EXTI_IMR_IM13 /*!< Extended line 13 */
117 #define LL_EXTI_LINE_14 EXTI_IMR_IM14 /*!< Extended line 14 */
118 #define LL_EXTI_LINE_15 EXTI_IMR_IM15 /*!< Extended line 15 */
119 #if defined(EXTI_IMR_IM16)
120 #define LL_EXTI_LINE_16 EXTI_IMR_IM16 /*!< Extended line 16 */
121 #endif
122 #define LL_EXTI_LINE_17 EXTI_IMR_IM17 /*!< Extended line 17 */
123 #if defined(EXTI_IMR_IM18)
124 #define LL_EXTI_LINE_18 EXTI_IMR_IM18 /*!< Extended line 18 */
125 #endif
126 #define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */
127 #if defined(EXTI_IMR_IM20)
128 #define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */
129 #endif
130 #if defined(EXTI_IMR_IM21)
131 #define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */
132 #endif
133 #if defined(EXTI_IMR_IM22)
134 #define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */
135 #endif
136 #if defined(EXTI_IMR_IM23)
137 #define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */
138 #endif
139 #if defined(EXTI_IMR_IM24)
140 #define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */
141 #endif
142 #if defined(EXTI_IMR_IM25)
143 #define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */
144 #endif
145 #if defined(EXTI_IMR_IM26)
146 #define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */
147 #endif
148 #if defined(EXTI_IMR_IM27)
149 #define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */
150 #endif
151 #if defined(EXTI_IMR_IM28)
152 #define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */
153 #endif
154 #if defined(EXTI_IMR_IM29)
155 #define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */
156 #endif
157 #if defined(EXTI_IMR_IM30)
158 #define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */
159 #endif
160 #if defined(EXTI_IMR_IM31)
161 #define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */
162 #endif
163 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/
164
165
166 #define LL_EXTI_LINE_ALL ((uint32_t)0xFFFFFFFFU) /*!< All Extended line */
167
168 #if defined(USE_FULL_LL_DRIVER)
169 #define LL_EXTI_LINE_NONE ((uint32_t)0x00000000U) /*!< None Extended line */
170 #endif /*USE_FULL_LL_DRIVER*/
171
172 /**
173 * @}
174 */
175 #if defined(USE_FULL_LL_DRIVER)
176
177 /** @defgroup EXTI_LL_EC_MODE Mode
178 * @{
179 */
180 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
181 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
182 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
183 /**
184 * @}
185 */
186
187 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
188 * @{
189 */
190 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
191 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
192 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
193 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
194
195 /**
196 * @}
197 */
198
199
200 #endif /*USE_FULL_LL_DRIVER*/
201
202
203 /**
204 * @}
205 */
206
207 /* Exported macro ------------------------------------------------------------*/
208 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
209 * @{
210 */
211
212 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
213 * @{
214 */
215
216 /**
217 * @brief Write a value in EXTI register
218 * @param __REG__ Register to be written
219 * @param __VALUE__ Value to be written in the register
220 * @retval None
221 */
222 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
223
224 /**
225 * @brief Read a value in EXTI register
226 * @param __REG__ Register to be read
227 * @retval Register value
228 */
229 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
230 /**
231 * @}
232 */
233
234
235 /**
236 * @}
237 */
238
239
240
241 /* Exported functions --------------------------------------------------------*/
242 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
243 * @{
244 */
245 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
246 * @{
247 */
248
249 /**
250 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
251 * @note The reset value for the direct or internal lines (see RM)
252 * is set to 1 in order to enable the interrupt by default.
253 * Bits are set automatically at Power on.
254 * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31
255 * @param ExtiLine This parameter can be one of the following values:
256 * @arg @ref LL_EXTI_LINE_0
257 * @arg @ref LL_EXTI_LINE_1
258 * @arg @ref LL_EXTI_LINE_2
259 * @arg @ref LL_EXTI_LINE_3
260 * @arg @ref LL_EXTI_LINE_4
261 * @arg @ref LL_EXTI_LINE_5
262 * @arg @ref LL_EXTI_LINE_6
263 * @arg @ref LL_EXTI_LINE_7
264 * @arg @ref LL_EXTI_LINE_8
265 * @arg @ref LL_EXTI_LINE_9
266 * @arg @ref LL_EXTI_LINE_10
267 * @arg @ref LL_EXTI_LINE_11
268 * @arg @ref LL_EXTI_LINE_12
269 * @arg @ref LL_EXTI_LINE_13
270 * @arg @ref LL_EXTI_LINE_14
271 * @arg @ref LL_EXTI_LINE_15
272 * @arg @ref LL_EXTI_LINE_16
273 * @arg @ref LL_EXTI_LINE_17
274 * @arg @ref LL_EXTI_LINE_18
275 * @arg @ref LL_EXTI_LINE_19(*)
276 * @arg @ref LL_EXTI_LINE_20(*)
277 * @arg @ref LL_EXTI_LINE_21
278 * @arg @ref LL_EXTI_LINE_22
279 * @arg @ref LL_EXTI_LINE_23(*)
280 * @arg @ref LL_EXTI_LINE_ALL_0_31
281 * @note (*): Available in some devices
282 * @note Please check each device line mapping for EXTI Line availability
283 * @retval None
284 */
285 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
286 {
287 SET_BIT(EXTI->IMR, ExtiLine);
288 }
289
290 /**
291 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
292 * @note The reset value for the direct or internal lines (see RM)
293 * is set to 1 in order to enable the interrupt by default.
294 * Bits are set automatically at Power on.
295 * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31
296 * @param ExtiLine This parameter can be one of the following values:
297 * @arg @ref LL_EXTI_LINE_0
298 * @arg @ref LL_EXTI_LINE_1
299 * @arg @ref LL_EXTI_LINE_2
300 * @arg @ref LL_EXTI_LINE_3
301 * @arg @ref LL_EXTI_LINE_4
302 * @arg @ref LL_EXTI_LINE_5
303 * @arg @ref LL_EXTI_LINE_6
304 * @arg @ref LL_EXTI_LINE_7
305 * @arg @ref LL_EXTI_LINE_8
306 * @arg @ref LL_EXTI_LINE_9
307 * @arg @ref LL_EXTI_LINE_10
308 * @arg @ref LL_EXTI_LINE_11
309 * @arg @ref LL_EXTI_LINE_12
310 * @arg @ref LL_EXTI_LINE_13
311 * @arg @ref LL_EXTI_LINE_14
312 * @arg @ref LL_EXTI_LINE_15
313 * @arg @ref LL_EXTI_LINE_16
314 * @arg @ref LL_EXTI_LINE_17
315 * @arg @ref LL_EXTI_LINE_18
316 * @arg @ref LL_EXTI_LINE_19(*)
317 * @arg @ref LL_EXTI_LINE_20(*)
318 * @arg @ref LL_EXTI_LINE_21
319 * @arg @ref LL_EXTI_LINE_22
320 * @arg @ref LL_EXTI_LINE_23(*)
321 * @arg @ref LL_EXTI_LINE_ALL_0_31
322 * @note (*): Available in some devices
323 * @note Please check each device line mapping for EXTI Line availability
324 * @retval None
325 */
326 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
327 {
328 CLEAR_BIT(EXTI->IMR, ExtiLine);
329 }
330
331
332 /**
333 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
334 * @note The reset value for the direct or internal lines (see RM)
335 * is set to 1 in order to enable the interrupt by default.
336 * Bits are set automatically at Power on.
337 * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31
338 * @param ExtiLine This parameter can be one of the following values:
339 * @arg @ref LL_EXTI_LINE_0
340 * @arg @ref LL_EXTI_LINE_1
341 * @arg @ref LL_EXTI_LINE_2
342 * @arg @ref LL_EXTI_LINE_3
343 * @arg @ref LL_EXTI_LINE_4
344 * @arg @ref LL_EXTI_LINE_5
345 * @arg @ref LL_EXTI_LINE_6
346 * @arg @ref LL_EXTI_LINE_7
347 * @arg @ref LL_EXTI_LINE_8
348 * @arg @ref LL_EXTI_LINE_9
349 * @arg @ref LL_EXTI_LINE_10
350 * @arg @ref LL_EXTI_LINE_11
351 * @arg @ref LL_EXTI_LINE_12
352 * @arg @ref LL_EXTI_LINE_13
353 * @arg @ref LL_EXTI_LINE_14
354 * @arg @ref LL_EXTI_LINE_15
355 * @arg @ref LL_EXTI_LINE_16
356 * @arg @ref LL_EXTI_LINE_17
357 * @arg @ref LL_EXTI_LINE_18
358 * @arg @ref LL_EXTI_LINE_19(*)
359 * @arg @ref LL_EXTI_LINE_20(*)
360 * @arg @ref LL_EXTI_LINE_21
361 * @arg @ref LL_EXTI_LINE_22
362 * @arg @ref LL_EXTI_LINE_23(*)
363 * @arg @ref LL_EXTI_LINE_ALL_0_31
364 * @note (*): Available in some devices
365 * @note Please check each device line mapping for EXTI Line availability
366 * @retval State of bit (1 or 0).
367 */
368 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
369 {
370 return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine));
371 }
372
373
374 /**
375 * @}
376 */
377
378 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
379 * @{
380 */
381
382 /**
383 * @brief Enable ExtiLine Event request for Lines in range 0 to 31
384 * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31
385 * @param ExtiLine This parameter can be one of the following values:
386 * @arg @ref LL_EXTI_LINE_0
387 * @arg @ref LL_EXTI_LINE_1
388 * @arg @ref LL_EXTI_LINE_2
389 * @arg @ref LL_EXTI_LINE_3
390 * @arg @ref LL_EXTI_LINE_4
391 * @arg @ref LL_EXTI_LINE_5
392 * @arg @ref LL_EXTI_LINE_6
393 * @arg @ref LL_EXTI_LINE_7
394 * @arg @ref LL_EXTI_LINE_8
395 * @arg @ref LL_EXTI_LINE_9
396 * @arg @ref LL_EXTI_LINE_10
397 * @arg @ref LL_EXTI_LINE_11
398 * @arg @ref LL_EXTI_LINE_12
399 * @arg @ref LL_EXTI_LINE_13
400 * @arg @ref LL_EXTI_LINE_14
401 * @arg @ref LL_EXTI_LINE_15
402 * @arg @ref LL_EXTI_LINE_16
403 * @arg @ref LL_EXTI_LINE_17
404 * @arg @ref LL_EXTI_LINE_18
405 * @arg @ref LL_EXTI_LINE_19(*)
406 * @arg @ref LL_EXTI_LINE_20(*)
407 * @arg @ref LL_EXTI_LINE_21
408 * @arg @ref LL_EXTI_LINE_22
409 * @arg @ref LL_EXTI_LINE_23(*)
410 * @arg @ref LL_EXTI_LINE_ALL_0_31
411 * @note (*): Available in some devices
412 * @note Please check each device line mapping for EXTI Line availability
413 * @retval None
414 */
415 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
416 {
417 SET_BIT(EXTI->EMR, ExtiLine);
418
419 }
420
421
422 /**
423 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
424 * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31
425 * @param ExtiLine This parameter can be one of the following values:
426 * @arg @ref LL_EXTI_LINE_0
427 * @arg @ref LL_EXTI_LINE_1
428 * @arg @ref LL_EXTI_LINE_2
429 * @arg @ref LL_EXTI_LINE_3
430 * @arg @ref LL_EXTI_LINE_4
431 * @arg @ref LL_EXTI_LINE_5
432 * @arg @ref LL_EXTI_LINE_6
433 * @arg @ref LL_EXTI_LINE_7
434 * @arg @ref LL_EXTI_LINE_8
435 * @arg @ref LL_EXTI_LINE_9
436 * @arg @ref LL_EXTI_LINE_10
437 * @arg @ref LL_EXTI_LINE_11
438 * @arg @ref LL_EXTI_LINE_12
439 * @arg @ref LL_EXTI_LINE_13
440 * @arg @ref LL_EXTI_LINE_14
441 * @arg @ref LL_EXTI_LINE_15
442 * @arg @ref LL_EXTI_LINE_16
443 * @arg @ref LL_EXTI_LINE_17
444 * @arg @ref LL_EXTI_LINE_18
445 * @arg @ref LL_EXTI_LINE_19(*)
446 * @arg @ref LL_EXTI_LINE_20(*)
447 * @arg @ref LL_EXTI_LINE_21
448 * @arg @ref LL_EXTI_LINE_22
449 * @arg @ref LL_EXTI_LINE_23(*)
450 * @arg @ref LL_EXTI_LINE_ALL_0_31
451 * @note (*): Available in some devices
452 * @note Please check each device line mapping for EXTI Line availability
453 * @retval None
454 */
455 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
456 {
457 CLEAR_BIT(EXTI->EMR, ExtiLine);
458 }
459
460
461 /**
462 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
463 * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31
464 * @param ExtiLine This parameter can be one of the following values:
465 * @arg @ref LL_EXTI_LINE_0
466 * @arg @ref LL_EXTI_LINE_1
467 * @arg @ref LL_EXTI_LINE_2
468 * @arg @ref LL_EXTI_LINE_3
469 * @arg @ref LL_EXTI_LINE_4
470 * @arg @ref LL_EXTI_LINE_5
471 * @arg @ref LL_EXTI_LINE_6
472 * @arg @ref LL_EXTI_LINE_7
473 * @arg @ref LL_EXTI_LINE_8
474 * @arg @ref LL_EXTI_LINE_9
475 * @arg @ref LL_EXTI_LINE_10
476 * @arg @ref LL_EXTI_LINE_11
477 * @arg @ref LL_EXTI_LINE_12
478 * @arg @ref LL_EXTI_LINE_13
479 * @arg @ref LL_EXTI_LINE_14
480 * @arg @ref LL_EXTI_LINE_15
481 * @arg @ref LL_EXTI_LINE_16
482 * @arg @ref LL_EXTI_LINE_17
483 * @arg @ref LL_EXTI_LINE_18
484 * @arg @ref LL_EXTI_LINE_19(*)
485 * @arg @ref LL_EXTI_LINE_20(*)
486 * @arg @ref LL_EXTI_LINE_21
487 * @arg @ref LL_EXTI_LINE_22
488 * @arg @ref LL_EXTI_LINE_23(*)
489 * @arg @ref LL_EXTI_LINE_ALL_0_31
490 * @note (*): Available in some devices
491 * @note Please check each device line mapping for EXTI Line availability
492 * @retval State of bit (1 or 0).
493 */
494 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
495 {
496 return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine));
497
498 }
499
500
501 /**
502 * @}
503 */
504
505 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
506 * @{
507 */
508
509 /**
510 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
511 * @note The configurable wakeup lines are edge-triggered. No glitch must be
512 * generated on these lines. If a rising edge on a configurable interrupt
513 * line occurs during a write operation in the EXTI_RTSR register, the
514 * pending bit is not set.
515 * Rising and falling edge triggers can be set for
516 * the same interrupt line. In this case, both generate a trigger
517 * condition.
518 * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31
519 * @param ExtiLine This parameter can be a combination of the following values:
520 * @arg @ref LL_EXTI_LINE_0
521 * @arg @ref LL_EXTI_LINE_1
522 * @arg @ref LL_EXTI_LINE_2
523 * @arg @ref LL_EXTI_LINE_3
524 * @arg @ref LL_EXTI_LINE_4
525 * @arg @ref LL_EXTI_LINE_5
526 * @arg @ref LL_EXTI_LINE_6
527 * @arg @ref LL_EXTI_LINE_7
528 * @arg @ref LL_EXTI_LINE_8
529 * @arg @ref LL_EXTI_LINE_9
530 * @arg @ref LL_EXTI_LINE_10
531 * @arg @ref LL_EXTI_LINE_11
532 * @arg @ref LL_EXTI_LINE_12
533 * @arg @ref LL_EXTI_LINE_13
534 * @arg @ref LL_EXTI_LINE_14
535 * @arg @ref LL_EXTI_LINE_15
536 * @arg @ref LL_EXTI_LINE_16
537 * @arg @ref LL_EXTI_LINE_18
538 * @arg @ref LL_EXTI_LINE_19(*)
539 * @arg @ref LL_EXTI_LINE_20(*)
540 * @arg @ref LL_EXTI_LINE_21
541 * @arg @ref LL_EXTI_LINE_22
542 * @note (*): Available in some devices
543 * @note Please check each device line mapping for EXTI Line availability
544 * @retval None
545 */
546 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
547 {
548 SET_BIT(EXTI->RTSR, ExtiLine);
549
550 }
551
552
553 /**
554 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
555 * @note The configurable wakeup lines are edge-triggered. No glitch must be
556 * generated on these lines. If a rising edge on a configurable interrupt
557 * line occurs during a write operation in the EXTI_RTSR register, the
558 * pending bit is not set.
559 * Rising and falling edge triggers can be set for
560 * the same interrupt line. In this case, both generate a trigger
561 * condition.
562 * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31
563 * @param ExtiLine This parameter can be a combination of the following values:
564 * @arg @ref LL_EXTI_LINE_0
565 * @arg @ref LL_EXTI_LINE_1
566 * @arg @ref LL_EXTI_LINE_2
567 * @arg @ref LL_EXTI_LINE_3
568 * @arg @ref LL_EXTI_LINE_4
569 * @arg @ref LL_EXTI_LINE_5
570 * @arg @ref LL_EXTI_LINE_6
571 * @arg @ref LL_EXTI_LINE_7
572 * @arg @ref LL_EXTI_LINE_8
573 * @arg @ref LL_EXTI_LINE_9
574 * @arg @ref LL_EXTI_LINE_10
575 * @arg @ref LL_EXTI_LINE_11
576 * @arg @ref LL_EXTI_LINE_12
577 * @arg @ref LL_EXTI_LINE_13
578 * @arg @ref LL_EXTI_LINE_14
579 * @arg @ref LL_EXTI_LINE_15
580 * @arg @ref LL_EXTI_LINE_16
581 * @arg @ref LL_EXTI_LINE_18
582 * @arg @ref LL_EXTI_LINE_19(*)
583 * @arg @ref LL_EXTI_LINE_20(*)
584 * @arg @ref LL_EXTI_LINE_21
585 * @arg @ref LL_EXTI_LINE_22
586 * @note (*): Available in some devices
587 * @note Please check each device line mapping for EXTI Line availability
588 * @retval None
589 */
590 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
591 {
592 CLEAR_BIT(EXTI->RTSR, ExtiLine);
593
594 }
595
596
597 /**
598 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
599 * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31
600 * @param ExtiLine This parameter can be a combination of the following values:
601 * @arg @ref LL_EXTI_LINE_0
602 * @arg @ref LL_EXTI_LINE_1
603 * @arg @ref LL_EXTI_LINE_2
604 * @arg @ref LL_EXTI_LINE_3
605 * @arg @ref LL_EXTI_LINE_4
606 * @arg @ref LL_EXTI_LINE_5
607 * @arg @ref LL_EXTI_LINE_6
608 * @arg @ref LL_EXTI_LINE_7
609 * @arg @ref LL_EXTI_LINE_8
610 * @arg @ref LL_EXTI_LINE_9
611 * @arg @ref LL_EXTI_LINE_10
612 * @arg @ref LL_EXTI_LINE_11
613 * @arg @ref LL_EXTI_LINE_12
614 * @arg @ref LL_EXTI_LINE_13
615 * @arg @ref LL_EXTI_LINE_14
616 * @arg @ref LL_EXTI_LINE_15
617 * @arg @ref LL_EXTI_LINE_16
618 * @arg @ref LL_EXTI_LINE_18
619 * @arg @ref LL_EXTI_LINE_19(*)
620 * @arg @ref LL_EXTI_LINE_20(*)
621 * @arg @ref LL_EXTI_LINE_21
622 * @arg @ref LL_EXTI_LINE_22
623 * @note (*): Available in some devices
624 * @note Please check each device line mapping for EXTI Line availability
625 * @retval State of bit (1 or 0).
626 */
627 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
628 {
629 return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine));
630 }
631
632
633 /**
634 * @}
635 */
636
637 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
638 * @{
639 */
640
641 /**
642 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
643 * @note The configurable wakeup lines are edge-triggered. No glitch must be
644 * generated on these lines. If a falling edge on a configurable interrupt
645 * line occurs during a write operation in the EXTI_FTSR register, the
646 * pending bit is not set.
647 * Rising and falling edge triggers can be set for
648 * the same interrupt line. In this case, both generate a trigger
649 * condition.
650 * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_0_31
651 * @param ExtiLine This parameter can be a combination of the following values:
652 * @arg @ref LL_EXTI_LINE_0
653 * @arg @ref LL_EXTI_LINE_1
654 * @arg @ref LL_EXTI_LINE_2
655 * @arg @ref LL_EXTI_LINE_3
656 * @arg @ref LL_EXTI_LINE_4
657 * @arg @ref LL_EXTI_LINE_5
658 * @arg @ref LL_EXTI_LINE_6
659 * @arg @ref LL_EXTI_LINE_7
660 * @arg @ref LL_EXTI_LINE_8
661 * @arg @ref LL_EXTI_LINE_9
662 * @arg @ref LL_EXTI_LINE_10
663 * @arg @ref LL_EXTI_LINE_11
664 * @arg @ref LL_EXTI_LINE_12
665 * @arg @ref LL_EXTI_LINE_13
666 * @arg @ref LL_EXTI_LINE_14
667 * @arg @ref LL_EXTI_LINE_15
668 * @arg @ref LL_EXTI_LINE_16
669 * @arg @ref LL_EXTI_LINE_18
670 * @arg @ref LL_EXTI_LINE_19(*)
671 * @arg @ref LL_EXTI_LINE_20(*)
672 * @arg @ref LL_EXTI_LINE_21
673 * @arg @ref LL_EXTI_LINE_22
674 * @note (*): Available in some devices
675 * @note Please check each device line mapping for EXTI Line availability
676 * @retval None
677 */
678 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
679 {
680 SET_BIT(EXTI->FTSR, ExtiLine);
681 }
682
683
684 /**
685 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
686 * @note The configurable wakeup lines are edge-triggered. No glitch must be
687 * generated on these lines. If a Falling edge on a configurable interrupt
688 * line occurs during a write operation in the EXTI_FTSR register, the
689 * pending bit is not set.
690 * Rising and falling edge triggers can be set for the same interrupt line.
691 * In this case, both generate a trigger condition.
692 * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31
693 * @param ExtiLine This parameter can be a combination of the following values:
694 * @arg @ref LL_EXTI_LINE_0
695 * @arg @ref LL_EXTI_LINE_1
696 * @arg @ref LL_EXTI_LINE_2
697 * @arg @ref LL_EXTI_LINE_3
698 * @arg @ref LL_EXTI_LINE_4
699 * @arg @ref LL_EXTI_LINE_5
700 * @arg @ref LL_EXTI_LINE_6
701 * @arg @ref LL_EXTI_LINE_7
702 * @arg @ref LL_EXTI_LINE_8
703 * @arg @ref LL_EXTI_LINE_9
704 * @arg @ref LL_EXTI_LINE_10
705 * @arg @ref LL_EXTI_LINE_11
706 * @arg @ref LL_EXTI_LINE_12
707 * @arg @ref LL_EXTI_LINE_13
708 * @arg @ref LL_EXTI_LINE_14
709 * @arg @ref LL_EXTI_LINE_15
710 * @arg @ref LL_EXTI_LINE_16
711 * @arg @ref LL_EXTI_LINE_18
712 * @arg @ref LL_EXTI_LINE_19(*)
713 * @arg @ref LL_EXTI_LINE_20(*)
714 * @arg @ref LL_EXTI_LINE_21
715 * @arg @ref LL_EXTI_LINE_22
716 * @note (*): Available in some devices
717 * @note Please check each device line mapping for EXTI Line availability
718 * @retval None
719 */
720 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
721 {
722 CLEAR_BIT(EXTI->FTSR, ExtiLine);
723 }
724
725
726 /**
727 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
728 * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31
729 * @param ExtiLine This parameter can be a combination of the following values:
730 * @arg @ref LL_EXTI_LINE_0
731 * @arg @ref LL_EXTI_LINE_1
732 * @arg @ref LL_EXTI_LINE_2
733 * @arg @ref LL_EXTI_LINE_3
734 * @arg @ref LL_EXTI_LINE_4
735 * @arg @ref LL_EXTI_LINE_5
736 * @arg @ref LL_EXTI_LINE_6
737 * @arg @ref LL_EXTI_LINE_7
738 * @arg @ref LL_EXTI_LINE_8
739 * @arg @ref LL_EXTI_LINE_9
740 * @arg @ref LL_EXTI_LINE_10
741 * @arg @ref LL_EXTI_LINE_11
742 * @arg @ref LL_EXTI_LINE_12
743 * @arg @ref LL_EXTI_LINE_13
744 * @arg @ref LL_EXTI_LINE_14
745 * @arg @ref LL_EXTI_LINE_15
746 * @arg @ref LL_EXTI_LINE_16
747 * @arg @ref LL_EXTI_LINE_18
748 * @arg @ref LL_EXTI_LINE_19(*)
749 * @arg @ref LL_EXTI_LINE_20(*)
750 * @arg @ref LL_EXTI_LINE_21
751 * @arg @ref LL_EXTI_LINE_22
752 * @note (*): Available in some devices
753 * @note Please check each device line mapping for EXTI Line availability
754 * @retval State of bit (1 or 0).
755 */
756 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
757 {
758 return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine));
759 }
760
761
762 /**
763 * @}
764 */
765
766 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
767 * @{
768 */
769
770 /**
771 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
772 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
773 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
774 * resulting in an interrupt request generation.
775 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
776 * register (by writing a 1 into the bit)
777 * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31
778 * @param ExtiLine This parameter can be a combination of the following values:
779 * @arg @ref LL_EXTI_LINE_0
780 * @arg @ref LL_EXTI_LINE_1
781 * @arg @ref LL_EXTI_LINE_2
782 * @arg @ref LL_EXTI_LINE_3
783 * @arg @ref LL_EXTI_LINE_4
784 * @arg @ref LL_EXTI_LINE_5
785 * @arg @ref LL_EXTI_LINE_6
786 * @arg @ref LL_EXTI_LINE_7
787 * @arg @ref LL_EXTI_LINE_8
788 * @arg @ref LL_EXTI_LINE_9
789 * @arg @ref LL_EXTI_LINE_10
790 * @arg @ref LL_EXTI_LINE_11
791 * @arg @ref LL_EXTI_LINE_12
792 * @arg @ref LL_EXTI_LINE_13
793 * @arg @ref LL_EXTI_LINE_14
794 * @arg @ref LL_EXTI_LINE_15
795 * @arg @ref LL_EXTI_LINE_16
796 * @arg @ref LL_EXTI_LINE_18
797 * @arg @ref LL_EXTI_LINE_19(*)
798 * @arg @ref LL_EXTI_LINE_20(*)
799 * @arg @ref LL_EXTI_LINE_21
800 * @arg @ref LL_EXTI_LINE_22
801 * @note (*): Available in some devices
802 * @note Please check each device line mapping for EXTI Line availability
803 * @retval None
804 */
805 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
806 {
807 SET_BIT(EXTI->SWIER, ExtiLine);
808 }
809
810
811 /**
812 * @}
813 */
814
815 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
816 * @{
817 */
818
819 /**
820 * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31
821 * @note This bit is set when the selected edge event arrives on the interrupt
822 * line. This bit is cleared by writing a 1 to the bit.
823 * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_0_31
824 * @param ExtiLine This parameter can be a combination of the following values:
825 * @arg @ref LL_EXTI_LINE_0
826 * @arg @ref LL_EXTI_LINE_1
827 * @arg @ref LL_EXTI_LINE_2
828 * @arg @ref LL_EXTI_LINE_3
829 * @arg @ref LL_EXTI_LINE_4
830 * @arg @ref LL_EXTI_LINE_5
831 * @arg @ref LL_EXTI_LINE_6
832 * @arg @ref LL_EXTI_LINE_7
833 * @arg @ref LL_EXTI_LINE_8
834 * @arg @ref LL_EXTI_LINE_9
835 * @arg @ref LL_EXTI_LINE_10
836 * @arg @ref LL_EXTI_LINE_11
837 * @arg @ref LL_EXTI_LINE_12
838 * @arg @ref LL_EXTI_LINE_13
839 * @arg @ref LL_EXTI_LINE_14
840 * @arg @ref LL_EXTI_LINE_15
841 * @arg @ref LL_EXTI_LINE_16
842 * @arg @ref LL_EXTI_LINE_18
843 * @arg @ref LL_EXTI_LINE_19(*)
844 * @arg @ref LL_EXTI_LINE_20(*)
845 * @arg @ref LL_EXTI_LINE_21
846 * @arg @ref LL_EXTI_LINE_22
847 * @note (*): Available in some devices
848 * @note Please check each device line mapping for EXTI Line availability
849 * @retval State of bit (1 or 0).
850 */
851 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine)
852 {
853 return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine));
854 }
855
856
857 /**
858 * @brief Read ExtLine Combination Flag for Lines in range 0 to 31
859 * @note This bit is set when the selected edge event arrives on the interrupt
860 * line. This bit is cleared by writing a 1 to the bit.
861 * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31
862 * @param ExtiLine This parameter can be a combination of the following values:
863 * @arg @ref LL_EXTI_LINE_0
864 * @arg @ref LL_EXTI_LINE_1
865 * @arg @ref LL_EXTI_LINE_2
866 * @arg @ref LL_EXTI_LINE_3
867 * @arg @ref LL_EXTI_LINE_4
868 * @arg @ref LL_EXTI_LINE_5
869 * @arg @ref LL_EXTI_LINE_6
870 * @arg @ref LL_EXTI_LINE_7
871 * @arg @ref LL_EXTI_LINE_8
872 * @arg @ref LL_EXTI_LINE_9
873 * @arg @ref LL_EXTI_LINE_10
874 * @arg @ref LL_EXTI_LINE_11
875 * @arg @ref LL_EXTI_LINE_12
876 * @arg @ref LL_EXTI_LINE_13
877 * @arg @ref LL_EXTI_LINE_14
878 * @arg @ref LL_EXTI_LINE_15
879 * @arg @ref LL_EXTI_LINE_16
880 * @arg @ref LL_EXTI_LINE_18
881 * @arg @ref LL_EXTI_LINE_19(*)
882 * @arg @ref LL_EXTI_LINE_20(*)
883 * @arg @ref LL_EXTI_LINE_21
884 * @arg @ref LL_EXTI_LINE_22
885 * @note (*): Available in some devices
886 * @note Please check each device line mapping for EXTI Line availability
887 * @retval @note This bit is set when the selected edge event arrives on the interrupt
888 */
889 __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine)
890 {
891 return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine));
892 }
893
894
895 /**
896 * @brief Clear ExtLine Flags for Lines in range 0 to 31
897 * @note This bit is set when the selected edge event arrives on the interrupt
898 * line. This bit is cleared by writing a 1 to the bit.
899 * @rmtoll PR PIFx LL_EXTI_ClearFlag_0_31
900 * @param ExtiLine This parameter can be a combination of the following values:
901 * @arg @ref LL_EXTI_LINE_0
902 * @arg @ref LL_EXTI_LINE_1
903 * @arg @ref LL_EXTI_LINE_2
904 * @arg @ref LL_EXTI_LINE_3
905 * @arg @ref LL_EXTI_LINE_4
906 * @arg @ref LL_EXTI_LINE_5
907 * @arg @ref LL_EXTI_LINE_6
908 * @arg @ref LL_EXTI_LINE_7
909 * @arg @ref LL_EXTI_LINE_8
910 * @arg @ref LL_EXTI_LINE_9
911 * @arg @ref LL_EXTI_LINE_10
912 * @arg @ref LL_EXTI_LINE_11
913 * @arg @ref LL_EXTI_LINE_12
914 * @arg @ref LL_EXTI_LINE_13
915 * @arg @ref LL_EXTI_LINE_14
916 * @arg @ref LL_EXTI_LINE_15
917 * @arg @ref LL_EXTI_LINE_16
918 * @arg @ref LL_EXTI_LINE_18
919 * @arg @ref LL_EXTI_LINE_19(*)
920 * @arg @ref LL_EXTI_LINE_20(*)
921 * @arg @ref LL_EXTI_LINE_21
922 * @arg @ref LL_EXTI_LINE_22
923 * @note (*): Available in some devices
924 * @note Please check each device line mapping for EXTI Line availability
925 * @retval None
926 */
927 __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine)
928 {
929 WRITE_REG(EXTI->PR, ExtiLine);
930 }
931
932
933 /**
934 * @}
935 */
936
937 #if defined(USE_FULL_LL_DRIVER)
938 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
939 * @{
940 */
941
942 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
943 uint32_t LL_EXTI_DeInit(void);
944 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
945
946
947 /**
948 * @}
949 */
950 #endif /* USE_FULL_LL_DRIVER */
951
952 /**
953 * @}
954 */
955
956 /**
957 * @}
958 */
959
960 #endif /* EXTI */
961
962 /**
963 * @}
964 */
965
966 #ifdef __cplusplus
967 }
968 #endif
969
970 #endif /* __STM32F4xx_LL_EXTI_H */
971
972 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/