2 ******************************************************************************
3 * @file stm32f1xx_ll_exti.h
4 * @author MCD Application Team
7 * @brief Header file of EXTI LL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2016 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 __STM32F1xx_LL_EXTI_H
40 #define __STM32F1xx_LL_EXTI_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f1xx.h"
49 /** @addtogroup STM32F1xx_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 #if defined(EXTI_IMR_IM19)
129 #define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */
131 #if defined(EXTI_IMR_IM20)
132 #define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */
134 #if defined(EXTI_IMR_IM21)
135 #define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */
137 #if defined(EXTI_IMR_IM22)
138 #define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */
140 #if defined(EXTI_IMR_IM23)
141 #define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */
143 #if defined(EXTI_IMR_IM24)
144 #define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */
146 #if defined(EXTI_IMR_IM25)
147 #define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */
149 #if defined(EXTI_IMR_IM26)
150 #define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */
152 #if defined(EXTI_IMR_IM27)
153 #define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */
155 #if defined(EXTI_IMR_IM28)
156 #define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */
158 #if defined(EXTI_IMR_IM29)
159 #define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */
161 #if defined(EXTI_IMR_IM30)
162 #define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */
164 #if defined(EXTI_IMR_IM31)
165 #define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */
167 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/
170 #define LL_EXTI_LINE_ALL (0xFFFFFFFFU) /*!< All Extended line */
172 #if defined(USE_FULL_LL_DRIVER)
173 #define LL_EXTI_LINE_NONE (0x00000000U) /*!< None Extended line */
174 #endif /*USE_FULL_LL_DRIVER*/
179 #if defined(USE_FULL_LL_DRIVER)
181 /** @defgroup EXTI_LL_EC_MODE Mode
184 #define LL_EXTI_MODE_IT ((uint8_t)0x00) /*!< Interrupt Mode */
185 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01) /*!< Event Mode */
186 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02) /*!< Interrupt & Event Mode */
191 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
194 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00) /*!< No Trigger Mode */
195 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01) /*!< Trigger Rising Mode */
196 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02) /*!< Trigger Falling Mode */
197 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03) /*!< Trigger Rising & Falling Mode */
204 #endif /*USE_FULL_LL_DRIVER*/
211 /* Exported macro ------------------------------------------------------------*/
212 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
216 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
221 * @brief Write a value in EXTI register
222 * @param __REG__ Register to be written
223 * @param __VALUE__ Value to be written in the register
226 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
229 * @brief Read a value in EXTI register
230 * @param __REG__ Register to be read
231 * @retval Register value
233 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
245 /* Exported functions --------------------------------------------------------*/
246 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
249 /** @defgroup EXTI_LL_EF_IT_Management IT_Management
254 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31
255 * @note The reset value for the direct or internal lines (see RM)
256 * is set to 1 in order to enable the interrupt by default.
257 * Bits are set automatically at Power on.
258 * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31
259 * @param ExtiLine This parameter can be one of the following values:
260 * @arg @ref LL_EXTI_LINE_0
261 * @arg @ref LL_EXTI_LINE_1
262 * @arg @ref LL_EXTI_LINE_2
263 * @arg @ref LL_EXTI_LINE_3
264 * @arg @ref LL_EXTI_LINE_4
265 * @arg @ref LL_EXTI_LINE_5
266 * @arg @ref LL_EXTI_LINE_6
267 * @arg @ref LL_EXTI_LINE_7
268 * @arg @ref LL_EXTI_LINE_8
269 * @arg @ref LL_EXTI_LINE_9
270 * @arg @ref LL_EXTI_LINE_10
271 * @arg @ref LL_EXTI_LINE_11
272 * @arg @ref LL_EXTI_LINE_12
273 * @arg @ref LL_EXTI_LINE_13
274 * @arg @ref LL_EXTI_LINE_14
275 * @arg @ref LL_EXTI_LINE_15
276 * @arg @ref LL_EXTI_LINE_16
277 * @arg @ref LL_EXTI_LINE_17
278 * @arg @ref LL_EXTI_LINE_18
279 * @arg @ref LL_EXTI_LINE_19
280 * @arg @ref LL_EXTI_LINE_ALL_0_31
281 * @note Please check each device line mapping for EXTI Line availability
284 __STATIC_INLINE
void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine
)
286 SET_BIT(EXTI
->IMR
, ExtiLine
);
290 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31
291 * @note The reset value for the direct or internal lines (see RM)
292 * is set to 1 in order to enable the interrupt by default.
293 * Bits are set automatically at Power on.
294 * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31
295 * @param ExtiLine This parameter can be one of the following values:
296 * @arg @ref LL_EXTI_LINE_0
297 * @arg @ref LL_EXTI_LINE_1
298 * @arg @ref LL_EXTI_LINE_2
299 * @arg @ref LL_EXTI_LINE_3
300 * @arg @ref LL_EXTI_LINE_4
301 * @arg @ref LL_EXTI_LINE_5
302 * @arg @ref LL_EXTI_LINE_6
303 * @arg @ref LL_EXTI_LINE_7
304 * @arg @ref LL_EXTI_LINE_8
305 * @arg @ref LL_EXTI_LINE_9
306 * @arg @ref LL_EXTI_LINE_10
307 * @arg @ref LL_EXTI_LINE_11
308 * @arg @ref LL_EXTI_LINE_12
309 * @arg @ref LL_EXTI_LINE_13
310 * @arg @ref LL_EXTI_LINE_14
311 * @arg @ref LL_EXTI_LINE_15
312 * @arg @ref LL_EXTI_LINE_16
313 * @arg @ref LL_EXTI_LINE_17
314 * @arg @ref LL_EXTI_LINE_18
315 * @arg @ref LL_EXTI_LINE_19
316 * @arg @ref LL_EXTI_LINE_ALL_0_31
317 * @note Please check each device line mapping for EXTI Line availability
320 __STATIC_INLINE
void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine
)
322 CLEAR_BIT(EXTI
->IMR
, ExtiLine
);
327 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
328 * @note The reset value for the direct or internal lines (see RM)
329 * is set to 1 in order to enable the interrupt by default.
330 * Bits are set automatically at Power on.
331 * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31
332 * @param ExtiLine This parameter can be one of the following values:
333 * @arg @ref LL_EXTI_LINE_0
334 * @arg @ref LL_EXTI_LINE_1
335 * @arg @ref LL_EXTI_LINE_2
336 * @arg @ref LL_EXTI_LINE_3
337 * @arg @ref LL_EXTI_LINE_4
338 * @arg @ref LL_EXTI_LINE_5
339 * @arg @ref LL_EXTI_LINE_6
340 * @arg @ref LL_EXTI_LINE_7
341 * @arg @ref LL_EXTI_LINE_8
342 * @arg @ref LL_EXTI_LINE_9
343 * @arg @ref LL_EXTI_LINE_10
344 * @arg @ref LL_EXTI_LINE_11
345 * @arg @ref LL_EXTI_LINE_12
346 * @arg @ref LL_EXTI_LINE_13
347 * @arg @ref LL_EXTI_LINE_14
348 * @arg @ref LL_EXTI_LINE_15
349 * @arg @ref LL_EXTI_LINE_16
350 * @arg @ref LL_EXTI_LINE_17
351 * @arg @ref LL_EXTI_LINE_18
352 * @arg @ref LL_EXTI_LINE_19
353 * @arg @ref LL_EXTI_LINE_ALL_0_31
354 * @note Please check each device line mapping for EXTI Line availability
355 * @retval State of bit (1 or 0).
357 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine
)
359 return (READ_BIT(EXTI
->IMR
, ExtiLine
) == (ExtiLine
));
367 /** @defgroup EXTI_LL_EF_Event_Management Event_Management
372 * @brief Enable ExtiLine Event request for Lines in range 0 to 31
373 * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31
374 * @param ExtiLine This parameter can be one of the following values:
375 * @arg @ref LL_EXTI_LINE_0
376 * @arg @ref LL_EXTI_LINE_1
377 * @arg @ref LL_EXTI_LINE_2
378 * @arg @ref LL_EXTI_LINE_3
379 * @arg @ref LL_EXTI_LINE_4
380 * @arg @ref LL_EXTI_LINE_5
381 * @arg @ref LL_EXTI_LINE_6
382 * @arg @ref LL_EXTI_LINE_7
383 * @arg @ref LL_EXTI_LINE_8
384 * @arg @ref LL_EXTI_LINE_9
385 * @arg @ref LL_EXTI_LINE_10
386 * @arg @ref LL_EXTI_LINE_11
387 * @arg @ref LL_EXTI_LINE_12
388 * @arg @ref LL_EXTI_LINE_13
389 * @arg @ref LL_EXTI_LINE_14
390 * @arg @ref LL_EXTI_LINE_15
391 * @arg @ref LL_EXTI_LINE_16
392 * @arg @ref LL_EXTI_LINE_17
393 * @arg @ref LL_EXTI_LINE_18
394 * @arg @ref LL_EXTI_LINE_19
395 * @arg @ref LL_EXTI_LINE_ALL_0_31
396 * @note Please check each device line mapping for EXTI Line availability
399 __STATIC_INLINE
void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine
)
401 SET_BIT(EXTI
->EMR
, ExtiLine
);
407 * @brief Disable ExtiLine Event request for Lines in range 0 to 31
408 * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31
409 * @param ExtiLine This parameter can be one of the following values:
410 * @arg @ref LL_EXTI_LINE_0
411 * @arg @ref LL_EXTI_LINE_1
412 * @arg @ref LL_EXTI_LINE_2
413 * @arg @ref LL_EXTI_LINE_3
414 * @arg @ref LL_EXTI_LINE_4
415 * @arg @ref LL_EXTI_LINE_5
416 * @arg @ref LL_EXTI_LINE_6
417 * @arg @ref LL_EXTI_LINE_7
418 * @arg @ref LL_EXTI_LINE_8
419 * @arg @ref LL_EXTI_LINE_9
420 * @arg @ref LL_EXTI_LINE_10
421 * @arg @ref LL_EXTI_LINE_11
422 * @arg @ref LL_EXTI_LINE_12
423 * @arg @ref LL_EXTI_LINE_13
424 * @arg @ref LL_EXTI_LINE_14
425 * @arg @ref LL_EXTI_LINE_15
426 * @arg @ref LL_EXTI_LINE_16
427 * @arg @ref LL_EXTI_LINE_17
428 * @arg @ref LL_EXTI_LINE_18
429 * @arg @ref LL_EXTI_LINE_19
430 * @arg @ref LL_EXTI_LINE_ALL_0_31
431 * @note Please check each device line mapping for EXTI Line availability
434 __STATIC_INLINE
void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine
)
436 CLEAR_BIT(EXTI
->EMR
, ExtiLine
);
441 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
442 * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31
443 * @param ExtiLine This parameter can be one of the following values:
444 * @arg @ref LL_EXTI_LINE_0
445 * @arg @ref LL_EXTI_LINE_1
446 * @arg @ref LL_EXTI_LINE_2
447 * @arg @ref LL_EXTI_LINE_3
448 * @arg @ref LL_EXTI_LINE_4
449 * @arg @ref LL_EXTI_LINE_5
450 * @arg @ref LL_EXTI_LINE_6
451 * @arg @ref LL_EXTI_LINE_7
452 * @arg @ref LL_EXTI_LINE_8
453 * @arg @ref LL_EXTI_LINE_9
454 * @arg @ref LL_EXTI_LINE_10
455 * @arg @ref LL_EXTI_LINE_11
456 * @arg @ref LL_EXTI_LINE_12
457 * @arg @ref LL_EXTI_LINE_13
458 * @arg @ref LL_EXTI_LINE_14
459 * @arg @ref LL_EXTI_LINE_15
460 * @arg @ref LL_EXTI_LINE_16
461 * @arg @ref LL_EXTI_LINE_17
462 * @arg @ref LL_EXTI_LINE_18
463 * @arg @ref LL_EXTI_LINE_19
464 * @arg @ref LL_EXTI_LINE_ALL_0_31
465 * @note Please check each device line mapping for EXTI Line availability
466 * @retval State of bit (1 or 0).
468 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine
)
470 return (READ_BIT(EXTI
->EMR
, ExtiLine
) == (ExtiLine
));
479 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
484 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
485 * @note The configurable wakeup lines are edge-triggered. No glitch must be
486 * generated on these lines. If a rising edge on a configurable interrupt
487 * line occurs during a write operation in the EXTI_RTSR register, the
488 * pending bit is not set.
489 * Rising and falling edge triggers can be set for
490 * the same interrupt line. In this case, both generate a trigger
492 * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31
493 * @param ExtiLine This parameter can be a combination of the following values:
494 * @arg @ref LL_EXTI_LINE_0
495 * @arg @ref LL_EXTI_LINE_1
496 * @arg @ref LL_EXTI_LINE_2
497 * @arg @ref LL_EXTI_LINE_3
498 * @arg @ref LL_EXTI_LINE_4
499 * @arg @ref LL_EXTI_LINE_5
500 * @arg @ref LL_EXTI_LINE_6
501 * @arg @ref LL_EXTI_LINE_7
502 * @arg @ref LL_EXTI_LINE_8
503 * @arg @ref LL_EXTI_LINE_9
504 * @arg @ref LL_EXTI_LINE_10
505 * @arg @ref LL_EXTI_LINE_11
506 * @arg @ref LL_EXTI_LINE_12
507 * @arg @ref LL_EXTI_LINE_13
508 * @arg @ref LL_EXTI_LINE_14
509 * @arg @ref LL_EXTI_LINE_15
510 * @arg @ref LL_EXTI_LINE_16
511 * @arg @ref LL_EXTI_LINE_18
512 * @arg @ref LL_EXTI_LINE_19
513 * @note Please check each device line mapping for EXTI Line availability
516 __STATIC_INLINE
void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine
)
518 SET_BIT(EXTI
->RTSR
, ExtiLine
);
524 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
525 * @note The configurable wakeup lines are edge-triggered. No glitch must be
526 * generated on these lines. If a rising edge on a configurable interrupt
527 * line occurs during a write operation in the EXTI_RTSR register, the
528 * pending bit is not set.
529 * Rising and falling edge triggers can be set for
530 * the same interrupt line. In this case, both generate a trigger
532 * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31
533 * @param ExtiLine This parameter can be a combination of the following values:
534 * @arg @ref LL_EXTI_LINE_0
535 * @arg @ref LL_EXTI_LINE_1
536 * @arg @ref LL_EXTI_LINE_2
537 * @arg @ref LL_EXTI_LINE_3
538 * @arg @ref LL_EXTI_LINE_4
539 * @arg @ref LL_EXTI_LINE_5
540 * @arg @ref LL_EXTI_LINE_6
541 * @arg @ref LL_EXTI_LINE_7
542 * @arg @ref LL_EXTI_LINE_8
543 * @arg @ref LL_EXTI_LINE_9
544 * @arg @ref LL_EXTI_LINE_10
545 * @arg @ref LL_EXTI_LINE_11
546 * @arg @ref LL_EXTI_LINE_12
547 * @arg @ref LL_EXTI_LINE_13
548 * @arg @ref LL_EXTI_LINE_14
549 * @arg @ref LL_EXTI_LINE_15
550 * @arg @ref LL_EXTI_LINE_16
551 * @arg @ref LL_EXTI_LINE_18
552 * @arg @ref LL_EXTI_LINE_19
553 * @note Please check each device line mapping for EXTI Line availability
556 __STATIC_INLINE
void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine
)
558 CLEAR_BIT(EXTI
->RTSR
, ExtiLine
);
564 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31
565 * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31
566 * @param ExtiLine This parameter can be a combination of the following values:
567 * @arg @ref LL_EXTI_LINE_0
568 * @arg @ref LL_EXTI_LINE_1
569 * @arg @ref LL_EXTI_LINE_2
570 * @arg @ref LL_EXTI_LINE_3
571 * @arg @ref LL_EXTI_LINE_4
572 * @arg @ref LL_EXTI_LINE_5
573 * @arg @ref LL_EXTI_LINE_6
574 * @arg @ref LL_EXTI_LINE_7
575 * @arg @ref LL_EXTI_LINE_8
576 * @arg @ref LL_EXTI_LINE_9
577 * @arg @ref LL_EXTI_LINE_10
578 * @arg @ref LL_EXTI_LINE_11
579 * @arg @ref LL_EXTI_LINE_12
580 * @arg @ref LL_EXTI_LINE_13
581 * @arg @ref LL_EXTI_LINE_14
582 * @arg @ref LL_EXTI_LINE_15
583 * @arg @ref LL_EXTI_LINE_16
584 * @arg @ref LL_EXTI_LINE_18
585 * @arg @ref LL_EXTI_LINE_19
586 * @note Please check each device line mapping for EXTI Line availability
587 * @retval State of bit (1 or 0).
589 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine
)
591 return (READ_BIT(EXTI
->RTSR
, ExtiLine
) == (ExtiLine
));
599 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
604 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
605 * @note The configurable wakeup lines are edge-triggered. No glitch must be
606 * generated on these lines. If a falling edge on a configurable interrupt
607 * line occurs during a write operation in the EXTI_FTSR register, the
608 * pending bit is not set.
609 * Rising and falling edge triggers can be set for
610 * the same interrupt line. In this case, both generate a trigger
612 * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_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_16
631 * @arg @ref LL_EXTI_LINE_18
632 * @arg @ref LL_EXTI_LINE_19
633 * @note Please check each device line mapping for EXTI Line availability
636 __STATIC_INLINE
void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine
)
638 SET_BIT(EXTI
->FTSR
, ExtiLine
);
643 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
644 * @note The configurable wakeup lines are edge-triggered. No glitch must be
645 * generated on these lines. If a Falling edge on a configurable interrupt
646 * line occurs during a write operation in the EXTI_FTSR register, the
647 * pending bit is not set.
648 * Rising and falling edge triggers can be set for the same interrupt line.
649 * In this case, both generate a trigger condition.
650 * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31
651 * @param ExtiLine This parameter can be a combination of the following values:
652 * @arg @ref LL_EXTI_LINE_0
653 * @arg @ref LL_EXTI_LINE_1
654 * @arg @ref LL_EXTI_LINE_2
655 * @arg @ref LL_EXTI_LINE_3
656 * @arg @ref LL_EXTI_LINE_4
657 * @arg @ref LL_EXTI_LINE_5
658 * @arg @ref LL_EXTI_LINE_6
659 * @arg @ref LL_EXTI_LINE_7
660 * @arg @ref LL_EXTI_LINE_8
661 * @arg @ref LL_EXTI_LINE_9
662 * @arg @ref LL_EXTI_LINE_10
663 * @arg @ref LL_EXTI_LINE_11
664 * @arg @ref LL_EXTI_LINE_12
665 * @arg @ref LL_EXTI_LINE_13
666 * @arg @ref LL_EXTI_LINE_14
667 * @arg @ref LL_EXTI_LINE_15
668 * @arg @ref LL_EXTI_LINE_16
669 * @arg @ref LL_EXTI_LINE_18
670 * @arg @ref LL_EXTI_LINE_19
671 * @note Please check each device line mapping for EXTI Line availability
674 __STATIC_INLINE
void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine
)
676 CLEAR_BIT(EXTI
->FTSR
, ExtiLine
);
681 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31
682 * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31
683 * @param ExtiLine This parameter can be a combination of the following values:
684 * @arg @ref LL_EXTI_LINE_0
685 * @arg @ref LL_EXTI_LINE_1
686 * @arg @ref LL_EXTI_LINE_2
687 * @arg @ref LL_EXTI_LINE_3
688 * @arg @ref LL_EXTI_LINE_4
689 * @arg @ref LL_EXTI_LINE_5
690 * @arg @ref LL_EXTI_LINE_6
691 * @arg @ref LL_EXTI_LINE_7
692 * @arg @ref LL_EXTI_LINE_8
693 * @arg @ref LL_EXTI_LINE_9
694 * @arg @ref LL_EXTI_LINE_10
695 * @arg @ref LL_EXTI_LINE_11
696 * @arg @ref LL_EXTI_LINE_12
697 * @arg @ref LL_EXTI_LINE_13
698 * @arg @ref LL_EXTI_LINE_14
699 * @arg @ref LL_EXTI_LINE_15
700 * @arg @ref LL_EXTI_LINE_16
701 * @arg @ref LL_EXTI_LINE_18
702 * @arg @ref LL_EXTI_LINE_19
703 * @note Please check each device line mapping for EXTI Line availability
704 * @retval State of bit (1 or 0).
706 __STATIC_INLINE
uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine
)
708 return (READ_BIT(EXTI
->FTSR
, ExtiLine
) == (ExtiLine
));
716 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
721 * @brief Generate a software Interrupt Event for Lines in range 0 to 31
722 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
723 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
724 * resulting in an interrupt request generation.
725 * This bit is cleared by clearing the corresponding bit in the EXTI_PR
726 * register (by writing a 1 into the bit)
727 * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31
728 * @param ExtiLine This parameter can be a combination of the following values:
729 * @arg @ref LL_EXTI_LINE_0
730 * @arg @ref LL_EXTI_LINE_1
731 * @arg @ref LL_EXTI_LINE_2
732 * @arg @ref LL_EXTI_LINE_3
733 * @arg @ref LL_EXTI_LINE_4
734 * @arg @ref LL_EXTI_LINE_5
735 * @arg @ref LL_EXTI_LINE_6
736 * @arg @ref LL_EXTI_LINE_7
737 * @arg @ref LL_EXTI_LINE_8
738 * @arg @ref LL_EXTI_LINE_9
739 * @arg @ref LL_EXTI_LINE_10
740 * @arg @ref LL_EXTI_LINE_11
741 * @arg @ref LL_EXTI_LINE_12
742 * @arg @ref LL_EXTI_LINE_13
743 * @arg @ref LL_EXTI_LINE_14
744 * @arg @ref LL_EXTI_LINE_15
745 * @arg @ref LL_EXTI_LINE_16
746 * @arg @ref LL_EXTI_LINE_18
747 * @arg @ref LL_EXTI_LINE_19
748 * @note Please check each device line mapping for EXTI Line availability
751 __STATIC_INLINE
void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine
)
753 SET_BIT(EXTI
->SWIER
, ExtiLine
);
761 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
766 * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31
767 * @note This bit is set when the selected edge event arrives on the interrupt
768 * line. This bit is cleared by writing a 1 to the bit.
769 * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_0_31
770 * @param ExtiLine This parameter can be a combination of the following values:
771 * @arg @ref LL_EXTI_LINE_0
772 * @arg @ref LL_EXTI_LINE_1
773 * @arg @ref LL_EXTI_LINE_2
774 * @arg @ref LL_EXTI_LINE_3
775 * @arg @ref LL_EXTI_LINE_4
776 * @arg @ref LL_EXTI_LINE_5
777 * @arg @ref LL_EXTI_LINE_6
778 * @arg @ref LL_EXTI_LINE_7
779 * @arg @ref LL_EXTI_LINE_8
780 * @arg @ref LL_EXTI_LINE_9
781 * @arg @ref LL_EXTI_LINE_10
782 * @arg @ref LL_EXTI_LINE_11
783 * @arg @ref LL_EXTI_LINE_12
784 * @arg @ref LL_EXTI_LINE_13
785 * @arg @ref LL_EXTI_LINE_14
786 * @arg @ref LL_EXTI_LINE_15
787 * @arg @ref LL_EXTI_LINE_16
788 * @arg @ref LL_EXTI_LINE_18
789 * @arg @ref LL_EXTI_LINE_19
790 * @note Please check each device line mapping for EXTI Line availability
791 * @retval State of bit (1 or 0).
793 __STATIC_INLINE
uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine
)
795 return (READ_BIT(EXTI
->PR
, ExtiLine
) == (ExtiLine
));
800 * @brief Read ExtLine Combination Flag for Lines in range 0 to 31
801 * @note This bit is set when the selected edge event arrives on the interrupt
802 * line. This bit is cleared by writing a 1 to the bit.
803 * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31
804 * @param ExtiLine This parameter can be a combination of the following values:
805 * @arg @ref LL_EXTI_LINE_0
806 * @arg @ref LL_EXTI_LINE_1
807 * @arg @ref LL_EXTI_LINE_2
808 * @arg @ref LL_EXTI_LINE_3
809 * @arg @ref LL_EXTI_LINE_4
810 * @arg @ref LL_EXTI_LINE_5
811 * @arg @ref LL_EXTI_LINE_6
812 * @arg @ref LL_EXTI_LINE_7
813 * @arg @ref LL_EXTI_LINE_8
814 * @arg @ref LL_EXTI_LINE_9
815 * @arg @ref LL_EXTI_LINE_10
816 * @arg @ref LL_EXTI_LINE_11
817 * @arg @ref LL_EXTI_LINE_12
818 * @arg @ref LL_EXTI_LINE_13
819 * @arg @ref LL_EXTI_LINE_14
820 * @arg @ref LL_EXTI_LINE_15
821 * @arg @ref LL_EXTI_LINE_16
822 * @arg @ref LL_EXTI_LINE_18
823 * @arg @ref LL_EXTI_LINE_19
824 * @note Please check each device line mapping for EXTI Line availability
825 * @retval @note This bit is set when the selected edge event arrives on the interrupt
827 __STATIC_INLINE
uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine
)
829 return (uint32_t)(READ_BIT(EXTI
->PR
, ExtiLine
));
834 * @brief Clear ExtLine Flags for Lines in range 0 to 31
835 * @note This bit is set when the selected edge event arrives on the interrupt
836 * line. This bit is cleared by writing a 1 to the bit.
837 * @rmtoll PR PIFx LL_EXTI_ClearFlag_0_31
838 * @param ExtiLine This parameter can be a combination of the following values:
839 * @arg @ref LL_EXTI_LINE_0
840 * @arg @ref LL_EXTI_LINE_1
841 * @arg @ref LL_EXTI_LINE_2
842 * @arg @ref LL_EXTI_LINE_3
843 * @arg @ref LL_EXTI_LINE_4
844 * @arg @ref LL_EXTI_LINE_5
845 * @arg @ref LL_EXTI_LINE_6
846 * @arg @ref LL_EXTI_LINE_7
847 * @arg @ref LL_EXTI_LINE_8
848 * @arg @ref LL_EXTI_LINE_9
849 * @arg @ref LL_EXTI_LINE_10
850 * @arg @ref LL_EXTI_LINE_11
851 * @arg @ref LL_EXTI_LINE_12
852 * @arg @ref LL_EXTI_LINE_13
853 * @arg @ref LL_EXTI_LINE_14
854 * @arg @ref LL_EXTI_LINE_15
855 * @arg @ref LL_EXTI_LINE_16
856 * @arg @ref LL_EXTI_LINE_18
857 * @arg @ref LL_EXTI_LINE_19
858 * @note Please check each device line mapping for EXTI Line availability
861 __STATIC_INLINE
void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine
)
863 WRITE_REG(EXTI
->PR
, ExtiLine
);
871 #if defined(USE_FULL_LL_DRIVER)
872 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
876 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef
*EXTI_InitStruct
);
877 uint32_t LL_EXTI_DeInit(void);
878 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef
*EXTI_InitStruct
);
884 #endif /* USE_FULL_LL_DRIVER */
904 #endif /* __STM32F1xx_LL_EXTI_H */
906 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/