1 /**
2 ******************************************************************************
3 * @file stm32u0xx_ll_exti.h
4 * @author MCD Application Team
5 * @brief Header file of EXTI LL module.
6 ******************************************************************************
7 * @attention
8 *
9 * Copyright (c) 2023 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 STM32U0xx_LL_EXTI_H
21 #define STM32U0xx_LL_EXTI_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32u0xx.h"
29
30 /** @addtogroup STM32U0xx_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 #define LL_EXTI_REGISTER_PINPOS_SHFT 16U /*!< Define used to shift pin position in EXTICR register */
44
45 /* Private Macros ------------------------------------------------------------*/
46 #if defined(USE_FULL_LL_DRIVER)
47 /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros
48 * @{
49 */
50 /**
51 * @}
52 */
53 #endif /*USE_FULL_LL_DRIVER*/
54 /* Exported types ------------------------------------------------------------*/
55 #if defined(USE_FULL_LL_DRIVER)
56 /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure
57 * @{
58 */
59 typedef struct
60 {
61
62 uint32_t Line_0_31; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31
63 This parameter can be any combination of @ref EXTI_LL_EC_LINE */
64
65 uint32_t Line_32_63; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 32 to 63
66 This parameter can be any combination of @ref EXTI_LL_EC_LINE */
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 /* Exported constants --------------------------------------------------------*/
83 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
84 * @{
85 */
86
87 /** @defgroup EXTI_LL_EC_LINE LINE
88 * @{
89 */
90 #define LL_EXTI_LINE_0 EXTI_IMR1_IM0 /*!< Extended line 0 */
91 #define LL_EXTI_LINE_1 EXTI_IMR1_IM1 /*!< Extended line 1 */
92 #define LL_EXTI_LINE_2 EXTI_IMR1_IM2 /*!< Extended line 2 */
93 #define LL_EXTI_LINE_3 EXTI_IMR1_IM3 /*!< Extended line 3 */
94 #define LL_EXTI_LINE_4 EXTI_IMR1_IM4 /*!< Extended line 4 */
95 #define LL_EXTI_LINE_5 EXTI_IMR1_IM5 /*!< Extended line 5 */
96 #define LL_EXTI_LINE_6 EXTI_IMR1_IM6 /*!< Extended line 6 */
97 #define LL_EXTI_LINE_7 EXTI_IMR1_IM7 /*!< Extended line 7 */
98 #define LL_EXTI_LINE_8 EXTI_IMR1_IM8 /*!< Extended line 8 */
99 #define LL_EXTI_LINE_9 EXTI_IMR1_IM9 /*!< Extended line 9 */
100 #define LL_EXTI_LINE_10 EXTI_IMR1_IM10 /*!< Extended line 10 */
101 #define LL_EXTI_LINE_11 EXTI_IMR1_IM11 /*!< Extended line 11 */
102 #define LL_EXTI_LINE_12 EXTI_IMR1_IM12 /*!< Extended line 12 */
103 #define LL_EXTI_LINE_13 EXTI_IMR1_IM13 /*!< Extended line 13 */
104 #define LL_EXTI_LINE_14 EXTI_IMR1_IM14 /*!< Extended line 14 */
105 #define LL_EXTI_LINE_15 EXTI_IMR1_IM15 /*!< Extended line 15 */
106 #define LL_EXTI_LINE_16 EXTI_IMR1_IM16 /*!< Extended line 16 */
107 #define LL_EXTI_LINE_17 EXTI_IMR1_IM17 /*!< Extended line 17 */
108 #if defined(EXTI_IMR1_IM18)
109 #define LL_EXTI_LINE_18 EXTI_IMR1_IM18 /*!< Extended line 18 */
110 #endif /* EXTI_IMR1_IM18 */
111 #if defined(EXTI_IMR1_IM19)
112 #define LL_EXTI_LINE_19 EXTI_IMR1_IM19 /*!< Extended line 19 */
113 #endif /* EXTI_IMR1_IM19 */
114 #define LL_EXTI_LINE_20 EXTI_IMR1_IM20 /*!< Extended line 20 */
115 #define LL_EXTI_LINE_21 EXTI_IMR1_IM21 /*!< Extended line 21 */
116 #if defined(EXTI_IMR1_IM22)
117 #define LL_EXTI_LINE_22 EXTI_IMR1_IM22 /*!< Extended line 22 */
118 #endif /* EXTI_IMR1_IM22 */
119 #define LL_EXTI_LINE_23 EXTI_IMR1_IM23 /*!< Extended line 23 */
120 #define LL_EXTI_LINE_24 EXTI_IMR1_IM24 /*!< Extended line 24 */
121 #define LL_EXTI_LINE_25 EXTI_IMR1_IM25 /*!< Extended line 25 */
122 #if defined(EXTI_IMR1_IM26)
123 #define LL_EXTI_LINE_26 EXTI_IMR1_IM26 /*!< Extended line 26 */
124 #endif /* EXTI_IMR1_IM26 */
125 #define LL_EXTI_LINE_27 EXTI_IMR1_IM27 /*!< Extended line 27 */
126 #define LL_EXTI_LINE_28 EXTI_IMR1_IM28 /*!< Extended line 28 */
127 #define LL_EXTI_LINE_29 EXTI_IMR1_IM29 /*!< Extended line 29 */
128 #define LL_EXTI_LINE_30 EXTI_IMR1_IM30 /*!< Extended line 30 */
129 #define LL_EXTI_LINE_31 EXTI_IMR1_IM31 /*!< Extended line 31 */
130 #if defined(EXTI_IMR1_IM18) && defined(EXTI_IMR1_IM19) && defined(EXTI_IMR1_IM22) && defined(EXTI_IMR1_IM26)
131 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR1_IM /*!< All Extended line not reserved*/
132 #else
133 #define LL_EXTI_LINE_ALL_0_31 0xFBB3FFFFU /*!< ALL Extended line */
134 #endif /* defined(EXTI_IMR1_IM18) && defined(EXTI_IMR1_IM19) && defined(EXTI_IMR1_IM22) && defined(EXTI_IMR1_IM26) */
135 #if defined(EXTI_IMR2_IM32)
136 #define LL_EXTI_LINE_32 EXTI_IMR2_IM32 /*!< Extended line 32 */
137 #endif /* EXTI_IMR2_IM32 */
138 #define LL_EXTI_LINE_33 EXTI_IMR2_IM33 /*!< Extended line 33 */
139 #define LL_EXTI_LINE_34 EXTI_IMR2_IM34 /*!< Extended line 34 */
140 #define LL_EXTI_LINE_35 EXTI_IMR2_IM35 /*!< Extended line 35 */
141 #if defined(EXTI_IMR2_IM36)
142 #define LL_EXTI_LINE_36 EXTI_IMR2_IM36 /*!< Extended line 36 */
143 #endif /* EXTI_IMR2_IM36 */
144 #define LL_EXTI_LINE_37 EXTI_IMR2_IM37 /*!< Extended line 37 */
145 #if defined(EXTI_IMR2_IM36) && defined(EXTI_IMR2_IM32)
146 #define LL_EXTI_LINE_ALL_32_63 EXTI_IMR2_IM /*!< All Extended line not reserved*/
147 #else
148 #define LL_EXTI_LINE_ALL_32_63 0x0000002EU /*!< line 36 & line 32 are reserved*/
149 #endif /* EXTI_IMR2_IM36 & EXTI_IMR2_IM32 */
150 #define LL_EXTI_LINE_ALL ((uint32_t)0xFFFFFFFFU) /*!< All Extended line */
151 #if defined(USE_FULL_LL_DRIVER)
152 #define LL_EXTI_LINE_NONE ((uint32_t)0x00000000U) /*!< None Extended line */
153 #endif /*USE_FULL_LL_DRIVER*/
154
155 /** @defgroup SYSTEM_LL_EC_EXTI_PORT EXTI EXTI PORT
156 * @{
157 */
158 #define LL_EXTI_CONFIG_PORTA 0U /*!< EXTI PORT A */
159 #define LL_EXTI_CONFIG_PORTB EXTI_EXTICR1_EXTI0_0 /*!< EXTI PORT B */
160 #define LL_EXTI_CONFIG_PORTC EXTI_EXTICR1_EXTI0_1 /*!< EXTI PORT C */
161 #define LL_EXTI_CONFIG_PORTD (EXTI_EXTICR1_EXTI0_1|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT D */
162 #if defined(GPIOE)
163 #define LL_EXTI_CONFIG_PORTE EXTI_EXTICR1_EXTI0_2 /*!< EXTI PORT E */
164 #endif /* GPIOE */
165 #define LL_EXTI_CONFIG_PORTF (EXTI_EXTICR1_EXTI0_2|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT F */
166 /**
167 * @}
168 */
169
170 /** @defgroup SYSTEM_LL_EC_EXTI_LINE EXTI CONFIG LINE
171 * @{
172 */
173 #define LL_EXTI_CONFIG_LINE0 (uint32_t)(0U << 16U | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
174 #define LL_EXTI_CONFIG_LINE1 (uint32_t)(8U << 16U | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
175 #define LL_EXTI_CONFIG_LINE2 (uint32_t)(16U << 16U | 0U) /*!< EXTI_POSITION_16 | EXTICR[0] */
176 #define LL_EXTI_CONFIG_LINE3 (uint32_t)(24U << 16U | 0U) /*!< EXTI_POSITION_24 | EXTICR[0] */
177 #define LL_EXTI_CONFIG_LINE4 (uint32_t)(0U << 16U | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
178 #define LL_EXTI_CONFIG_LINE5 (uint32_t)(8U << 16U | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
179 #define LL_EXTI_CONFIG_LINE6 (uint32_t)(16U << 16U | 1U) /*!< EXTI_POSITION_16 | EXTICR[1] */
180 #define LL_EXTI_CONFIG_LINE7 (uint32_t)(24U << 16U | 1U) /*!< EXTI_POSITION_24 | EXTICR[1] */
181 #define LL_EXTI_CONFIG_LINE8 (uint32_t)(0U << 16U | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
182 #define LL_EXTI_CONFIG_LINE9 (uint32_t)(8U << 16U | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
183 #define LL_EXTI_CONFIG_LINE10 (uint32_t)(16U << 16U | 2U) /*!< EXTI_POSITION_16 | EXTICR[2] */
184 #define LL_EXTI_CONFIG_LINE11 (uint32_t)(24U << 16U | 2U) /*!< EXTI_POSITION_24 | EXTICR[2] */
185 #define LL_EXTI_CONFIG_LINE12 (uint32_t)(0U << 16U | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
186 #define LL_EXTI_CONFIG_LINE13 (uint32_t)(8U << 16U | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
187 #define LL_EXTI_CONFIG_LINE14 (uint32_t)(16U << 16U | 3U) /*!< EXTI_POSITION_16 | EXTICR[3] */
188 #define LL_EXTI_CONFIG_LINE15 (uint32_t)(24U << 16U | 3U) /*!< EXTI_POSITION_24 | EXTICR[3] */
189 /**
190 * @}
191 */
192 /**
193 * @}
194 */
195 #if defined(USE_FULL_LL_DRIVER)
196
197 /** @defgroup EXTI_LL_EC_MODE Mode
198 * @{
199 */
200 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
201 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
202 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
203 /**
204 * @}
205 */
206
207 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
208 * @{
209 */
210 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
211 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
212 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
213 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
214
215 /**
216 * @}
217 */
218
219 #endif /*USE_FULL_LL_DRIVER*/
220
221 /**
222 * @}
223 */
224
225 /* Exported macro ------------------------------------------------------------*/
226 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
227 * @{
228 */
229
230 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
231 * @{
232 */
233
234 /**
235 * @brief Write a value in EXTI register
236 * @param __REG__ Register to be written
237 * @param __VALUE__ Value to be written in the register
238 * @retval None
239 */
240 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
241
242 /**
243 * @brief Read a value in EXTI register
244 * @param __REG__ Register to be read
245 * @retval Register value
246 */
247 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
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 IMR1 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 *
305 * (*) value not defined in all devices.
306 * @note Please check each device line mapping for EXTI Line availability
307 * @retval None
308 */
LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)309 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
310 {
311 SET_BIT(EXTI->IMR1, ExtiLine);
312 }
313 /**
314 * @brief Enable ExtiLine Interrupt request for Lines in range 32 to 63
315 * @note The reset value for the direct lines (lines from 32 to 34, line
316 * 39) is set to 1 in order to enable the interrupt by default.
317 * Bits are set automatically at Power on.
318 * @rmtoll IMR2 IMx LL_EXTI_EnableIT_32_63
319 * @param ExtiLine This parameter can be one of the following values:
320 * @arg @ref LL_EXTI_LINE_32 (*)
321 * @arg @ref LL_EXTI_LINE_33
322 * @arg @ref LL_EXTI_LINE_34
323 * @arg @ref LL_EXTI_LINE_35
324 * @arg @ref LL_EXTI_LINE_36 (*)
325 * @arg @ref LL_EXTI_LINE_37
326 * @arg @ref LL_EXTI_LINE_ALL_32_63
327 *
328 * (*) value not defined in all devices.
329 * @retval None
330 */
LL_EXTI_EnableIT_32_63(uint32_t ExtiLine)331 __STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine)
332 {
333 SET_BIT(EXTI->IMR2, ExtiLine);
334 }
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 IMR1 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 *
377 * (*) value not defined in all devices.
378 * @note Please check each device line mapping for EXTI Line availability
379 * @retval None
380 */
LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)381 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
382 {
383 CLEAR_BIT(EXTI->IMR1, ExtiLine);
384 }
385
386 /**
387 * @brief Disable ExtiLine Interrupt request for Lines in range 32 to 63
388 * @note The reset value for the direct lines (lines from 32 to 34, line
389 * 39) is set to 1 in order to enable the interrupt by default.
390 * Bits are set automatically at Power on.
391 * @rmtoll IMR2 IMx LL_EXTI_DisableIT_32_63
392 * @param ExtiLine This parameter can be one of the following values:
393 * @arg @ref LL_EXTI_LINE_32 (*)
394 * @arg @ref LL_EXTI_LINE_33
395 * @arg @ref LL_EXTI_LINE_34
396 * @arg @ref LL_EXTI_LINE_35
397 * @arg @ref LL_EXTI_LINE_36 (*)
398 * @arg @ref LL_EXTI_LINE_37
399 * @arg @ref LL_EXTI_LINE_ALL_32_63
400 *
401 * (*) value not defined in all devices.
402 * @retval None
403 */
LL_EXTI_DisableIT_32_63(uint32_t ExtiLine)404 __STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine)
405 {
406 CLEAR_BIT(EXTI->IMR2, ExtiLine);
407 }
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 IMR1 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 *
450 * (*) value not defined in all devices.
451 * @note Please check each device line mapping for EXTI Line availability
452 * @retval State of bit (1 or 0).
453 */
LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)454 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
455 {
456 return ((READ_BIT(EXTI->IMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
457 }
458
459 /**
460 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63
461 * @note The reset value for the direct lines (lines from 32 to 34, line
462 * 39) is set to 1 in order to enable the interrupt by default.
463 * Bits are set automatically at Power on.
464 * @rmtoll IMR2 IMx LL_EXTI_IsEnabledIT_32_63
465 * @param ExtiLine This parameter can be one of the following values:
466 * @arg @ref LL_EXTI_LINE_32 (*)
467 * @arg @ref LL_EXTI_LINE_33
468 * @arg @ref LL_EXTI_LINE_34
469 * @arg @ref LL_EXTI_LINE_35
470 * @arg @ref LL_EXTI_LINE_36 (*)
471 * @arg @ref LL_EXTI_LINE_37
472 * @arg @ref LL_EXTI_LINE_ALL_32_63
473 *
474 * (*) value not defined in all devices.
475 * @retval State of bit (1 or 0).
476 */
LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine)477 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine)
478 {
479 return ((READ_BIT(EXTI->IMR2, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
480 }
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 EMR1 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 *
528 * (*) value not defined in all devices.
529 * @note Please check each device line mapping for EXTI Line availability
530 * @retval None
531 */
LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)532 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
533 {
534 SET_BIT(EXTI->EMR1, ExtiLine);
535
536 }
537
538 /**
539 * @brief Enable ExtiLine Event request for Lines in range 32 to 63
540 * @rmtoll EMR2 EMx LL_EXTI_EnableEvent_32_63
541 * @param ExtiLine This parameter can be a combination of the following values:
542 * @arg @ref LL_EXTI_LINE_32 (*)
543 * @arg @ref LL_EXTI_LINE_33
544 * @arg @ref LL_EXTI_LINE_34
545 * @arg @ref LL_EXTI_LINE_35
546 * @arg @ref LL_EXTI_LINE_36 (*)
547 * @arg @ref LL_EXTI_LINE_37
548 * @arg @ref LL_EXTI_LINE_ALL_32_63
549 *
550 * (*) value not defined in all devices.
551 * @retval None
552 */
LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine)553 __STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine)
554 {
555 SET_BIT(EXTI->EMR2, ExtiLine);
556 }
557
558 /**
559 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
560 * @rmtoll EMR1 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 *
596 * (*) value not defined in all devices.
597 * @note Please check each device line mapping for EXTI Line availability
598 * @retval None
599 */
LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)600 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
601 {
602 CLEAR_BIT(EXTI->EMR1, ExtiLine);
603 }
604
605 /**
606 * @brief Disable ExtiLine Event request for Lines in range 32 to 63
607 * @rmtoll EMR2 EMx LL_EXTI_DisableEvent_32_63
608 * @param ExtiLine This parameter can be a combination of the following values:
609 * @arg @ref LL_EXTI_LINE_32 (*)
610 * @arg @ref LL_EXTI_LINE_33
611 * @arg @ref LL_EXTI_LINE_34
612 * @arg @ref LL_EXTI_LINE_35
613 * @arg @ref LL_EXTI_LINE_36 (*)
614 * @arg @ref LL_EXTI_LINE_37
615 * @arg @ref LL_EXTI_LINE_ALL_32_63
616 *
617 * (*) value not defined in all devices.
618 * @retval None
619 */
LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine)620 __STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine)
621 {
622 CLEAR_BIT(EXTI->EMR2, ExtiLine);
623 }
624
625 /**
626 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
627 * @rmtoll EMR1 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 *
663 * (*) value not defined in all devices.
664 * @note Please check each device line mapping for EXTI Line availability
665 * @retval State of bit (1 or 0).
666 */
LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)667 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
668 {
669 return ((READ_BIT(EXTI->EMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
670 }
671
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_ALL_32_63
683 *
684 * (*) value not defined in all devices.
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)) ? 1UL : 0UL);
690 }
691
692 /**
693 * @}
694 */
695
696 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
697 * @{
698 */
699
700 /**
701 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
702 * @note The configurable wakeup lines are edge-triggered. No glitch must be
703 * generated on these lines. If a rising edge on a configurable interrupt
704 * line occurs during a write operation in the EXTI_RTSR register, the
705 * pending bit is not set.
706 * Rising and falling edge triggers can be set for
707 * the same interrupt line. In this case, both generate a trigger
708 * condition.
709 * @rmtoll RTSR1 RTx LL_EXTI_EnableRisingTrig_0_31
710 * @param ExtiLine This parameter can be a combination of the following values:
711 * @arg @ref LL_EXTI_LINE_0
712 * @arg @ref LL_EXTI_LINE_1
713 * @arg @ref LL_EXTI_LINE_2
714 * @arg @ref LL_EXTI_LINE_3
715 * @arg @ref LL_EXTI_LINE_4
716 * @arg @ref LL_EXTI_LINE_5
717 * @arg @ref LL_EXTI_LINE_6
718 * @arg @ref LL_EXTI_LINE_7
719 * @arg @ref LL_EXTI_LINE_8
720 * @arg @ref LL_EXTI_LINE_9
721 * @arg @ref LL_EXTI_LINE_10
722 * @arg @ref LL_EXTI_LINE_11
723 * @arg @ref LL_EXTI_LINE_12
724 * @arg @ref LL_EXTI_LINE_13
725 * @arg @ref LL_EXTI_LINE_14
726 * @arg @ref LL_EXTI_LINE_15
727 * @arg @ref LL_EXTI_LINE_16
728 * @arg @ref LL_EXTI_LINE_21
729 * @note Please check each device line mapping for EXTI Line availability
730 * @retval None
731 */
LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)732 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
733 {
734 SET_BIT(EXTI->RTSR1, ExtiLine);
735 }
736
737 /**
738 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
739 * @note The configurable wakeup lines are edge-triggered. No glitch must be
740 * generated on these lines. If a rising edge on a configurable interrupt
741 * line occurs during a write operation in the EXTI_RTSR register, the
742 * pending bit is not set.
743 * Rising and falling edge triggers can be set for
744 * the same interrupt line. In this case, both generate a trigger
745 * condition.
746 * @rmtoll RTSR1 RTx LL_EXTI_DisableRisingTrig_0_31
747 * @param ExtiLine This parameter can be a combination of the following values:
748 * @arg @ref LL_EXTI_LINE_0
749 * @arg @ref LL_EXTI_LINE_1
750 * @arg @ref LL_EXTI_LINE_2
751 * @arg @ref LL_EXTI_LINE_3
752 * @arg @ref LL_EXTI_LINE_4
753 * @arg @ref LL_EXTI_LINE_5
754 * @arg @ref LL_EXTI_LINE_6
755 * @arg @ref LL_EXTI_LINE_7
756 * @arg @ref LL_EXTI_LINE_8
757 * @arg @ref LL_EXTI_LINE_9
758 * @arg @ref LL_EXTI_LINE_10
759 * @arg @ref LL_EXTI_LINE_11
760 * @arg @ref LL_EXTI_LINE_12
761 * @arg @ref LL_EXTI_LINE_13
762 * @arg @ref LL_EXTI_LINE_14
763 * @arg @ref LL_EXTI_LINE_15
764 * @arg @ref LL_EXTI_LINE_16
765 * @arg @ref LL_EXTI_LINE_21
766 * @note Please check each device line mapping for EXTI Line availability
767 * @retval None
768 */
LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)769 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
770 {
771 CLEAR_BIT(EXTI->RTSR1, ExtiLine);
772 }
773
774 /**
775 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
776 * @rmtoll RTSR1 RTx LL_EXTI_IsEnabledRisingTrig_0_31
777 * @param ExtiLine This parameter can be a combination of the following values:
778 * @arg @ref LL_EXTI_LINE_0
779 * @arg @ref LL_EXTI_LINE_1
780 * @arg @ref LL_EXTI_LINE_2
781 * @arg @ref LL_EXTI_LINE_3
782 * @arg @ref LL_EXTI_LINE_4
783 * @arg @ref LL_EXTI_LINE_5
784 * @arg @ref LL_EXTI_LINE_6
785 * @arg @ref LL_EXTI_LINE_7
786 * @arg @ref LL_EXTI_LINE_8
787 * @arg @ref LL_EXTI_LINE_9
788 * @arg @ref LL_EXTI_LINE_10
789 * @arg @ref LL_EXTI_LINE_11
790 * @arg @ref LL_EXTI_LINE_12
791 * @arg @ref LL_EXTI_LINE_13
792 * @arg @ref LL_EXTI_LINE_14
793 * @arg @ref LL_EXTI_LINE_15
794 * @arg @ref LL_EXTI_LINE_16
795 * @arg @ref LL_EXTI_LINE_21
796 * @note Please check each device line mapping for EXTI Line availability
797 * @retval State of bit (1 or 0).
798 */
LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)799 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
800 {
801 return ((READ_BIT(EXTI->RTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
802 }
803
804 /**
805 * @}
806 */
807
808 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
809 * @{
810 */
811
812 /**
813 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
814 * @note The configurable wakeup lines are edge-triggered. No glitch must be
815 * generated on these lines. If a falling edge on a configurable interrupt
816 * line occurs during a write operation in the EXTI_FTSR register, the
817 * pending bit is not set.
818 * Rising and falling edge triggers can be set for
819 * the same interrupt line. In this case, both generate a trigger
820 * condition.
821 * @rmtoll FTSR1 FTx LL_EXTI_EnableFallingTrig_0_31
822 * @param ExtiLine This parameter can be a combination of the following values:
823 * @arg @ref LL_EXTI_LINE_0
824 * @arg @ref LL_EXTI_LINE_1
825 * @arg @ref LL_EXTI_LINE_2
826 * @arg @ref LL_EXTI_LINE_3
827 * @arg @ref LL_EXTI_LINE_4
828 * @arg @ref LL_EXTI_LINE_5
829 * @arg @ref LL_EXTI_LINE_6
830 * @arg @ref LL_EXTI_LINE_7
831 * @arg @ref LL_EXTI_LINE_8
832 * @arg @ref LL_EXTI_LINE_9
833 * @arg @ref LL_EXTI_LINE_10
834 * @arg @ref LL_EXTI_LINE_11
835 * @arg @ref LL_EXTI_LINE_12
836 * @arg @ref LL_EXTI_LINE_13
837 * @arg @ref LL_EXTI_LINE_14
838 * @arg @ref LL_EXTI_LINE_15
839 * @arg @ref LL_EXTI_LINE_16
840 * @arg @ref LL_EXTI_LINE_21
841 * @note Please check each device line mapping for EXTI Line availability
842 * @retval None
843 */
LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)844 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
845 {
846 SET_BIT(EXTI->FTSR1, ExtiLine);
847 }
848
849 /**
850 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
851 * @note The configurable wakeup lines are edge-triggered. No glitch must be
852 * generated on these lines. If a Falling edge on a configurable interrupt
853 * line occurs during a write operation in the EXTI_FTSR register, the
854 * pending bit is not set.
855 * Rising and falling edge triggers can be set for the same interrupt line.
856 * In this case, both generate a trigger condition.
857 * @rmtoll FTSR1 FTx LL_EXTI_DisableFallingTrig_0_31
858 * @param ExtiLine This parameter can be a combination of the following values:
859 * @arg @ref LL_EXTI_LINE_0
860 * @arg @ref LL_EXTI_LINE_1
861 * @arg @ref LL_EXTI_LINE_2
862 * @arg @ref LL_EXTI_LINE_3
863 * @arg @ref LL_EXTI_LINE_4
864 * @arg @ref LL_EXTI_LINE_5
865 * @arg @ref LL_EXTI_LINE_6
866 * @arg @ref LL_EXTI_LINE_7
867 * @arg @ref LL_EXTI_LINE_8
868 * @arg @ref LL_EXTI_LINE_9
869 * @arg @ref LL_EXTI_LINE_10
870 * @arg @ref LL_EXTI_LINE_11
871 * @arg @ref LL_EXTI_LINE_12
872 * @arg @ref LL_EXTI_LINE_13
873 * @arg @ref LL_EXTI_LINE_14
874 * @arg @ref LL_EXTI_LINE_15
875 * @arg @ref LL_EXTI_LINE_16
876 * @arg @ref LL_EXTI_LINE_21
877 * @note Please check each device line mapping for EXTI Line availability
878 * @retval None
879 */
LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)880 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
881 {
882 CLEAR_BIT(EXTI->FTSR1, ExtiLine);
883 }
884
885 /**
886 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
887 * @rmtoll FTSR1 FTx LL_EXTI_IsEnabledFallingTrig_0_31
888 * @param ExtiLine This parameter can be a combination of the following values:
889 * @arg @ref LL_EXTI_LINE_0
890 * @arg @ref LL_EXTI_LINE_1
891 * @arg @ref LL_EXTI_LINE_2
892 * @arg @ref LL_EXTI_LINE_3
893 * @arg @ref LL_EXTI_LINE_4
894 * @arg @ref LL_EXTI_LINE_5
895 * @arg @ref LL_EXTI_LINE_6
896 * @arg @ref LL_EXTI_LINE_7
897 * @arg @ref LL_EXTI_LINE_8
898 * @arg @ref LL_EXTI_LINE_9
899 * @arg @ref LL_EXTI_LINE_10
900 * @arg @ref LL_EXTI_LINE_11
901 * @arg @ref LL_EXTI_LINE_12
902 * @arg @ref LL_EXTI_LINE_13
903 * @arg @ref LL_EXTI_LINE_14
904 * @arg @ref LL_EXTI_LINE_15
905 * @arg @ref LL_EXTI_LINE_16
906 * @arg @ref LL_EXTI_LINE_21
907 * @note Please check each device line mapping for EXTI Line availability
908 * @retval State of bit (1 or 0).
909 */
LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)910 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
911 {
912 return ((READ_BIT(EXTI->FTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
913 }
914
915 /**
916 * @}
917 */
918
919 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
920 * @{
921 */
922
923 /**
924 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
925 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
926 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
927 * resulting in an interrupt request generation.
928 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
929 * register (by writing a 1 into the bit)
930 * @rmtoll SWIER1 SWIx LL_EXTI_GenerateSWI_0_31
931 * @param ExtiLine This parameter can be a combination of the following values:
932 * @arg @ref LL_EXTI_LINE_0
933 * @arg @ref LL_EXTI_LINE_1
934 * @arg @ref LL_EXTI_LINE_2
935 * @arg @ref LL_EXTI_LINE_3
936 * @arg @ref LL_EXTI_LINE_4
937 * @arg @ref LL_EXTI_LINE_5
938 * @arg @ref LL_EXTI_LINE_6
939 * @arg @ref LL_EXTI_LINE_7
940 * @arg @ref LL_EXTI_LINE_8
941 * @arg @ref LL_EXTI_LINE_9
942 * @arg @ref LL_EXTI_LINE_10
943 * @arg @ref LL_EXTI_LINE_11
944 * @arg @ref LL_EXTI_LINE_12
945 * @arg @ref LL_EXTI_LINE_13
946 * @arg @ref LL_EXTI_LINE_14
947 * @arg @ref LL_EXTI_LINE_15
948 * @arg @ref LL_EXTI_LINE_16
949 * @arg @ref LL_EXTI_LINE_21
950 * @note Please check each device line mapping for EXTI Line availability
951 * @retval None
952 */
LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)953 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
954 {
955 SET_BIT(EXTI->SWIER1, ExtiLine);
956 }
957
958 /**
959 * @}
960 */
961
962 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
963 * @{
964 */
965
966 /**
967 * @brief Check if the ExtLine Falling Flag is set or not for Lines in range 0 to 31
968 * @note This bit is set when the falling edge event arrives on the interrupt
969 * line. This bit is cleared by writing a 1 to the bit.
970 * @rmtoll FPR1 FPIFx LL_EXTI_IsActiveFallingFlag_0_31
971 * @param ExtiLine This parameter can be a combination of the following values:
972 * @arg @ref LL_EXTI_LINE_0
973 * @arg @ref LL_EXTI_LINE_1
974 * @arg @ref LL_EXTI_LINE_2
975 * @arg @ref LL_EXTI_LINE_3
976 * @arg @ref LL_EXTI_LINE_4
977 * @arg @ref LL_EXTI_LINE_5
978 * @arg @ref LL_EXTI_LINE_6
979 * @arg @ref LL_EXTI_LINE_7
980 * @arg @ref LL_EXTI_LINE_8
981 * @arg @ref LL_EXTI_LINE_9
982 * @arg @ref LL_EXTI_LINE_10
983 * @arg @ref LL_EXTI_LINE_11
984 * @arg @ref LL_EXTI_LINE_12
985 * @arg @ref LL_EXTI_LINE_13
986 * @arg @ref LL_EXTI_LINE_14
987 * @arg @ref LL_EXTI_LINE_15
988 * @arg @ref LL_EXTI_LINE_16
989 * @arg @ref LL_EXTI_LINE_21
990 * @note Please check each device line mapping for EXTI Line availability
991 * @retval State of bit (1 or 0).
992 */
LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)993 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)
994 {
995 return ((READ_BIT(EXTI->FPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
996 }
997
998 /**
999 * @brief Read ExtLine Combination Falling Flag for Lines in range 0 to 31
1000 * @note This bit is set when the falling edge event arrives on the interrupt
1001 * line. This bit is cleared by writing a 1 to the bit.
1002 * @rmtoll FPR1 FPIFx LL_EXTI_ReadFallingFlag_0_31
1003 * @param ExtiLine This parameter can be a combination of the following values:
1004 * @arg @ref LL_EXTI_LINE_0
1005 * @arg @ref LL_EXTI_LINE_1
1006 * @arg @ref LL_EXTI_LINE_2
1007 * @arg @ref LL_EXTI_LINE_3
1008 * @arg @ref LL_EXTI_LINE_4
1009 * @arg @ref LL_EXTI_LINE_5
1010 * @arg @ref LL_EXTI_LINE_6
1011 * @arg @ref LL_EXTI_LINE_7
1012 * @arg @ref LL_EXTI_LINE_8
1013 * @arg @ref LL_EXTI_LINE_9
1014 * @arg @ref LL_EXTI_LINE_10
1015 * @arg @ref LL_EXTI_LINE_11
1016 * @arg @ref LL_EXTI_LINE_12
1017 * @arg @ref LL_EXTI_LINE_13
1018 * @arg @ref LL_EXTI_LINE_14
1019 * @arg @ref LL_EXTI_LINE_15
1020 * @arg @ref LL_EXTI_LINE_16
1021 * @arg @ref LL_EXTI_LINE_21
1022 * @note Please check each device line mapping for EXTI Line availability
1023 * @retval @note This bit is set when the selected edge event arrives on the interrupt
1024 */
LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)1025 __STATIC_INLINE uint32_t LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)
1026 {
1027 return (uint32_t)(READ_BIT(EXTI->FPR1, ExtiLine));
1028 }
1029
1030 /**
1031 * @brief Clear ExtLine Falling Flags for Lines in range 0 to 31
1032 * @note This bit is set when the falling edge event arrives on the interrupt
1033 * line. This bit is cleared by writing a 1 to the bit.
1034 * @rmtoll FPR1 FPIFx LL_EXTI_ClearFallingFlag_0_31
1035 * @param ExtiLine This parameter can be a combination of the following values:
1036 * @arg @ref LL_EXTI_LINE_0
1037 * @arg @ref LL_EXTI_LINE_1
1038 * @arg @ref LL_EXTI_LINE_2
1039 * @arg @ref LL_EXTI_LINE_3
1040 * @arg @ref LL_EXTI_LINE_4
1041 * @arg @ref LL_EXTI_LINE_5
1042 * @arg @ref LL_EXTI_LINE_6
1043 * @arg @ref LL_EXTI_LINE_7
1044 * @arg @ref LL_EXTI_LINE_8
1045 * @arg @ref LL_EXTI_LINE_9
1046 * @arg @ref LL_EXTI_LINE_10
1047 * @arg @ref LL_EXTI_LINE_11
1048 * @arg @ref LL_EXTI_LINE_12
1049 * @arg @ref LL_EXTI_LINE_13
1050 * @arg @ref LL_EXTI_LINE_14
1051 * @arg @ref LL_EXTI_LINE_15
1052 * @arg @ref LL_EXTI_LINE_16
1053 * @arg @ref LL_EXTI_LINE_21
1054 * @note Please check each device line mapping for EXTI Line availability
1055 * @retval None
1056 */
LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)1057 __STATIC_INLINE void LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)
1058 {
1059 WRITE_REG(EXTI->FPR1, ExtiLine);
1060 }
1061
1062 /**
1063 * @brief Check if the ExtLine Rising Flag is set or not for Lines in range 0 to 31
1064 * @note This bit is set when the Rising edge event arrives on the interrupt
1065 * line. This bit is cleared by writing a 1 to the bit.
1066 * @rmtoll RPR1 RPIFx LL_EXTI_IsActiveRisingFlag_0_31
1067 * @param ExtiLine This parameter can be a combination of the following values:
1068 * @arg @ref LL_EXTI_LINE_0
1069 * @arg @ref LL_EXTI_LINE_1
1070 * @arg @ref LL_EXTI_LINE_2
1071 * @arg @ref LL_EXTI_LINE_3
1072 * @arg @ref LL_EXTI_LINE_4
1073 * @arg @ref LL_EXTI_LINE_5
1074 * @arg @ref LL_EXTI_LINE_6
1075 * @arg @ref LL_EXTI_LINE_7
1076 * @arg @ref LL_EXTI_LINE_8
1077 * @arg @ref LL_EXTI_LINE_9
1078 * @arg @ref LL_EXTI_LINE_10
1079 * @arg @ref LL_EXTI_LINE_11
1080 * @arg @ref LL_EXTI_LINE_12
1081 * @arg @ref LL_EXTI_LINE_13
1082 * @arg @ref LL_EXTI_LINE_14
1083 * @arg @ref LL_EXTI_LINE_15
1084 * @arg @ref LL_EXTI_LINE_16
1085 * @arg @ref LL_EXTI_LINE_21
1086 * @note Please check each device line mapping for EXTI Line availability
1087 * @retval State of bit (1 or 0).
1088 */
LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)1089 __STATIC_INLINE uint32_t LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)
1090 {
1091 return ((READ_BIT(EXTI->RPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
1092 }
1093
1094 /**
1095 * @brief Read ExtLine Combination Rising Flag for Lines in range 0 to 31
1096 * @note This bit is set when the Rising edge event arrives on the interrupt
1097 * line. This bit is cleared by writing a 1 to the bit.
1098 * @rmtoll RPR1 RPIFx LL_EXTI_ReadRisingFlag_0_31
1099 * @param ExtiLine This parameter can be a combination of the following values:
1100 * @arg @ref LL_EXTI_LINE_0
1101 * @arg @ref LL_EXTI_LINE_1
1102 * @arg @ref LL_EXTI_LINE_2
1103 * @arg @ref LL_EXTI_LINE_3
1104 * @arg @ref LL_EXTI_LINE_4
1105 * @arg @ref LL_EXTI_LINE_5
1106 * @arg @ref LL_EXTI_LINE_6
1107 * @arg @ref LL_EXTI_LINE_7
1108 * @arg @ref LL_EXTI_LINE_8
1109 * @arg @ref LL_EXTI_LINE_9
1110 * @arg @ref LL_EXTI_LINE_10
1111 * @arg @ref LL_EXTI_LINE_11
1112 * @arg @ref LL_EXTI_LINE_12
1113 * @arg @ref LL_EXTI_LINE_13
1114 * @arg @ref LL_EXTI_LINE_14
1115 * @arg @ref LL_EXTI_LINE_15
1116 * @arg @ref LL_EXTI_LINE_16
1117 * @arg @ref LL_EXTI_LINE_21
1118 * @note Please check each device line mapping for EXTI Line availability
1119 * @retval @note This bit is set when the selected edge event arrives on the interrupt
1120 */
LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)1121 __STATIC_INLINE uint32_t LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)
1122 {
1123 return (uint32_t)(READ_BIT(EXTI->RPR1, ExtiLine));
1124 }
1125
1126 /**
1127 * @brief Clear ExtLine Rising Flags for Lines in range 0 to 31
1128 * @note This bit is set when the Rising edge event arrives on the interrupt
1129 * line. This bit is cleared by writing a 1 to the bit.
1130 * @rmtoll RPR1 RPIFx LL_EXTI_ClearRisingFlag_0_31
1131 * @param ExtiLine This parameter can be a combination of the following values:
1132 * @arg @ref LL_EXTI_LINE_0
1133 * @arg @ref LL_EXTI_LINE_1
1134 * @arg @ref LL_EXTI_LINE_2
1135 * @arg @ref LL_EXTI_LINE_3
1136 * @arg @ref LL_EXTI_LINE_4
1137 * @arg @ref LL_EXTI_LINE_5
1138 * @arg @ref LL_EXTI_LINE_6
1139 * @arg @ref LL_EXTI_LINE_7
1140 * @arg @ref LL_EXTI_LINE_8
1141 * @arg @ref LL_EXTI_LINE_9
1142 * @arg @ref LL_EXTI_LINE_10
1143 * @arg @ref LL_EXTI_LINE_11
1144 * @arg @ref LL_EXTI_LINE_12
1145 * @arg @ref LL_EXTI_LINE_13
1146 * @arg @ref LL_EXTI_LINE_14
1147 * @arg @ref LL_EXTI_LINE_15
1148 * @arg @ref LL_EXTI_LINE_16
1149 * @arg @ref LL_EXTI_LINE_21
1150 * @note Please check each device line mapping for EXTI Line availability
1151 * @retval None
1152 */
LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)1153 __STATIC_INLINE void LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)
1154 {
1155 WRITE_REG(EXTI->RPR1, ExtiLine);
1156 }
1157
1158 /**
1159 * @}
1160 */
1161 /** @defgroup EXTI_LL_EF_Config EF configuration functions
1162 * @{
1163 */
1164
1165 /**
1166 * @brief Configure source input for the EXTI external interrupt.
1167 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
1168 * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
1169 * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
1170 * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
1171 * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
1172 * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
1173 * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
1174 * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
1175 * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
1176 * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
1177 * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
1178 * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
1179 * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
1180 * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
1181 * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
1182 * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
1183 * @param Port This parameter can be one of the following values:
1184 * @arg @ref LL_EXTI_CONFIG_PORTA
1185 * @arg @ref LL_EXTI_CONFIG_PORTB
1186 * @arg @ref LL_EXTI_CONFIG_PORTC
1187 * @arg @ref LL_EXTI_CONFIG_PORTD
1188 * @arg @ref LL_EXTI_CONFIG_PORTE
1189 * @arg @ref LL_EXTI_CONFIG_PORTF
1190 *
1191 * (*) value not defined in all devices
1192 * @param Line This parameter can be one of the following values:
1193 * @arg @ref LL_EXTI_CONFIG_LINE0
1194 * @arg @ref LL_EXTI_CONFIG_LINE1
1195 * @arg @ref LL_EXTI_CONFIG_LINE2
1196 * @arg @ref LL_EXTI_CONFIG_LINE3
1197 * @arg @ref LL_EXTI_CONFIG_LINE4
1198 * @arg @ref LL_EXTI_CONFIG_LINE5
1199 * @arg @ref LL_EXTI_CONFIG_LINE6
1200 * @arg @ref LL_EXTI_CONFIG_LINE7
1201 * @arg @ref LL_EXTI_CONFIG_LINE8
1202 * @arg @ref LL_EXTI_CONFIG_LINE9
1203 * @arg @ref LL_EXTI_CONFIG_LINE10
1204 * @arg @ref LL_EXTI_CONFIG_LINE11
1205 * @arg @ref LL_EXTI_CONFIG_LINE12
1206 * @arg @ref LL_EXTI_CONFIG_LINE13
1207 * @arg @ref LL_EXTI_CONFIG_LINE14
1208 * @arg @ref LL_EXTI_CONFIG_LINE15
1209 * @retval None
1210 */
LL_EXTI_SetEXTISource(uint32_t Port,uint32_t Line)1211 __STATIC_INLINE void LL_EXTI_SetEXTISource(uint32_t Port, uint32_t Line)
1212 {
1213 MODIFY_REG(EXTI->EXTICR[Line & 0xFF], EXTI_EXTICR1_EXTI0 << (Line >> 16), Port << (Line >> 16));
1214 }
1215
1216 /**
1217 * @brief Get the configured defined for specific EXTI Line
1218 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
1219 * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
1220 * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
1221 * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
1222 * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
1223 * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
1224 * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
1225 * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
1226 * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
1227 * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
1228 * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
1229 * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
1230 * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
1231 * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
1232 * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
1233 * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
1234 * @param Line This parameter can be one of the following values:
1235 * @arg @ref LL_EXTI_CONFIG_LINE0
1236 * @arg @ref LL_EXTI_CONFIG_LINE1
1237 * @arg @ref LL_EXTI_CONFIG_LINE2
1238 * @arg @ref LL_EXTI_CONFIG_LINE3
1239 * @arg @ref LL_EXTI_CONFIG_LINE4
1240 * @arg @ref LL_EXTI_CONFIG_LINE5
1241 * @arg @ref LL_EXTI_CONFIG_LINE6
1242 * @arg @ref LL_EXTI_CONFIG_LINE7
1243 * @arg @ref LL_EXTI_CONFIG_LINE8
1244 * @arg @ref LL_EXTI_CONFIG_LINE9
1245 * @arg @ref LL_EXTI_CONFIG_LINE10
1246 * @arg @ref LL_EXTI_CONFIG_LINE11
1247 * @arg @ref LL_EXTI_CONFIG_LINE12
1248 * @arg @ref LL_EXTI_CONFIG_LINE13
1249 * @arg @ref LL_EXTI_CONFIG_LINE14
1250 * @arg @ref LL_EXTI_CONFIG_LINE15
1251 * @retval Returned value can be one of the following values:
1252 * @arg @ref LL_EXTI_CONFIG_PORTA
1253 * @arg @ref LL_EXTI_CONFIG_PORTB
1254 * @arg @ref LL_EXTI_CONFIG_PORTC
1255 * @arg @ref LL_EXTI_CONFIG_PORTD
1256 * @arg @ref LL_EXTI_CONFIG_PORTE
1257 * @arg @ref LL_EXTI_CONFIG_PORTF
1258 */
LL_EXTI_GetEXTISource(uint32_t Line)1259 __STATIC_INLINE uint32_t LL_EXTI_GetEXTISource(uint32_t Line)
1260 {
1261 return (uint32_t)(READ_BIT(EXTI->EXTICR[Line & 0xFF], (EXTI_EXTICR1_EXTI0 << (Line >> 16))) >> (Line >> 16));
1262 }
1263 /**
1264 * @}
1265 */
1266
1267 #if defined(USE_FULL_LL_DRIVER)
1268 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
1269 * @{
1270 */
1271
1272 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1273 uint32_t LL_EXTI_DeInit(void);
1274 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1275
1276 /**
1277 * @}
1278 */
1279 #endif /* USE_FULL_LL_DRIVER */
1280
1281 /**
1282 * @}
1283 */
1284
1285 /**
1286 * @}
1287 */
1288
1289 #endif /* EXTI */
1290
1291 /**
1292 * @}
1293 */
1294
1295 #ifdef __cplusplus
1296 }
1297 #endif
1298 #endif /* __STM32U0xx_LL_EXTI_H */
1299