Subversion Repositories dashGPS

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /**
  2.   ******************************************************************************
  3.   * @file    stm32f1xx_ll_exti.h
  4.   * @author  MCD Application Team
  5.   * @brief   Header file of EXTI LL module.
  6.   ******************************************************************************
  7.   * @attention
  8.   *
  9.   * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
  10.   * All rights reserved.</center></h2>
  11.   *
  12.   * This software component is licensed by ST under BSD 3-Clause license,
  13.   * the "License"; You may not use this file except in compliance with the
  14.   * License. You may obtain a copy of the License at:
  15.   *                        opensource.org/licenses/BSD-3-Clause
  16.   *
  17.   ******************************************************************************
  18.   */
  19.  
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef STM32F1xx_LL_EXTI_H
  22. #define STM32F1xx_LL_EXTI_H
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f1xx.h"
  30.  
  31. /** @addtogroup STM32F1xx_LL_Driver
  32.   * @{
  33.   */
  34.  
  35. #if defined (EXTI)
  36.  
  37. /** @defgroup EXTI_LL EXTI
  38.   * @{
  39.   */
  40.  
  41. /* Private types -------------------------------------------------------------*/
  42. /* Private variables ---------------------------------------------------------*/
  43. /* Private constants ---------------------------------------------------------*/
  44. /* Private Macros ------------------------------------------------------------*/
  45. #if defined(USE_FULL_LL_DRIVER)
  46. /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros
  47.   * @{
  48.   */
  49. /**
  50.   * @}
  51.   */
  52. #endif /*USE_FULL_LL_DRIVER*/
  53. /* Exported types ------------------------------------------------------------*/
  54. #if defined(USE_FULL_LL_DRIVER)
  55. /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure
  56.   * @{
  57.   */
  58. typedef struct
  59. {
  60.  
  61.   uint32_t Line_0_31;           /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31
  62.                                      This parameter can be any combination of @ref EXTI_LL_EC_LINE */
  63.  
  64.   FunctionalState LineCommand;  /*!< Specifies the new state of the selected EXTI lines.
  65.                                      This parameter can be set either to ENABLE or DISABLE */
  66.  
  67.   uint8_t Mode;                 /*!< Specifies the mode for the EXTI lines.
  68.                                      This parameter can be a value of @ref EXTI_LL_EC_MODE. */
  69.  
  70.   uint8_t Trigger;              /*!< Specifies the trigger signal active edge for the EXTI lines.
  71.                                      This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */
  72. } LL_EXTI_InitTypeDef;
  73.  
  74. /**
  75.   * @}
  76.   */
  77. #endif /*USE_FULL_LL_DRIVER*/
  78.  
  79. /* Exported constants --------------------------------------------------------*/
  80. /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants
  81.   * @{
  82.   */
  83.  
  84. /** @defgroup EXTI_LL_EC_LINE LINE
  85.   * @{
  86.   */
  87. #define LL_EXTI_LINE_0                 EXTI_IMR_IM0           /*!< Extended line 0 */
  88. #define LL_EXTI_LINE_1                 EXTI_IMR_IM1           /*!< Extended line 1 */
  89. #define LL_EXTI_LINE_2                 EXTI_IMR_IM2           /*!< Extended line 2 */
  90. #define LL_EXTI_LINE_3                 EXTI_IMR_IM3           /*!< Extended line 3 */
  91. #define LL_EXTI_LINE_4                 EXTI_IMR_IM4           /*!< Extended line 4 */
  92. #define LL_EXTI_LINE_5                 EXTI_IMR_IM5           /*!< Extended line 5 */
  93. #define LL_EXTI_LINE_6                 EXTI_IMR_IM6           /*!< Extended line 6 */
  94. #define LL_EXTI_LINE_7                 EXTI_IMR_IM7           /*!< Extended line 7 */
  95. #define LL_EXTI_LINE_8                 EXTI_IMR_IM8           /*!< Extended line 8 */
  96. #define LL_EXTI_LINE_9                 EXTI_IMR_IM9           /*!< Extended line 9 */
  97. #define LL_EXTI_LINE_10                EXTI_IMR_IM10          /*!< Extended line 10 */
  98. #define LL_EXTI_LINE_11                EXTI_IMR_IM11          /*!< Extended line 11 */
  99. #define LL_EXTI_LINE_12                EXTI_IMR_IM12          /*!< Extended line 12 */
  100. #define LL_EXTI_LINE_13                EXTI_IMR_IM13          /*!< Extended line 13 */
  101. #define LL_EXTI_LINE_14                EXTI_IMR_IM14          /*!< Extended line 14 */
  102. #define LL_EXTI_LINE_15                EXTI_IMR_IM15          /*!< Extended line 15 */
  103. #if defined(EXTI_IMR_IM16)
  104. #define LL_EXTI_LINE_16                EXTI_IMR_IM16          /*!< Extended line 16 */
  105. #endif
  106. #define LL_EXTI_LINE_17                EXTI_IMR_IM17          /*!< Extended line 17 */
  107. #if defined(EXTI_IMR_IM18)
  108. #define LL_EXTI_LINE_18                EXTI_IMR_IM18          /*!< Extended line 18 */
  109. #endif
  110. #if defined(EXTI_IMR_IM19)
  111. #define LL_EXTI_LINE_19                EXTI_IMR_IM19          /*!< Extended line 19 */
  112. #endif
  113. #if defined(EXTI_IMR_IM20)
  114. #define LL_EXTI_LINE_20                EXTI_IMR_IM20          /*!< Extended line 20 */
  115. #endif
  116. #if defined(EXTI_IMR_IM21)
  117. #define LL_EXTI_LINE_21                EXTI_IMR_IM21          /*!< Extended line 21 */
  118. #endif
  119. #if defined(EXTI_IMR_IM22)
  120. #define LL_EXTI_LINE_22                EXTI_IMR_IM22          /*!< Extended line 22 */
  121. #endif
  122. #if defined(EXTI_IMR_IM23)
  123. #define LL_EXTI_LINE_23                EXTI_IMR_IM23          /*!< Extended line 23 */
  124. #endif
  125. #if defined(EXTI_IMR_IM24)
  126. #define LL_EXTI_LINE_24                EXTI_IMR_IM24          /*!< Extended line 24 */
  127. #endif
  128. #if defined(EXTI_IMR_IM25)
  129. #define LL_EXTI_LINE_25                EXTI_IMR_IM25          /*!< Extended line 25 */
  130. #endif
  131. #if defined(EXTI_IMR_IM26)
  132. #define LL_EXTI_LINE_26                EXTI_IMR_IM26          /*!< Extended line 26 */
  133. #endif
  134. #if defined(EXTI_IMR_IM27)
  135. #define LL_EXTI_LINE_27                EXTI_IMR_IM27          /*!< Extended line 27 */
  136. #endif
  137. #if defined(EXTI_IMR_IM28)
  138. #define LL_EXTI_LINE_28                EXTI_IMR_IM28          /*!< Extended line 28 */
  139. #endif
  140. #if defined(EXTI_IMR_IM29)
  141. #define LL_EXTI_LINE_29                EXTI_IMR_IM29          /*!< Extended line 29 */
  142. #endif
  143. #if defined(EXTI_IMR_IM30)
  144. #define LL_EXTI_LINE_30                EXTI_IMR_IM30          /*!< Extended line 30 */
  145. #endif
  146. #if defined(EXTI_IMR_IM31)
  147. #define LL_EXTI_LINE_31                EXTI_IMR_IM31          /*!< Extended line 31 */
  148. #endif
  149. #define LL_EXTI_LINE_ALL_0_31          EXTI_IMR_IM            /*!< All Extended line not reserved*/
  150.  
  151.  
  152. #define LL_EXTI_LINE_ALL               (0xFFFFFFFFU)  /*!< All Extended line */
  153.  
  154. #if defined(USE_FULL_LL_DRIVER)
  155. #define LL_EXTI_LINE_NONE              (0x00000000U)  /*!< None Extended line */
  156. #endif /*USE_FULL_LL_DRIVER*/
  157.  
  158. /**
  159.   * @}
  160.   */
  161. #if defined(USE_FULL_LL_DRIVER)
  162.  
  163. /** @defgroup EXTI_LL_EC_MODE Mode
  164.   * @{
  165.   */
  166. #define LL_EXTI_MODE_IT                 ((uint8_t)0x00) /*!< Interrupt Mode */
  167. #define LL_EXTI_MODE_EVENT              ((uint8_t)0x01) /*!< Event Mode */
  168. #define LL_EXTI_MODE_IT_EVENT           ((uint8_t)0x02) /*!< Interrupt & Event Mode */
  169. /**
  170.   * @}
  171.   */
  172.  
  173. /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger
  174.   * @{
  175.   */
  176. #define LL_EXTI_TRIGGER_NONE            ((uint8_t)0x00) /*!< No Trigger Mode */
  177. #define LL_EXTI_TRIGGER_RISING          ((uint8_t)0x01) /*!< Trigger Rising Mode */
  178. #define LL_EXTI_TRIGGER_FALLING         ((uint8_t)0x02) /*!< Trigger Falling Mode */
  179. #define LL_EXTI_TRIGGER_RISING_FALLING  ((uint8_t)0x03) /*!< Trigger Rising & Falling Mode */
  180.  
  181. /**
  182.   * @}
  183.   */
  184.  
  185.  
  186. #endif /*USE_FULL_LL_DRIVER*/
  187.  
  188.  
  189. /**
  190.   * @}
  191.   */
  192.  
  193. /* Exported macro ------------------------------------------------------------*/
  194. /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros
  195.   * @{
  196.   */
  197.  
  198. /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros
  199.   * @{
  200.   */
  201.  
  202. /**
  203.   * @brief  Write a value in EXTI register
  204.   * @param  __REG__ Register to be written
  205.   * @param  __VALUE__ Value to be written in the register
  206.   * @retval None
  207.   */
  208. #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__))
  209.  
  210. /**
  211.   * @brief  Read a value in EXTI register
  212.   * @param  __REG__ Register to be read
  213.   * @retval Register value
  214.   */
  215. #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__)
  216. /**
  217.   * @}
  218.   */
  219.  
  220.  
  221. /**
  222.   * @}
  223.   */
  224.  
  225.  
  226.  
  227. /* Exported functions --------------------------------------------------------*/
  228. /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions
  229.  * @{
  230.  */
  231. /** @defgroup EXTI_LL_EF_IT_Management IT_Management
  232.   * @{
  233.   */
  234.  
  235. /**
  236.   * @brief  Enable ExtiLine Interrupt request for Lines in range 0 to 31
  237.   * @note The reset value for the direct or internal lines (see RM)
  238.   *       is set to 1 in order to enable the interrupt by default.
  239.   *       Bits are set automatically at Power on.
  240.   * @rmtoll IMR         IMx           LL_EXTI_EnableIT_0_31
  241.   * @param  ExtiLine This parameter can be one of the following values:
  242.   *         @arg @ref LL_EXTI_LINE_0
  243.   *         @arg @ref LL_EXTI_LINE_1
  244.   *         @arg @ref LL_EXTI_LINE_2
  245.   *         @arg @ref LL_EXTI_LINE_3
  246.   *         @arg @ref LL_EXTI_LINE_4
  247.   *         @arg @ref LL_EXTI_LINE_5
  248.   *         @arg @ref LL_EXTI_LINE_6
  249.   *         @arg @ref LL_EXTI_LINE_7
  250.   *         @arg @ref LL_EXTI_LINE_8
  251.   *         @arg @ref LL_EXTI_LINE_9
  252.   *         @arg @ref LL_EXTI_LINE_10
  253.   *         @arg @ref LL_EXTI_LINE_11
  254.   *         @arg @ref LL_EXTI_LINE_12
  255.   *         @arg @ref LL_EXTI_LINE_13
  256.   *         @arg @ref LL_EXTI_LINE_14
  257.   *         @arg @ref LL_EXTI_LINE_15
  258.   *         @arg @ref LL_EXTI_LINE_16
  259.   *         @arg @ref LL_EXTI_LINE_17
  260.   *         @arg @ref LL_EXTI_LINE_18
  261.   *         @arg @ref LL_EXTI_LINE_19
  262.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  263.   * @note   Please check each device line mapping for EXTI Line availability
  264.   * @retval None
  265.   */
  266. __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine)
  267. {
  268.   SET_BIT(EXTI->IMR, ExtiLine);
  269. }
  270.  
  271. /**
  272.   * @brief  Disable ExtiLine Interrupt request for Lines in range 0 to 31
  273.   * @note The reset value for the direct or internal lines (see RM)
  274.   *       is set to 1 in order to enable the interrupt by default.
  275.   *       Bits are set automatically at Power on.
  276.   * @rmtoll IMR         IMx           LL_EXTI_DisableIT_0_31
  277.   * @param  ExtiLine This parameter can be one of the following values:
  278.   *         @arg @ref LL_EXTI_LINE_0
  279.   *         @arg @ref LL_EXTI_LINE_1
  280.   *         @arg @ref LL_EXTI_LINE_2
  281.   *         @arg @ref LL_EXTI_LINE_3
  282.   *         @arg @ref LL_EXTI_LINE_4
  283.   *         @arg @ref LL_EXTI_LINE_5
  284.   *         @arg @ref LL_EXTI_LINE_6
  285.   *         @arg @ref LL_EXTI_LINE_7
  286.   *         @arg @ref LL_EXTI_LINE_8
  287.   *         @arg @ref LL_EXTI_LINE_9
  288.   *         @arg @ref LL_EXTI_LINE_10
  289.   *         @arg @ref LL_EXTI_LINE_11
  290.   *         @arg @ref LL_EXTI_LINE_12
  291.   *         @arg @ref LL_EXTI_LINE_13
  292.   *         @arg @ref LL_EXTI_LINE_14
  293.   *         @arg @ref LL_EXTI_LINE_15
  294.   *         @arg @ref LL_EXTI_LINE_16
  295.   *         @arg @ref LL_EXTI_LINE_17
  296.   *         @arg @ref LL_EXTI_LINE_18
  297.   *         @arg @ref LL_EXTI_LINE_19
  298.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  299.   * @note   Please check each device line mapping for EXTI Line availability
  300.   * @retval None
  301.   */
  302. __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine)
  303. {
  304.   CLEAR_BIT(EXTI->IMR, ExtiLine);
  305. }
  306.  
  307.  
  308. /**
  309.   * @brief  Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31
  310.   * @note The reset value for the direct or internal lines (see RM)
  311.   *       is set to 1 in order to enable the interrupt by default.
  312.   *       Bits are set automatically at Power on.
  313.   * @rmtoll IMR         IMx           LL_EXTI_IsEnabledIT_0_31
  314.   * @param  ExtiLine This parameter can be one of the following values:
  315.   *         @arg @ref LL_EXTI_LINE_0
  316.   *         @arg @ref LL_EXTI_LINE_1
  317.   *         @arg @ref LL_EXTI_LINE_2
  318.   *         @arg @ref LL_EXTI_LINE_3
  319.   *         @arg @ref LL_EXTI_LINE_4
  320.   *         @arg @ref LL_EXTI_LINE_5
  321.   *         @arg @ref LL_EXTI_LINE_6
  322.   *         @arg @ref LL_EXTI_LINE_7
  323.   *         @arg @ref LL_EXTI_LINE_8
  324.   *         @arg @ref LL_EXTI_LINE_9
  325.   *         @arg @ref LL_EXTI_LINE_10
  326.   *         @arg @ref LL_EXTI_LINE_11
  327.   *         @arg @ref LL_EXTI_LINE_12
  328.   *         @arg @ref LL_EXTI_LINE_13
  329.   *         @arg @ref LL_EXTI_LINE_14
  330.   *         @arg @ref LL_EXTI_LINE_15
  331.   *         @arg @ref LL_EXTI_LINE_16
  332.   *         @arg @ref LL_EXTI_LINE_17
  333.   *         @arg @ref LL_EXTI_LINE_18
  334.   *         @arg @ref LL_EXTI_LINE_19
  335.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  336.   * @note   Please check each device line mapping for EXTI Line availability
  337.   * @retval State of bit (1 or 0).
  338.   */
  339. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine)
  340. {
  341.   return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine));
  342. }
  343.  
  344.  
  345. /**
  346.   * @}
  347.   */
  348.  
  349. /** @defgroup EXTI_LL_EF_Event_Management Event_Management
  350.   * @{
  351.   */
  352.  
  353. /**
  354.   * @brief  Enable ExtiLine Event request for Lines in range 0 to 31
  355.   * @rmtoll EMR         EMx           LL_EXTI_EnableEvent_0_31
  356.   * @param  ExtiLine This parameter can be one of the following values:
  357.   *         @arg @ref LL_EXTI_LINE_0
  358.   *         @arg @ref LL_EXTI_LINE_1
  359.   *         @arg @ref LL_EXTI_LINE_2
  360.   *         @arg @ref LL_EXTI_LINE_3
  361.   *         @arg @ref LL_EXTI_LINE_4
  362.   *         @arg @ref LL_EXTI_LINE_5
  363.   *         @arg @ref LL_EXTI_LINE_6
  364.   *         @arg @ref LL_EXTI_LINE_7
  365.   *         @arg @ref LL_EXTI_LINE_8
  366.   *         @arg @ref LL_EXTI_LINE_9
  367.   *         @arg @ref LL_EXTI_LINE_10
  368.   *         @arg @ref LL_EXTI_LINE_11
  369.   *         @arg @ref LL_EXTI_LINE_12
  370.   *         @arg @ref LL_EXTI_LINE_13
  371.   *         @arg @ref LL_EXTI_LINE_14
  372.   *         @arg @ref LL_EXTI_LINE_15
  373.   *         @arg @ref LL_EXTI_LINE_16
  374.   *         @arg @ref LL_EXTI_LINE_17
  375.   *         @arg @ref LL_EXTI_LINE_18
  376.   *         @arg @ref LL_EXTI_LINE_19
  377.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  378.   * @note   Please check each device line mapping for EXTI Line availability
  379.   * @retval None
  380.   */
  381. __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine)
  382. {
  383.   SET_BIT(EXTI->EMR, ExtiLine);
  384.  
  385. }
  386.  
  387.  
  388. /**
  389.   * @brief  Disable ExtiLine Event request for Lines in range 0 to 31
  390.   * @rmtoll EMR         EMx           LL_EXTI_DisableEvent_0_31
  391.   * @param  ExtiLine This parameter can be one of the following values:
  392.   *         @arg @ref LL_EXTI_LINE_0
  393.   *         @arg @ref LL_EXTI_LINE_1
  394.   *         @arg @ref LL_EXTI_LINE_2
  395.   *         @arg @ref LL_EXTI_LINE_3
  396.   *         @arg @ref LL_EXTI_LINE_4
  397.   *         @arg @ref LL_EXTI_LINE_5
  398.   *         @arg @ref LL_EXTI_LINE_6
  399.   *         @arg @ref LL_EXTI_LINE_7
  400.   *         @arg @ref LL_EXTI_LINE_8
  401.   *         @arg @ref LL_EXTI_LINE_9
  402.   *         @arg @ref LL_EXTI_LINE_10
  403.   *         @arg @ref LL_EXTI_LINE_11
  404.   *         @arg @ref LL_EXTI_LINE_12
  405.   *         @arg @ref LL_EXTI_LINE_13
  406.   *         @arg @ref LL_EXTI_LINE_14
  407.   *         @arg @ref LL_EXTI_LINE_15
  408.   *         @arg @ref LL_EXTI_LINE_16
  409.   *         @arg @ref LL_EXTI_LINE_17
  410.   *         @arg @ref LL_EXTI_LINE_18
  411.   *         @arg @ref LL_EXTI_LINE_19
  412.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  413.   * @note   Please check each device line mapping for EXTI Line availability
  414.   * @retval None
  415.   */
  416. __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine)
  417. {
  418.   CLEAR_BIT(EXTI->EMR, ExtiLine);
  419. }
  420.  
  421.  
  422. /**
  423.   * @brief  Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31
  424.   * @rmtoll EMR         EMx           LL_EXTI_IsEnabledEvent_0_31
  425.   * @param  ExtiLine This parameter can be one of the following values:
  426.   *         @arg @ref LL_EXTI_LINE_0
  427.   *         @arg @ref LL_EXTI_LINE_1
  428.   *         @arg @ref LL_EXTI_LINE_2
  429.   *         @arg @ref LL_EXTI_LINE_3
  430.   *         @arg @ref LL_EXTI_LINE_4
  431.   *         @arg @ref LL_EXTI_LINE_5
  432.   *         @arg @ref LL_EXTI_LINE_6
  433.   *         @arg @ref LL_EXTI_LINE_7
  434.   *         @arg @ref LL_EXTI_LINE_8
  435.   *         @arg @ref LL_EXTI_LINE_9
  436.   *         @arg @ref LL_EXTI_LINE_10
  437.   *         @arg @ref LL_EXTI_LINE_11
  438.   *         @arg @ref LL_EXTI_LINE_12
  439.   *         @arg @ref LL_EXTI_LINE_13
  440.   *         @arg @ref LL_EXTI_LINE_14
  441.   *         @arg @ref LL_EXTI_LINE_15
  442.   *         @arg @ref LL_EXTI_LINE_16
  443.   *         @arg @ref LL_EXTI_LINE_17
  444.   *         @arg @ref LL_EXTI_LINE_18
  445.   *         @arg @ref LL_EXTI_LINE_19
  446.   *         @arg @ref LL_EXTI_LINE_ALL_0_31
  447.   * @note   Please check each device line mapping for EXTI Line availability
  448.   * @retval State of bit (1 or 0).
  449.   */
  450. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine)
  451. {
  452.   return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine));
  453.  
  454. }
  455.  
  456.  
  457. /**
  458.   * @}
  459.   */
  460.  
  461. /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management
  462.   * @{
  463.   */
  464.  
  465. /**
  466.   * @brief  Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
  467.   * @note The configurable wakeup lines are edge-triggered. No glitch must be
  468.   *       generated on these lines. If a rising edge on a configurable interrupt
  469.   *       line occurs during a write operation in the EXTI_RTSR register, the
  470.   *       pending bit is not set.
  471.   *       Rising and falling edge triggers can be set for
  472.   *       the same interrupt line. In this case, both generate a trigger
  473.   *       condition.
  474.   * @rmtoll RTSR        RTx           LL_EXTI_EnableRisingTrig_0_31
  475.   * @param  ExtiLine This parameter can be a combination of the following values:
  476.   *         @arg @ref LL_EXTI_LINE_0
  477.   *         @arg @ref LL_EXTI_LINE_1
  478.   *         @arg @ref LL_EXTI_LINE_2
  479.   *         @arg @ref LL_EXTI_LINE_3
  480.   *         @arg @ref LL_EXTI_LINE_4
  481.   *         @arg @ref LL_EXTI_LINE_5
  482.   *         @arg @ref LL_EXTI_LINE_6
  483.   *         @arg @ref LL_EXTI_LINE_7
  484.   *         @arg @ref LL_EXTI_LINE_8
  485.   *         @arg @ref LL_EXTI_LINE_9
  486.   *         @arg @ref LL_EXTI_LINE_10
  487.   *         @arg @ref LL_EXTI_LINE_11
  488.   *         @arg @ref LL_EXTI_LINE_12
  489.   *         @arg @ref LL_EXTI_LINE_13
  490.   *         @arg @ref LL_EXTI_LINE_14
  491.   *         @arg @ref LL_EXTI_LINE_15
  492.   *         @arg @ref LL_EXTI_LINE_16
  493.   *         @arg @ref LL_EXTI_LINE_18
  494.   *         @arg @ref LL_EXTI_LINE_19
  495.   * @note   Please check each device line mapping for EXTI Line availability
  496.   * @retval None
  497.   */
  498. __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine)
  499. {
  500.   SET_BIT(EXTI->RTSR, ExtiLine);
  501.  
  502. }
  503.  
  504.  
  505. /**
  506.   * @brief  Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31
  507.   * @note The configurable wakeup lines are edge-triggered. No glitch must be
  508.   *       generated on these lines. If a rising edge on a configurable interrupt
  509.   *       line occurs during a write operation in the EXTI_RTSR register, the
  510.   *       pending bit is not set.
  511.   *       Rising and falling edge triggers can be set for
  512.   *       the same interrupt line. In this case, both generate a trigger
  513.   *       condition.
  514.   * @rmtoll RTSR        RTx           LL_EXTI_DisableRisingTrig_0_31
  515.   * @param  ExtiLine This parameter can be a combination of the following values:
  516.   *         @arg @ref LL_EXTI_LINE_0
  517.   *         @arg @ref LL_EXTI_LINE_1
  518.   *         @arg @ref LL_EXTI_LINE_2
  519.   *         @arg @ref LL_EXTI_LINE_3
  520.   *         @arg @ref LL_EXTI_LINE_4
  521.   *         @arg @ref LL_EXTI_LINE_5
  522.   *         @arg @ref LL_EXTI_LINE_6
  523.   *         @arg @ref LL_EXTI_LINE_7
  524.   *         @arg @ref LL_EXTI_LINE_8
  525.   *         @arg @ref LL_EXTI_LINE_9
  526.   *         @arg @ref LL_EXTI_LINE_10
  527.   *         @arg @ref LL_EXTI_LINE_11
  528.   *         @arg @ref LL_EXTI_LINE_12
  529.   *         @arg @ref LL_EXTI_LINE_13
  530.   *         @arg @ref LL_EXTI_LINE_14
  531.   *         @arg @ref LL_EXTI_LINE_15
  532.   *         @arg @ref LL_EXTI_LINE_16
  533.   *         @arg @ref LL_EXTI_LINE_18
  534.   *         @arg @ref LL_EXTI_LINE_19
  535.   * @note   Please check each device line mapping for EXTI Line availability
  536.   * @retval None
  537.   */
  538. __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine)
  539. {
  540.   CLEAR_BIT(EXTI->RTSR, ExtiLine);
  541.  
  542. }
  543.  
  544.  
  545. /**
  546.   * @brief  Check if rising edge trigger is enabled for Lines in range 0 to 31
  547.   * @rmtoll RTSR        RTx           LL_EXTI_IsEnabledRisingTrig_0_31
  548.   * @param  ExtiLine This parameter can be a combination of the following values:
  549.   *         @arg @ref LL_EXTI_LINE_0
  550.   *         @arg @ref LL_EXTI_LINE_1
  551.   *         @arg @ref LL_EXTI_LINE_2
  552.   *         @arg @ref LL_EXTI_LINE_3
  553.   *         @arg @ref LL_EXTI_LINE_4
  554.   *         @arg @ref LL_EXTI_LINE_5
  555.   *         @arg @ref LL_EXTI_LINE_6
  556.   *         @arg @ref LL_EXTI_LINE_7
  557.   *         @arg @ref LL_EXTI_LINE_8
  558.   *         @arg @ref LL_EXTI_LINE_9
  559.   *         @arg @ref LL_EXTI_LINE_10
  560.   *         @arg @ref LL_EXTI_LINE_11
  561.   *         @arg @ref LL_EXTI_LINE_12
  562.   *         @arg @ref LL_EXTI_LINE_13
  563.   *         @arg @ref LL_EXTI_LINE_14
  564.   *         @arg @ref LL_EXTI_LINE_15
  565.   *         @arg @ref LL_EXTI_LINE_16
  566.   *         @arg @ref LL_EXTI_LINE_18
  567.   *         @arg @ref LL_EXTI_LINE_19
  568.   * @note   Please check each device line mapping for EXTI Line availability
  569.   * @retval State of bit (1 or 0).
  570.   */
  571. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine)
  572. {
  573.   return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine));
  574. }
  575.  
  576.  
  577. /**
  578.   * @}
  579.   */
  580.  
  581. /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management
  582.   * @{
  583.   */
  584.  
  585. /**
  586.   * @brief  Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
  587.   * @note The configurable wakeup lines are edge-triggered. No glitch must be
  588.   *       generated on these lines. If a falling edge on a configurable interrupt
  589.   *       line occurs during a write operation in the EXTI_FTSR register, the
  590.   *       pending bit is not set.
  591.   *       Rising and falling edge triggers can be set for
  592.   *       the same interrupt line. In this case, both generate a trigger
  593.   *       condition.
  594.   * @rmtoll FTSR        FTx           LL_EXTI_EnableFallingTrig_0_31
  595.   * @param  ExtiLine This parameter can be a combination of the following values:
  596.   *         @arg @ref LL_EXTI_LINE_0
  597.   *         @arg @ref LL_EXTI_LINE_1
  598.   *         @arg @ref LL_EXTI_LINE_2
  599.   *         @arg @ref LL_EXTI_LINE_3
  600.   *         @arg @ref LL_EXTI_LINE_4
  601.   *         @arg @ref LL_EXTI_LINE_5
  602.   *         @arg @ref LL_EXTI_LINE_6
  603.   *         @arg @ref LL_EXTI_LINE_7
  604.   *         @arg @ref LL_EXTI_LINE_8
  605.   *         @arg @ref LL_EXTI_LINE_9
  606.   *         @arg @ref LL_EXTI_LINE_10
  607.   *         @arg @ref LL_EXTI_LINE_11
  608.   *         @arg @ref LL_EXTI_LINE_12
  609.   *         @arg @ref LL_EXTI_LINE_13
  610.   *         @arg @ref LL_EXTI_LINE_14
  611.   *         @arg @ref LL_EXTI_LINE_15
  612.   *         @arg @ref LL_EXTI_LINE_16
  613.   *         @arg @ref LL_EXTI_LINE_18
  614.   *         @arg @ref LL_EXTI_LINE_19
  615.   * @note   Please check each device line mapping for EXTI Line availability
  616.   * @retval None
  617.   */
  618. __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine)
  619. {
  620.   SET_BIT(EXTI->FTSR, ExtiLine);
  621. }
  622.  
  623.  
  624. /**
  625.   * @brief  Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31
  626.   * @note The configurable wakeup lines are edge-triggered. No glitch must be
  627.   *       generated on these lines. If a Falling edge on a configurable interrupt
  628.   *       line occurs during a write operation in the EXTI_FTSR register, the
  629.   *       pending bit is not set.
  630.   *       Rising and falling edge triggers can be set for the same interrupt line.
  631.   *       In this case, both generate a trigger condition.
  632.   * @rmtoll FTSR        FTx           LL_EXTI_DisableFallingTrig_0_31
  633.   * @param  ExtiLine This parameter can be a combination of the following values:
  634.   *         @arg @ref LL_EXTI_LINE_0
  635.   *         @arg @ref LL_EXTI_LINE_1
  636.   *         @arg @ref LL_EXTI_LINE_2
  637.   *         @arg @ref LL_EXTI_LINE_3
  638.   *         @arg @ref LL_EXTI_LINE_4
  639.   *         @arg @ref LL_EXTI_LINE_5
  640.   *         @arg @ref LL_EXTI_LINE_6
  641.   *         @arg @ref LL_EXTI_LINE_7
  642.   *         @arg @ref LL_EXTI_LINE_8
  643.   *         @arg @ref LL_EXTI_LINE_9
  644.   *         @arg @ref LL_EXTI_LINE_10
  645.   *         @arg @ref LL_EXTI_LINE_11
  646.   *         @arg @ref LL_EXTI_LINE_12
  647.   *         @arg @ref LL_EXTI_LINE_13
  648.   *         @arg @ref LL_EXTI_LINE_14
  649.   *         @arg @ref LL_EXTI_LINE_15
  650.   *         @arg @ref LL_EXTI_LINE_16
  651.   *         @arg @ref LL_EXTI_LINE_18
  652.   *         @arg @ref LL_EXTI_LINE_19
  653.   * @note   Please check each device line mapping for EXTI Line availability
  654.   * @retval None
  655.   */
  656. __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine)
  657. {
  658.   CLEAR_BIT(EXTI->FTSR, ExtiLine);
  659. }
  660.  
  661.  
  662. /**
  663.   * @brief  Check if falling edge trigger is enabled for Lines in range 0 to 31
  664.   * @rmtoll FTSR        FTx           LL_EXTI_IsEnabledFallingTrig_0_31
  665.   * @param  ExtiLine This parameter can be a combination of the following values:
  666.   *         @arg @ref LL_EXTI_LINE_0
  667.   *         @arg @ref LL_EXTI_LINE_1
  668.   *         @arg @ref LL_EXTI_LINE_2
  669.   *         @arg @ref LL_EXTI_LINE_3
  670.   *         @arg @ref LL_EXTI_LINE_4
  671.   *         @arg @ref LL_EXTI_LINE_5
  672.   *         @arg @ref LL_EXTI_LINE_6
  673.   *         @arg @ref LL_EXTI_LINE_7
  674.   *         @arg @ref LL_EXTI_LINE_8
  675.   *         @arg @ref LL_EXTI_LINE_9
  676.   *         @arg @ref LL_EXTI_LINE_10
  677.   *         @arg @ref LL_EXTI_LINE_11
  678.   *         @arg @ref LL_EXTI_LINE_12
  679.   *         @arg @ref LL_EXTI_LINE_13
  680.   *         @arg @ref LL_EXTI_LINE_14
  681.   *         @arg @ref LL_EXTI_LINE_15
  682.   *         @arg @ref LL_EXTI_LINE_16
  683.   *         @arg @ref LL_EXTI_LINE_18
  684.   *         @arg @ref LL_EXTI_LINE_19
  685.   * @note   Please check each device line mapping for EXTI Line availability
  686.   * @retval State of bit (1 or 0).
  687.   */
  688. __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine)
  689. {
  690.   return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine));
  691. }
  692.  
  693.  
  694. /**
  695.   * @}
  696.   */
  697.  
  698. /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management
  699.   * @{
  700.   */
  701.  
  702. /**
  703.   * @brief  Generate a software Interrupt Event for Lines in range 0 to 31
  704.   * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to
  705.   *       this bit when it is at '0' sets the corresponding pending bit in EXTI_PR
  706.   *       resulting in an interrupt request generation.
  707.   *       This bit is cleared by clearing the corresponding bit in the EXTI_PR
  708.   *       register (by writing a 1 into the bit)
  709.   * @rmtoll SWIER       SWIx          LL_EXTI_GenerateSWI_0_31
  710.   * @param  ExtiLine This parameter can be a combination of the following values:
  711.   *         @arg @ref LL_EXTI_LINE_0
  712.   *         @arg @ref LL_EXTI_LINE_1
  713.   *         @arg @ref LL_EXTI_LINE_2
  714.   *         @arg @ref LL_EXTI_LINE_3
  715.   *         @arg @ref LL_EXTI_LINE_4
  716.   *         @arg @ref LL_EXTI_LINE_5
  717.   *         @arg @ref LL_EXTI_LINE_6
  718.   *         @arg @ref LL_EXTI_LINE_7
  719.   *         @arg @ref LL_EXTI_LINE_8
  720.   *         @arg @ref LL_EXTI_LINE_9
  721.   *         @arg @ref LL_EXTI_LINE_10
  722.   *         @arg @ref LL_EXTI_LINE_11
  723.   *         @arg @ref LL_EXTI_LINE_12
  724.   *         @arg @ref LL_EXTI_LINE_13
  725.   *         @arg @ref LL_EXTI_LINE_14
  726.   *         @arg @ref LL_EXTI_LINE_15
  727.   *         @arg @ref LL_EXTI_LINE_16
  728.   *         @arg @ref LL_EXTI_LINE_18
  729.   *         @arg @ref LL_EXTI_LINE_19
  730.   * @note   Please check each device line mapping for EXTI Line availability
  731.   * @retval None
  732.   */
  733. __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine)
  734. {
  735.   SET_BIT(EXTI->SWIER, ExtiLine);
  736. }
  737.  
  738.  
  739. /**
  740.   * @}
  741.   */
  742.  
  743. /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management
  744.   * @{
  745.   */
  746.  
  747. /**
  748.   * @brief  Check if the ExtLine Flag is set or not for Lines in range 0 to 31
  749.   * @note This bit is set when the selected edge event arrives on the interrupt
  750.   *       line. This bit is cleared by writing a 1 to the bit.
  751.   * @rmtoll PR          PIFx           LL_EXTI_IsActiveFlag_0_31
  752.   * @param  ExtiLine This parameter can be a combination of the following values:
  753.   *         @arg @ref LL_EXTI_LINE_0
  754.   *         @arg @ref LL_EXTI_LINE_1
  755.   *         @arg @ref LL_EXTI_LINE_2
  756.   *         @arg @ref LL_EXTI_LINE_3
  757.   *         @arg @ref LL_EXTI_LINE_4
  758.   *         @arg @ref LL_EXTI_LINE_5
  759.   *         @arg @ref LL_EXTI_LINE_6
  760.   *         @arg @ref LL_EXTI_LINE_7
  761.   *         @arg @ref LL_EXTI_LINE_8
  762.   *         @arg @ref LL_EXTI_LINE_9
  763.   *         @arg @ref LL_EXTI_LINE_10
  764.   *         @arg @ref LL_EXTI_LINE_11
  765.   *         @arg @ref LL_EXTI_LINE_12
  766.   *         @arg @ref LL_EXTI_LINE_13
  767.   *         @arg @ref LL_EXTI_LINE_14
  768.   *         @arg @ref LL_EXTI_LINE_15
  769.   *         @arg @ref LL_EXTI_LINE_16
  770.   *         @arg @ref LL_EXTI_LINE_18
  771.   *         @arg @ref LL_EXTI_LINE_19
  772.   * @note   Please check each device line mapping for EXTI Line availability
  773.   * @retval State of bit (1 or 0).
  774.   */
  775. __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine)
  776. {
  777.   return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine));
  778. }
  779.  
  780.  
  781. /**
  782.   * @brief  Read ExtLine Combination Flag for Lines in range 0 to 31
  783.   * @note This bit is set when the selected edge event arrives on the interrupt
  784.   *       line. This bit is cleared by writing a 1 to the bit.
  785.   * @rmtoll PR          PIFx           LL_EXTI_ReadFlag_0_31
  786.   * @param  ExtiLine This parameter can be a combination of the following values:
  787.   *         @arg @ref LL_EXTI_LINE_0
  788.   *         @arg @ref LL_EXTI_LINE_1
  789.   *         @arg @ref LL_EXTI_LINE_2
  790.   *         @arg @ref LL_EXTI_LINE_3
  791.   *         @arg @ref LL_EXTI_LINE_4
  792.   *         @arg @ref LL_EXTI_LINE_5
  793.   *         @arg @ref LL_EXTI_LINE_6
  794.   *         @arg @ref LL_EXTI_LINE_7
  795.   *         @arg @ref LL_EXTI_LINE_8
  796.   *         @arg @ref LL_EXTI_LINE_9
  797.   *         @arg @ref LL_EXTI_LINE_10
  798.   *         @arg @ref LL_EXTI_LINE_11
  799.   *         @arg @ref LL_EXTI_LINE_12
  800.   *         @arg @ref LL_EXTI_LINE_13
  801.   *         @arg @ref LL_EXTI_LINE_14
  802.   *         @arg @ref LL_EXTI_LINE_15
  803.   *         @arg @ref LL_EXTI_LINE_16
  804.   *         @arg @ref LL_EXTI_LINE_18
  805.   *         @arg @ref LL_EXTI_LINE_19
  806.   * @note   Please check each device line mapping for EXTI Line availability
  807.   * @retval @note This bit is set when the selected edge event arrives on the interrupt
  808.   */
  809. __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine)
  810. {
  811.   return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine));
  812. }
  813.  
  814.  
  815. /**
  816.   * @brief  Clear ExtLine Flags  for Lines in range 0 to 31
  817.   * @note This bit is set when the selected edge event arrives on the interrupt
  818.   *       line. This bit is cleared by writing a 1 to the bit.
  819.   * @rmtoll PR          PIFx           LL_EXTI_ClearFlag_0_31
  820.   * @param  ExtiLine This parameter can be a combination of the following values:
  821.   *         @arg @ref LL_EXTI_LINE_0
  822.   *         @arg @ref LL_EXTI_LINE_1
  823.   *         @arg @ref LL_EXTI_LINE_2
  824.   *         @arg @ref LL_EXTI_LINE_3
  825.   *         @arg @ref LL_EXTI_LINE_4
  826.   *         @arg @ref LL_EXTI_LINE_5
  827.   *         @arg @ref LL_EXTI_LINE_6
  828.   *         @arg @ref LL_EXTI_LINE_7
  829.   *         @arg @ref LL_EXTI_LINE_8
  830.   *         @arg @ref LL_EXTI_LINE_9
  831.   *         @arg @ref LL_EXTI_LINE_10
  832.   *         @arg @ref LL_EXTI_LINE_11
  833.   *         @arg @ref LL_EXTI_LINE_12
  834.   *         @arg @ref LL_EXTI_LINE_13
  835.   *         @arg @ref LL_EXTI_LINE_14
  836.   *         @arg @ref LL_EXTI_LINE_15
  837.   *         @arg @ref LL_EXTI_LINE_16
  838.   *         @arg @ref LL_EXTI_LINE_18
  839.   *         @arg @ref LL_EXTI_LINE_19
  840.   * @note   Please check each device line mapping for EXTI Line availability
  841.   * @retval None
  842.   */
  843. __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine)
  844. {
  845.   WRITE_REG(EXTI->PR, ExtiLine);
  846. }
  847.  
  848.  
  849. /**
  850.   * @}
  851.   */
  852.  
  853. #if defined(USE_FULL_LL_DRIVER)
  854. /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions
  855.   * @{
  856.   */
  857.  
  858. uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct);
  859. uint32_t LL_EXTI_DeInit(void);
  860. void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct);
  861.  
  862.  
  863. /**
  864.   * @}
  865.   */
  866. #endif /* USE_FULL_LL_DRIVER */
  867.  
  868. /**
  869.   * @}
  870.   */
  871.  
  872. /**
  873.   * @}
  874.   */
  875.  
  876. #endif /* EXTI */
  877.  
  878. /**
  879.   * @}
  880.   */
  881.  
  882. #ifdef __cplusplus
  883. }
  884. #endif
  885.  
  886. #endif /* STM32F1xx_LL_EXTI_H */
  887.  
  888. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  889.