1 /**
2   ******************************************************************************
3   * @file    stm32f3xx_ll_exti.h
4   * @author  MCD Application Team
5   * @brief   Header file of EXTI LL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2016 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 __STM32F3xx_LL_EXTI_H
21 #define __STM32F3xx_LL_EXTI_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f3xx.h"
29 
30 /** @addtogroup STM32F3xx_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 #if defined(EXTI_32_63_SUPPORT)
63 
64   uint32_t Line_32_63;          /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 32 to 63
65                                      This parameter can be any combination of @ref EXTI_LL_EC_LINE */
66 #endif
67 
68   FunctionalState LineCommand;  /*!< Specifies the new state of the selected EXTI lines.
69                                      This parameter can be set either to ENABLE or DISABLE */
70 
71   uint8_t Mode;                 /*!< Specifies the mode for the EXTI lines.
72                                      This parameter can be a value of @ref EXTI_LL_EC_MODE. */
73 
74   uint8_t Trigger;              /*!< Specifies the trigger signal active edge for the EXTI lines.
75                                      This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
76 } LL_EXTI_InitTypeDef;
77 
78 /**
79   * @}
80   */
81 #endif /*USE_FULL_LL_DRIVER*/
82 
83 /* Exported constants --------------------------------------------------------*/
84 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
85   * @{
86   */
87 
88 /** @defgroup EXTI_LL_EC_LINE LINE
89   * @{
90   */
91 #define LL_EXTI_LINE_0                 EXTI_IMR_IM0           /*!< Extended line 0 */
92 #define LL_EXTI_LINE_1                 EXTI_IMR_IM1           /*!< Extended line 1 */
93 #define LL_EXTI_LINE_2                 EXTI_IMR_IM2           /*!< Extended line 2 */
94 #define LL_EXTI_LINE_3                 EXTI_IMR_IM3           /*!< Extended line 3 */
95 #define LL_EXTI_LINE_4                 EXTI_IMR_IM4           /*!< Extended line 4 */
96 #define LL_EXTI_LINE_5                 EXTI_IMR_IM5           /*!< Extended line 5 */
97 #define LL_EXTI_LINE_6                 EXTI_IMR_IM6           /*!< Extended line 6 */
98 #define LL_EXTI_LINE_7                 EXTI_IMR_IM7           /*!< Extended line 7 */
99 #define LL_EXTI_LINE_8                 EXTI_IMR_IM8           /*!< Extended line 8 */
100 #define LL_EXTI_LINE_9                 EXTI_IMR_IM9           /*!< Extended line 9 */
101 #define LL_EXTI_LINE_10                EXTI_IMR_IM10          /*!< Extended line 10 */
102 #define LL_EXTI_LINE_11                EXTI_IMR_IM11          /*!< Extended line 11 */
103 #define LL_EXTI_LINE_12                EXTI_IMR_IM12          /*!< Extended line 12 */
104 #define LL_EXTI_LINE_13                EXTI_IMR_IM13          /*!< Extended line 13 */
105 #define LL_EXTI_LINE_14                EXTI_IMR_IM14          /*!< Extended line 14 */
106 #define LL_EXTI_LINE_15                EXTI_IMR_IM15          /*!< Extended line 15 */
107 #if defined(EXTI_IMR_IM16)
108 #define LL_EXTI_LINE_16                EXTI_IMR_IM16          /*!< Extended line 16 */
109 #endif
110 #define LL_EXTI_LINE_17                EXTI_IMR_IM17          /*!< Extended line 17 */
111 #if defined(EXTI_IMR_IM18)
112 #define LL_EXTI_LINE_18                EXTI_IMR_IM18          /*!< Extended line 18 */
113 #endif
114 #define LL_EXTI_LINE_19                EXTI_IMR_IM19          /*!< Extended line 19 */
115 #if defined(EXTI_IMR_IM20)
116 #define LL_EXTI_LINE_20                EXTI_IMR_IM20          /*!< Extended line 20 */
117 #endif
118 #if defined(EXTI_IMR_IM21)
119 #define LL_EXTI_LINE_21                EXTI_IMR_IM21          /*!< Extended line 21 */
120 #endif
121 #if defined(EXTI_IMR_IM22)
122 #define LL_EXTI_LINE_22                EXTI_IMR_IM22          /*!< Extended line 22 */
123 #endif
124 #define LL_EXTI_LINE_23                EXTI_IMR_IM23          /*!< Extended line 23 */
125 #if defined(EXTI_IMR_IM24)
126 #define LL_EXTI_LINE_24                EXTI_IMR_IM24          /*!< Extended line 24 */
127 #endif
128 #if defined(EXTI_IMR_IM25)
129 #define LL_EXTI_LINE_25                EXTI_IMR_IM25          /*!< Extended line 25 */
130 #endif
131 #if defined(EXTI_IMR_IM26)
132 #define LL_EXTI_LINE_26                EXTI_IMR_IM26          /*!< Extended line 26 */
133 #endif
134 #if defined(EXTI_IMR_IM27)
135 #define LL_EXTI_LINE_27                EXTI_IMR_IM27          /*!< Extended line 27 */
136 #endif
137 #if defined(EXTI_IMR_IM28)
138 #define LL_EXTI_LINE_28                EXTI_IMR_IM28          /*!< Extended line 28 */
139 #endif
140 #if defined(EXTI_IMR_IM29)
141 #define LL_EXTI_LINE_29                EXTI_IMR_IM29          /*!< Extended line 29 */
142 #endif
143 #if defined(EXTI_IMR_IM30)
144 #define LL_EXTI_LINE_30                EXTI_IMR_IM30          /*!< Extended line 30 */
145 #endif
146 #if defined(EXTI_IMR_IM31)
147 #define LL_EXTI_LINE_31                EXTI_IMR_IM31          /*!< Extended line 31 */
148 #endif
149 #define LL_EXTI_LINE_ALL_0_31          EXTI_IMR_IM            /*!< All Extended line not reserved*/
150 
151 #if defined(EXTI_32_63_SUPPORT)
152 #define LL_EXTI_LINE_32                EXTI_IMR2_IM32          /*!< Extended line 32 */
153 #if defined(EXTI_IMR2_IM33)
154 #define LL_EXTI_LINE_33                EXTI_IMR2_IM33          /*!< Extended line 33 */
155 #endif
156 #if defined(EXTI_IMR2_IM34)
157 #define LL_EXTI_LINE_34                EXTI_IMR2_IM34          /*!< Extended line 34 */
158 #endif
159 #if defined(EXTI_IMR2_IM35)
160 #define LL_EXTI_LINE_35                EXTI_IMR2_IM35          /*!< Extended line 35 */
161 #endif
162 #if defined(EXTI_IMR2_IM36)
163 #define LL_EXTI_LINE_36                EXTI_IMR2_IM36          /*!< Extended line 36 */
164 #endif
165 #if defined(EXTI_IMR2_IM37)
166 #define LL_EXTI_LINE_37                EXTI_IMR2_IM37          /*!< Extended line 37 */
167 #endif
168 #if defined(EXTI_IMR2_IM38)
169 #define LL_EXTI_LINE_38                EXTI_IMR2_IM38          /*!< Extended line 38 */
170 #endif
171 #if defined(EXTI_IMR2_IM39)
172 #define LL_EXTI_LINE_39                EXTI_IMR2_IM39          /*!< Extended line 39 */
173 #endif
174 #if defined(EXTI_IMR2_IM40)
175 #define LL_EXTI_LINE_40                EXTI_IMR2_IM40          /*!< Extended line 40 */
176 #endif
177 #define LL_EXTI_LINE_ALL_32_63         EXTI_IMR2_IM            /*!< All Extended line not reserved*/
178 
179 #endif
180 
181 #define LL_EXTI_LINE_ALL               (0xFFFFFFFFU)  /*!< All Extended line */
182 
183 #if defined(USE_FULL_LL_DRIVER)
184 #define LL_EXTI_LINE_NONE              (0x00000000U)  /*!< None Extended line */
185 #endif /*USE_FULL_LL_DRIVER*/
186 
187 /**
188   * @}
189   */
190 #if defined(USE_FULL_LL_DRIVER)
191 
192 /** @defgroup EXTI_LL_EC_MODE Mode
193   * @{
194   */
195 #define LL_EXTI_MODE_IT                 ((uint8_t)0x00U) /*!< Interrupt Mode */
196 #define LL_EXTI_MODE_EVENT              ((uint8_t)0x01U) /*!< Event Mode */
197 #define LL_EXTI_MODE_IT_EVENT           ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
198 /**
199   * @}
200   */
201 
202 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
203   * @{
204   */
205 #define LL_EXTI_TRIGGER_NONE            ((uint8_t)0x00U) /*!< No Trigger Mode */
206 #define LL_EXTI_TRIGGER_RISING          ((uint8_t)0x01U) /*!< Trigger Rising Mode */
207 #define LL_EXTI_TRIGGER_FALLING         ((uint8_t)0x02U) /*!< Trigger Falling Mode */
208 #define LL_EXTI_TRIGGER_RISING_FALLING  ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
209 
210 /**
211   * @}
212   */
213 
214 
215 #endif /*USE_FULL_LL_DRIVER*/
216 
217 
218 /**
219   * @}
220   */
221 
222 /* Exported macro ------------------------------------------------------------*/
223 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
224   * @{
225   */
226 
227 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
228   * @{
229   */
230 
231 /**
232   * @brief  Write a value in EXTI register
233   * @param  __REG__ Register to be written
234   * @param  __VALUE__ Value to be written in the register
235   * @retval None
236   */
237 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
238 
239 /**
240   * @brief  Read a value in EXTI register
241   * @param  __REG__ Register to be read
242   * @retval Register value
243   */
244 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
245 /**
246   * @}
247   */
248 
249 
250 /**
251   * @}
252   */
253 
254 
255 
256 /* Exported functions --------------------------------------------------------*/
257 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
258  * @{
259  */
260 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
261   * @{
262   */
263 
264 /**
265   * @brief  Enable ExtiLine Interrupt request for Lines in range 0 to 31
266   * @note The reset value for the direct or internal lines (see RM)
267   *       is set to 1 in order to enable the interrupt by default.
268   *       Bits are set automatically at Power on.
269   * @rmtoll IMR         IMx           LL_EXTI_EnableIT_0_31
270   * @param  ExtiLine This parameter can be one of the following values:
271   *         @arg @ref LL_EXTI_LINE_0
272   *         @arg @ref LL_EXTI_LINE_1
273   *         @arg @ref LL_EXTI_LINE_2
274   *         @arg @ref LL_EXTI_LINE_3
275   *         @arg @ref LL_EXTI_LINE_4
276   *         @arg @ref LL_EXTI_LINE_5
277   *         @arg @ref LL_EXTI_LINE_6
278   *         @arg @ref LL_EXTI_LINE_7
279   *         @arg @ref LL_EXTI_LINE_8
280   *         @arg @ref LL_EXTI_LINE_9
281   *         @arg @ref LL_EXTI_LINE_10
282   *         @arg @ref LL_EXTI_LINE_11
283   *         @arg @ref LL_EXTI_LINE_12
284   *         @arg @ref LL_EXTI_LINE_13
285   *         @arg @ref LL_EXTI_LINE_14
286   *         @arg @ref LL_EXTI_LINE_15
287   *         @arg @ref LL_EXTI_LINE_16
288   *         @arg @ref LL_EXTI_LINE_17
289   *         @arg @ref LL_EXTI_LINE_18
290   *         @arg @ref LL_EXTI_LINE_19
291   *         @arg @ref LL_EXTI_LINE_20
292   *         @arg @ref LL_EXTI_LINE_21
293   *         @arg @ref LL_EXTI_LINE_22
294   *         @arg @ref LL_EXTI_LINE_23
295   *         @arg @ref LL_EXTI_LINE_24
296   *         @arg @ref LL_EXTI_LINE_25
297   *         @arg @ref LL_EXTI_LINE_26
298   *         @arg @ref LL_EXTI_LINE_27
299   *         @arg @ref LL_EXTI_LINE_28
300   *         @arg @ref LL_EXTI_LINE_29
301   *         @arg @ref LL_EXTI_LINE_30
302   *         @arg @ref LL_EXTI_LINE_31
303   *         @arg @ref LL_EXTI_LINE_ALL_0_31
304   * @note   Please check each device line mapping for EXTI Line availability
305   * @retval None
306   */
LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)307 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
308 {
309   SET_BIT(EXTI->IMR, ExtiLine);
310 }
311 #if defined(EXTI_32_63_SUPPORT)
312 /**
313   * @brief  Enable ExtiLine Interrupt request for Lines in range 32 to 63
314   * @note The reset value for the direct lines (lines from 32 to 34, line
315   *       39) is set to 1 in order to enable the interrupt by default.
316   *       Bits are set automatically at Power on.
317   * @rmtoll IMR2         IMx           LL_EXTI_EnableIT_32_63
318   * @param  ExtiLine This parameter can be one of the following values:
319   *         @arg @ref LL_EXTI_LINE_32
320   *         @arg @ref LL_EXTI_LINE_33
321   *         @arg @ref LL_EXTI_LINE_34
322   *         @arg @ref LL_EXTI_LINE_35
323   *         @arg @ref LL_EXTI_LINE_36
324   *         @arg @ref LL_EXTI_LINE_37
325   *         @arg @ref LL_EXTI_LINE_38
326   *         @arg @ref LL_EXTI_LINE_39
327   *         @arg @ref LL_EXTI_LINE_ALL_32_63
328   * @retval None
329   */
LL_EXTI_EnableIT_32_63(uint32_t ExtiLine)330 __STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine)
331 {
332   SET_BIT(EXTI->IMR2, ExtiLine);
333 }
334 #endif
335 
336 /**
337   * @brief  Disable ExtiLine Interrupt request for Lines in range 0 to 31
338   * @note The reset value for the direct or internal lines (see RM)
339   *       is set to 1 in order to enable the interrupt by default.
340   *       Bits are set automatically at Power on.
341   * @rmtoll IMR         IMx           LL_EXTI_DisableIT_0_31
342   * @param  ExtiLine This parameter can be one of the following values:
343   *         @arg @ref LL_EXTI_LINE_0
344   *         @arg @ref LL_EXTI_LINE_1
345   *         @arg @ref LL_EXTI_LINE_2
346   *         @arg @ref LL_EXTI_LINE_3
347   *         @arg @ref LL_EXTI_LINE_4
348   *         @arg @ref LL_EXTI_LINE_5
349   *         @arg @ref LL_EXTI_LINE_6
350   *         @arg @ref LL_EXTI_LINE_7
351   *         @arg @ref LL_EXTI_LINE_8
352   *         @arg @ref LL_EXTI_LINE_9
353   *         @arg @ref LL_EXTI_LINE_10
354   *         @arg @ref LL_EXTI_LINE_11
355   *         @arg @ref LL_EXTI_LINE_12
356   *         @arg @ref LL_EXTI_LINE_13
357   *         @arg @ref LL_EXTI_LINE_14
358   *         @arg @ref LL_EXTI_LINE_15
359   *         @arg @ref LL_EXTI_LINE_16
360   *         @arg @ref LL_EXTI_LINE_17
361   *         @arg @ref LL_EXTI_LINE_18
362   *         @arg @ref LL_EXTI_LINE_19
363   *         @arg @ref LL_EXTI_LINE_20
364   *         @arg @ref LL_EXTI_LINE_21
365   *         @arg @ref LL_EXTI_LINE_22
366   *         @arg @ref LL_EXTI_LINE_23
367   *         @arg @ref LL_EXTI_LINE_24
368   *         @arg @ref LL_EXTI_LINE_25
369   *         @arg @ref LL_EXTI_LINE_26
370   *         @arg @ref LL_EXTI_LINE_27
371   *         @arg @ref LL_EXTI_LINE_28
372   *         @arg @ref LL_EXTI_LINE_29
373   *         @arg @ref LL_EXTI_LINE_30
374   *         @arg @ref LL_EXTI_LINE_31
375   *         @arg @ref LL_EXTI_LINE_ALL_0_31
376   * @note   Please check each device line mapping for EXTI Line availability
377   * @retval None
378   */
LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)379 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
380 {
381   CLEAR_BIT(EXTI->IMR, ExtiLine);
382 }
383 
384 #if defined(EXTI_32_63_SUPPORT)
385 /**
386   * @brief  Disable ExtiLine Interrupt request for Lines in range 32 to 63
387   * @note The reset value for the direct lines (lines from 32 to 34, line
388   *       39) is set to 1 in order to enable the interrupt by default.
389   *       Bits are set automatically at Power on.
390   * @rmtoll IMR2         IMx           LL_EXTI_DisableIT_32_63
391   * @param  ExtiLine This parameter can be one of the following values:
392   *         @arg @ref LL_EXTI_LINE_32
393   *         @arg @ref LL_EXTI_LINE_33
394   *         @arg @ref LL_EXTI_LINE_34
395   *         @arg @ref LL_EXTI_LINE_35
396   *         @arg @ref LL_EXTI_LINE_36
397   *         @arg @ref LL_EXTI_LINE_37
398   *         @arg @ref LL_EXTI_LINE_38
399   *         @arg @ref LL_EXTI_LINE_39
400   *         @arg @ref LL_EXTI_LINE_ALL_32_63
401   * @retval None
402   */
LL_EXTI_DisableIT_32_63(uint32_t ExtiLine)403 __STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine)
404 {
405   CLEAR_BIT(EXTI->IMR2, ExtiLine);
406 }
407 #endif
408 
409 /**
410   * @brief  Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
411   * @note The reset value for the direct or internal lines (see RM)
412   *       is set to 1 in order to enable the interrupt by default.
413   *       Bits are set automatically at Power on.
414   * @rmtoll IMR         IMx           LL_EXTI_IsEnabledIT_0_31
415   * @param  ExtiLine This parameter can be one of the following values:
416   *         @arg @ref LL_EXTI_LINE_0
417   *         @arg @ref LL_EXTI_LINE_1
418   *         @arg @ref LL_EXTI_LINE_2
419   *         @arg @ref LL_EXTI_LINE_3
420   *         @arg @ref LL_EXTI_LINE_4
421   *         @arg @ref LL_EXTI_LINE_5
422   *         @arg @ref LL_EXTI_LINE_6
423   *         @arg @ref LL_EXTI_LINE_7
424   *         @arg @ref LL_EXTI_LINE_8
425   *         @arg @ref LL_EXTI_LINE_9
426   *         @arg @ref LL_EXTI_LINE_10
427   *         @arg @ref LL_EXTI_LINE_11
428   *         @arg @ref LL_EXTI_LINE_12
429   *         @arg @ref LL_EXTI_LINE_13
430   *         @arg @ref LL_EXTI_LINE_14
431   *         @arg @ref LL_EXTI_LINE_15
432   *         @arg @ref LL_EXTI_LINE_16
433   *         @arg @ref LL_EXTI_LINE_17
434   *         @arg @ref LL_EXTI_LINE_18
435   *         @arg @ref LL_EXTI_LINE_19
436   *         @arg @ref LL_EXTI_LINE_20
437   *         @arg @ref LL_EXTI_LINE_21
438   *         @arg @ref LL_EXTI_LINE_22
439   *         @arg @ref LL_EXTI_LINE_23
440   *         @arg @ref LL_EXTI_LINE_24
441   *         @arg @ref LL_EXTI_LINE_25
442   *         @arg @ref LL_EXTI_LINE_26
443   *         @arg @ref LL_EXTI_LINE_27
444   *         @arg @ref LL_EXTI_LINE_28
445   *         @arg @ref LL_EXTI_LINE_29
446   *         @arg @ref LL_EXTI_LINE_30
447   *         @arg @ref LL_EXTI_LINE_31
448   *         @arg @ref LL_EXTI_LINE_ALL_0_31
449   * @note   Please check each device line mapping for EXTI Line availability
450   * @retval State of bit (1 or 0).
451   */
LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)452 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
453 {
454   return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine));
455 }
456 
457 #if defined(EXTI_32_63_SUPPORT)
458 /**
459   * @brief  Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63
460   * @note The reset value for the direct lines (lines from 32 to 34, line
461   *       39) is set to 1 in order to enable the interrupt by default.
462   *       Bits are set automatically at Power on.
463   * @rmtoll IMR2         IMx           LL_EXTI_IsEnabledIT_32_63
464   * @param  ExtiLine This parameter can be one of the following values:
465   *         @arg @ref LL_EXTI_LINE_32
466   *         @arg @ref LL_EXTI_LINE_33
467   *         @arg @ref LL_EXTI_LINE_34
468   *         @arg @ref LL_EXTI_LINE_35
469   *         @arg @ref LL_EXTI_LINE_36
470   *         @arg @ref LL_EXTI_LINE_37
471   *         @arg @ref LL_EXTI_LINE_38
472   *         @arg @ref LL_EXTI_LINE_39
473   *         @arg @ref LL_EXTI_LINE_ALL_32_63
474   * @retval State of bit (1 or 0).
475   */
LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine)476 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine)
477 {
478   return (READ_BIT(EXTI->IMR2, ExtiLine) == (ExtiLine));
479 }
480 #endif
481 
482 /**
483   * @}
484   */
485 
486 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
487   * @{
488   */
489 
490 /**
491   * @brief  Enable ExtiLine Event request for Lines in range 0 to 31
492   * @rmtoll EMR         EMx           LL_EXTI_EnableEvent_0_31
493   * @param  ExtiLine This parameter can be one of the following values:
494   *         @arg @ref LL_EXTI_LINE_0
495   *         @arg @ref LL_EXTI_LINE_1
496   *         @arg @ref LL_EXTI_LINE_2
497   *         @arg @ref LL_EXTI_LINE_3
498   *         @arg @ref LL_EXTI_LINE_4
499   *         @arg @ref LL_EXTI_LINE_5
500   *         @arg @ref LL_EXTI_LINE_6
501   *         @arg @ref LL_EXTI_LINE_7
502   *         @arg @ref LL_EXTI_LINE_8
503   *         @arg @ref LL_EXTI_LINE_9
504   *         @arg @ref LL_EXTI_LINE_10
505   *         @arg @ref LL_EXTI_LINE_11
506   *         @arg @ref LL_EXTI_LINE_12
507   *         @arg @ref LL_EXTI_LINE_13
508   *         @arg @ref LL_EXTI_LINE_14
509   *         @arg @ref LL_EXTI_LINE_15
510   *         @arg @ref LL_EXTI_LINE_16
511   *         @arg @ref LL_EXTI_LINE_17
512   *         @arg @ref LL_EXTI_LINE_18
513   *         @arg @ref LL_EXTI_LINE_19
514   *         @arg @ref LL_EXTI_LINE_20
515   *         @arg @ref LL_EXTI_LINE_21
516   *         @arg @ref LL_EXTI_LINE_22
517   *         @arg @ref LL_EXTI_LINE_23
518   *         @arg @ref LL_EXTI_LINE_24
519   *         @arg @ref LL_EXTI_LINE_25
520   *         @arg @ref LL_EXTI_LINE_26
521   *         @arg @ref LL_EXTI_LINE_27
522   *         @arg @ref LL_EXTI_LINE_28
523   *         @arg @ref LL_EXTI_LINE_29
524   *         @arg @ref LL_EXTI_LINE_30
525   *         @arg @ref LL_EXTI_LINE_31
526   *         @arg @ref LL_EXTI_LINE_ALL_0_31
527   * @note   Please check each device line mapping for EXTI Line availability
528   * @retval None
529   */
LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)530 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
531 {
532   SET_BIT(EXTI->EMR, ExtiLine);
533 
534 }
535 
536 #if defined(EXTI_32_63_SUPPORT)
537 /**
538   * @brief  Enable ExtiLine Event request for Lines in range 32 to 63
539   * @rmtoll EMR2         EMx           LL_EXTI_EnableEvent_32_63
540   * @param  ExtiLine This parameter can be a combination of the following values:
541   *         @arg @ref LL_EXTI_LINE_32
542   *         @arg @ref LL_EXTI_LINE_33
543   *         @arg @ref LL_EXTI_LINE_34
544   *         @arg @ref LL_EXTI_LINE_35
545   *         @arg @ref LL_EXTI_LINE_36
546   *         @arg @ref LL_EXTI_LINE_37
547   *         @arg @ref LL_EXTI_LINE_38
548   *         @arg @ref LL_EXTI_LINE_39
549   *         @arg @ref LL_EXTI_LINE_ALL_32_63
550   * @retval None
551   */
LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine)552 __STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine)
553 {
554   SET_BIT(EXTI->EMR2, ExtiLine);
555 }
556 #endif
557 
558 /**
559   * @brief  Disable ExtiLine Event request for Lines in range 0 to 31
560   * @rmtoll EMR         EMx           LL_EXTI_DisableEvent_0_31
561   * @param  ExtiLine This parameter can be one of the following values:
562   *         @arg @ref LL_EXTI_LINE_0
563   *         @arg @ref LL_EXTI_LINE_1
564   *         @arg @ref LL_EXTI_LINE_2
565   *         @arg @ref LL_EXTI_LINE_3
566   *         @arg @ref LL_EXTI_LINE_4
567   *         @arg @ref LL_EXTI_LINE_5
568   *         @arg @ref LL_EXTI_LINE_6
569   *         @arg @ref LL_EXTI_LINE_7
570   *         @arg @ref LL_EXTI_LINE_8
571   *         @arg @ref LL_EXTI_LINE_9
572   *         @arg @ref LL_EXTI_LINE_10
573   *         @arg @ref LL_EXTI_LINE_11
574   *         @arg @ref LL_EXTI_LINE_12
575   *         @arg @ref LL_EXTI_LINE_13
576   *         @arg @ref LL_EXTI_LINE_14
577   *         @arg @ref LL_EXTI_LINE_15
578   *         @arg @ref LL_EXTI_LINE_16
579   *         @arg @ref LL_EXTI_LINE_17
580   *         @arg @ref LL_EXTI_LINE_18
581   *         @arg @ref LL_EXTI_LINE_19
582   *         @arg @ref LL_EXTI_LINE_20
583   *         @arg @ref LL_EXTI_LINE_21
584   *         @arg @ref LL_EXTI_LINE_22
585   *         @arg @ref LL_EXTI_LINE_23
586   *         @arg @ref LL_EXTI_LINE_24
587   *         @arg @ref LL_EXTI_LINE_25
588   *         @arg @ref LL_EXTI_LINE_26
589   *         @arg @ref LL_EXTI_LINE_27
590   *         @arg @ref LL_EXTI_LINE_28
591   *         @arg @ref LL_EXTI_LINE_29
592   *         @arg @ref LL_EXTI_LINE_30
593   *         @arg @ref LL_EXTI_LINE_31
594   *         @arg @ref LL_EXTI_LINE_ALL_0_31
595   * @note   Please check each device line mapping for EXTI Line availability
596   * @retval None
597   */
LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)598 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
599 {
600   CLEAR_BIT(EXTI->EMR, ExtiLine);
601 }
602 
603 #if defined(EXTI_32_63_SUPPORT)
604 /**
605   * @brief  Disable ExtiLine Event request for Lines in range 32 to 63
606   * @rmtoll EMR2         EMx           LL_EXTI_DisableEvent_32_63
607   * @param  ExtiLine This parameter can be a combination of the following values:
608   *         @arg @ref LL_EXTI_LINE_32
609   *         @arg @ref LL_EXTI_LINE_33
610   *         @arg @ref LL_EXTI_LINE_34
611   *         @arg @ref LL_EXTI_LINE_35
612   *         @arg @ref LL_EXTI_LINE_36
613   *         @arg @ref LL_EXTI_LINE_37
614   *         @arg @ref LL_EXTI_LINE_38
615   *         @arg @ref LL_EXTI_LINE_39
616   *         @arg @ref LL_EXTI_LINE_ALL_32_63
617   * @retval None
618   */
LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine)619 __STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine)
620 {
621   CLEAR_BIT(EXTI->EMR2, ExtiLine);
622 }
623 #endif
624 
625 /**
626   * @brief  Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
627   * @rmtoll EMR         EMx           LL_EXTI_IsEnabledEvent_0_31
628   * @param  ExtiLine This parameter can be one of the following values:
629   *         @arg @ref LL_EXTI_LINE_0
630   *         @arg @ref LL_EXTI_LINE_1
631   *         @arg @ref LL_EXTI_LINE_2
632   *         @arg @ref LL_EXTI_LINE_3
633   *         @arg @ref LL_EXTI_LINE_4
634   *         @arg @ref LL_EXTI_LINE_5
635   *         @arg @ref LL_EXTI_LINE_6
636   *         @arg @ref LL_EXTI_LINE_7
637   *         @arg @ref LL_EXTI_LINE_8
638   *         @arg @ref LL_EXTI_LINE_9
639   *         @arg @ref LL_EXTI_LINE_10
640   *         @arg @ref LL_EXTI_LINE_11
641   *         @arg @ref LL_EXTI_LINE_12
642   *         @arg @ref LL_EXTI_LINE_13
643   *         @arg @ref LL_EXTI_LINE_14
644   *         @arg @ref LL_EXTI_LINE_15
645   *         @arg @ref LL_EXTI_LINE_16
646   *         @arg @ref LL_EXTI_LINE_17
647   *         @arg @ref LL_EXTI_LINE_18
648   *         @arg @ref LL_EXTI_LINE_19
649   *         @arg @ref LL_EXTI_LINE_20
650   *         @arg @ref LL_EXTI_LINE_21
651   *         @arg @ref LL_EXTI_LINE_22
652   *         @arg @ref LL_EXTI_LINE_23
653   *         @arg @ref LL_EXTI_LINE_24
654   *         @arg @ref LL_EXTI_LINE_25
655   *         @arg @ref LL_EXTI_LINE_26
656   *         @arg @ref LL_EXTI_LINE_27
657   *         @arg @ref LL_EXTI_LINE_28
658   *         @arg @ref LL_EXTI_LINE_29
659   *         @arg @ref LL_EXTI_LINE_30
660   *         @arg @ref LL_EXTI_LINE_31
661   *         @arg @ref LL_EXTI_LINE_ALL_0_31
662   * @note   Please check each device line mapping for EXTI Line availability
663   * @retval State of bit (1 or 0).
664   */
LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)665 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
666 {
667   return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine));
668 
669 }
670 
671 #if defined(EXTI_32_63_SUPPORT)
672 /**
673   * @brief  Indicate if ExtiLine Event request is enabled for Lines in range 32 to 63
674   * @rmtoll EMR2         EMx           LL_EXTI_IsEnabledEvent_32_63
675   * @param  ExtiLine This parameter can be a combination of the following values:
676   *         @arg @ref LL_EXTI_LINE_32
677   *         @arg @ref LL_EXTI_LINE_33
678   *         @arg @ref LL_EXTI_LINE_34
679   *         @arg @ref LL_EXTI_LINE_35
680   *         @arg @ref LL_EXTI_LINE_36
681   *         @arg @ref LL_EXTI_LINE_37
682   *         @arg @ref LL_EXTI_LINE_38
683   *         @arg @ref LL_EXTI_LINE_39
684   *         @arg @ref LL_EXTI_LINE_ALL_32_63
685   * @retval State of bit (1 or 0).
686   */
LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine)687 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine)
688 {
689   return (READ_BIT(EXTI->EMR2, ExtiLine) == (ExtiLine));
690 }
691 #endif
692 
693 /**
694   * @}
695   */
696 
697 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
698   * @{
699   */
700 
701 /**
702   * @brief  Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
703   * @note The configurable wakeup lines are edge-triggered. No glitch must be
704   *       generated on these lines. If a rising edge on a configurable interrupt
705   *       line occurs during a write operation in the EXTI_RTSR register, the
706   *       pending bit is not set.
707   *       Rising and falling edge triggers can be set for
708   *       the same interrupt line. In this case, both generate a trigger
709   *       condition.
710   * @rmtoll RTSR        RTx           LL_EXTI_EnableRisingTrig_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   *         @arg @ref LL_EXTI_LINE_29
735   *         @arg @ref LL_EXTI_LINE_30
736   *         @arg @ref LL_EXTI_LINE_31
737   * @note   Please check each device line mapping for EXTI Line availability
738   * @retval None
739   */
LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)740 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
741 {
742   SET_BIT(EXTI->RTSR, ExtiLine);
743 
744 }
745 
746 #if defined(EXTI_32_63_SUPPORT)
747 /**
748   * @brief  Enable ExtiLine Rising Edge Trigger for Lines in range 32 to 63
749   * @note The configurable wakeup lines are edge-triggered. No glitch must be
750   *       generated on these lines. If a rising edge on a configurable interrupt
751   *       line occurs during a write operation in the EXTI_RTSR register, the
752   *       pending bit is not set.Rising and falling edge triggers can be set for
753   *       the same interrupt line. In this case, both generate a trigger
754   *       condition.
755   * @rmtoll RTSR2        RTx           LL_EXTI_EnableRisingTrig_32_63
756   * @param  ExtiLine This parameter can be a combination of the following values:
757   *         @arg @ref LL_EXTI_LINE_35
758   *         @arg @ref LL_EXTI_LINE_36
759   *         @arg @ref LL_EXTI_LINE_37
760   *         @arg @ref LL_EXTI_LINE_38
761   * @retval None
762   */
LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine)763 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine)
764 {
765   SET_BIT(EXTI->RTSR2, ExtiLine);
766 }
767 #endif
768 
769 /**
770   * @brief  Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
771   * @note The configurable wakeup lines are edge-triggered. No glitch must be
772   *       generated on these lines. If a rising edge on a configurable interrupt
773   *       line occurs during a write operation in the EXTI_RTSR register, the
774   *       pending bit is not set.
775   *       Rising and falling edge triggers can be set for
776   *       the same interrupt line. In this case, both generate a trigger
777   *       condition.
778   * @rmtoll RTSR        RTx           LL_EXTI_DisableRisingTrig_0_31
779   * @param  ExtiLine This parameter can be a combination of the following values:
780   *         @arg @ref LL_EXTI_LINE_0
781   *         @arg @ref LL_EXTI_LINE_1
782   *         @arg @ref LL_EXTI_LINE_2
783   *         @arg @ref LL_EXTI_LINE_3
784   *         @arg @ref LL_EXTI_LINE_4
785   *         @arg @ref LL_EXTI_LINE_5
786   *         @arg @ref LL_EXTI_LINE_6
787   *         @arg @ref LL_EXTI_LINE_7
788   *         @arg @ref LL_EXTI_LINE_8
789   *         @arg @ref LL_EXTI_LINE_9
790   *         @arg @ref LL_EXTI_LINE_10
791   *         @arg @ref LL_EXTI_LINE_11
792   *         @arg @ref LL_EXTI_LINE_12
793   *         @arg @ref LL_EXTI_LINE_13
794   *         @arg @ref LL_EXTI_LINE_14
795   *         @arg @ref LL_EXTI_LINE_15
796   *         @arg @ref LL_EXTI_LINE_16
797   *         @arg @ref LL_EXTI_LINE_18
798   *         @arg @ref LL_EXTI_LINE_19
799   *         @arg @ref LL_EXTI_LINE_20
800   *         @arg @ref LL_EXTI_LINE_21
801   *         @arg @ref LL_EXTI_LINE_22
802   *         @arg @ref LL_EXTI_LINE_29
803   *         @arg @ref LL_EXTI_LINE_30
804   *         @arg @ref LL_EXTI_LINE_31
805   * @note   Please check each device line mapping for EXTI Line availability
806   * @retval None
807   */
LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)808 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
809 {
810   CLEAR_BIT(EXTI->RTSR, ExtiLine);
811 
812 }
813 
814 #if defined(EXTI_32_63_SUPPORT)
815 /**
816   * @brief  Disable ExtiLine Rising Edge Trigger for Lines in range 32 to 63
817   * @note The configurable wakeup lines are edge-triggered. No glitch must be
818   *       generated on these lines. If a rising edge on a configurable interrupt
819   *       line occurs during a write operation in the EXTI_RTSR register, the
820   *       pending bit is not set.
821   *       Rising and falling edge triggers can be set for
822   *       the same interrupt line. In this case, both generate a trigger
823   *       condition.
824   * @rmtoll RTSR2        RTx           LL_EXTI_DisableRisingTrig_32_63
825   * @param  ExtiLine This parameter can be a combination of the following values:
826   *         @arg @ref LL_EXTI_LINE_35
827   *         @arg @ref LL_EXTI_LINE_36
828   *         @arg @ref LL_EXTI_LINE_37
829   *         @arg @ref LL_EXTI_LINE_38
830   * @retval None
831   */
LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine)832 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine)
833 {
834   CLEAR_BIT(EXTI->RTSR2, ExtiLine);
835 }
836 #endif
837 
838 /**
839   * @brief  Check if rising edge trigger is enabled for Lines in range 0 to 31
840   * @rmtoll RTSR        RTx           LL_EXTI_IsEnabledRisingTrig_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   *         @arg @ref LL_EXTI_LINE_29
865   *         @arg @ref LL_EXTI_LINE_30
866   *         @arg @ref LL_EXTI_LINE_31
867   * @note   Please check each device line mapping for EXTI Line availability
868   * @retval State of bit (1 or 0).
869   */
LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)870 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
871 {
872   return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine));
873 }
874 
875 #if defined(EXTI_32_63_SUPPORT)
876 /**
877   * @brief  Check if rising edge trigger is enabled for Lines in range 32 to 63
878   * @rmtoll RTSR2        RTx           LL_EXTI_IsEnabledRisingTrig_32_63
879   * @param  ExtiLine This parameter can be a combination of the following values:
880   *         @arg @ref LL_EXTI_LINE_35
881   *         @arg @ref LL_EXTI_LINE_36
882   *         @arg @ref LL_EXTI_LINE_37
883   *         @arg @ref LL_EXTI_LINE_38
884   * @retval State of bit (1 or 0).
885   */
LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine)886 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine)
887 {
888   return (READ_BIT(EXTI->RTSR2, ExtiLine) == (ExtiLine));
889 }
890 #endif
891 
892 /**
893   * @}
894   */
895 
896 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
897   * @{
898   */
899 
900 /**
901   * @brief  Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
902   * @note The configurable wakeup lines are edge-triggered. No glitch must be
903   *       generated on these lines. If a falling edge on a configurable interrupt
904   *       line occurs during a write operation in the EXTI_FTSR register, the
905   *       pending bit is not set.
906   *       Rising and falling edge triggers can be set for
907   *       the same interrupt line. In this case, both generate a trigger
908   *       condition.
909   * @rmtoll FTSR        FTx           LL_EXTI_EnableFallingTrig_0_31
910   * @param  ExtiLine This parameter can be a combination of the following values:
911   *         @arg @ref LL_EXTI_LINE_0
912   *         @arg @ref LL_EXTI_LINE_1
913   *         @arg @ref LL_EXTI_LINE_2
914   *         @arg @ref LL_EXTI_LINE_3
915   *         @arg @ref LL_EXTI_LINE_4
916   *         @arg @ref LL_EXTI_LINE_5
917   *         @arg @ref LL_EXTI_LINE_6
918   *         @arg @ref LL_EXTI_LINE_7
919   *         @arg @ref LL_EXTI_LINE_8
920   *         @arg @ref LL_EXTI_LINE_9
921   *         @arg @ref LL_EXTI_LINE_10
922   *         @arg @ref LL_EXTI_LINE_11
923   *         @arg @ref LL_EXTI_LINE_12
924   *         @arg @ref LL_EXTI_LINE_13
925   *         @arg @ref LL_EXTI_LINE_14
926   *         @arg @ref LL_EXTI_LINE_15
927   *         @arg @ref LL_EXTI_LINE_16
928   *         @arg @ref LL_EXTI_LINE_18
929   *         @arg @ref LL_EXTI_LINE_19
930   *         @arg @ref LL_EXTI_LINE_20
931   *         @arg @ref LL_EXTI_LINE_21
932   *         @arg @ref LL_EXTI_LINE_22
933   *         @arg @ref LL_EXTI_LINE_29
934   *         @arg @ref LL_EXTI_LINE_30
935   *         @arg @ref LL_EXTI_LINE_31
936   * @note   Please check each device line mapping for EXTI Line availability
937   * @retval None
938   */
LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)939 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
940 {
941   SET_BIT(EXTI->FTSR, ExtiLine);
942 }
943 
944 #if defined(EXTI_32_63_SUPPORT)
945 /**
946   * @brief  Enable ExtiLine Falling Edge Trigger for Lines in range 32 to 63
947   * @note The configurable wakeup lines are edge-triggered. No glitch must be
948   *       generated on these lines. If a Falling edge on a configurable interrupt
949   *       line occurs during a write operation in the EXTI_FTSR register, the
950   *       pending bit is not set.
951   *       Rising and falling edge triggers can be set for
952   *       the same interrupt line. In this case, both generate a trigger
953   *       condition.
954   * @rmtoll FTSR2        FTx           LL_EXTI_EnableFallingTrig_32_63
955   * @param  ExtiLine This parameter can be a combination of the following values:
956   *         @arg @ref LL_EXTI_LINE_35
957   *         @arg @ref LL_EXTI_LINE_36
958   *         @arg @ref LL_EXTI_LINE_37
959   *         @arg @ref LL_EXTI_LINE_38
960   * @retval None
961   */
LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine)962 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine)
963 {
964   SET_BIT(EXTI->FTSR2, ExtiLine);
965 }
966 #endif
967 
968 /**
969   * @brief  Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
970   * @note The configurable wakeup lines are edge-triggered. No glitch must be
971   *       generated on these lines. If a Falling edge on a configurable interrupt
972   *       line occurs during a write operation in the EXTI_FTSR register, the
973   *       pending bit is not set.
974   *       Rising and falling edge triggers can be set for the same interrupt line.
975   *       In this case, both generate a trigger condition.
976   * @rmtoll FTSR        FTx           LL_EXTI_DisableFallingTrig_0_31
977   * @param  ExtiLine This parameter can be a combination of the following values:
978   *         @arg @ref LL_EXTI_LINE_0
979   *         @arg @ref LL_EXTI_LINE_1
980   *         @arg @ref LL_EXTI_LINE_2
981   *         @arg @ref LL_EXTI_LINE_3
982   *         @arg @ref LL_EXTI_LINE_4
983   *         @arg @ref LL_EXTI_LINE_5
984   *         @arg @ref LL_EXTI_LINE_6
985   *         @arg @ref LL_EXTI_LINE_7
986   *         @arg @ref LL_EXTI_LINE_8
987   *         @arg @ref LL_EXTI_LINE_9
988   *         @arg @ref LL_EXTI_LINE_10
989   *         @arg @ref LL_EXTI_LINE_11
990   *         @arg @ref LL_EXTI_LINE_12
991   *         @arg @ref LL_EXTI_LINE_13
992   *         @arg @ref LL_EXTI_LINE_14
993   *         @arg @ref LL_EXTI_LINE_15
994   *         @arg @ref LL_EXTI_LINE_16
995   *         @arg @ref LL_EXTI_LINE_18
996   *         @arg @ref LL_EXTI_LINE_19
997   *         @arg @ref LL_EXTI_LINE_20
998   *         @arg @ref LL_EXTI_LINE_21
999   *         @arg @ref LL_EXTI_LINE_22
1000   *         @arg @ref LL_EXTI_LINE_29
1001   *         @arg @ref LL_EXTI_LINE_30
1002   *         @arg @ref LL_EXTI_LINE_31
1003   * @note   Please check each device line mapping for EXTI Line availability
1004   * @retval None
1005   */
LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)1006 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
1007 {
1008   CLEAR_BIT(EXTI->FTSR, ExtiLine);
1009 }
1010 
1011 #if defined(EXTI_32_63_SUPPORT)
1012 /**
1013   * @brief  Disable ExtiLine Falling Edge Trigger for Lines in range 32 to 63
1014   * @note The configurable wakeup lines are edge-triggered. No glitch must be
1015   *       generated on these lines. If a Falling edge on a configurable interrupt
1016   *       line occurs during a write operation in the EXTI_FTSR register, the
1017   *       pending bit is not set.
1018   *       Rising and falling edge triggers can be set for the same interrupt line.
1019   *       In this case, both generate a trigger condition.
1020   * @rmtoll FTSR2        FTx           LL_EXTI_DisableFallingTrig_32_63
1021   * @param  ExtiLine This parameter can be a combination of the following values:
1022   *         @arg @ref LL_EXTI_LINE_35
1023   *         @arg @ref LL_EXTI_LINE_36
1024   *         @arg @ref LL_EXTI_LINE_37
1025   *         @arg @ref LL_EXTI_LINE_38
1026   * @retval None
1027   */
LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine)1028 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine)
1029 {
1030   CLEAR_BIT(EXTI->FTSR2, ExtiLine);
1031 }
1032 #endif
1033 
1034 /**
1035   * @brief  Check if falling edge trigger is enabled for Lines in range 0 to 31
1036   * @rmtoll FTSR        FTx           LL_EXTI_IsEnabledFallingTrig_0_31
1037   * @param  ExtiLine This parameter can be a combination of the following values:
1038   *         @arg @ref LL_EXTI_LINE_0
1039   *         @arg @ref LL_EXTI_LINE_1
1040   *         @arg @ref LL_EXTI_LINE_2
1041   *         @arg @ref LL_EXTI_LINE_3
1042   *         @arg @ref LL_EXTI_LINE_4
1043   *         @arg @ref LL_EXTI_LINE_5
1044   *         @arg @ref LL_EXTI_LINE_6
1045   *         @arg @ref LL_EXTI_LINE_7
1046   *         @arg @ref LL_EXTI_LINE_8
1047   *         @arg @ref LL_EXTI_LINE_9
1048   *         @arg @ref LL_EXTI_LINE_10
1049   *         @arg @ref LL_EXTI_LINE_11
1050   *         @arg @ref LL_EXTI_LINE_12
1051   *         @arg @ref LL_EXTI_LINE_13
1052   *         @arg @ref LL_EXTI_LINE_14
1053   *         @arg @ref LL_EXTI_LINE_15
1054   *         @arg @ref LL_EXTI_LINE_16
1055   *         @arg @ref LL_EXTI_LINE_18
1056   *         @arg @ref LL_EXTI_LINE_19
1057   *         @arg @ref LL_EXTI_LINE_20
1058   *         @arg @ref LL_EXTI_LINE_21
1059   *         @arg @ref LL_EXTI_LINE_22
1060   *         @arg @ref LL_EXTI_LINE_29
1061   *         @arg @ref LL_EXTI_LINE_30
1062   *         @arg @ref LL_EXTI_LINE_31
1063   * @note   Please check each device line mapping for EXTI Line availability
1064   * @retval State of bit (1 or 0).
1065   */
LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)1066 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
1067 {
1068   return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine));
1069 }
1070 
1071 #if defined(EXTI_32_63_SUPPORT)
1072 /**
1073   * @brief  Check if falling edge trigger is enabled for Lines in range 32 to 63
1074   * @rmtoll FTSR2        FTx           LL_EXTI_IsEnabledFallingTrig_32_63
1075   * @param  ExtiLine This parameter can be a combination of the following values:
1076   *         @arg @ref LL_EXTI_LINE_35
1077   *         @arg @ref LL_EXTI_LINE_36
1078   *         @arg @ref LL_EXTI_LINE_37
1079   *         @arg @ref LL_EXTI_LINE_38
1080   * @retval State of bit (1 or 0).
1081   */
LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine)1082 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine)
1083 {
1084   return (READ_BIT(EXTI->FTSR2, ExtiLine) == (ExtiLine));
1085 }
1086 #endif
1087 
1088 /**
1089   * @}
1090   */
1091 
1092 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
1093   * @{
1094   */
1095 
1096 /**
1097   * @brief  Generate a software Interrupt Event for Lines in range 0 to 31
1098   * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
1099   *       this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
1100   *       resulting in an interrupt request generation.
1101   *       This bit is cleared by clearing the corresponding bit in the EXTI_PR
1102   *       register (by writing a 1 into the bit)
1103   * @rmtoll SWIER       SWIx          LL_EXTI_GenerateSWI_0_31
1104   * @param  ExtiLine This parameter can be a combination of the following values:
1105   *         @arg @ref LL_EXTI_LINE_0
1106   *         @arg @ref LL_EXTI_LINE_1
1107   *         @arg @ref LL_EXTI_LINE_2
1108   *         @arg @ref LL_EXTI_LINE_3
1109   *         @arg @ref LL_EXTI_LINE_4
1110   *         @arg @ref LL_EXTI_LINE_5
1111   *         @arg @ref LL_EXTI_LINE_6
1112   *         @arg @ref LL_EXTI_LINE_7
1113   *         @arg @ref LL_EXTI_LINE_8
1114   *         @arg @ref LL_EXTI_LINE_9
1115   *         @arg @ref LL_EXTI_LINE_10
1116   *         @arg @ref LL_EXTI_LINE_11
1117   *         @arg @ref LL_EXTI_LINE_12
1118   *         @arg @ref LL_EXTI_LINE_13
1119   *         @arg @ref LL_EXTI_LINE_14
1120   *         @arg @ref LL_EXTI_LINE_15
1121   *         @arg @ref LL_EXTI_LINE_16
1122   *         @arg @ref LL_EXTI_LINE_18
1123   *         @arg @ref LL_EXTI_LINE_19
1124   *         @arg @ref LL_EXTI_LINE_20
1125   *         @arg @ref LL_EXTI_LINE_21
1126   *         @arg @ref LL_EXTI_LINE_22
1127   *         @arg @ref LL_EXTI_LINE_29
1128   *         @arg @ref LL_EXTI_LINE_30
1129   *         @arg @ref LL_EXTI_LINE_31
1130   * @note   Please check each device line mapping for EXTI Line availability
1131   * @retval None
1132   */
LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)1133 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
1134 {
1135   SET_BIT(EXTI->SWIER, ExtiLine);
1136 }
1137 
1138 #if defined(EXTI_32_63_SUPPORT)
1139 /**
1140   * @brief  Generate a software Interrupt Event for Lines in range 32 to 63
1141   * @note If the interrupt is enabled on this line in the EXTI_IMR2, writing a 1 to
1142   *       this bit when it is at '0' sets the corresponding pending bit in EXTI_PR2
1143   *       resulting in an interrupt request generation.
1144   *       This bit is cleared by clearing the corresponding bit in the EXTI_PR2
1145   *       register (by writing a 1 into the bit)
1146   * @rmtoll SWIER2       SWIx          LL_EXTI_GenerateSWI_32_63
1147   * @param  ExtiLine This parameter can be a combination of the following values:
1148   *         @arg @ref LL_EXTI_LINE_35
1149   *         @arg @ref LL_EXTI_LINE_36
1150   *         @arg @ref LL_EXTI_LINE_37
1151   *         @arg @ref LL_EXTI_LINE_38
1152   * @retval None
1153   */
LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine)1154 __STATIC_INLINE void LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine)
1155 {
1156   SET_BIT(EXTI->SWIER2, ExtiLine);
1157 }
1158 #endif
1159 
1160 /**
1161   * @}
1162   */
1163 
1164 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
1165   * @{
1166   */
1167 
1168 /**
1169   * @brief  Check if the ExtLine Flag is set or not for Lines in range 0 to 31
1170   * @note This bit is set when the selected edge event arrives on the interrupt
1171   *       line. This bit is cleared by writing a 1 to the bit.
1172   * @rmtoll PR          PIFx           LL_EXTI_IsActiveFlag_0_31
1173   * @param  ExtiLine This parameter can be a combination of the following values:
1174   *         @arg @ref LL_EXTI_LINE_0
1175   *         @arg @ref LL_EXTI_LINE_1
1176   *         @arg @ref LL_EXTI_LINE_2
1177   *         @arg @ref LL_EXTI_LINE_3
1178   *         @arg @ref LL_EXTI_LINE_4
1179   *         @arg @ref LL_EXTI_LINE_5
1180   *         @arg @ref LL_EXTI_LINE_6
1181   *         @arg @ref LL_EXTI_LINE_7
1182   *         @arg @ref LL_EXTI_LINE_8
1183   *         @arg @ref LL_EXTI_LINE_9
1184   *         @arg @ref LL_EXTI_LINE_10
1185   *         @arg @ref LL_EXTI_LINE_11
1186   *         @arg @ref LL_EXTI_LINE_12
1187   *         @arg @ref LL_EXTI_LINE_13
1188   *         @arg @ref LL_EXTI_LINE_14
1189   *         @arg @ref LL_EXTI_LINE_15
1190   *         @arg @ref LL_EXTI_LINE_16
1191   *         @arg @ref LL_EXTI_LINE_18
1192   *         @arg @ref LL_EXTI_LINE_19
1193   *         @arg @ref LL_EXTI_LINE_20
1194   *         @arg @ref LL_EXTI_LINE_21
1195   *         @arg @ref LL_EXTI_LINE_22
1196   *         @arg @ref LL_EXTI_LINE_29
1197   *         @arg @ref LL_EXTI_LINE_30
1198   *         @arg @ref LL_EXTI_LINE_31
1199   * @note   Please check each device line mapping for EXTI Line availability
1200   * @retval State of bit (1 or 0).
1201   */
LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine)1202 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine)
1203 {
1204   return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine));
1205 }
1206 
1207 #if defined(EXTI_32_63_SUPPORT)
1208 /**
1209   * @brief  Check if the ExtLine Flag is set or not for  Lines in range 32 to 63
1210   * @note This bit is set when the selected edge event arrives on the interrupt
1211   *       line. This bit is cleared by writing a 1 to the bit.
1212   * @rmtoll PR2          PIFx           LL_EXTI_IsActiveFlag_32_63
1213   * @param  ExtiLine This parameter can be a combination of the following values:
1214   *         @arg @ref LL_EXTI_LINE_35
1215   *         @arg @ref LL_EXTI_LINE_36
1216   *         @arg @ref LL_EXTI_LINE_37
1217   *         @arg @ref LL_EXTI_LINE_38
1218   * @retval State of bit (1 or 0).
1219   */
LL_EXTI_IsActiveFlag_32_63(uint32_t ExtiLine)1220 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_32_63(uint32_t ExtiLine)
1221 {
1222   return (READ_BIT(EXTI->PR2, ExtiLine) == (ExtiLine));
1223 }
1224 #endif
1225 
1226 /**
1227   * @brief  Read ExtLine Combination Flag for Lines in range 0 to 31
1228   * @note This bit is set when the selected edge event arrives on the interrupt
1229   *       line. This bit is cleared by writing a 1 to the bit.
1230   * @rmtoll PR          PIFx           LL_EXTI_ReadFlag_0_31
1231   * @param  ExtiLine This parameter can be a combination of the following values:
1232   *         @arg @ref LL_EXTI_LINE_0
1233   *         @arg @ref LL_EXTI_LINE_1
1234   *         @arg @ref LL_EXTI_LINE_2
1235   *         @arg @ref LL_EXTI_LINE_3
1236   *         @arg @ref LL_EXTI_LINE_4
1237   *         @arg @ref LL_EXTI_LINE_5
1238   *         @arg @ref LL_EXTI_LINE_6
1239   *         @arg @ref LL_EXTI_LINE_7
1240   *         @arg @ref LL_EXTI_LINE_8
1241   *         @arg @ref LL_EXTI_LINE_9
1242   *         @arg @ref LL_EXTI_LINE_10
1243   *         @arg @ref LL_EXTI_LINE_11
1244   *         @arg @ref LL_EXTI_LINE_12
1245   *         @arg @ref LL_EXTI_LINE_13
1246   *         @arg @ref LL_EXTI_LINE_14
1247   *         @arg @ref LL_EXTI_LINE_15
1248   *         @arg @ref LL_EXTI_LINE_16
1249   *         @arg @ref LL_EXTI_LINE_18
1250   *         @arg @ref LL_EXTI_LINE_19
1251   *         @arg @ref LL_EXTI_LINE_20
1252   *         @arg @ref LL_EXTI_LINE_21
1253   *         @arg @ref LL_EXTI_LINE_22
1254   *         @arg @ref LL_EXTI_LINE_29
1255   *         @arg @ref LL_EXTI_LINE_30
1256   *         @arg @ref LL_EXTI_LINE_31
1257   * @note   Please check each device line mapping for EXTI Line availability
1258   * @retval @note This bit is set when the selected edge event arrives on the interrupt
1259   */
LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine)1260 __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine)
1261 {
1262   return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine));
1263 }
1264 
1265 #if defined(EXTI_32_63_SUPPORT)
1266 
1267 /**
1268   * @brief  Read ExtLine Combination Flag for  Lines in range 32 to 63
1269   * @note This bit is set when the selected edge event arrives on the interrupt
1270   *       line. This bit is cleared by writing a 1 to the bit.
1271   * @rmtoll PR2          PIFx           LL_EXTI_ReadFlag_32_63
1272   * @param  ExtiLine This parameter can be a combination of the following values:
1273   *         @arg @ref LL_EXTI_LINE_35
1274   *         @arg @ref LL_EXTI_LINE_36
1275   *         @arg @ref LL_EXTI_LINE_37
1276   *         @arg @ref LL_EXTI_LINE_38
1277   * @retval @note This bit is set when the selected edge event arrives on the interrupt
1278   */
LL_EXTI_ReadFlag_32_63(uint32_t ExtiLine)1279 __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_32_63(uint32_t ExtiLine)
1280 {
1281   return (uint32_t)(READ_BIT(EXTI->PR2, ExtiLine));
1282 }
1283 #endif
1284 
1285 /**
1286   * @brief  Clear ExtLine Flags  for Lines in range 0 to 31
1287   * @note This bit is set when the selected edge event arrives on the interrupt
1288   *       line. This bit is cleared by writing a 1 to the bit.
1289   * @rmtoll PR          PIFx           LL_EXTI_ClearFlag_0_31
1290   * @param  ExtiLine This parameter can be a combination of the following values:
1291   *         @arg @ref LL_EXTI_LINE_0
1292   *         @arg @ref LL_EXTI_LINE_1
1293   *         @arg @ref LL_EXTI_LINE_2
1294   *         @arg @ref LL_EXTI_LINE_3
1295   *         @arg @ref LL_EXTI_LINE_4
1296   *         @arg @ref LL_EXTI_LINE_5
1297   *         @arg @ref LL_EXTI_LINE_6
1298   *         @arg @ref LL_EXTI_LINE_7
1299   *         @arg @ref LL_EXTI_LINE_8
1300   *         @arg @ref LL_EXTI_LINE_9
1301   *         @arg @ref LL_EXTI_LINE_10
1302   *         @arg @ref LL_EXTI_LINE_11
1303   *         @arg @ref LL_EXTI_LINE_12
1304   *         @arg @ref LL_EXTI_LINE_13
1305   *         @arg @ref LL_EXTI_LINE_14
1306   *         @arg @ref LL_EXTI_LINE_15
1307   *         @arg @ref LL_EXTI_LINE_16
1308   *         @arg @ref LL_EXTI_LINE_18
1309   *         @arg @ref LL_EXTI_LINE_19
1310   *         @arg @ref LL_EXTI_LINE_20
1311   *         @arg @ref LL_EXTI_LINE_21
1312   *         @arg @ref LL_EXTI_LINE_22
1313   *         @arg @ref LL_EXTI_LINE_29
1314   *         @arg @ref LL_EXTI_LINE_30
1315   *         @arg @ref LL_EXTI_LINE_31
1316   * @note   Please check each device line mapping for EXTI Line availability
1317   * @retval None
1318   */
LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine)1319 __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine)
1320 {
1321   WRITE_REG(EXTI->PR, ExtiLine);
1322 }
1323 
1324 #if defined(EXTI_32_63_SUPPORT)
1325 /**
1326   * @brief  Clear ExtLine Flags for  Lines in range 32 to 63
1327   * @note This bit is set when the selected edge event arrives on the interrupt
1328   *       line. This bit is cleared by writing a 1 to the bit.
1329   * @rmtoll PR2          PIFx           LL_EXTI_ClearFlag_32_63
1330   * @param  ExtiLine This parameter can be a combination of the following values:
1331   *         @arg @ref LL_EXTI_LINE_35
1332   *         @arg @ref LL_EXTI_LINE_36
1333   *         @arg @ref LL_EXTI_LINE_37
1334   *         @arg @ref LL_EXTI_LINE_38
1335   * @retval None
1336   */
LL_EXTI_ClearFlag_32_63(uint32_t ExtiLine)1337 __STATIC_INLINE void LL_EXTI_ClearFlag_32_63(uint32_t ExtiLine)
1338 {
1339   WRITE_REG(EXTI->PR2, ExtiLine);
1340 }
1341 #endif
1342 
1343 /**
1344   * @}
1345   */
1346 
1347 #if defined(USE_FULL_LL_DRIVER)
1348 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
1349   * @{
1350   */
1351 
1352 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1353 uint32_t LL_EXTI_DeInit(void);
1354 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1355 
1356 
1357 /**
1358   * @}
1359   */
1360 #endif /* USE_FULL_LL_DRIVER */
1361 
1362 /**
1363   * @}
1364   */
1365 
1366 /**
1367   * @}
1368   */
1369 
1370 #endif /* EXTI */
1371 
1372 /**
1373   * @}
1374   */
1375 
1376 #ifdef __cplusplus
1377 }
1378 #endif
1379 
1380 #endif /* __STM32F3xx_LL_EXTI_H */
1381 
1382