1 /**
2 ******************************************************************************
3 * @file stm32c0xx_ll_exti.h
4 * @author MCD Application Team
5 * @brief Header file of EXTI LL module.
6 ******************************************************************************
7 * @attention
8 *
9 * Copyright (c) 2022 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 STM32C0xx_LL_EXTI_H
21 #define STM32C0xx_LL_EXTI_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32c0xx.h"
29
30 /** @addtogroup STM32C0xx_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 FunctionalState LineCommand; /*!< Specifies the new state of the selected EXTI lines.
66 This parameter can be set either to ENABLE or DISABLE */
67
68 uint8_t Mode; /*!< Specifies the mode for the EXTI lines.
69 This parameter can be a value of @ref EXTI_LL_EC_MODE. */
70
71 uint8_t Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
72 This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
73 } LL_EXTI_InitTypeDef;
74
75 /**
76 * @}
77 */
78 #endif /*USE_FULL_LL_DRIVER*/
79
80 /* Exported constants --------------------------------------------------------*/
81 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
82 * @{
83 */
84
85 /** @defgroup EXTI_LL_EC_LINE LINE
86 * @{
87 */
88 #define LL_EXTI_LINE_0 EXTI_IMR1_IM0 /*!< Extended line 0 */
89 #define LL_EXTI_LINE_1 EXTI_IMR1_IM1 /*!< Extended line 1 */
90 #define LL_EXTI_LINE_2 EXTI_IMR1_IM2 /*!< Extended line 2 */
91 #define LL_EXTI_LINE_3 EXTI_IMR1_IM3 /*!< Extended line 3 */
92 #define LL_EXTI_LINE_4 EXTI_IMR1_IM4 /*!< Extended line 4 */
93 #define LL_EXTI_LINE_5 EXTI_IMR1_IM5 /*!< Extended line 5 */
94 #define LL_EXTI_LINE_6 EXTI_IMR1_IM6 /*!< Extended line 6 */
95 #define LL_EXTI_LINE_7 EXTI_IMR1_IM7 /*!< Extended line 7 */
96 #define LL_EXTI_LINE_8 EXTI_IMR1_IM8 /*!< Extended line 8 */
97 #define LL_EXTI_LINE_9 EXTI_IMR1_IM9 /*!< Extended line 9 */
98 #define LL_EXTI_LINE_10 EXTI_IMR1_IM10 /*!< Extended line 10 */
99 #define LL_EXTI_LINE_11 EXTI_IMR1_IM11 /*!< Extended line 11 */
100 #define LL_EXTI_LINE_12 EXTI_IMR1_IM12 /*!< Extended line 12 */
101 #define LL_EXTI_LINE_13 EXTI_IMR1_IM13 /*!< Extended line 13 */
102 #define LL_EXTI_LINE_14 EXTI_IMR1_IM14 /*!< Extended line 14 */
103 #define LL_EXTI_LINE_15 EXTI_IMR1_IM15 /*!< Extended line 15 */
104 #define LL_EXTI_LINE_19 EXTI_IMR1_IM19 /*!< Extended line 19 */
105 #define LL_EXTI_LINE_23 EXTI_IMR1_IM23 /*!< Extended line 23 */
106 #define LL_EXTI_LINE_25 EXTI_IMR1_IM25 /*!< Extended line 25 */
107 #define LL_EXTI_LINE_31 EXTI_IMR1_IM31 /*!< Extended line 31 */
108 #define LL_EXTI_LINE_ALL_0_31 0xFFFFFFFFU /*!< All Extended line */
109
110 #if defined(USE_FULL_LL_DRIVER)
111 #define LL_EXTI_LINE_NONE 0x00000000U /*!< None Extended line */
112 #endif /*USE_FULL_LL_DRIVER*/
113
114 /** @defgroup EXTI_LL_EC_CONFIG_PORT EXTI CONFIG PORT
115 * @{
116 */
117 #define LL_EXTI_CONFIG_PORTA 0U /*!< EXTI PORT A */
118 #define LL_EXTI_CONFIG_PORTB EXTI_EXTICR1_EXTI0_0 /*!< EXTI PORT B */
119 #define LL_EXTI_CONFIG_PORTC EXTI_EXTICR1_EXTI0_1 /*!< EXTI PORT C */
120 #if defined(GPIOD_BASE)
121 #define LL_EXTI_CONFIG_PORTD (EXTI_EXTICR1_EXTI0_1|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT D */
122 #endif /*GPIOD_BASE*/
123 #define LL_EXTI_CONFIG_PORTF (EXTI_EXTICR1_EXTI0_2|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT F */
124 /**
125 * @}
126 */
127
128 /** @defgroup EXTI_LL_EC_CONFIG_LINE EXTI CONFIG LINE
129 * @{
130 */
131 #define LL_EXTI_CONFIG_LINE0 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
132 #define LL_EXTI_CONFIG_LINE1 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
133 #define LL_EXTI_CONFIG_LINE2 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_16 | EXTICR[0] */
134 #define LL_EXTI_CONFIG_LINE3 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 0U) /*!< EXTI_POSITION_24 | EXTICR[0] */
135 #define LL_EXTI_CONFIG_LINE4 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
136 #define LL_EXTI_CONFIG_LINE5 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
137 #define LL_EXTI_CONFIG_LINE6 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_16 | EXTICR[1] */
138 #define LL_EXTI_CONFIG_LINE7 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 1U) /*!< EXTI_POSITION_24 | EXTICR[1] */
139 #define LL_EXTI_CONFIG_LINE8 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
140 #define LL_EXTI_CONFIG_LINE9 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
141 #define LL_EXTI_CONFIG_LINE10 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_16 | EXTICR[2] */
142 #define LL_EXTI_CONFIG_LINE11 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 2U) /*!< EXTI_POSITION_24 | EXTICR[2] */
143 #define LL_EXTI_CONFIG_LINE12 ((0uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
144 #define LL_EXTI_CONFIG_LINE13 ((8uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
145 #define LL_EXTI_CONFIG_LINE14 ((16uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_16 | EXTICR[3] */
146 #define LL_EXTI_CONFIG_LINE15 ((24uL << LL_EXTI_REGISTER_PINPOS_SHFT) | 3U) /*!< EXTI_POSITION_24 | EXTICR[3] */
147 /**
148 * @}
149 */
150 /**
151 * @}
152 */
153 #if defined(USE_FULL_LL_DRIVER)
154
155 /** @defgroup EXTI_LL_EC_MODE Mode
156 * @{
157 */
158 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
159 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
160 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
161 /**
162 * @}
163 */
164
165 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
166 * @{
167 */
168 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
169 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
170 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
171 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
172
173 /**
174 * @}
175 */
176
177
178 #endif /*USE_FULL_LL_DRIVER*/
179
180
181 /**
182 * @}
183 */
184
185 /* Exported macro ------------------------------------------------------------*/
186 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
187 * @{
188 */
189
190 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
191 * @{
192 */
193
194 /**
195 * @brief Write a value in EXTI register
196 * @param __REG__ Register to be written
197 * @param __VALUE__ Value to be written in the register
198 * @retval None
199 */
200 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
201
202 /**
203 * @brief Read a value in EXTI register
204 * @param __REG__ Register to be read
205 * @retval Register value
206 */
207 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
208 /**
209 * @}
210 */
211
212
213 /**
214 * @}
215 */
216
217
218
219 /* Exported functions --------------------------------------------------------*/
220 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
221 * @{
222 */
223 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
224 * @{
225 */
226
227 /**
228 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
229 * @note The reset value for the direct or internal lines (see RM)
230 * is set to 1 in order to enable the interrupt by default.
231 * Bits are set automatically at Power on.
232 * @rmtoll IMR1 IMx LL_EXTI_EnableIT_0_31
233 * @param ExtiLine This parameter can be one of the following values:
234 * @arg @ref LL_EXTI_LINE_0
235 * @arg @ref LL_EXTI_LINE_1
236 * @arg @ref LL_EXTI_LINE_2
237 * @arg @ref LL_EXTI_LINE_3
238 * @arg @ref LL_EXTI_LINE_4
239 * @arg @ref LL_EXTI_LINE_5
240 * @arg @ref LL_EXTI_LINE_6
241 * @arg @ref LL_EXTI_LINE_7
242 * @arg @ref LL_EXTI_LINE_8
243 * @arg @ref LL_EXTI_LINE_9
244 * @arg @ref LL_EXTI_LINE_10
245 * @arg @ref LL_EXTI_LINE_11
246 * @arg @ref LL_EXTI_LINE_12
247 * @arg @ref LL_EXTI_LINE_13
248 * @arg @ref LL_EXTI_LINE_14
249 * @arg @ref LL_EXTI_LINE_15
250 * @arg @ref LL_EXTI_LINE_19
251 * @arg @ref LL_EXTI_LINE_23
252 * @arg @ref LL_EXTI_LINE_25
253 * @arg @ref LL_EXTI_LINE_31
254 * @note Please check each device line mapping for EXTI Line availability
255 * @retval None
256 */
LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)257 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
258 {
259 SET_BIT(EXTI->IMR1, ExtiLine);
260 }
261
262 /**
263 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
264 * @note The reset value for the direct or internal lines (see RM)
265 * is set to 1 in order to enable the interrupt by default.
266 * Bits are set automatically at Power on.
267 * @rmtoll IMR1 IMx LL_EXTI_DisableIT_0_31
268 * @param ExtiLine This parameter can be one of the following values:
269 * @arg @ref LL_EXTI_LINE_0
270 * @arg @ref LL_EXTI_LINE_1
271 * @arg @ref LL_EXTI_LINE_2
272 * @arg @ref LL_EXTI_LINE_3
273 * @arg @ref LL_EXTI_LINE_4
274 * @arg @ref LL_EXTI_LINE_5
275 * @arg @ref LL_EXTI_LINE_6
276 * @arg @ref LL_EXTI_LINE_7
277 * @arg @ref LL_EXTI_LINE_8
278 * @arg @ref LL_EXTI_LINE_9
279 * @arg @ref LL_EXTI_LINE_10
280 * @arg @ref LL_EXTI_LINE_11
281 * @arg @ref LL_EXTI_LINE_12
282 * @arg @ref LL_EXTI_LINE_13
283 * @arg @ref LL_EXTI_LINE_14
284 * @arg @ref LL_EXTI_LINE_15
285 * @arg @ref LL_EXTI_LINE_19
286 * @arg @ref LL_EXTI_LINE_23
287 * @arg @ref LL_EXTI_LINE_25
288 * @arg @ref LL_EXTI_LINE_31
289 * @note Please check each device line mapping for EXTI Line availability
290 * @retval None
291 */
LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)292 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
293 {
294 CLEAR_BIT(EXTI->IMR1, ExtiLine);
295 }
296
297 /**
298 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
299 * @note The reset value for the direct or internal lines (see RM)
300 * is set to 1 in order to enable the interrupt by default.
301 * Bits are set automatically at Power on.
302 * @rmtoll IMR1 IMx LL_EXTI_IsEnabledIT_0_31
303 * @param ExtiLine This parameter can be one of the following values:
304 * @arg @ref LL_EXTI_LINE_0
305 * @arg @ref LL_EXTI_LINE_1
306 * @arg @ref LL_EXTI_LINE_2
307 * @arg @ref LL_EXTI_LINE_3
308 * @arg @ref LL_EXTI_LINE_4
309 * @arg @ref LL_EXTI_LINE_5
310 * @arg @ref LL_EXTI_LINE_6
311 * @arg @ref LL_EXTI_LINE_7
312 * @arg @ref LL_EXTI_LINE_8
313 * @arg @ref LL_EXTI_LINE_9
314 * @arg @ref LL_EXTI_LINE_10
315 * @arg @ref LL_EXTI_LINE_11
316 * @arg @ref LL_EXTI_LINE_12
317 * @arg @ref LL_EXTI_LINE_13
318 * @arg @ref LL_EXTI_LINE_14
319 * @arg @ref LL_EXTI_LINE_15
320 * @arg @ref LL_EXTI_LINE_19
321 * @arg @ref LL_EXTI_LINE_23
322 * @arg @ref LL_EXTI_LINE_25
323 * @arg @ref LL_EXTI_LINE_31
324 * @note Please check each device line mapping for EXTI Line availability
325 * @retval None
326 */
LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)327 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
328 {
329 return ((READ_BIT(EXTI->IMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
330 }
331
332 /**
333 * @}
334 */
335
336 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
337 * @{
338 */
339
340 /**
341 * @brief Enable ExtiLine Event request for Lines in range 0 to 31
342 * @rmtoll EMR1 EMx LL_EXTI_EnableEvent_0_31
343 * @param ExtiLine This parameter can be one of the following values:
344 * @arg @ref LL_EXTI_LINE_0
345 * @arg @ref LL_EXTI_LINE_1
346 * @arg @ref LL_EXTI_LINE_2
347 * @arg @ref LL_EXTI_LINE_3
348 * @arg @ref LL_EXTI_LINE_4
349 * @arg @ref LL_EXTI_LINE_5
350 * @arg @ref LL_EXTI_LINE_6
351 * @arg @ref LL_EXTI_LINE_7
352 * @arg @ref LL_EXTI_LINE_8
353 * @arg @ref LL_EXTI_LINE_9
354 * @arg @ref LL_EXTI_LINE_10
355 * @arg @ref LL_EXTI_LINE_11
356 * @arg @ref LL_EXTI_LINE_12
357 * @arg @ref LL_EXTI_LINE_13
358 * @arg @ref LL_EXTI_LINE_14
359 * @arg @ref LL_EXTI_LINE_15
360 * @arg @ref LL_EXTI_LINE_19
361 * @arg @ref LL_EXTI_LINE_23
362 * @arg @ref LL_EXTI_LINE_25
363 * @arg @ref LL_EXTI_LINE_31
364 * @note Please check each device line mapping for EXTI Line availability
365 * @retval None
366 */
LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)367 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
368 {
369 SET_BIT(EXTI->EMR1, ExtiLine);
370
371 }
372
373 /**
374 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
375 * @rmtoll EMR1 EMx LL_EXTI_DisableEvent_0_31
376 * @param ExtiLine This parameter can be one of the following values:
377 * @arg @ref LL_EXTI_LINE_0
378 * @arg @ref LL_EXTI_LINE_1
379 * @arg @ref LL_EXTI_LINE_2
380 * @arg @ref LL_EXTI_LINE_3
381 * @arg @ref LL_EXTI_LINE_4
382 * @arg @ref LL_EXTI_LINE_5
383 * @arg @ref LL_EXTI_LINE_6
384 * @arg @ref LL_EXTI_LINE_7
385 * @arg @ref LL_EXTI_LINE_8
386 * @arg @ref LL_EXTI_LINE_9
387 * @arg @ref LL_EXTI_LINE_10
388 * @arg @ref LL_EXTI_LINE_11
389 * @arg @ref LL_EXTI_LINE_12
390 * @arg @ref LL_EXTI_LINE_13
391 * @arg @ref LL_EXTI_LINE_14
392 * @arg @ref LL_EXTI_LINE_15
393 * @arg @ref LL_EXTI_LINE_19
394 * @arg @ref LL_EXTI_LINE_23
395 * @arg @ref LL_EXTI_LINE_25
396 * @arg @ref LL_EXTI_LINE_31
397 * @note Please check each device line mapping for EXTI Line availability
398 * @retval None
399 */
LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)400 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
401 {
402 CLEAR_BIT(EXTI->EMR1, ExtiLine);
403 }
404
405 /**
406 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
407 * @rmtoll EMR1 EMx LL_EXTI_IsEnabledEvent_0_31
408 * @param ExtiLine This parameter can be one of the following values:
409 * @arg @ref LL_EXTI_LINE_0
410 * @arg @ref LL_EXTI_LINE_1
411 * @arg @ref LL_EXTI_LINE_2
412 * @arg @ref LL_EXTI_LINE_3
413 * @arg @ref LL_EXTI_LINE_4
414 * @arg @ref LL_EXTI_LINE_5
415 * @arg @ref LL_EXTI_LINE_6
416 * @arg @ref LL_EXTI_LINE_7
417 * @arg @ref LL_EXTI_LINE_8
418 * @arg @ref LL_EXTI_LINE_9
419 * @arg @ref LL_EXTI_LINE_10
420 * @arg @ref LL_EXTI_LINE_11
421 * @arg @ref LL_EXTI_LINE_12
422 * @arg @ref LL_EXTI_LINE_13
423 * @arg @ref LL_EXTI_LINE_14
424 * @arg @ref LL_EXTI_LINE_15
425 * @arg @ref LL_EXTI_LINE_19
426 * @arg @ref LL_EXTI_LINE_23
427 * @arg @ref LL_EXTI_LINE_25
428 * @arg @ref LL_EXTI_LINE_31
429 * @note Please check each device line mapping for EXTI Line availability
430 * @retval State of bit (1 or 0).
431 */
LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)432 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
433 {
434 return ((READ_BIT(EXTI->EMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
435 }
436
437
438 /**
439 * @}
440 */
441
442 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
443 * @{
444 */
445
446 /**
447 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
448 * @note The configurable wakeup lines are edge-triggered. No glitch must be
449 * generated on these lines. If a rising edge on a configurable interrupt
450 * line occurs during a write operation in the EXTI_RTSR register, the
451 * pending bit is not set.
452 * Rising and falling edge triggers can be set for
453 * the same interrupt line. In this case, both generate a trigger
454 * condition.
455 * @rmtoll RTSR1 RTx LL_EXTI_EnableRisingTrig_0_31
456 * @param ExtiLine This parameter can be a combination of the following values:
457 * @arg @ref LL_EXTI_LINE_0
458 * @arg @ref LL_EXTI_LINE_1
459 * @arg @ref LL_EXTI_LINE_2
460 * @arg @ref LL_EXTI_LINE_3
461 * @arg @ref LL_EXTI_LINE_4
462 * @arg @ref LL_EXTI_LINE_5
463 * @arg @ref LL_EXTI_LINE_6
464 * @arg @ref LL_EXTI_LINE_7
465 * @arg @ref LL_EXTI_LINE_8
466 * @arg @ref LL_EXTI_LINE_9
467 * @arg @ref LL_EXTI_LINE_10
468 * @arg @ref LL_EXTI_LINE_11
469 * @arg @ref LL_EXTI_LINE_12
470 * @arg @ref LL_EXTI_LINE_13
471 * @arg @ref LL_EXTI_LINE_14
472 * @arg @ref LL_EXTI_LINE_15
473 * @arg @ref LL_EXTI_LINE_19
474 * @arg @ref LL_EXTI_LINE_23
475 * @arg @ref LL_EXTI_LINE_25
476 * @arg @ref LL_EXTI_LINE_31
477 * @note Please check each device line mapping for EXTI Line availability
478 * @retval None
479 */
LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)480 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
481 {
482 SET_BIT(EXTI->RTSR1, ExtiLine);
483 }
484
485 /**
486 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
487 * @note The configurable wakeup lines are edge-triggered. No glitch must be
488 * generated on these lines. If a rising edge on a configurable interrupt
489 * line occurs during a write operation in the EXTI_RTSR register, the
490 * pending bit is not set.
491 * Rising and falling edge triggers can be set for
492 * the same interrupt line. In this case, both generate a trigger
493 * condition.
494 * @rmtoll RTSR1 RTx LL_EXTI_DisableRisingTrig_0_31
495 * @param ExtiLine This parameter can be a combination of the following values:
496 * @arg @ref LL_EXTI_LINE_0
497 * @arg @ref LL_EXTI_LINE_1
498 * @arg @ref LL_EXTI_LINE_2
499 * @arg @ref LL_EXTI_LINE_3
500 * @arg @ref LL_EXTI_LINE_4
501 * @arg @ref LL_EXTI_LINE_5
502 * @arg @ref LL_EXTI_LINE_6
503 * @arg @ref LL_EXTI_LINE_7
504 * @arg @ref LL_EXTI_LINE_8
505 * @arg @ref LL_EXTI_LINE_9
506 * @arg @ref LL_EXTI_LINE_10
507 * @arg @ref LL_EXTI_LINE_11
508 * @arg @ref LL_EXTI_LINE_12
509 * @arg @ref LL_EXTI_LINE_13
510 * @arg @ref LL_EXTI_LINE_14
511 * @arg @ref LL_EXTI_LINE_15
512 * @arg @ref LL_EXTI_LINE_19
513 * @arg @ref LL_EXTI_LINE_23
514 * @arg @ref LL_EXTI_LINE_25
515 * @arg @ref LL_EXTI_LINE_31
516 * @note Please check each device line mapping for EXTI Line availability
517 * @retval None
518 */
LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)519 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
520 {
521 CLEAR_BIT(EXTI->RTSR1, ExtiLine);
522
523 }
524
525 /**
526 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
527 * @rmtoll RTSR1 RTx LL_EXTI_IsEnabledRisingTrig_0_31
528 * @param ExtiLine This parameter can be a combination of the following values:
529 * @arg @ref LL_EXTI_LINE_0
530 * @arg @ref LL_EXTI_LINE_1
531 * @arg @ref LL_EXTI_LINE_2
532 * @arg @ref LL_EXTI_LINE_3
533 * @arg @ref LL_EXTI_LINE_4
534 * @arg @ref LL_EXTI_LINE_5
535 * @arg @ref LL_EXTI_LINE_6
536 * @arg @ref LL_EXTI_LINE_7
537 * @arg @ref LL_EXTI_LINE_8
538 * @arg @ref LL_EXTI_LINE_9
539 * @arg @ref LL_EXTI_LINE_10
540 * @arg @ref LL_EXTI_LINE_11
541 * @arg @ref LL_EXTI_LINE_12
542 * @arg @ref LL_EXTI_LINE_13
543 * @arg @ref LL_EXTI_LINE_14
544 * @arg @ref LL_EXTI_LINE_15
545 * @arg @ref LL_EXTI_LINE_19
546 * @arg @ref LL_EXTI_LINE_23
547 * @arg @ref LL_EXTI_LINE_25
548 * @arg @ref LL_EXTI_LINE_31
549 * @note Please check each device line mapping for EXTI Line availability
550 * @retval State of bit (1 or 0).
551 */
LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)552 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
553 {
554 return ((READ_BIT(EXTI->RTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
555 }
556
557 /**
558 * @}
559 */
560
561 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
562 * @{
563 */
564
565 /**
566 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
567 * @note The configurable wakeup lines are edge-triggered. No glitch must be
568 * generated on these lines. If a falling edge on a configurable interrupt
569 * line occurs during a write operation in the EXTI_FTSR register, the
570 * pending bit is not set.
571 * Rising and falling edge triggers can be set for
572 * the same interrupt line. In this case, both generate a trigger
573 * condition.
574 * @rmtoll FTSR1 FTx LL_EXTI_EnableFallingTrig_0_31
575 * @param ExtiLine This parameter can be a combination of the following values:
576 * @arg @ref LL_EXTI_LINE_0
577 * @arg @ref LL_EXTI_LINE_1
578 * @arg @ref LL_EXTI_LINE_2
579 * @arg @ref LL_EXTI_LINE_3
580 * @arg @ref LL_EXTI_LINE_4
581 * @arg @ref LL_EXTI_LINE_5
582 * @arg @ref LL_EXTI_LINE_6
583 * @arg @ref LL_EXTI_LINE_7
584 * @arg @ref LL_EXTI_LINE_8
585 * @arg @ref LL_EXTI_LINE_9
586 * @arg @ref LL_EXTI_LINE_10
587 * @arg @ref LL_EXTI_LINE_11
588 * @arg @ref LL_EXTI_LINE_12
589 * @arg @ref LL_EXTI_LINE_13
590 * @arg @ref LL_EXTI_LINE_14
591 * @arg @ref LL_EXTI_LINE_15
592 * @arg @ref LL_EXTI_LINE_19
593 * @arg @ref LL_EXTI_LINE_23
594 * @arg @ref LL_EXTI_LINE_25
595 * @arg @ref LL_EXTI_LINE_31
596 * @note Please check each device line mapping for EXTI Line availability
597 * @retval None
598 */
LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)599 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
600 {
601 SET_BIT(EXTI->FTSR1, ExtiLine);
602 }
603
604 /**
605 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
606 * @note The configurable wakeup lines are edge-triggered. No glitch must be
607 * generated on these lines. If a Falling edge on a configurable interrupt
608 * line occurs during a write operation in the EXTI_FTSR register, the
609 * pending bit is not set.
610 * Rising and falling edge triggers can be set for the same interrupt line.
611 * In this case, both generate a trigger condition.
612 * @rmtoll FTSR1 FTx LL_EXTI_DisableFallingTrig_0_31
613 * @param ExtiLine This parameter can be a combination of the following values:
614 * @arg @ref LL_EXTI_LINE_0
615 * @arg @ref LL_EXTI_LINE_1
616 * @arg @ref LL_EXTI_LINE_2
617 * @arg @ref LL_EXTI_LINE_3
618 * @arg @ref LL_EXTI_LINE_4
619 * @arg @ref LL_EXTI_LINE_5
620 * @arg @ref LL_EXTI_LINE_6
621 * @arg @ref LL_EXTI_LINE_7
622 * @arg @ref LL_EXTI_LINE_8
623 * @arg @ref LL_EXTI_LINE_9
624 * @arg @ref LL_EXTI_LINE_10
625 * @arg @ref LL_EXTI_LINE_11
626 * @arg @ref LL_EXTI_LINE_12
627 * @arg @ref LL_EXTI_LINE_13
628 * @arg @ref LL_EXTI_LINE_14
629 * @arg @ref LL_EXTI_LINE_15
630 * @arg @ref LL_EXTI_LINE_19
631 * @arg @ref LL_EXTI_LINE_23
632 * @arg @ref LL_EXTI_LINE_25
633 * @arg @ref LL_EXTI_LINE_31
634 * @note Please check each device line mapping for EXTI Line availability
635 * @retval None
636 */
LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)637 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
638 {
639 CLEAR_BIT(EXTI->FTSR1, ExtiLine);
640 }
641
642 /**
643 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
644 * @rmtoll FTSR1 FTx LL_EXTI_IsEnabledFallingTrig_0_31
645 * @param ExtiLine This parameter can be a combination of the following values:
646 * @arg @ref LL_EXTI_LINE_0
647 * @arg @ref LL_EXTI_LINE_1
648 * @arg @ref LL_EXTI_LINE_2
649 * @arg @ref LL_EXTI_LINE_3
650 * @arg @ref LL_EXTI_LINE_4
651 * @arg @ref LL_EXTI_LINE_5
652 * @arg @ref LL_EXTI_LINE_6
653 * @arg @ref LL_EXTI_LINE_7
654 * @arg @ref LL_EXTI_LINE_8
655 * @arg @ref LL_EXTI_LINE_9
656 * @arg @ref LL_EXTI_LINE_10
657 * @arg @ref LL_EXTI_LINE_11
658 * @arg @ref LL_EXTI_LINE_12
659 * @arg @ref LL_EXTI_LINE_13
660 * @arg @ref LL_EXTI_LINE_14
661 * @arg @ref LL_EXTI_LINE_15
662 * @arg @ref LL_EXTI_LINE_19
663 * @arg @ref LL_EXTI_LINE_23
664 * @arg @ref LL_EXTI_LINE_25
665 * @arg @ref LL_EXTI_LINE_31
666 * @note Please check each device line mapping for EXTI Line availability
667 * @retval State of bit (1 or 0).
668 */
LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)669 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
670 {
671 return ((READ_BIT(EXTI->FTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
672 }
673
674 /**
675 * @}
676 */
677
678 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
679 * @{
680 */
681
682 /**
683 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
684 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
685 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
686 * resulting in an interrupt request generation.
687 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
688 * register (by writing a 1 into the bit)
689 * @rmtoll SWIER1 SWIx LL_EXTI_GenerateSWI_0_31
690 * @param ExtiLine This parameter can be a combination of the following values:
691 * @arg @ref LL_EXTI_LINE_0
692 * @arg @ref LL_EXTI_LINE_1
693 * @arg @ref LL_EXTI_LINE_2
694 * @arg @ref LL_EXTI_LINE_3
695 * @arg @ref LL_EXTI_LINE_4
696 * @arg @ref LL_EXTI_LINE_5
697 * @arg @ref LL_EXTI_LINE_6
698 * @arg @ref LL_EXTI_LINE_7
699 * @arg @ref LL_EXTI_LINE_8
700 * @arg @ref LL_EXTI_LINE_9
701 * @arg @ref LL_EXTI_LINE_10
702 * @arg @ref LL_EXTI_LINE_11
703 * @arg @ref LL_EXTI_LINE_12
704 * @arg @ref LL_EXTI_LINE_13
705 * @arg @ref LL_EXTI_LINE_14
706 * @arg @ref LL_EXTI_LINE_15
707 * @arg @ref LL_EXTI_LINE_19
708 * @arg @ref LL_EXTI_LINE_23
709 * @arg @ref LL_EXTI_LINE_25
710 * @arg @ref LL_EXTI_LINE_31
711 * @note Please check each device line mapping for EXTI Line availability
712 * @retval None
713 */
LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)714 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
715 {
716 SET_BIT(EXTI->SWIER1, ExtiLine);
717 }
718
719 /**
720 * @}
721 */
722
723 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
724 * @{
725 */
726
727 /**
728 * @brief Check if the ExtLine Falling Flag is set or not for Lines in range 0 to 31
729 * @note This bit is set when the falling edge event arrives on the interrupt
730 * line. This bit is cleared by writing a 1 to the bit.
731 * @rmtoll FPR1 FPIFx LL_EXTI_IsActiveFallingFlag_0_31
732 * @param ExtiLine This parameter can be a combination of the following values:
733 * @arg @ref LL_EXTI_LINE_0
734 * @arg @ref LL_EXTI_LINE_1
735 * @arg @ref LL_EXTI_LINE_2
736 * @arg @ref LL_EXTI_LINE_3
737 * @arg @ref LL_EXTI_LINE_4
738 * @arg @ref LL_EXTI_LINE_5
739 * @arg @ref LL_EXTI_LINE_6
740 * @arg @ref LL_EXTI_LINE_7
741 * @arg @ref LL_EXTI_LINE_8
742 * @arg @ref LL_EXTI_LINE_9
743 * @arg @ref LL_EXTI_LINE_10
744 * @arg @ref LL_EXTI_LINE_11
745 * @arg @ref LL_EXTI_LINE_12
746 * @arg @ref LL_EXTI_LINE_13
747 * @arg @ref LL_EXTI_LINE_14
748 * @arg @ref LL_EXTI_LINE_15
749 * @arg @ref LL_EXTI_LINE_19
750 * @arg @ref LL_EXTI_LINE_23
751 * @arg @ref LL_EXTI_LINE_25
752 * @arg @ref LL_EXTI_LINE_31
753 * @note Please check each device line mapping for EXTI Line availability
754 * @retval State of bit (1 or 0).
755 */
LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)756 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)
757 {
758 return ((READ_BIT(EXTI->FPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
759 }
760
761 /**
762 * @brief Read ExtLine Combination Falling Flag for Lines in range 0 to 31
763 * @note This bit is set when the falling edge event arrives on the interrupt
764 * line. This bit is cleared by writing a 1 to the bit.
765 * @rmtoll FPR1 FPIFx LL_EXTI_ReadFallingFlag_0_31
766 * @param ExtiLine This parameter can be a combination of the following values:
767 * @arg @ref LL_EXTI_LINE_0
768 * @arg @ref LL_EXTI_LINE_1
769 * @arg @ref LL_EXTI_LINE_2
770 * @arg @ref LL_EXTI_LINE_3
771 * @arg @ref LL_EXTI_LINE_4
772 * @arg @ref LL_EXTI_LINE_5
773 * @arg @ref LL_EXTI_LINE_6
774 * @arg @ref LL_EXTI_LINE_7
775 * @arg @ref LL_EXTI_LINE_8
776 * @arg @ref LL_EXTI_LINE_9
777 * @arg @ref LL_EXTI_LINE_10
778 * @arg @ref LL_EXTI_LINE_11
779 * @arg @ref LL_EXTI_LINE_12
780 * @arg @ref LL_EXTI_LINE_13
781 * @arg @ref LL_EXTI_LINE_14
782 * @arg @ref LL_EXTI_LINE_15
783 * @arg @ref LL_EXTI_LINE_19
784 * @arg @ref LL_EXTI_LINE_23
785 * @arg @ref LL_EXTI_LINE_25
786 * @arg @ref LL_EXTI_LINE_31
787 * @note Please check each device line mapping for EXTI Line availability
788 * @retval @note This bit is set when the selected edge event arrives on the interrupt
789 */
LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)790 __STATIC_INLINE uint32_t LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)
791 {
792 return (READ_BIT(EXTI->FPR1, ExtiLine));
793 }
794
795 /**
796 * @brief Clear ExtLine Falling Flags for Lines in range 0 to 31
797 * @note This bit is set when the falling edge event arrives on the interrupt
798 * line. This bit is cleared by writing a 1 to the bit.
799 * @rmtoll FPR1 FPIFx LL_EXTI_ClearFallingFlag_0_31
800 * @param ExtiLine This parameter can be a combination of the following values:
801 * @arg @ref LL_EXTI_LINE_0
802 * @arg @ref LL_EXTI_LINE_1
803 * @arg @ref LL_EXTI_LINE_2
804 * @arg @ref LL_EXTI_LINE_3
805 * @arg @ref LL_EXTI_LINE_4
806 * @arg @ref LL_EXTI_LINE_5
807 * @arg @ref LL_EXTI_LINE_6
808 * @arg @ref LL_EXTI_LINE_7
809 * @arg @ref LL_EXTI_LINE_8
810 * @arg @ref LL_EXTI_LINE_9
811 * @arg @ref LL_EXTI_LINE_10
812 * @arg @ref LL_EXTI_LINE_11
813 * @arg @ref LL_EXTI_LINE_12
814 * @arg @ref LL_EXTI_LINE_13
815 * @arg @ref LL_EXTI_LINE_14
816 * @arg @ref LL_EXTI_LINE_15
817 * @arg @ref LL_EXTI_LINE_19
818 * @arg @ref LL_EXTI_LINE_23
819 * @arg @ref LL_EXTI_LINE_25
820 * @arg @ref LL_EXTI_LINE_31
821 * @note Please check each device line mapping for EXTI Line availability
822 * @retval None
823 */
LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)824 __STATIC_INLINE void LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)
825 {
826 WRITE_REG(EXTI->FPR1, ExtiLine);
827 }
828
829 /**
830 * @brief Check if the ExtLine Rising Flag is set or not for Lines in range 0 to 31
831 * @note This bit is set when the Rising edge event arrives on the interrupt
832 * line. This bit is cleared by writing a 1 to the bit.
833 * @rmtoll RPR1 RPIFx LL_EXTI_IsActiveRisingFlag_0_31
834 * @param ExtiLine This parameter can be a combination of the following values:
835 * @arg @ref LL_EXTI_LINE_0
836 * @arg @ref LL_EXTI_LINE_1
837 * @arg @ref LL_EXTI_LINE_2
838 * @arg @ref LL_EXTI_LINE_3
839 * @arg @ref LL_EXTI_LINE_4
840 * @arg @ref LL_EXTI_LINE_5
841 * @arg @ref LL_EXTI_LINE_6
842 * @arg @ref LL_EXTI_LINE_7
843 * @arg @ref LL_EXTI_LINE_8
844 * @arg @ref LL_EXTI_LINE_9
845 * @arg @ref LL_EXTI_LINE_10
846 * @arg @ref LL_EXTI_LINE_11
847 * @arg @ref LL_EXTI_LINE_12
848 * @arg @ref LL_EXTI_LINE_13
849 * @arg @ref LL_EXTI_LINE_14
850 * @arg @ref LL_EXTI_LINE_15
851 * @arg @ref LL_EXTI_LINE_19
852 * @arg @ref LL_EXTI_LINE_23
853 * @arg @ref LL_EXTI_LINE_25
854 * @arg @ref LL_EXTI_LINE_31
855 * @note Please check each device line mapping for EXTI Line availability
856 * @retval State of bit (1 or 0).
857 */
LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)858 __STATIC_INLINE uint32_t LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)
859 {
860 return ((READ_BIT(EXTI->RPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
861 }
862
863 /**
864 * @brief Read ExtLine Combination Rising Flag for Lines in range 0 to 31
865 * @note This bit is set when the Rising edge event arrives on the interrupt
866 * line. This bit is cleared by writing a 1 to the bit.
867 * @rmtoll RPR1 RPIFx LL_EXTI_ReadRisingFlag_0_31
868 * @param ExtiLine This parameter can be a combination of the following values:
869 * @arg @ref LL_EXTI_LINE_0
870 * @arg @ref LL_EXTI_LINE_1
871 * @arg @ref LL_EXTI_LINE_2
872 * @arg @ref LL_EXTI_LINE_3
873 * @arg @ref LL_EXTI_LINE_4
874 * @arg @ref LL_EXTI_LINE_5
875 * @arg @ref LL_EXTI_LINE_6
876 * @arg @ref LL_EXTI_LINE_7
877 * @arg @ref LL_EXTI_LINE_8
878 * @arg @ref LL_EXTI_LINE_9
879 * @arg @ref LL_EXTI_LINE_10
880 * @arg @ref LL_EXTI_LINE_11
881 * @arg @ref LL_EXTI_LINE_12
882 * @arg @ref LL_EXTI_LINE_13
883 * @arg @ref LL_EXTI_LINE_14
884 * @arg @ref LL_EXTI_LINE_15
885 * @arg @ref LL_EXTI_LINE_19
886 * @arg @ref LL_EXTI_LINE_23
887 * @arg @ref LL_EXTI_LINE_25
888 * @arg @ref LL_EXTI_LINE_31
889 * @note Please check each device line mapping for EXTI Line availability
890 * @retval @note This bit is set when the selected edge event arrives on the interrupt
891 */
LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)892 __STATIC_INLINE uint32_t LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)
893 {
894 return (READ_BIT(EXTI->RPR1, ExtiLine));
895 }
896
897 /**
898 * @brief Clear ExtLine Rising Flags for Lines in range 0 to 31
899 * @note This bit is set when the Rising edge event arrives on the interrupt
900 * line. This bit is cleared by writing a 1 to the bit.
901 * @rmtoll RPR1 RPIFx LL_EXTI_ClearRisingFlag_0_31
902 * @param ExtiLine This parameter can be a combination of the following values:
903 * @arg @ref LL_EXTI_LINE_0
904 * @arg @ref LL_EXTI_LINE_1
905 * @arg @ref LL_EXTI_LINE_2
906 * @arg @ref LL_EXTI_LINE_3
907 * @arg @ref LL_EXTI_LINE_4
908 * @arg @ref LL_EXTI_LINE_5
909 * @arg @ref LL_EXTI_LINE_6
910 * @arg @ref LL_EXTI_LINE_7
911 * @arg @ref LL_EXTI_LINE_8
912 * @arg @ref LL_EXTI_LINE_9
913 * @arg @ref LL_EXTI_LINE_10
914 * @arg @ref LL_EXTI_LINE_11
915 * @arg @ref LL_EXTI_LINE_12
916 * @arg @ref LL_EXTI_LINE_13
917 * @arg @ref LL_EXTI_LINE_14
918 * @arg @ref LL_EXTI_LINE_15
919 * @arg @ref LL_EXTI_LINE_19
920 * @arg @ref LL_EXTI_LINE_23
921 * @arg @ref LL_EXTI_LINE_25
922 * @arg @ref LL_EXTI_LINE_31
923 * @note Please check each device line mapping for EXTI Line availability
924 * @retval None
925 */
LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)926 __STATIC_INLINE void LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)
927 {
928 WRITE_REG(EXTI->RPR1, ExtiLine);
929 }
930
931 /**
932 * @}
933 */
934 /** @defgroup EXTI_LL_EF_Config EF configuration functions
935 * @{
936 */
937
938 /**
939 * @brief Configure source input for the EXTI external interrupt.
940 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
941 * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
942 * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
943 * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
944 * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
945 * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
946 * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
947 * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
948 * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
949 * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
950 * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
951 * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
952 * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
953 * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
954 * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
955 * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
956 * @param Port This parameter can be one of the following values:
957 * @arg @ref EXTI_LL_EC_CONFIG_PORT
958 *
959 * (*) value not defined in all devices
960 * @param Line This parameter can be one of the following values:
961 * @arg @ref LL_EXTI_CONFIG_LINE0
962 * @arg @ref LL_EXTI_CONFIG_LINE1
963 * @arg @ref LL_EXTI_CONFIG_LINE2
964 * @arg @ref LL_EXTI_CONFIG_LINE3
965 * @arg @ref LL_EXTI_CONFIG_LINE4
966 * @arg @ref LL_EXTI_CONFIG_LINE5
967 * @arg @ref LL_EXTI_CONFIG_LINE6
968 * @arg @ref LL_EXTI_CONFIG_LINE7
969 * @arg @ref LL_EXTI_CONFIG_LINE8
970 * @arg @ref LL_EXTI_CONFIG_LINE9
971 * @arg @ref LL_EXTI_CONFIG_LINE10
972 * @arg @ref LL_EXTI_CONFIG_LINE11
973 * @arg @ref LL_EXTI_CONFIG_LINE12
974 * @arg @ref LL_EXTI_CONFIG_LINE13
975 * @arg @ref LL_EXTI_CONFIG_LINE14
976 * @arg @ref LL_EXTI_CONFIG_LINE15
977 * @retval None
978 */
LL_EXTI_SetEXTISource(uint32_t Port,uint32_t Line)979 __STATIC_INLINE void LL_EXTI_SetEXTISource(uint32_t Port, uint32_t Line)
980 {
981 MODIFY_REG(EXTI->EXTICR[Line & 0x03u], EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT), Port << \
982 (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
983 }
984
985 /**
986 * @brief Get the configured defined for specific EXTI Line
987 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
988 * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
989 * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
990 * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
991 * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
992 * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
993 * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
994 * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
995 * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
996 * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
997 * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
998 * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
999 * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
1000 * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
1001 * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
1002 * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
1003 * @param Line This parameter can be one of the following values:
1004 * @arg @ref LL_EXTI_CONFIG_LINE0
1005 * @arg @ref LL_EXTI_CONFIG_LINE1
1006 * @arg @ref LL_EXTI_CONFIG_LINE2
1007 * @arg @ref LL_EXTI_CONFIG_LINE3
1008 * @arg @ref LL_EXTI_CONFIG_LINE4
1009 * @arg @ref LL_EXTI_CONFIG_LINE5
1010 * @arg @ref LL_EXTI_CONFIG_LINE6
1011 * @arg @ref LL_EXTI_CONFIG_LINE7
1012 * @arg @ref LL_EXTI_CONFIG_LINE8
1013 * @arg @ref LL_EXTI_CONFIG_LINE9
1014 * @arg @ref LL_EXTI_CONFIG_LINE10
1015 * @arg @ref LL_EXTI_CONFIG_LINE11
1016 * @arg @ref LL_EXTI_CONFIG_LINE12
1017 * @arg @ref LL_EXTI_CONFIG_LINE13
1018 * @arg @ref LL_EXTI_CONFIG_LINE14
1019 * @arg @ref LL_EXTI_CONFIG_LINE15
1020 * @retval Returned value can be one of the following values:
1021 * @arg @ref EXTI_LL_EC_CONFIG_PORT
1022 *
1023 * (*) value not defined in all devices
1024 */
LL_EXTI_GetEXTISource(uint32_t Line)1025 __STATIC_INLINE uint32_t LL_EXTI_GetEXTISource(uint32_t Line)
1026 {
1027 return (READ_BIT(EXTI->EXTICR[Line & 0x03u], (EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT))) >> \
1028 (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
1029 }
1030 /**
1031 * @}
1032 */
1033
1034 #if defined(USE_FULL_LL_DRIVER)
1035 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
1036 * @{
1037 */
1038
1039 ErrorStatus LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1040 ErrorStatus LL_EXTI_DeInit(void);
1041 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1042
1043
1044 /**
1045 * @}
1046 */
1047 #endif /* USE_FULL_LL_DRIVER */
1048
1049 /**
1050 * @}
1051 */
1052
1053 /**
1054 * @}
1055 */
1056
1057 #endif /* EXTI */
1058
1059 /**
1060 * @}
1061 */
1062
1063 #ifdef __cplusplus
1064 }
1065 #endif
1066
1067 #endif /* STM32U5xx_LL_EXTI_H */
1068