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