Subversion Repositories LedShow

Rev

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