2 ******************************************************************************
3 * @file stm32f4xx_ll_exti.h
4 * @author MCD Application Team
7 * @brief Header file of EXTI LL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F4xx_LL_EXTI_H
40 #define __STM32F4xx_LL_EXTI_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f4xx.h"
49 /** @addtogroup STM32F4xx_LL_Driver
55 /** @defgroup EXTI_LL EXTI
59 /* Private types -------------------------------------------------------------*/
60 /* Private variables ---------------------------------------------------------*/
61 /* Private constants ---------------------------------------------------------*/
62 /* Private Macros ------------------------------------------------------------*/
63 #if defined(USE_FULL_LL_DRIVER)
64 /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros
70 #endif /*USE_FULL_LL_DRIVER*/
71 /* Exported types ------------------------------------------------------------*/
72 #if defined(USE_FULL_LL_DRIVER)
73 /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure
79 uint32_t Line_0_31
; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31
80 This parameter can be any combination of @ref EXTI_LL_EC_LINE */
82 FunctionalState LineCommand
; /*!< Specifies the new state of the selected EXTI lines.
83 This parameter can be set either to ENABLE or DISABLE */
85 uint8_t Mode
; /*!< Specifies the mode for the EXTI lines.
86 This parameter can be a value of @ref EXTI_LL_EC_MODE. */
88 uint8_t Trigger
; /*!< Specifies the trigger signal active edge for the EXTI lines.
89 This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
90 } LL_EXTI_InitTypeDef
;
95 #endif /*USE_FULL_LL_DRIVER*/
97 /* Exported constants --------------------------------------------------------*/
98 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
102 /** @defgroup EXTI_LL_EC_LINE LINE
105 #define LL_EXTI_LINE_0 EXTI_IMR_IM0 /*!< Extended line 0 */
106 #define LL_EXTI_LINE_1 EXTI_IMR_IM1 /*!< Extended line 1 */
107 #define LL_EXTI_LINE_2 EXTI_IMR_IM2 /*!< Extended line 2 */
108 #define LL_EXTI_LINE_3 EXTI_IMR_IM3 /*!< Extended line 3 */
109 #define LL_EXTI_LINE_4 EXTI_IMR_IM4 /*!< Extended line 4 */
110 #define LL_EXTI_LINE_5 EXTI_IMR_IM5 /*!< Extended line 5 */
111 #define LL_EXTI_LINE_6 EXTI_IMR_IM6 /*!< Extended line 6 */
112 #define LL_EXTI_LINE_7 EXTI_IMR_IM7 /*!< Extended line 7 */
113 #define LL_EXTI_LINE_8 EXTI_IMR_IM8 /*!< Extended line 8 */
114 #define LL_EXTI_LINE_9 EXTI_IMR_IM9 /*!< Extended line 9 */
115 #define LL_EXTI_LINE_10 EXTI_IMR_IM10 /*!< Extended line 10 */
116 #define LL_EXTI_LINE_11 EXTI_IMR_IM11 /*!< Extended line 11 */
117 #define LL_EXTI_LINE_12 EXTI_IMR_IM12 /*!< Extended line 12 */
118 #define LL_EXTI_LINE_13 EXTI_IMR_IM13 /*!< Extended line 13 */
119 #define LL_EXTI_LINE_14 EXTI_IMR_IM14 /*!< Extended line 14 */
120 #define LL_EXTI_LINE_15 EXTI_IMR_IM15 /*!< Extended line 15 */
121 #if defined(EXTI_IMR_IM16)
122 #define LL_EXTI_LINE_16 EXTI_IMR_IM16 /*!< Extended line 16 */
124 #define LL_EXTI_LINE_17 EXTI_IMR_IM17 /*!< Extended line 17 */
125 #if defined(EXTI_IMR_IM18)
126 #define LL_EXTI_LINE_18 EXTI_IMR_IM18 /*!< Extended line 18 */
128 #define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */
129 #if defined(EXTI_IMR_IM20)
130 #define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */
132 #if defined(EXTI_IMR_IM21)
133 #define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */
135 #if defined(EXTI_IMR_IM22)
136 #define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */
138 #if defined(EXTI_IMR_IM23)
139 #define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */
141 #if defined(EXTI_IMR_IM24)
142 #define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */
144 #if defined(EXTI_IMR_IM25)
145 #define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */
147 #if defined(EXTI_IMR_IM26)
148 #define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */
150 #if defined(EXTI_IMR_IM27)
151 #define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */
153 #if defined(EXTI_IMR_IM28)
154 #define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */
156 #if defined(EXTI_IMR_IM29)
157 #define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */
159 #if defined(EXTI_IMR_IM30)
160 #define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */
162 #if defined(EXTI_IMR_IM31)
163 #define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */
165 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/
168 #define LL_EXTI_LINE_ALL ((uint32_t)0xFFFFFFFFU) /*!< All Extended line */
170 #if defined(USE_FULL_LL_DRIVER)
171 #define LL_EXTI_LINE_NONE ((uint32_t)0x00000000U) /*!< None Extended line */
172 #endif /*USE_FULL_LL_DRIVER*/
177 #if defined(USE_FULL_LL_DRIVER)
179 /** @defgroup EXTI_LL_EC_MODE Mode
182 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */
183 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */
184 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */
189 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
192 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */
193 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */
194 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */
195 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */
202 #endif /*USE_FULL_LL_DRIVER*/
209 /* Exported macro ------------------------------------------------------------*/
210 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
214 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
219 * @brief Write a value in EXTI register
220 * @param __REG__ Register to be written
221 * @param __VALUE__ Value to be written in the register
224 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
227 * @brief Read a value in EXTI register
228 * @param __REG__ Register to be read
229 * @retval Register value
231 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
243 /* Exported functions --------------------------------------------------------*/
244 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
247 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
252 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
253 * @note The reset value for the direct or internal lines (see RM)
254 * is set to 1 in order to enable the interrupt by default.
255 * Bits are set automatically at Power on.
256 * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31
257 * @param ExtiLine This parameter can be one of the following values:
258 * @arg @ref LL_EXTI_LINE_0
259 * @arg @ref LL_EXTI_LINE_1
260 * @arg @ref LL_EXTI_LINE_2
261 * @arg @ref LL_EXTI_LINE_3
262 * @arg @ref LL_EXTI_LINE_4
263 * @arg @ref LL_EXTI_LINE_5
264 * @arg @ref LL_EXTI_LINE_6
265 * @arg @ref LL_EXTI_LINE_7
266 * @arg @ref LL_EXTI_LINE_8
267 * @arg @ref LL_EXTI_LINE_9
268 * @arg @ref LL_EXTI_LINE_10
269 * @arg @ref LL_EXTI_LINE_11
270 * @arg @ref LL_EXTI_LINE_12
271 * @arg @ref LL_EXTI_LINE_13
272 * @arg @ref LL_EXTI_LINE_14
273 * @arg @ref LL_EXTI_LINE_15
274 * @arg @ref LL_EXTI_LINE_16
275 * @arg @ref LL_EXTI_LINE_17
276 * @arg @ref LL_EXTI_LINE_18
277 * @arg @ref LL_EXTI_LINE_19(*)
278 * @arg @ref LL_EXTI_LINE_20(*)
279 * @arg @ref LL_EXTI_LINE_21
280 * @arg @ref LL_EXTI_LINE_22
281 * @arg @ref LL_EXTI_LINE_23(*)
282 * @arg @ref LL_EXTI_LINE_ALL_0_31
283 * @note (*): Available in some devices
284 * @note Please check each device line mapping for EXTI Line availability
287 __STATIC_INLINE
void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine
)
289 SET_BIT(EXTI
->IMR
, ExtiLine
);
293 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
294 * @note The reset value for the direct or internal lines (see RM)
295 * is set to 1 in order to enable the interrupt by default.
296 * Bits are set automatically at Power on.
297 * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31
298 * @param ExtiLine This parameter can be one of the following values:
299 * @arg @ref LL_EXTI_LINE_0
300 * @arg @ref LL_EXTI_LINE_1
301 * @arg @ref LL_EXTI_LINE_2
302 * @arg @ref LL_EXTI_LINE_3
303 * @arg @ref LL_EXTI_LINE_4
304 * @arg @ref LL_EXTI_LINE_5
305 * @arg @ref LL_EXTI_LINE_6
306 * @arg @ref LL_EXTI_LINE_7
307 * @arg @ref LL_EXTI_LINE_8
308 * @arg @ref LL_EXTI_LINE_9
309 * @arg @ref LL_EXTI_LINE_10
310 * @arg @ref LL_EXTI_LINE_11
311 * @arg @ref LL_EXTI_LINE_12
312 * @arg @ref LL_EXTI_LINE_13
313 * @arg @ref LL_EXTI_LINE_14
314 * @arg @ref LL_EXTI_LINE_15
315 * @arg @ref LL_EXTI_LINE_16
316 * @arg @ref LL_EXTI_LINE_17
317 * @arg @ref LL_EXTI_LINE_18
318 * @arg @ref LL_EXTI_LINE_19(*)
319 * @arg @ref LL_EXTI_LINE_20(*)
320 * @arg @ref LL_EXTI_LINE_21
321 * @arg @ref LL_EXTI_LINE_22
322 * @arg @ref LL_EXTI_LINE_23(*)
323 * @arg @ref LL_EXTI_LINE_ALL_0_31
324 * @note (*): Available in some devices
325 * @note Please check each device line mapping for EXTI Line availability
328 __STATIC_INLINE
void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine
)
330 CLEAR_BIT(EXTI
->IMR
, ExtiLine
);
335 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
336 * @note The reset value for the direct or internal lines (see RM)
337 * is set to 1 in order to enable the interrupt by default.
338 * Bits are set automatically at Power on.
339 * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31
340 * @param ExtiLine This parameter can be one of the following values:
341 * @arg @ref LL_EXTI_LINE_0
342 * @arg @ref LL_EXTI_LINE_1
343 * @arg @ref LL_EXTI_LINE_2
344 * @arg @ref LL_EXTI_LINE_3
345 * @arg @ref LL_EXTI_LINE_4
346 * @arg @ref LL_EXTI_LINE_5
347 * @arg @ref LL_EXTI_LINE_6
348 * @arg @ref LL_EXTI_LINE_7
349 * @arg @ref LL_EXTI_LINE_8
350 * @arg @ref LL_EXTI_LINE_9
351 * @arg @ref LL_EXTI_LINE_10
352 * @arg @ref LL_EXTI_LINE_11
353 * @arg @ref LL_EXTI_LINE_12
354 * @arg @ref LL_EXTI_LINE_13
355 * @arg @ref LL_EXTI_LINE_14
356 * @arg @ref LL_EXTI_LINE_15
357 * @arg @ref LL_EXTI_LINE_16
358 * @arg @ref LL_EXTI_LINE_17
359 * @arg @ref LL_EXTI_LINE_18
360 * @arg @ref LL_EXTI_LINE_19(*)
361 * @arg @ref LL_EXTI_LINE_20(*)
362 * @arg @ref LL_EXTI_LINE_21
363 * @arg @ref LL_EXTI_LINE_22
364 * @arg @ref LL_EXTI_LINE_23(*)
365 * @arg @ref LL_EXTI_LINE_ALL_0_31
366 * @note (*): Available in some devices
367 * @note Please check each device line mapping for EXTI Line availability
368 * @retval State of bit (1 or 0).
370 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine
)
372 return (READ_BIT(EXTI
->IMR
, ExtiLine
) == (ExtiLine
));
380 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
385 * @brief Enable ExtiLine Event request for Lines in range 0 to 31
386 * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31
387 * @param ExtiLine This parameter can be one of the following values:
388 * @arg @ref LL_EXTI_LINE_0
389 * @arg @ref LL_EXTI_LINE_1
390 * @arg @ref LL_EXTI_LINE_2
391 * @arg @ref LL_EXTI_LINE_3
392 * @arg @ref LL_EXTI_LINE_4
393 * @arg @ref LL_EXTI_LINE_5
394 * @arg @ref LL_EXTI_LINE_6
395 * @arg @ref LL_EXTI_LINE_7
396 * @arg @ref LL_EXTI_LINE_8
397 * @arg @ref LL_EXTI_LINE_9
398 * @arg @ref LL_EXTI_LINE_10
399 * @arg @ref LL_EXTI_LINE_11
400 * @arg @ref LL_EXTI_LINE_12
401 * @arg @ref LL_EXTI_LINE_13
402 * @arg @ref LL_EXTI_LINE_14
403 * @arg @ref LL_EXTI_LINE_15
404 * @arg @ref LL_EXTI_LINE_16
405 * @arg @ref LL_EXTI_LINE_17
406 * @arg @ref LL_EXTI_LINE_18
407 * @arg @ref LL_EXTI_LINE_19(*)
408 * @arg @ref LL_EXTI_LINE_20(*)
409 * @arg @ref LL_EXTI_LINE_21
410 * @arg @ref LL_EXTI_LINE_22
411 * @arg @ref LL_EXTI_LINE_23(*)
412 * @arg @ref LL_EXTI_LINE_ALL_0_31
413 * @note (*): Available in some devices
414 * @note Please check each device line mapping for EXTI Line availability
417 __STATIC_INLINE
void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine
)
419 SET_BIT(EXTI
->EMR
, ExtiLine
);
425 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
426 * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31
427 * @param ExtiLine This parameter can be one of the following values:
428 * @arg @ref LL_EXTI_LINE_0
429 * @arg @ref LL_EXTI_LINE_1
430 * @arg @ref LL_EXTI_LINE_2
431 * @arg @ref LL_EXTI_LINE_3
432 * @arg @ref LL_EXTI_LINE_4
433 * @arg @ref LL_EXTI_LINE_5
434 * @arg @ref LL_EXTI_LINE_6
435 * @arg @ref LL_EXTI_LINE_7
436 * @arg @ref LL_EXTI_LINE_8
437 * @arg @ref LL_EXTI_LINE_9
438 * @arg @ref LL_EXTI_LINE_10
439 * @arg @ref LL_EXTI_LINE_11
440 * @arg @ref LL_EXTI_LINE_12
441 * @arg @ref LL_EXTI_LINE_13
442 * @arg @ref LL_EXTI_LINE_14
443 * @arg @ref LL_EXTI_LINE_15
444 * @arg @ref LL_EXTI_LINE_16
445 * @arg @ref LL_EXTI_LINE_17
446 * @arg @ref LL_EXTI_LINE_18
447 * @arg @ref LL_EXTI_LINE_19(*)
448 * @arg @ref LL_EXTI_LINE_20(*)
449 * @arg @ref LL_EXTI_LINE_21
450 * @arg @ref LL_EXTI_LINE_22
451 * @arg @ref LL_EXTI_LINE_23(*)
452 * @arg @ref LL_EXTI_LINE_ALL_0_31
453 * @note (*): Available in some devices
454 * @note Please check each device line mapping for EXTI Line availability
457 __STATIC_INLINE
void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine
)
459 CLEAR_BIT(EXTI
->EMR
, ExtiLine
);
464 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
465 * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31
466 * @param ExtiLine This parameter can be one of the following values:
467 * @arg @ref LL_EXTI_LINE_0
468 * @arg @ref LL_EXTI_LINE_1
469 * @arg @ref LL_EXTI_LINE_2
470 * @arg @ref LL_EXTI_LINE_3
471 * @arg @ref LL_EXTI_LINE_4
472 * @arg @ref LL_EXTI_LINE_5
473 * @arg @ref LL_EXTI_LINE_6
474 * @arg @ref LL_EXTI_LINE_7
475 * @arg @ref LL_EXTI_LINE_8
476 * @arg @ref LL_EXTI_LINE_9
477 * @arg @ref LL_EXTI_LINE_10
478 * @arg @ref LL_EXTI_LINE_11
479 * @arg @ref LL_EXTI_LINE_12
480 * @arg @ref LL_EXTI_LINE_13
481 * @arg @ref LL_EXTI_LINE_14
482 * @arg @ref LL_EXTI_LINE_15
483 * @arg @ref LL_EXTI_LINE_16
484 * @arg @ref LL_EXTI_LINE_17
485 * @arg @ref LL_EXTI_LINE_18
486 * @arg @ref LL_EXTI_LINE_19(*)
487 * @arg @ref LL_EXTI_LINE_20(*)
488 * @arg @ref LL_EXTI_LINE_21
489 * @arg @ref LL_EXTI_LINE_22
490 * @arg @ref LL_EXTI_LINE_23(*)
491 * @arg @ref LL_EXTI_LINE_ALL_0_31
492 * @note (*): Available in some devices
493 * @note Please check each device line mapping for EXTI Line availability
494 * @retval State of bit (1 or 0).
496 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine
)
498 return (READ_BIT(EXTI
->EMR
, ExtiLine
) == (ExtiLine
));
507 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
512 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
513 * @note The configurable wakeup lines are edge-triggered. No glitch must be
514 * generated on these lines. If a rising edge on a configurable interrupt
515 * line occurs during a write operation in the EXTI_RTSR register, the
516 * pending bit is not set.
517 * Rising and falling edge triggers can be set for
518 * the same interrupt line. In this case, both generate a trigger
520 * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31
521 * @param ExtiLine This parameter can be a combination of the following values:
522 * @arg @ref LL_EXTI_LINE_0
523 * @arg @ref LL_EXTI_LINE_1
524 * @arg @ref LL_EXTI_LINE_2
525 * @arg @ref LL_EXTI_LINE_3
526 * @arg @ref LL_EXTI_LINE_4
527 * @arg @ref LL_EXTI_LINE_5
528 * @arg @ref LL_EXTI_LINE_6
529 * @arg @ref LL_EXTI_LINE_7
530 * @arg @ref LL_EXTI_LINE_8
531 * @arg @ref LL_EXTI_LINE_9
532 * @arg @ref LL_EXTI_LINE_10
533 * @arg @ref LL_EXTI_LINE_11
534 * @arg @ref LL_EXTI_LINE_12
535 * @arg @ref LL_EXTI_LINE_13
536 * @arg @ref LL_EXTI_LINE_14
537 * @arg @ref LL_EXTI_LINE_15
538 * @arg @ref LL_EXTI_LINE_16
539 * @arg @ref LL_EXTI_LINE_18
540 * @arg @ref LL_EXTI_LINE_19(*)
541 * @arg @ref LL_EXTI_LINE_20(*)
542 * @arg @ref LL_EXTI_LINE_21
543 * @arg @ref LL_EXTI_LINE_22
544 * @note (*): Available in some devices
545 * @note Please check each device line mapping for EXTI Line availability
548 __STATIC_INLINE
void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine
)
550 SET_BIT(EXTI
->RTSR
, ExtiLine
);
556 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
557 * @note The configurable wakeup lines are edge-triggered. No glitch must be
558 * generated on these lines. If a rising edge on a configurable interrupt
559 * line occurs during a write operation in the EXTI_RTSR register, the
560 * pending bit is not set.
561 * Rising and falling edge triggers can be set for
562 * the same interrupt line. In this case, both generate a trigger
564 * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31
565 * @param ExtiLine This parameter can be a combination of the following values:
566 * @arg @ref LL_EXTI_LINE_0
567 * @arg @ref LL_EXTI_LINE_1
568 * @arg @ref LL_EXTI_LINE_2
569 * @arg @ref LL_EXTI_LINE_3
570 * @arg @ref LL_EXTI_LINE_4
571 * @arg @ref LL_EXTI_LINE_5
572 * @arg @ref LL_EXTI_LINE_6
573 * @arg @ref LL_EXTI_LINE_7
574 * @arg @ref LL_EXTI_LINE_8
575 * @arg @ref LL_EXTI_LINE_9
576 * @arg @ref LL_EXTI_LINE_10
577 * @arg @ref LL_EXTI_LINE_11
578 * @arg @ref LL_EXTI_LINE_12
579 * @arg @ref LL_EXTI_LINE_13
580 * @arg @ref LL_EXTI_LINE_14
581 * @arg @ref LL_EXTI_LINE_15
582 * @arg @ref LL_EXTI_LINE_16
583 * @arg @ref LL_EXTI_LINE_18
584 * @arg @ref LL_EXTI_LINE_19(*)
585 * @arg @ref LL_EXTI_LINE_20(*)
586 * @arg @ref LL_EXTI_LINE_21
587 * @arg @ref LL_EXTI_LINE_22
588 * @note (*): Available in some devices
589 * @note Please check each device line mapping for EXTI Line availability
592 __STATIC_INLINE
void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine
)
594 CLEAR_BIT(EXTI
->RTSR
, ExtiLine
);
600 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
601 * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31
602 * @param ExtiLine This parameter can be a combination of the following values:
603 * @arg @ref LL_EXTI_LINE_0
604 * @arg @ref LL_EXTI_LINE_1
605 * @arg @ref LL_EXTI_LINE_2
606 * @arg @ref LL_EXTI_LINE_3
607 * @arg @ref LL_EXTI_LINE_4
608 * @arg @ref LL_EXTI_LINE_5
609 * @arg @ref LL_EXTI_LINE_6
610 * @arg @ref LL_EXTI_LINE_7
611 * @arg @ref LL_EXTI_LINE_8
612 * @arg @ref LL_EXTI_LINE_9
613 * @arg @ref LL_EXTI_LINE_10
614 * @arg @ref LL_EXTI_LINE_11
615 * @arg @ref LL_EXTI_LINE_12
616 * @arg @ref LL_EXTI_LINE_13
617 * @arg @ref LL_EXTI_LINE_14
618 * @arg @ref LL_EXTI_LINE_15
619 * @arg @ref LL_EXTI_LINE_16
620 * @arg @ref LL_EXTI_LINE_18
621 * @arg @ref LL_EXTI_LINE_19(*)
622 * @arg @ref LL_EXTI_LINE_20(*)
623 * @arg @ref LL_EXTI_LINE_21
624 * @arg @ref LL_EXTI_LINE_22
625 * @note (*): Available in some devices
626 * @note Please check each device line mapping for EXTI Line availability
627 * @retval State of bit (1 or 0).
629 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine
)
631 return (READ_BIT(EXTI
->RTSR
, ExtiLine
) == (ExtiLine
));
639 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
644 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
645 * @note The configurable wakeup lines are edge-triggered. No glitch must be
646 * generated on these lines. If a falling edge on a configurable interrupt
647 * line occurs during a write operation in the EXTI_FTSR register, the
648 * pending bit is not set.
649 * Rising and falling edge triggers can be set for
650 * the same interrupt line. In this case, both generate a trigger
652 * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_0_31
653 * @param ExtiLine This parameter can be a combination of the following values:
654 * @arg @ref LL_EXTI_LINE_0
655 * @arg @ref LL_EXTI_LINE_1
656 * @arg @ref LL_EXTI_LINE_2
657 * @arg @ref LL_EXTI_LINE_3
658 * @arg @ref LL_EXTI_LINE_4
659 * @arg @ref LL_EXTI_LINE_5
660 * @arg @ref LL_EXTI_LINE_6
661 * @arg @ref LL_EXTI_LINE_7
662 * @arg @ref LL_EXTI_LINE_8
663 * @arg @ref LL_EXTI_LINE_9
664 * @arg @ref LL_EXTI_LINE_10
665 * @arg @ref LL_EXTI_LINE_11
666 * @arg @ref LL_EXTI_LINE_12
667 * @arg @ref LL_EXTI_LINE_13
668 * @arg @ref LL_EXTI_LINE_14
669 * @arg @ref LL_EXTI_LINE_15
670 * @arg @ref LL_EXTI_LINE_16
671 * @arg @ref LL_EXTI_LINE_18
672 * @arg @ref LL_EXTI_LINE_19(*)
673 * @arg @ref LL_EXTI_LINE_20(*)
674 * @arg @ref LL_EXTI_LINE_21
675 * @arg @ref LL_EXTI_LINE_22
676 * @note (*): Available in some devices
677 * @note Please check each device line mapping for EXTI Line availability
680 __STATIC_INLINE
void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine
)
682 SET_BIT(EXTI
->FTSR
, ExtiLine
);
687 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
688 * @note The configurable wakeup lines are edge-triggered. No glitch must be
689 * generated on these lines. If a Falling edge on a configurable interrupt
690 * line occurs during a write operation in the EXTI_FTSR register, the
691 * pending bit is not set.
692 * Rising and falling edge triggers can be set for the same interrupt line.
693 * In this case, both generate a trigger condition.
694 * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31
695 * @param ExtiLine This parameter can be a combination of the following values:
696 * @arg @ref LL_EXTI_LINE_0
697 * @arg @ref LL_EXTI_LINE_1
698 * @arg @ref LL_EXTI_LINE_2
699 * @arg @ref LL_EXTI_LINE_3
700 * @arg @ref LL_EXTI_LINE_4
701 * @arg @ref LL_EXTI_LINE_5
702 * @arg @ref LL_EXTI_LINE_6
703 * @arg @ref LL_EXTI_LINE_7
704 * @arg @ref LL_EXTI_LINE_8
705 * @arg @ref LL_EXTI_LINE_9
706 * @arg @ref LL_EXTI_LINE_10
707 * @arg @ref LL_EXTI_LINE_11
708 * @arg @ref LL_EXTI_LINE_12
709 * @arg @ref LL_EXTI_LINE_13
710 * @arg @ref LL_EXTI_LINE_14
711 * @arg @ref LL_EXTI_LINE_15
712 * @arg @ref LL_EXTI_LINE_16
713 * @arg @ref LL_EXTI_LINE_18
714 * @arg @ref LL_EXTI_LINE_19(*)
715 * @arg @ref LL_EXTI_LINE_20(*)
716 * @arg @ref LL_EXTI_LINE_21
717 * @arg @ref LL_EXTI_LINE_22
718 * @note (*): Available in some devices
719 * @note Please check each device line mapping for EXTI Line availability
722 __STATIC_INLINE
void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine
)
724 CLEAR_BIT(EXTI
->FTSR
, ExtiLine
);
729 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
730 * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31
731 * @param ExtiLine This parameter can be a combination of the following values:
732 * @arg @ref LL_EXTI_LINE_0
733 * @arg @ref LL_EXTI_LINE_1
734 * @arg @ref LL_EXTI_LINE_2
735 * @arg @ref LL_EXTI_LINE_3
736 * @arg @ref LL_EXTI_LINE_4
737 * @arg @ref LL_EXTI_LINE_5
738 * @arg @ref LL_EXTI_LINE_6
739 * @arg @ref LL_EXTI_LINE_7
740 * @arg @ref LL_EXTI_LINE_8
741 * @arg @ref LL_EXTI_LINE_9
742 * @arg @ref LL_EXTI_LINE_10
743 * @arg @ref LL_EXTI_LINE_11
744 * @arg @ref LL_EXTI_LINE_12
745 * @arg @ref LL_EXTI_LINE_13
746 * @arg @ref LL_EXTI_LINE_14
747 * @arg @ref LL_EXTI_LINE_15
748 * @arg @ref LL_EXTI_LINE_16
749 * @arg @ref LL_EXTI_LINE_18
750 * @arg @ref LL_EXTI_LINE_19(*)
751 * @arg @ref LL_EXTI_LINE_20(*)
752 * @arg @ref LL_EXTI_LINE_21
753 * @arg @ref LL_EXTI_LINE_22
754 * @note (*): Available in some devices
755 * @note Please check each device line mapping for EXTI Line availability
756 * @retval State of bit (1 or 0).
758 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine
)
760 return (READ_BIT(EXTI
->FTSR
, ExtiLine
) == (ExtiLine
));
768 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
773 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
774 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
775 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
776 * resulting in an interrupt request generation.
777 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
778 * register (by writing a 1 into the bit)
779 * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31
780 * @param ExtiLine This parameter can be a combination of the following values:
781 * @arg @ref LL_EXTI_LINE_0
782 * @arg @ref LL_EXTI_LINE_1
783 * @arg @ref LL_EXTI_LINE_2
784 * @arg @ref LL_EXTI_LINE_3
785 * @arg @ref LL_EXTI_LINE_4
786 * @arg @ref LL_EXTI_LINE_5
787 * @arg @ref LL_EXTI_LINE_6
788 * @arg @ref LL_EXTI_LINE_7
789 * @arg @ref LL_EXTI_LINE_8
790 * @arg @ref LL_EXTI_LINE_9
791 * @arg @ref LL_EXTI_LINE_10
792 * @arg @ref LL_EXTI_LINE_11
793 * @arg @ref LL_EXTI_LINE_12
794 * @arg @ref LL_EXTI_LINE_13
795 * @arg @ref LL_EXTI_LINE_14
796 * @arg @ref LL_EXTI_LINE_15
797 * @arg @ref LL_EXTI_LINE_16
798 * @arg @ref LL_EXTI_LINE_18
799 * @arg @ref LL_EXTI_LINE_19(*)
800 * @arg @ref LL_EXTI_LINE_20(*)
801 * @arg @ref LL_EXTI_LINE_21
802 * @arg @ref LL_EXTI_LINE_22
803 * @note (*): Available in some devices
804 * @note Please check each device line mapping for EXTI Line availability
807 __STATIC_INLINE
void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine
)
809 SET_BIT(EXTI
->SWIER
, ExtiLine
);
817 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
822 * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31
823 * @note This bit is set when the selected edge event arrives on the interrupt
824 * line. This bit is cleared by writing a 1 to the bit.
825 * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_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_18
845 * @arg @ref LL_EXTI_LINE_19(*)
846 * @arg @ref LL_EXTI_LINE_20(*)
847 * @arg @ref LL_EXTI_LINE_21
848 * @arg @ref LL_EXTI_LINE_22
849 * @note (*): Available in some devices
850 * @note Please check each device line mapping for EXTI Line availability
851 * @retval State of bit (1 or 0).
853 __STATIC_INLINE
uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine
)
855 return (READ_BIT(EXTI
->PR
, ExtiLine
) == (ExtiLine
));
860 * @brief Read ExtLine Combination Flag for Lines in range 0 to 31
861 * @note This bit is set when the selected edge event arrives on the interrupt
862 * line. This bit is cleared by writing a 1 to the bit.
863 * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31
864 * @param ExtiLine This parameter can be a combination of the following values:
865 * @arg @ref LL_EXTI_LINE_0
866 * @arg @ref LL_EXTI_LINE_1
867 * @arg @ref LL_EXTI_LINE_2
868 * @arg @ref LL_EXTI_LINE_3
869 * @arg @ref LL_EXTI_LINE_4
870 * @arg @ref LL_EXTI_LINE_5
871 * @arg @ref LL_EXTI_LINE_6
872 * @arg @ref LL_EXTI_LINE_7
873 * @arg @ref LL_EXTI_LINE_8
874 * @arg @ref LL_EXTI_LINE_9
875 * @arg @ref LL_EXTI_LINE_10
876 * @arg @ref LL_EXTI_LINE_11
877 * @arg @ref LL_EXTI_LINE_12
878 * @arg @ref LL_EXTI_LINE_13
879 * @arg @ref LL_EXTI_LINE_14
880 * @arg @ref LL_EXTI_LINE_15
881 * @arg @ref LL_EXTI_LINE_16
882 * @arg @ref LL_EXTI_LINE_18
883 * @arg @ref LL_EXTI_LINE_19(*)
884 * @arg @ref LL_EXTI_LINE_20(*)
885 * @arg @ref LL_EXTI_LINE_21
886 * @arg @ref LL_EXTI_LINE_22
887 * @note (*): Available in some devices
888 * @note Please check each device line mapping for EXTI Line availability
889 * @retval @note This bit is set when the selected edge event arrives on the interrupt
891 __STATIC_INLINE
uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine
)
893 return (uint32_t)(READ_BIT(EXTI
->PR
, ExtiLine
));
898 * @brief Clear ExtLine Flags for Lines in range 0 to 31
899 * @note This bit is set when the selected edge event arrives on the interrupt
900 * line. This bit is cleared by writing a 1 to the bit.
901 * @rmtoll PR PIFx LL_EXTI_ClearFlag_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_16
920 * @arg @ref LL_EXTI_LINE_18
921 * @arg @ref LL_EXTI_LINE_19(*)
922 * @arg @ref LL_EXTI_LINE_20(*)
923 * @arg @ref LL_EXTI_LINE_21
924 * @arg @ref LL_EXTI_LINE_22
925 * @note (*): Available in some devices
926 * @note Please check each device line mapping for EXTI Line availability
929 __STATIC_INLINE
void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine
)
931 WRITE_REG(EXTI
->PR
, ExtiLine
);
939 #if defined(USE_FULL_LL_DRIVER)
940 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
944 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef
*EXTI_InitStruct
);
945 uint32_t LL_EXTI_DeInit(void);
946 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef
*EXTI_InitStruct
);
952 #endif /* USE_FULL_LL_DRIVER */
972 #endif /* __STM32F4xx_LL_EXTI_H */
974 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/