1 /**
2 ******************************************************************************
3 * @file stm32wbaxx_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 STM32WBAxx_LL_EXTI_H
21 #define STM32WBAxx_LL_EXTI_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32wbaxx.h"
29
30 /** @addtogroup STM32WBAxx_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 #if defined(EXTI_IMR1_IM16)
105 #define LL_EXTI_LINE_16 EXTI_IMR1_IM16 /*!< Extended line 16 */
106 #if defined(EXTI_IMR1_IM17)
107 #endif /* EXTI_IMR_IM17 */
108 #define LL_EXTI_LINE_17 EXTI_IMR1_IM17 /*!< Extended line 17 */
109 #endif /* LL_EXTI_LINE_17 */
110 #if defined(EXTI_IMR1_IM18)
111 #define LL_EXTI_LINE_18 EXTI_IMR1_IM18 /*!< Extended line 18 */
112 #endif /* LL_EXTI_LINE_18 */
113 #define LL_EXTI_LINE_ALL_0_31 0x007FFFFFU /*!< ALL Extended line */
114
115 #if defined(USE_FULL_LL_DRIVER)
116 #define LL_EXTI_LINE_NONE 0x00000000U /*!< None Extended line */
117 #endif /*USE_FULL_LL_DRIVER*/
118
119 /** @defgroup SYSTEM_LL_EC_EXTI_PORT EXTI EXTI PORT
120 * @{
121 */
122 #define LL_EXTI_CONFIG_PORTA 0U /*!< EXTI PORT A */
123 #define LL_EXTI_CONFIG_PORTB EXTI_EXTICR1_EXTI0_0 /*!< EXTI PORT B */
124 #define LL_EXTI_CONFIG_PORTC EXTI_EXTICR1_EXTI0_1 /*!< EXTI PORT C */
125 #define LL_EXTI_CONFIG_PORTH (EXTI_EXTICR1_EXTI0_2|EXTI_EXTICR1_EXTI0_1|EXTI_EXTICR1_EXTI0_0) /*!< EXTI PORT H */
126 /**
127 * @}
128 */
129
130 /** @defgroup SYSTEM_LL_EC_EXTI_LINE EXTI EXTI LINE
131 * @{
132 */
133 #define LL_EXTI_CONFIG_LINE0 (0U << LL_EXTI_REGISTER_PINPOS_SHFT | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
134 #define LL_EXTI_CONFIG_LINE1 (8U << LL_EXTI_REGISTER_PINPOS_SHFT | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
135 #define LL_EXTI_CONFIG_LINE2 (16U << LL_EXTI_REGISTER_PINPOS_SHFT | 0U) /*!< EXTI_POSITION_16 | EXTICR[0] */
136 #define LL_EXTI_CONFIG_LINE3 (24U << LL_EXTI_REGISTER_PINPOS_SHFT | 0U) /*!< EXTI_POSITION_24 | EXTICR[0] */
137 #define LL_EXTI_CONFIG_LINE4 (0U << LL_EXTI_REGISTER_PINPOS_SHFT | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
138 #define LL_EXTI_CONFIG_LINE5 (8U << LL_EXTI_REGISTER_PINPOS_SHFT | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
139 #define LL_EXTI_CONFIG_LINE6 (16U << LL_EXTI_REGISTER_PINPOS_SHFT | 1U) /*!< EXTI_POSITION_16 | EXTICR[1] */
140 #define LL_EXTI_CONFIG_LINE7 (24U << LL_EXTI_REGISTER_PINPOS_SHFT | 1U) /*!< EXTI_POSITION_24 | EXTICR[1] */
141 #define LL_EXTI_CONFIG_LINE8 (0U << LL_EXTI_REGISTER_PINPOS_SHFT | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
142 #define LL_EXTI_CONFIG_LINE9 (8U << LL_EXTI_REGISTER_PINPOS_SHFT | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
143 #define LL_EXTI_CONFIG_LINE10 (16U << LL_EXTI_REGISTER_PINPOS_SHFT | 2U) /*!< EXTI_POSITION_16 | EXTICR[2] */
144 #define LL_EXTI_CONFIG_LINE11 (24U << LL_EXTI_REGISTER_PINPOS_SHFT | 2U) /*!< EXTI_POSITION_24 | EXTICR[2] */
145 #define LL_EXTI_CONFIG_LINE12 (0U << LL_EXTI_REGISTER_PINPOS_SHFT | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
146 #define LL_EXTI_CONFIG_LINE13 (8U << LL_EXTI_REGISTER_PINPOS_SHFT | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
147 #define LL_EXTI_CONFIG_LINE14 (16U << LL_EXTI_REGISTER_PINPOS_SHFT | 3U) /*!< EXTI_POSITION_16 | EXTICR[3] */
148 #define LL_EXTI_CONFIG_LINE15 (24U << LL_EXTI_REGISTER_PINPOS_SHFT | 3U) /*!< EXTI_POSITION_24 | EXTICR[3] */
149 /**
150 * @}
151 */
152 /**
153 * @}
154 */
155 #if defined(USE_FULL_LL_DRIVER)
156
157 /** @defgroup EXTI_LL_EC_MODE Mode
158 * @{
159 */
160 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
161 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
162 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
163 /**
164 * @}
165 */
166
167 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
168 * @{
169 */
170 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
171 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
172 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
173 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
174
175 /**
176 * @}
177 */
178
179
180 #endif /*USE_FULL_LL_DRIVER*/
181
182
183 /**
184 * @}
185 */
186
187 /* Exported macro ------------------------------------------------------------*/
188 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
189 * @{
190 */
191
192 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
193 * @{
194 */
195
196 /**
197 * @brief Write a value in EXTI register
198 * @param __REG__ Register to be written
199 * @param __VALUE__ Value to be written in the register
200 * @retval None
201 */
202 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
203
204 /**
205 * @brief Read a value in EXTI register
206 * @param __REG__ Register to be read
207 * @retval Register value
208 */
209 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
210 /**
211 * @}
212 */
213
214
215 /**
216 * @}
217 */
218
219
220
221 /* Exported functions --------------------------------------------------------*/
222 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
223 * @{
224 */
225 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
226 * @{
227 */
228
229 /**
230 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
231 * @note The reset value for the direct or internal lines (see RM)
232 * is set to 1 in order to enable the interrupt by default.
233 * Bits are set automatically at Power on.
234 * @rmtoll IMR1 IMx LL_EXTI_EnableIT_0_31
235 * @param ExtiLine This parameter can be one of the following values:
236 * @arg @ref LL_EXTI_LINE_0
237 * @arg @ref LL_EXTI_LINE_1
238 * @arg @ref LL_EXTI_LINE_2
239 * @arg @ref LL_EXTI_LINE_3
240 * @arg @ref LL_EXTI_LINE_4
241 * @arg @ref LL_EXTI_LINE_5
242 * @arg @ref LL_EXTI_LINE_6
243 * @arg @ref LL_EXTI_LINE_7
244 * @arg @ref LL_EXTI_LINE_8
245 * @arg @ref LL_EXTI_LINE_9
246 * @arg @ref LL_EXTI_LINE_10
247 * @arg @ref LL_EXTI_LINE_11
248 * @arg @ref LL_EXTI_LINE_12
249 * @arg @ref LL_EXTI_LINE_13
250 * @arg @ref LL_EXTI_LINE_14
251 * @arg @ref LL_EXTI_LINE_15
252 * @arg @ref LL_EXTI_LINE_16
253 * @arg @ref LL_EXTI_LINE_17
254 * @arg @ref LL_EXTI_LINE_18
255 * @arg @ref LL_EXTI_LINE_ALL_0_31
256 * @note Please check each device line mapping for EXTI Line availability
257 * @retval None
258 */
LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)259 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
260 {
261 SET_BIT(EXTI->IMR1, ExtiLine);
262 }
263
264 /**
265 * @brief Disable 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_DisableIT_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_ALL_0_31
291 * @note Please check each device line mapping for EXTI Line availability
292 * @retval None
293 */
LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)294 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
295 {
296 CLEAR_BIT(EXTI->IMR1, ExtiLine);
297 }
298
299 /**
300 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
301 * @note The reset value for the direct or internal lines (see RM)
302 * is set to 1 in order to enable the interrupt by default.
303 * Bits are set automatically at Power on.
304 * @rmtoll IMR1 IMx LL_EXTI_IsEnabledIT_0_31
305 * @param ExtiLine This parameter can be one of the following values:
306 * @arg @ref LL_EXTI_LINE_0
307 * @arg @ref LL_EXTI_LINE_1
308 * @arg @ref LL_EXTI_LINE_2
309 * @arg @ref LL_EXTI_LINE_3
310 * @arg @ref LL_EXTI_LINE_4
311 * @arg @ref LL_EXTI_LINE_5
312 * @arg @ref LL_EXTI_LINE_6
313 * @arg @ref LL_EXTI_LINE_7
314 * @arg @ref LL_EXTI_LINE_8
315 * @arg @ref LL_EXTI_LINE_9
316 * @arg @ref LL_EXTI_LINE_10
317 * @arg @ref LL_EXTI_LINE_11
318 * @arg @ref LL_EXTI_LINE_12
319 * @arg @ref LL_EXTI_LINE_13
320 * @arg @ref LL_EXTI_LINE_14
321 * @arg @ref LL_EXTI_LINE_15
322 * @arg @ref LL_EXTI_LINE_16
323 * @arg @ref LL_EXTI_LINE_17
324 * @arg @ref LL_EXTI_LINE_18
325 * @arg @ref LL_EXTI_LINE_ALL_0_31
326 * @note Please check each device line mapping for EXTI Line availability
327 * @retval State of bit (1 or 0).
328 */
LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)329 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
330 {
331 return ((READ_BIT(EXTI->IMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
332 }
333
334 /**
335 * @}
336 */
337
338 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
339 * @{
340 */
341
342 /**
343 * @brief Enable ExtiLine Event request for Lines in range 0 to 31
344 * @rmtoll EMR1 EMx LL_EXTI_EnableEvent_0_31
345 * @param ExtiLine This parameter can be one of the following values:
346 * @arg @ref LL_EXTI_LINE_0
347 * @arg @ref LL_EXTI_LINE_1
348 * @arg @ref LL_EXTI_LINE_2
349 * @arg @ref LL_EXTI_LINE_3
350 * @arg @ref LL_EXTI_LINE_4
351 * @arg @ref LL_EXTI_LINE_5
352 * @arg @ref LL_EXTI_LINE_6
353 * @arg @ref LL_EXTI_LINE_7
354 * @arg @ref LL_EXTI_LINE_8
355 * @arg @ref LL_EXTI_LINE_9
356 * @arg @ref LL_EXTI_LINE_10
357 * @arg @ref LL_EXTI_LINE_11
358 * @arg @ref LL_EXTI_LINE_12
359 * @arg @ref LL_EXTI_LINE_13
360 * @arg @ref LL_EXTI_LINE_14
361 * @arg @ref LL_EXTI_LINE_15
362 * @arg @ref LL_EXTI_LINE_16
363 * @arg @ref LL_EXTI_LINE_17
364 * @arg @ref LL_EXTI_LINE_18
365 * @arg @ref LL_EXTI_LINE_ALL_0_31
366 * @note Please check each device line mapping for EXTI Line availability
367 * @retval None
368 */
LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)369 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
370 {
371 SET_BIT(EXTI->EMR1, ExtiLine);
372
373 }
374
375 /**
376 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
377 * @rmtoll EMR1 EMx LL_EXTI_DisableEvent_0_31
378 * @param ExtiLine This parameter can be one of the following values:
379 * @arg @ref LL_EXTI_LINE_0
380 * @arg @ref LL_EXTI_LINE_1
381 * @arg @ref LL_EXTI_LINE_2
382 * @arg @ref LL_EXTI_LINE_3
383 * @arg @ref LL_EXTI_LINE_4
384 * @arg @ref LL_EXTI_LINE_5
385 * @arg @ref LL_EXTI_LINE_6
386 * @arg @ref LL_EXTI_LINE_7
387 * @arg @ref LL_EXTI_LINE_8
388 * @arg @ref LL_EXTI_LINE_9
389 * @arg @ref LL_EXTI_LINE_10
390 * @arg @ref LL_EXTI_LINE_11
391 * @arg @ref LL_EXTI_LINE_12
392 * @arg @ref LL_EXTI_LINE_13
393 * @arg @ref LL_EXTI_LINE_14
394 * @arg @ref LL_EXTI_LINE_15
395 * @arg @ref LL_EXTI_LINE_16
396 * @arg @ref LL_EXTI_LINE_17
397 * @arg @ref LL_EXTI_LINE_18
398 * @arg @ref LL_EXTI_LINE_ALL_0_31
399 * @note Please check each device line mapping for EXTI Line availability
400 * @retval None
401 */
LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)402 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
403 {
404 CLEAR_BIT(EXTI->EMR1, ExtiLine);
405 }
406
407 /**
408 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
409 * @rmtoll EMR1 EMx LL_EXTI_IsEnabledEvent_0_31
410 * @param ExtiLine This parameter can be one of the following values:
411 * @arg @ref LL_EXTI_LINE_0
412 * @arg @ref LL_EXTI_LINE_1
413 * @arg @ref LL_EXTI_LINE_2
414 * @arg @ref LL_EXTI_LINE_3
415 * @arg @ref LL_EXTI_LINE_4
416 * @arg @ref LL_EXTI_LINE_5
417 * @arg @ref LL_EXTI_LINE_6
418 * @arg @ref LL_EXTI_LINE_7
419 * @arg @ref LL_EXTI_LINE_8
420 * @arg @ref LL_EXTI_LINE_9
421 * @arg @ref LL_EXTI_LINE_10
422 * @arg @ref LL_EXTI_LINE_11
423 * @arg @ref LL_EXTI_LINE_12
424 * @arg @ref LL_EXTI_LINE_13
425 * @arg @ref LL_EXTI_LINE_14
426 * @arg @ref LL_EXTI_LINE_15
427 * @arg @ref LL_EXTI_LINE_16
428 * @arg @ref LL_EXTI_LINE_17
429 * @arg @ref LL_EXTI_LINE_18
430 * @arg @ref LL_EXTI_LINE_ALL_0_31
431 * @note Please check each device line mapping for EXTI Line availability
432 * @retval State of bit (1 or 0).
433 */
LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)434 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
435 {
436 return ((READ_BIT(EXTI->EMR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
437
438 }
439
440 /**
441 * @}
442 */
443
444 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
445 * @{
446 */
447
448 /**
449 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
450 * @note The configurable wakeup lines are edge-triggered. No glitch must be
451 * generated on these lines. If a rising edge on a configurable interrupt
452 * line occurs during a write operation in the EXTI_RTSR register, the
453 * pending bit is not set.
454 * Rising and falling edge triggers can be set for
455 * the same interrupt line. In this case, both generate a trigger
456 * condition.
457 * @rmtoll RTSR1 RTx LL_EXTI_EnableRisingTrig_0_31
458 * @param ExtiLine This parameter can be a combination of the following values:
459 * @arg @ref LL_EXTI_LINE_0
460 * @arg @ref LL_EXTI_LINE_1
461 * @arg @ref LL_EXTI_LINE_2
462 * @arg @ref LL_EXTI_LINE_3
463 * @arg @ref LL_EXTI_LINE_4
464 * @arg @ref LL_EXTI_LINE_5
465 * @arg @ref LL_EXTI_LINE_6
466 * @arg @ref LL_EXTI_LINE_7
467 * @arg @ref LL_EXTI_LINE_8
468 * @arg @ref LL_EXTI_LINE_9
469 * @arg @ref LL_EXTI_LINE_10
470 * @arg @ref LL_EXTI_LINE_11
471 * @arg @ref LL_EXTI_LINE_12
472 * @arg @ref LL_EXTI_LINE_13
473 * @arg @ref LL_EXTI_LINE_14
474 * @arg @ref LL_EXTI_LINE_15
475 * @arg @ref LL_EXTI_LINE_16
476 * @arg @ref LL_EXTI_LINE_17
477 * @arg @ref LL_EXTI_LINE_18
478 * @note Please check each device line mapping for EXTI Line availability
479 * @retval None
480 */
LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)481 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
482 {
483 SET_BIT(EXTI->RTSR1, ExtiLine);
484 }
485
486 /**
487 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
488 * @note The configurable wakeup lines are edge-triggered. No glitch must be
489 * generated on these lines. If a rising edge on a configurable interrupt
490 * line occurs during a write operation in the EXTI_RTSR register, the
491 * pending bit is not set.
492 * Rising and falling edge triggers can be set for
493 * the same interrupt line. In this case, both generate a trigger
494 * condition.
495 * @rmtoll RTSR1 RTx LL_EXTI_DisableRisingTrig_0_31
496 * @param ExtiLine This parameter can be a combination of the following values:
497 * @arg @ref LL_EXTI_LINE_0
498 * @arg @ref LL_EXTI_LINE_1
499 * @arg @ref LL_EXTI_LINE_2
500 * @arg @ref LL_EXTI_LINE_3
501 * @arg @ref LL_EXTI_LINE_4
502 * @arg @ref LL_EXTI_LINE_5
503 * @arg @ref LL_EXTI_LINE_6
504 * @arg @ref LL_EXTI_LINE_7
505 * @arg @ref LL_EXTI_LINE_8
506 * @arg @ref LL_EXTI_LINE_9
507 * @arg @ref LL_EXTI_LINE_10
508 * @arg @ref LL_EXTI_LINE_11
509 * @arg @ref LL_EXTI_LINE_12
510 * @arg @ref LL_EXTI_LINE_13
511 * @arg @ref LL_EXTI_LINE_14
512 * @arg @ref LL_EXTI_LINE_15
513 * @arg @ref LL_EXTI_LINE_16
514 * @arg @ref LL_EXTI_LINE_17
515 * @arg @ref LL_EXTI_LINE_18
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_16
546 * @arg @ref LL_EXTI_LINE_17
547 * @arg @ref LL_EXTI_LINE_18
548 * @note Please check each device line mapping for EXTI Line availability
549 * @retval State of bit (1 or 0).
550 */
LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)551 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
552 {
553 return ((READ_BIT(EXTI->RTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
554 }
555
556 /**
557 * @}
558 */
559
560 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
561 * @{
562 */
563
564 /**
565 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
566 * @note The configurable wakeup lines are edge-triggered. No glitch must be
567 * generated on these lines. If a falling edge on a configurable interrupt
568 * line occurs during a write operation in the EXTI_FTSR register, the
569 * pending bit is not set.
570 * Rising and falling edge triggers can be set for
571 * the same interrupt line. In this case, both generate a trigger
572 * condition.
573 * @rmtoll FTSR1 FTx LL_EXTI_EnableFallingTrig_0_31
574 * @param ExtiLine This parameter can be a combination of the following values:
575 * @arg @ref LL_EXTI_LINE_0
576 * @arg @ref LL_EXTI_LINE_1
577 * @arg @ref LL_EXTI_LINE_2
578 * @arg @ref LL_EXTI_LINE_3
579 * @arg @ref LL_EXTI_LINE_4
580 * @arg @ref LL_EXTI_LINE_5
581 * @arg @ref LL_EXTI_LINE_6
582 * @arg @ref LL_EXTI_LINE_7
583 * @arg @ref LL_EXTI_LINE_8
584 * @arg @ref LL_EXTI_LINE_9
585 * @arg @ref LL_EXTI_LINE_10
586 * @arg @ref LL_EXTI_LINE_11
587 * @arg @ref LL_EXTI_LINE_12
588 * @arg @ref LL_EXTI_LINE_13
589 * @arg @ref LL_EXTI_LINE_14
590 * @arg @ref LL_EXTI_LINE_15
591 * @arg @ref LL_EXTI_LINE_16
592 * @arg @ref LL_EXTI_LINE_17
593 * @arg @ref LL_EXTI_LINE_18
594 * @note Please check each device line mapping for EXTI Line availability
595 * @retval None
596 */
LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)597 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
598 {
599 SET_BIT(EXTI->FTSR1, ExtiLine);
600 }
601
602 /**
603 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
604 * @note The configurable wakeup lines are edge-triggered. No glitch must be
605 * generated on these lines. If a Falling edge on a configurable interrupt
606 * line occurs during a write operation in the EXTI_FTSR register, the
607 * pending bit is not set.
608 * Rising and falling edge triggers can be set for the same interrupt line.
609 * In this case, both generate a trigger condition.
610 * @rmtoll FTSR1 FTx LL_EXTI_DisableFallingTrig_0_31
611 * @param ExtiLine This parameter can be a combination of the following values:
612 * @arg @ref LL_EXTI_LINE_0
613 * @arg @ref LL_EXTI_LINE_1
614 * @arg @ref LL_EXTI_LINE_2
615 * @arg @ref LL_EXTI_LINE_3
616 * @arg @ref LL_EXTI_LINE_4
617 * @arg @ref LL_EXTI_LINE_5
618 * @arg @ref LL_EXTI_LINE_6
619 * @arg @ref LL_EXTI_LINE_7
620 * @arg @ref LL_EXTI_LINE_8
621 * @arg @ref LL_EXTI_LINE_9
622 * @arg @ref LL_EXTI_LINE_10
623 * @arg @ref LL_EXTI_LINE_11
624 * @arg @ref LL_EXTI_LINE_12
625 * @arg @ref LL_EXTI_LINE_13
626 * @arg @ref LL_EXTI_LINE_14
627 * @arg @ref LL_EXTI_LINE_15
628 * @arg @ref LL_EXTI_LINE_16
629 * @arg @ref LL_EXTI_LINE_17
630 * @arg @ref LL_EXTI_LINE_18
631 * @note Please check each device line mapping for EXTI Line availability
632 * @retval None
633 */
LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)634 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
635 {
636 CLEAR_BIT(EXTI->FTSR1, ExtiLine);
637 }
638
639 /**
640 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
641 * @rmtoll FTSR1 FTx LL_EXTI_IsEnabledFallingTrig_0_31
642 * @param ExtiLine This parameter can be a combination of the following values:
643 * @arg @ref LL_EXTI_LINE_0
644 * @arg @ref LL_EXTI_LINE_1
645 * @arg @ref LL_EXTI_LINE_2
646 * @arg @ref LL_EXTI_LINE_3
647 * @arg @ref LL_EXTI_LINE_4
648 * @arg @ref LL_EXTI_LINE_5
649 * @arg @ref LL_EXTI_LINE_6
650 * @arg @ref LL_EXTI_LINE_7
651 * @arg @ref LL_EXTI_LINE_8
652 * @arg @ref LL_EXTI_LINE_9
653 * @arg @ref LL_EXTI_LINE_10
654 * @arg @ref LL_EXTI_LINE_11
655 * @arg @ref LL_EXTI_LINE_12
656 * @arg @ref LL_EXTI_LINE_13
657 * @arg @ref LL_EXTI_LINE_14
658 * @arg @ref LL_EXTI_LINE_15
659 * @arg @ref LL_EXTI_LINE_16
660 * @arg @ref LL_EXTI_LINE_17
661 * @arg @ref LL_EXTI_LINE_18
662 * @note Please check each device line mapping for EXTI Line availability
663 * @retval State of bit (1 or 0).
664 */
LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)665 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
666 {
667 return ((READ_BIT(EXTI->FTSR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
668 }
669
670 /**
671 * @}
672 */
673
674 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
675 * @{
676 */
677
678 /**
679 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
680 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
681 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
682 * resulting in an interrupt request generation.
683 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
684 * register (by writing a 1 into the bit)
685 * @rmtoll SWIER1 SWIx LL_EXTI_GenerateSWI_0_31
686 * @param ExtiLine This parameter can be a combination of the following values:
687 * @arg @ref LL_EXTI_LINE_0
688 * @arg @ref LL_EXTI_LINE_1
689 * @arg @ref LL_EXTI_LINE_2
690 * @arg @ref LL_EXTI_LINE_3
691 * @arg @ref LL_EXTI_LINE_4
692 * @arg @ref LL_EXTI_LINE_5
693 * @arg @ref LL_EXTI_LINE_6
694 * @arg @ref LL_EXTI_LINE_7
695 * @arg @ref LL_EXTI_LINE_8
696 * @arg @ref LL_EXTI_LINE_9
697 * @arg @ref LL_EXTI_LINE_10
698 * @arg @ref LL_EXTI_LINE_11
699 * @arg @ref LL_EXTI_LINE_12
700 * @arg @ref LL_EXTI_LINE_13
701 * @arg @ref LL_EXTI_LINE_14
702 * @arg @ref LL_EXTI_LINE_15
703 * @arg @ref LL_EXTI_LINE_16
704 * @arg @ref LL_EXTI_LINE_17
705 * @arg @ref LL_EXTI_LINE_18
706 * @note Please check each device line mapping for EXTI Line availability
707 * @retval None
708 */
LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)709 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
710 {
711 SET_BIT(EXTI->SWIER1, ExtiLine);
712 }
713
714 /**
715 * @}
716 */
717
718 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
719 * @{
720 */
721
722 /**
723 * @brief Check if the ExtLine Falling Flag is set or not for Lines in range 0 to 31
724 * @note This bit is set when the falling edge event arrives on the interrupt
725 * line. This bit is cleared by writing a 1 to the bit.
726 * @rmtoll FPR1 FPIFx LL_EXTI_IsActiveFallingFlag_0_31
727 * @param ExtiLine This parameter can be a combination of the following values:
728 * @arg @ref LL_EXTI_LINE_0
729 * @arg @ref LL_EXTI_LINE_1
730 * @arg @ref LL_EXTI_LINE_2
731 * @arg @ref LL_EXTI_LINE_3
732 * @arg @ref LL_EXTI_LINE_4
733 * @arg @ref LL_EXTI_LINE_5
734 * @arg @ref LL_EXTI_LINE_6
735 * @arg @ref LL_EXTI_LINE_7
736 * @arg @ref LL_EXTI_LINE_8
737 * @arg @ref LL_EXTI_LINE_9
738 * @arg @ref LL_EXTI_LINE_10
739 * @arg @ref LL_EXTI_LINE_11
740 * @arg @ref LL_EXTI_LINE_12
741 * @arg @ref LL_EXTI_LINE_13
742 * @arg @ref LL_EXTI_LINE_14
743 * @arg @ref LL_EXTI_LINE_15
744 * @arg @ref LL_EXTI_LINE_16
745 * @arg @ref LL_EXTI_LINE_17
746 * @arg @ref LL_EXTI_LINE_18
747 * @note Please check each device line mapping for EXTI Line availability
748 * @retval State of bit (1 or 0).
749 */
LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)750 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFallingFlag_0_31(uint32_t ExtiLine)
751 {
752 return ((READ_BIT(EXTI->FPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
753 }
754
755 /**
756 * @brief Read ExtLine Combination Falling Flag for Lines in range 0 to 31
757 * @note This bit is set when the falling edge event arrives on the interrupt
758 * line. This bit is cleared by writing a 1 to the bit.
759 * @rmtoll FPR1 FPIFx LL_EXTI_ReadFallingFlag_0_31
760 * @param ExtiLine This parameter can be a combination of the following values:
761 * @arg @ref LL_EXTI_LINE_0
762 * @arg @ref LL_EXTI_LINE_1
763 * @arg @ref LL_EXTI_LINE_2
764 * @arg @ref LL_EXTI_LINE_3
765 * @arg @ref LL_EXTI_LINE_4
766 * @arg @ref LL_EXTI_LINE_5
767 * @arg @ref LL_EXTI_LINE_6
768 * @arg @ref LL_EXTI_LINE_7
769 * @arg @ref LL_EXTI_LINE_8
770 * @arg @ref LL_EXTI_LINE_9
771 * @arg @ref LL_EXTI_LINE_10
772 * @arg @ref LL_EXTI_LINE_11
773 * @arg @ref LL_EXTI_LINE_12
774 * @arg @ref LL_EXTI_LINE_13
775 * @arg @ref LL_EXTI_LINE_14
776 * @arg @ref LL_EXTI_LINE_15
777 * @arg @ref LL_EXTI_LINE_16
778 * @arg @ref LL_EXTI_LINE_17
779 * @arg @ref LL_EXTI_LINE_18
780 * @note Please check each device line mapping for EXTI Line availability
781 * @retval @note This bit is set when the selected edge event arrives on the interrupt
782 */
LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)783 __STATIC_INLINE uint32_t LL_EXTI_ReadFallingFlag_0_31(uint32_t ExtiLine)
784 {
785 return (uint32_t)(READ_BIT(EXTI->FPR1, ExtiLine));
786 }
787
788 /**
789 * @brief Clear ExtLine Falling Flags for Lines in range 0 to 31
790 * @note This bit is set when the falling edge event arrives on the interrupt
791 * line. This bit is cleared by writing a 1 to the bit.
792 * @rmtoll FPR1 FPIFx LL_EXTI_ClearFallingFlag_0_31
793 * @param ExtiLine This parameter can be a combination of the following values:
794 * @arg @ref LL_EXTI_LINE_0
795 * @arg @ref LL_EXTI_LINE_1
796 * @arg @ref LL_EXTI_LINE_2
797 * @arg @ref LL_EXTI_LINE_3
798 * @arg @ref LL_EXTI_LINE_4
799 * @arg @ref LL_EXTI_LINE_5
800 * @arg @ref LL_EXTI_LINE_6
801 * @arg @ref LL_EXTI_LINE_7
802 * @arg @ref LL_EXTI_LINE_8
803 * @arg @ref LL_EXTI_LINE_9
804 * @arg @ref LL_EXTI_LINE_10
805 * @arg @ref LL_EXTI_LINE_11
806 * @arg @ref LL_EXTI_LINE_12
807 * @arg @ref LL_EXTI_LINE_13
808 * @arg @ref LL_EXTI_LINE_14
809 * @arg @ref LL_EXTI_LINE_15
810 * @arg @ref LL_EXTI_LINE_16
811 * @arg @ref LL_EXTI_LINE_17
812 * @arg @ref LL_EXTI_LINE_18
813 * @note Please check each device line mapping for EXTI Line availability
814 * @retval None
815 */
LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)816 __STATIC_INLINE void LL_EXTI_ClearFallingFlag_0_31(uint32_t ExtiLine)
817 {
818 WRITE_REG(EXTI->FPR1, ExtiLine);
819 }
820
821 /**
822 * @brief Check if the ExtLine Rising Flag is set or not for Lines in range 0 to 31
823 * @note This bit is set when the Rising edge event arrives on the interrupt
824 * line. This bit is cleared by writing a 1 to the bit.
825 * @rmtoll RPR1 RPIFx LL_EXTI_IsActiveRisingFlag_0_31
826 * @param ExtiLine This parameter can be a combination of the following values:
827 * @arg @ref LL_EXTI_LINE_0
828 * @arg @ref LL_EXTI_LINE_1
829 * @arg @ref LL_EXTI_LINE_2
830 * @arg @ref LL_EXTI_LINE_3
831 * @arg @ref LL_EXTI_LINE_4
832 * @arg @ref LL_EXTI_LINE_5
833 * @arg @ref LL_EXTI_LINE_6
834 * @arg @ref LL_EXTI_LINE_7
835 * @arg @ref LL_EXTI_LINE_8
836 * @arg @ref LL_EXTI_LINE_9
837 * @arg @ref LL_EXTI_LINE_10
838 * @arg @ref LL_EXTI_LINE_11
839 * @arg @ref LL_EXTI_LINE_12
840 * @arg @ref LL_EXTI_LINE_13
841 * @arg @ref LL_EXTI_LINE_14
842 * @arg @ref LL_EXTI_LINE_15
843 * @arg @ref LL_EXTI_LINE_16
844 * @arg @ref LL_EXTI_LINE_17
845 * @arg @ref LL_EXTI_LINE_18
846 * @note Please check each device line mapping for EXTI Line availability
847 * @retval State of bit (1 or 0).
848 */
LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)849 __STATIC_INLINE uint32_t LL_EXTI_IsActiveRisingFlag_0_31(uint32_t ExtiLine)
850 {
851 return ((READ_BIT(EXTI->RPR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
852 }
853
854 /**
855 * @brief Read ExtLine Combination Rising Flag for Lines in range 0 to 31
856 * @note This bit is set when the Rising edge event arrives on the interrupt
857 * line. This bit is cleared by writing a 1 to the bit.
858 * @rmtoll RPR1 RPIFx LL_EXTI_ReadRisingFlag_0_31
859 * @param ExtiLine This parameter can be a combination of the following values:
860 * @arg @ref LL_EXTI_LINE_0
861 * @arg @ref LL_EXTI_LINE_1
862 * @arg @ref LL_EXTI_LINE_2
863 * @arg @ref LL_EXTI_LINE_3
864 * @arg @ref LL_EXTI_LINE_4
865 * @arg @ref LL_EXTI_LINE_5
866 * @arg @ref LL_EXTI_LINE_6
867 * @arg @ref LL_EXTI_LINE_7
868 * @arg @ref LL_EXTI_LINE_8
869 * @arg @ref LL_EXTI_LINE_9
870 * @arg @ref LL_EXTI_LINE_10
871 * @arg @ref LL_EXTI_LINE_11
872 * @arg @ref LL_EXTI_LINE_12
873 * @arg @ref LL_EXTI_LINE_13
874 * @arg @ref LL_EXTI_LINE_14
875 * @arg @ref LL_EXTI_LINE_15
876 * @arg @ref LL_EXTI_LINE_16
877 * @arg @ref LL_EXTI_LINE_17
878 * @arg @ref LL_EXTI_LINE_18
879 * @note Please check each device line mapping for EXTI Line availability
880 * @retval @note This bit is set when the selected edge event arrives on the interrupt
881 */
LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)882 __STATIC_INLINE uint32_t LL_EXTI_ReadRisingFlag_0_31(uint32_t ExtiLine)
883 {
884 return (uint32_t)(READ_BIT(EXTI->RPR1, ExtiLine));
885 }
886
887 /**
888 * @brief Clear ExtLine Rising Flags for Lines in range 0 to 31
889 * @note This bit is set when the Rising edge event arrives on the interrupt
890 * line. This bit is cleared by writing a 1 to the bit.
891 * @rmtoll RPR1 RPIFx LL_EXTI_ClearRisingFlag_0_31
892 * @param ExtiLine This parameter can be a combination of the following values:
893 * @arg @ref LL_EXTI_LINE_0
894 * @arg @ref LL_EXTI_LINE_1
895 * @arg @ref LL_EXTI_LINE_2
896 * @arg @ref LL_EXTI_LINE_3
897 * @arg @ref LL_EXTI_LINE_4
898 * @arg @ref LL_EXTI_LINE_5
899 * @arg @ref LL_EXTI_LINE_6
900 * @arg @ref LL_EXTI_LINE_7
901 * @arg @ref LL_EXTI_LINE_8
902 * @arg @ref LL_EXTI_LINE_9
903 * @arg @ref LL_EXTI_LINE_10
904 * @arg @ref LL_EXTI_LINE_11
905 * @arg @ref LL_EXTI_LINE_12
906 * @arg @ref LL_EXTI_LINE_13
907 * @arg @ref LL_EXTI_LINE_14
908 * @arg @ref LL_EXTI_LINE_15
909 * @arg @ref LL_EXTI_LINE_16
910 * @arg @ref LL_EXTI_LINE_17
911 * @arg @ref LL_EXTI_LINE_18
912 * @note Please check each device line mapping for EXTI Line availability
913 * @retval None
914 */
LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)915 __STATIC_INLINE void LL_EXTI_ClearRisingFlag_0_31(uint32_t ExtiLine)
916 {
917 WRITE_REG(EXTI->RPR1, ExtiLine);
918 }
919
920 /**
921 * @}
922 */
923 /** @defgroup EXTI_LL_EF_Config EF configuration functions
924 * @{
925 */
926
927 /**
928 * @brief Configure source input for the EXTI external interrupt.
929 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_SetEXTISource\n
930 * EXTI_EXTICR1 EXTI1 LL_EXTI_SetEXTISource\n
931 * EXTI_EXTICR1 EXTI2 LL_EXTI_SetEXTISource\n
932 * EXTI_EXTICR1 EXTI3 LL_EXTI_SetEXTISource\n
933 * EXTI_EXTICR2 EXTI4 LL_EXTI_SetEXTISource\n
934 * EXTI_EXTICR2 EXTI5 LL_EXTI_SetEXTISource\n
935 * EXTI_EXTICR2 EXTI6 LL_EXTI_SetEXTISource\n
936 * EXTI_EXTICR2 EXTI7 LL_EXTI_SetEXTISource\n
937 * EXTI_EXTICR3 EXTI8 LL_EXTI_SetEXTISource\n
938 * EXTI_EXTICR3 EXTI9 LL_EXTI_SetEXTISource\n
939 * EXTI_EXTICR3 EXTI10 LL_EXTI_SetEXTISource\n
940 * EXTI_EXTICR3 EXTI11 LL_EXTI_SetEXTISource\n
941 * EXTI_EXTICR4 EXTI12 LL_EXTI_SetEXTISource\n
942 * EXTI_EXTICR4 EXTI13 LL_EXTI_SetEXTISource\n
943 * EXTI_EXTICR4 EXTI14 LL_EXTI_SetEXTISource\n
944 * EXTI_EXTICR4 EXTI15 LL_EXTI_SetEXTISource
945 * @param Port This parameter can be one of the following values:
946 * @arg @ref LL_EXTI_CONFIG_PORTA
947 * @arg @ref LL_EXTI_CONFIG_PORTB
948 * @arg @ref LL_EXTI_CONFIG_PORTC
949 * @arg @ref LL_EXTI_CONFIG_PORTH
950 *
951 * (*) value not defined in all devices
952 * @param Line This parameter can be one of the following values:
953 * @arg @ref LL_EXTI_CONFIG_LINE0
954 * @arg @ref LL_EXTI_CONFIG_LINE1
955 * @arg @ref LL_EXTI_CONFIG_LINE2
956 * @arg @ref LL_EXTI_CONFIG_LINE3
957 * @arg @ref LL_EXTI_CONFIG_LINE4
958 * @arg @ref LL_EXTI_CONFIG_LINE5
959 * @arg @ref LL_EXTI_CONFIG_LINE6
960 * @arg @ref LL_EXTI_CONFIG_LINE7
961 * @arg @ref LL_EXTI_CONFIG_LINE8
962 * @arg @ref LL_EXTI_CONFIG_LINE9
963 * @arg @ref LL_EXTI_CONFIG_LINE10
964 * @arg @ref LL_EXTI_CONFIG_LINE11
965 * @arg @ref LL_EXTI_CONFIG_LINE12
966 * @arg @ref LL_EXTI_CONFIG_LINE13
967 * @arg @ref LL_EXTI_CONFIG_LINE14
968 * @arg @ref LL_EXTI_CONFIG_LINE15
969 * @retval None
970 */
LL_EXTI_SetEXTISource(uint32_t Port,uint32_t Line)971 __STATIC_INLINE void LL_EXTI_SetEXTISource(uint32_t Port, uint32_t Line)
972 {
973 MODIFY_REG(EXTI->EXTICR[Line & 0x03U], EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT), Port << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
974 }
975
976 /**
977 * @brief Get the configured defined for specific EXTI Line
978 * @rmtoll EXTI_EXTICR1 EXTI0 LL_EXTI_GetEXTISource\n
979 * EXTI_EXTICR1 EXTI1 LL_EXTI_GetEXTISource\n
980 * EXTI_EXTICR1 EXTI2 LL_EXTI_GetEXTISource\n
981 * EXTI_EXTICR1 EXTI3 LL_EXTI_GetEXTISource\n
982 * EXTI_EXTICR2 EXTI4 LL_EXTI_GetEXTISource\n
983 * EXTI_EXTICR2 EXTI5 LL_EXTI_GetEXTISource\n
984 * EXTI_EXTICR2 EXTI6 LL_EXTI_GetEXTISource\n
985 * EXTI_EXTICR2 EXTI7 LL_EXTI_GetEXTISource\n
986 * EXTI_EXTICR3 EXTI8 LL_EXTI_GetEXTISource\n
987 * EXTI_EXTICR3 EXTI9 LL_EXTI_GetEXTISource\n
988 * EXTI_EXTICR3 EXTI10 LL_EXTI_GetEXTISource\n
989 * EXTI_EXTICR3 EXTI11 LL_EXTI_GetEXTISource\n
990 * EXTI_EXTICR4 EXTI12 LL_EXTI_GetEXTISource\n
991 * EXTI_EXTICR4 EXTI13 LL_EXTI_GetEXTISource\n
992 * EXTI_EXTICR4 EXTI14 LL_EXTI_GetEXTISource\n
993 * EXTI_EXTICR4 EXTI15 LL_EXTI_GetEXTISource
994 * @param Line This parameter can be one of the following values:
995 * @arg @ref LL_EXTI_CONFIG_LINE0
996 * @arg @ref LL_EXTI_CONFIG_LINE1
997 * @arg @ref LL_EXTI_CONFIG_LINE2
998 * @arg @ref LL_EXTI_CONFIG_LINE3
999 * @arg @ref LL_EXTI_CONFIG_LINE4
1000 * @arg @ref LL_EXTI_CONFIG_LINE5
1001 * @arg @ref LL_EXTI_CONFIG_LINE6
1002 * @arg @ref LL_EXTI_CONFIG_LINE7
1003 * @arg @ref LL_EXTI_CONFIG_LINE8
1004 * @arg @ref LL_EXTI_CONFIG_LINE9
1005 * @arg @ref LL_EXTI_CONFIG_LINE10
1006 * @arg @ref LL_EXTI_CONFIG_LINE11
1007 * @arg @ref LL_EXTI_CONFIG_LINE12
1008 * @arg @ref LL_EXTI_CONFIG_LINE13
1009 * @arg @ref LL_EXTI_CONFIG_LINE14
1010 * @arg @ref LL_EXTI_CONFIG_LINE15
1011 * @retval Returned value can be one of the following values:
1012 * @arg @ref LL_EXTI_CONFIG_PORTA
1013 * @arg @ref LL_EXTI_CONFIG_PORTB
1014 * @arg @ref LL_EXTI_CONFIG_PORTC
1015 * @arg @ref LL_EXTI_CONFIG_PORTH
1016 */
LL_EXTI_GetEXTISource(uint32_t Line)1017 __STATIC_INLINE uint32_t LL_EXTI_GetEXTISource(uint32_t Line)
1018 {
1019 return (uint32_t)(READ_BIT(EXTI->EXTICR[Line & 0x03U], (EXTI_EXTICR1_EXTI0 << (Line >> LL_EXTI_REGISTER_PINPOS_SHFT))) >> (Line >> LL_EXTI_REGISTER_PINPOS_SHFT));
1020 }
1021 /**
1022 * @}
1023 */
1024
1025 /** @defgroup EXTI_LL_EF_Secure_Management Secure_Management
1026 * @{
1027 */
1028
1029 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1030
1031 /**
1032 * @brief Enable ExtiLine Secure attribute for Lines in range 0 to 31
1033 * @rmtoll SECCFGR1 SECx LL_EXTI_EnableSecure_0_31
1034 * @param ExtiLine This parameter can be one of the following values:
1035 * @arg @ref LL_EXTI_LINE_0
1036 * @arg @ref LL_EXTI_LINE_1
1037 * @arg @ref LL_EXTI_LINE_2
1038 * @arg @ref LL_EXTI_LINE_3
1039 * @arg @ref LL_EXTI_LINE_4
1040 * @arg @ref LL_EXTI_LINE_5
1041 * @arg @ref LL_EXTI_LINE_6
1042 * @arg @ref LL_EXTI_LINE_7
1043 * @arg @ref LL_EXTI_LINE_8
1044 * @arg @ref LL_EXTI_LINE_9
1045 * @arg @ref LL_EXTI_LINE_10
1046 * @arg @ref LL_EXTI_LINE_11
1047 * @arg @ref LL_EXTI_LINE_12
1048 * @arg @ref LL_EXTI_LINE_13
1049 * @arg @ref LL_EXTI_LINE_14
1050 * @arg @ref LL_EXTI_LINE_15
1051 * @arg @ref LL_EXTI_LINE_16
1052 * @arg @ref LL_EXTI_LINE_17
1053 * @arg @ref LL_EXTI_LINE_18
1054 * @arg @ref LL_EXTI_LINE_ALL_0_31
1055 * @note Please check each device line mapping for EXTI Line availability
1056 * @retval None
1057 */
LL_EXTI_EnableSecure_0_31(uint32_t ExtiLine)1058 __STATIC_INLINE void LL_EXTI_EnableSecure_0_31(uint32_t ExtiLine)
1059 {
1060 SET_BIT(EXTI->SECCFGR1, ExtiLine);
1061 }
1062
1063 /**
1064 * @brief Disable ExtiLine Secure attribute for Lines in range 0 to 31
1065 * @rmtoll SECCFGR1 SECx LL_EXTI_DisableSecure_0_31
1066 * @param ExtiLine This parameter can be one of the following values:
1067 * @arg @ref LL_EXTI_LINE_0
1068 * @arg @ref LL_EXTI_LINE_1
1069 * @arg @ref LL_EXTI_LINE_2
1070 * @arg @ref LL_EXTI_LINE_3
1071 * @arg @ref LL_EXTI_LINE_4
1072 * @arg @ref LL_EXTI_LINE_5
1073 * @arg @ref LL_EXTI_LINE_6
1074 * @arg @ref LL_EXTI_LINE_7
1075 * @arg @ref LL_EXTI_LINE_8
1076 * @arg @ref LL_EXTI_LINE_9
1077 * @arg @ref LL_EXTI_LINE_10
1078 * @arg @ref LL_EXTI_LINE_11
1079 * @arg @ref LL_EXTI_LINE_12
1080 * @arg @ref LL_EXTI_LINE_13
1081 * @arg @ref LL_EXTI_LINE_14
1082 * @arg @ref LL_EXTI_LINE_15
1083 * @arg @ref LL_EXTI_LINE_16
1084 * @arg @ref LL_EXTI_LINE_17
1085 * @arg @ref LL_EXTI_LINE_18
1086 * @arg @ref LL_EXTI_LINE_ALL_0_31
1087 * @note Please check each device line mapping for EXTI Line availability
1088 * @retval None
1089 */
LL_EXTI_DisableSecure_0_31(uint32_t ExtiLine)1090 __STATIC_INLINE void LL_EXTI_DisableSecure_0_31(uint32_t ExtiLine)
1091 {
1092 CLEAR_BIT(EXTI->SECCFGR1, ExtiLine);
1093 }
1094
1095 /**
1096 * @brief Indicate if ExtiLine Secure attribute is enabled for Lines in range 0 to 31
1097 * @rmtoll SECCFGR1 SECx LL_EXTI_IsEnabledSecure_0_31
1098 * @param ExtiLine This parameter can be one of the following values:
1099 * @arg @ref LL_EXTI_LINE_0
1100 * @arg @ref LL_EXTI_LINE_1
1101 * @arg @ref LL_EXTI_LINE_2
1102 * @arg @ref LL_EXTI_LINE_3
1103 * @arg @ref LL_EXTI_LINE_4
1104 * @arg @ref LL_EXTI_LINE_5
1105 * @arg @ref LL_EXTI_LINE_6
1106 * @arg @ref LL_EXTI_LINE_7
1107 * @arg @ref LL_EXTI_LINE_8
1108 * @arg @ref LL_EXTI_LINE_9
1109 * @arg @ref LL_EXTI_LINE_10
1110 * @arg @ref LL_EXTI_LINE_11
1111 * @arg @ref LL_EXTI_LINE_12
1112 * @arg @ref LL_EXTI_LINE_13
1113 * @arg @ref LL_EXTI_LINE_14
1114 * @arg @ref LL_EXTI_LINE_15
1115 * @arg @ref LL_EXTI_LINE_16
1116 * @arg @ref LL_EXTI_LINE_17
1117 * @arg @ref LL_EXTI_LINE_18
1118 * @arg @ref LL_EXTI_LINE_ALL_0_31
1119 * @note Please check each device line mapping for EXTI Line availability
1120 * @retval State of bit (1 or 0).
1121 */
LL_EXTI_IsEnabledSecure_0_31(uint32_t ExtiLine)1122 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledSecure_0_31(uint32_t ExtiLine)
1123 {
1124 return ((READ_BIT(EXTI->SECCFGR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
1125 }
1126 #endif /* __ARM_FEATURE_CMSE */
1127
1128 /**
1129 * @}
1130 */
1131
1132 /** @defgroup EXTI_LL_EF_Privilege_Management Privilege_Management
1133 * @{
1134 */
1135
1136 #if defined(EXTI_PRIVCFGR1_PRIV0)
1137 /**
1138 * @brief Enable ExtiLine Privilege attribute for Lines in range 0 to 31
1139 * @rmtoll PRIVCFGR1 PRIVx LL_EXTI_EnablePrivilege_0_31
1140 * @param ExtiLine This parameter can be one of the following values:
1141 * @arg @ref LL_EXTI_LINE_0
1142 * @arg @ref LL_EXTI_LINE_1
1143 * @arg @ref LL_EXTI_LINE_2
1144 * @arg @ref LL_EXTI_LINE_3
1145 * @arg @ref LL_EXTI_LINE_4
1146 * @arg @ref LL_EXTI_LINE_5
1147 * @arg @ref LL_EXTI_LINE_6
1148 * @arg @ref LL_EXTI_LINE_7
1149 * @arg @ref LL_EXTI_LINE_8
1150 * @arg @ref LL_EXTI_LINE_9
1151 * @arg @ref LL_EXTI_LINE_10
1152 * @arg @ref LL_EXTI_LINE_11
1153 * @arg @ref LL_EXTI_LINE_12
1154 * @arg @ref LL_EXTI_LINE_13
1155 * @arg @ref LL_EXTI_LINE_14
1156 * @arg @ref LL_EXTI_LINE_15
1157 * @arg @ref LL_EXTI_LINE_16
1158 * @arg @ref LL_EXTI_LINE_17
1159 * @arg @ref LL_EXTI_LINE_18
1160 * @arg @ref LL_EXTI_LINE_ALL_0_31
1161 * @note Please check each device line mapping for EXTI Line availability
1162 * @retval None
1163 */
LL_EXTI_EnablePrivilege_0_31(uint32_t ExtiLine)1164 __STATIC_INLINE void LL_EXTI_EnablePrivilege_0_31(uint32_t ExtiLine)
1165 {
1166 SET_BIT(EXTI->PRIVCFGR1, ExtiLine);
1167 }
1168
1169 /**
1170 * @brief Disable ExtiLine Privilege attribute for Lines in range 0 to 31
1171 * @rmtoll PRIVCFGR1 PRIVx LL_EXTI_DisablePrivilege_0_31
1172 * @param ExtiLine This parameter can be one of the following values:
1173 * @arg @ref LL_EXTI_LINE_0
1174 * @arg @ref LL_EXTI_LINE_1
1175 * @arg @ref LL_EXTI_LINE_2
1176 * @arg @ref LL_EXTI_LINE_3
1177 * @arg @ref LL_EXTI_LINE_4
1178 * @arg @ref LL_EXTI_LINE_5
1179 * @arg @ref LL_EXTI_LINE_6
1180 * @arg @ref LL_EXTI_LINE_7
1181 * @arg @ref LL_EXTI_LINE_8
1182 * @arg @ref LL_EXTI_LINE_9
1183 * @arg @ref LL_EXTI_LINE_10
1184 * @arg @ref LL_EXTI_LINE_11
1185 * @arg @ref LL_EXTI_LINE_12
1186 * @arg @ref LL_EXTI_LINE_13
1187 * @arg @ref LL_EXTI_LINE_14
1188 * @arg @ref LL_EXTI_LINE_15
1189 * @arg @ref LL_EXTI_LINE_16
1190 * @arg @ref LL_EXTI_LINE_17
1191 * @arg @ref LL_EXTI_LINE_18
1192 * @arg @ref LL_EXTI_LINE_ALL_0_31
1193 * @note Please check each device line mapping for EXTI Line availability
1194 * @retval None
1195 */
LL_EXTI_DisablePrivilege_0_31(uint32_t ExtiLine)1196 __STATIC_INLINE void LL_EXTI_DisablePrivilege_0_31(uint32_t ExtiLine)
1197 {
1198 CLEAR_BIT(EXTI->PRIVCFGR1, ExtiLine);
1199 }
1200
1201 /**
1202 * @brief Indicate if ExtiLine Privilege attribute is enabled for Lines in range 0 to 31
1203 * @rmtoll PRIVCFGR1 PRIVx LL_EXTI_IsEnabledPrivilege_0_31
1204 * @param ExtiLine This parameter can be one of the following values:
1205 * @arg @ref LL_EXTI_LINE_0
1206 * @arg @ref LL_EXTI_LINE_1
1207 * @arg @ref LL_EXTI_LINE_2
1208 * @arg @ref LL_EXTI_LINE_3
1209 * @arg @ref LL_EXTI_LINE_4
1210 * @arg @ref LL_EXTI_LINE_5
1211 * @arg @ref LL_EXTI_LINE_6
1212 * @arg @ref LL_EXTI_LINE_7
1213 * @arg @ref LL_EXTI_LINE_8
1214 * @arg @ref LL_EXTI_LINE_9
1215 * @arg @ref LL_EXTI_LINE_10
1216 * @arg @ref LL_EXTI_LINE_11
1217 * @arg @ref LL_EXTI_LINE_12
1218 * @arg @ref LL_EXTI_LINE_13
1219 * @arg @ref LL_EXTI_LINE_14
1220 * @arg @ref LL_EXTI_LINE_15
1221 * @arg @ref LL_EXTI_LINE_16
1222 * @arg @ref LL_EXTI_LINE_17
1223 * @arg @ref LL_EXTI_LINE_18
1224 * @arg @ref LL_EXTI_LINE_ALL_0_31
1225 * @note Please check each device line mapping for EXTI Line availability
1226 * @retval State of bit (1 or 0).
1227 */
LL_EXTI_IsEnabledPrivilege_0_31(uint32_t ExtiLine)1228 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledPrivilege_0_31(uint32_t ExtiLine)
1229 {
1230 return ((READ_BIT(EXTI->PRIVCFGR1, ExtiLine) == (ExtiLine)) ? 1UL : 0UL);
1231 }
1232 #endif /* EXTI_PRIVCFGR1_PRIV0 */
1233
1234 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
1235 /**
1236 * @brief Lock the secure and privilege configuration registers.
1237 * @rmtoll LOCKR LOCK LL_EXTI_LockAttributes
1238 * @retval None
1239 */
LL_EXTI_LockAttributes(void)1240 __STATIC_INLINE void LL_EXTI_LockAttributes(void)
1241 {
1242 SET_BIT(EXTI->LOCKR, EXTI_LOCKR_LOCK);
1243 }
1244
1245 /**
1246 * @brief Return the secure and privilege configuration registers LOCK status
1247 * @rmtoll LOCKR LOCK LL_EXTI_GetLockAttributes
1248 * @retval 1 if the secure and privilege configuration registers have been locked else 0.
1249 */
LL_EXTI_GetLockAttributes(void)1250 __STATIC_INLINE uint32_t LL_EXTI_GetLockAttributes(void)
1251 {
1252 return READ_BIT(EXTI->LOCKR, EXTI_LOCKR_LOCK);
1253 }
1254 #endif /* __ARM_FEATURE_CMSE */
1255
1256 /**
1257 * @}
1258 */
1259
1260
1261
1262 #if defined(USE_FULL_LL_DRIVER)
1263 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
1264 * @{
1265 */
1266
1267 ErrorStatus LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1268 ErrorStatus LL_EXTI_DeInit(void);
1269 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
1270
1271
1272 /**
1273 * @}
1274 */
1275 #endif /* USE_FULL_LL_DRIVER */
1276
1277 /**
1278 * @}
1279 */
1280
1281 /**
1282 * @}
1283 */
1284
1285 #endif /* EXTI */
1286
1287 /**
1288 * @}
1289 */
1290
1291 #ifdef __cplusplus
1292 }
1293 #endif
1294
1295 #endif /* STM32WBAxx_LL_EXTI_H */
1296
1297