STM32F479xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_ll_exti.h 00004 * @author MCD Application Team 00005 * @brief Header file of EXTI LL module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© Copyright (c) 2016 STMicroelectronics. 00010 * All rights reserved.</center></h2> 00011 * 00012 * This software component is licensed by ST under BSD 3-Clause license, 00013 * the "License"; You may not use this file except in compliance with the 00014 * License. You may obtain a copy of the License at: 00015 * opensource.org/licenses/BSD-3-Clause 00016 * 00017 ****************************************************************************** 00018 */ 00019 00020 /* Define to prevent recursive inclusion -------------------------------------*/ 00021 #ifndef __STM32F4xx_LL_EXTI_H 00022 #define __STM32F4xx_LL_EXTI_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /* Includes ------------------------------------------------------------------*/ 00029 #include "stm32f4xx.h" 00030 00031 /** @addtogroup STM32F4xx_LL_Driver 00032 * @{ 00033 */ 00034 00035 #if defined (EXTI) 00036 00037 /** @defgroup EXTI_LL EXTI 00038 * @{ 00039 */ 00040 00041 /* Private types -------------------------------------------------------------*/ 00042 /* Private variables ---------------------------------------------------------*/ 00043 /* Private constants ---------------------------------------------------------*/ 00044 /* Private Macros ------------------------------------------------------------*/ 00045 #if defined(USE_FULL_LL_DRIVER) 00046 /** @defgroup EXTI_LL_Private_Macros EXTI Private Macros 00047 * @{ 00048 */ 00049 /** 00050 * @} 00051 */ 00052 #endif /*USE_FULL_LL_DRIVER*/ 00053 /* Exported types ------------------------------------------------------------*/ 00054 #if defined(USE_FULL_LL_DRIVER) 00055 /** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure 00056 * @{ 00057 */ 00058 typedef struct 00059 { 00060 00061 uint32_t Line_0_31; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31 00062 This parameter can be any combination of @ref EXTI_LL_EC_LINE */ 00063 00064 FunctionalState LineCommand; /*!< Specifies the new state of the selected EXTI lines. 00065 This parameter can be set either to ENABLE or DISABLE */ 00066 00067 uint8_t Mode; /*!< Specifies the mode for the EXTI lines. 00068 This parameter can be a value of @ref EXTI_LL_EC_MODE. */ 00069 00070 uint8_t Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. 00071 This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */ 00072 } LL_EXTI_InitTypeDef; 00073 00074 /** 00075 * @} 00076 */ 00077 #endif /*USE_FULL_LL_DRIVER*/ 00078 00079 /* Exported constants --------------------------------------------------------*/ 00080 /** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants 00081 * @{ 00082 */ 00083 00084 /** @defgroup EXTI_LL_EC_LINE LINE 00085 * @{ 00086 */ 00087 #define LL_EXTI_LINE_0 EXTI_IMR_IM0 /*!< Extended line 0 */ 00088 #define LL_EXTI_LINE_1 EXTI_IMR_IM1 /*!< Extended line 1 */ 00089 #define LL_EXTI_LINE_2 EXTI_IMR_IM2 /*!< Extended line 2 */ 00090 #define LL_EXTI_LINE_3 EXTI_IMR_IM3 /*!< Extended line 3 */ 00091 #define LL_EXTI_LINE_4 EXTI_IMR_IM4 /*!< Extended line 4 */ 00092 #define LL_EXTI_LINE_5 EXTI_IMR_IM5 /*!< Extended line 5 */ 00093 #define LL_EXTI_LINE_6 EXTI_IMR_IM6 /*!< Extended line 6 */ 00094 #define LL_EXTI_LINE_7 EXTI_IMR_IM7 /*!< Extended line 7 */ 00095 #define LL_EXTI_LINE_8 EXTI_IMR_IM8 /*!< Extended line 8 */ 00096 #define LL_EXTI_LINE_9 EXTI_IMR_IM9 /*!< Extended line 9 */ 00097 #define LL_EXTI_LINE_10 EXTI_IMR_IM10 /*!< Extended line 10 */ 00098 #define LL_EXTI_LINE_11 EXTI_IMR_IM11 /*!< Extended line 11 */ 00099 #define LL_EXTI_LINE_12 EXTI_IMR_IM12 /*!< Extended line 12 */ 00100 #define LL_EXTI_LINE_13 EXTI_IMR_IM13 /*!< Extended line 13 */ 00101 #define LL_EXTI_LINE_14 EXTI_IMR_IM14 /*!< Extended line 14 */ 00102 #define LL_EXTI_LINE_15 EXTI_IMR_IM15 /*!< Extended line 15 */ 00103 #if defined(EXTI_IMR_IM16) 00104 #define LL_EXTI_LINE_16 EXTI_IMR_IM16 /*!< Extended line 16 */ 00105 #endif 00106 #define LL_EXTI_LINE_17 EXTI_IMR_IM17 /*!< Extended line 17 */ 00107 #if defined(EXTI_IMR_IM18) 00108 #define LL_EXTI_LINE_18 EXTI_IMR_IM18 /*!< Extended line 18 */ 00109 #endif 00110 #define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */ 00111 #if defined(EXTI_IMR_IM20) 00112 #define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */ 00113 #endif 00114 #if defined(EXTI_IMR_IM21) 00115 #define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */ 00116 #endif 00117 #if defined(EXTI_IMR_IM22) 00118 #define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */ 00119 #endif 00120 #if defined(EXTI_IMR_IM23) 00121 #define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */ 00122 #endif 00123 #if defined(EXTI_IMR_IM24) 00124 #define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */ 00125 #endif 00126 #if defined(EXTI_IMR_IM25) 00127 #define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */ 00128 #endif 00129 #if defined(EXTI_IMR_IM26) 00130 #define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */ 00131 #endif 00132 #if defined(EXTI_IMR_IM27) 00133 #define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */ 00134 #endif 00135 #if defined(EXTI_IMR_IM28) 00136 #define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */ 00137 #endif 00138 #if defined(EXTI_IMR_IM29) 00139 #define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */ 00140 #endif 00141 #if defined(EXTI_IMR_IM30) 00142 #define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */ 00143 #endif 00144 #if defined(EXTI_IMR_IM31) 00145 #define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */ 00146 #endif 00147 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/ 00148 00149 00150 #define LL_EXTI_LINE_ALL ((uint32_t)0xFFFFFFFFU) /*!< All Extended line */ 00151 00152 #if defined(USE_FULL_LL_DRIVER) 00153 #define LL_EXTI_LINE_NONE ((uint32_t)0x00000000U) /*!< None Extended line */ 00154 #endif /*USE_FULL_LL_DRIVER*/ 00155 00156 /** 00157 * @} 00158 */ 00159 #if defined(USE_FULL_LL_DRIVER) 00160 00161 /** @defgroup EXTI_LL_EC_MODE Mode 00162 * @{ 00163 */ 00164 #define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */ 00165 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */ 00166 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */ 00167 /** 00168 * @} 00169 */ 00170 00171 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger 00172 * @{ 00173 */ 00174 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */ 00175 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */ 00176 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */ 00177 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */ 00178 00179 /** 00180 * @} 00181 */ 00182 00183 00184 #endif /*USE_FULL_LL_DRIVER*/ 00185 00186 00187 /** 00188 * @} 00189 */ 00190 00191 /* Exported macro ------------------------------------------------------------*/ 00192 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros 00193 * @{ 00194 */ 00195 00196 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros 00197 * @{ 00198 */ 00199 00200 /** 00201 * @brief Write a value in EXTI register 00202 * @param __REG__ Register to be written 00203 * @param __VALUE__ Value to be written in the register 00204 * @retval None 00205 */ 00206 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__)) 00207 00208 /** 00209 * @brief Read a value in EXTI register 00210 * @param __REG__ Register to be read 00211 * @retval Register value 00212 */ 00213 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__) 00214 /** 00215 * @} 00216 */ 00217 00218 00219 /** 00220 * @} 00221 */ 00222 00223 00224 00225 /* Exported functions --------------------------------------------------------*/ 00226 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions 00227 * @{ 00228 */ 00229 /** @defgroup EXTI_LL_EF_IT_Management IT_Management 00230 * @{ 00231 */ 00232 00233 /** 00234 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31 00235 * @note The reset value for the direct or internal lines (see RM) 00236 * is set to 1 in order to enable the interrupt by default. 00237 * Bits are set automatically at Power on. 00238 * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31 00239 * @param ExtiLine This parameter can be one of the following values: 00240 * @arg @ref LL_EXTI_LINE_0 00241 * @arg @ref LL_EXTI_LINE_1 00242 * @arg @ref LL_EXTI_LINE_2 00243 * @arg @ref LL_EXTI_LINE_3 00244 * @arg @ref LL_EXTI_LINE_4 00245 * @arg @ref LL_EXTI_LINE_5 00246 * @arg @ref LL_EXTI_LINE_6 00247 * @arg @ref LL_EXTI_LINE_7 00248 * @arg @ref LL_EXTI_LINE_8 00249 * @arg @ref LL_EXTI_LINE_9 00250 * @arg @ref LL_EXTI_LINE_10 00251 * @arg @ref LL_EXTI_LINE_11 00252 * @arg @ref LL_EXTI_LINE_12 00253 * @arg @ref LL_EXTI_LINE_13 00254 * @arg @ref LL_EXTI_LINE_14 00255 * @arg @ref LL_EXTI_LINE_15 00256 * @arg @ref LL_EXTI_LINE_16 00257 * @arg @ref LL_EXTI_LINE_17 00258 * @arg @ref LL_EXTI_LINE_18 00259 * @arg @ref LL_EXTI_LINE_19(*) 00260 * @arg @ref LL_EXTI_LINE_20(*) 00261 * @arg @ref LL_EXTI_LINE_21 00262 * @arg @ref LL_EXTI_LINE_22 00263 * @arg @ref LL_EXTI_LINE_23(*) 00264 * @arg @ref LL_EXTI_LINE_ALL_0_31 00265 * @note (*): Available in some devices 00266 * @note Please check each device line mapping for EXTI Line availability 00267 * @retval None 00268 */ 00269 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) 00270 { 00271 SET_BIT(EXTI->IMR, ExtiLine); 00272 } 00273 00274 /** 00275 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31 00276 * @note The reset value for the direct or internal lines (see RM) 00277 * is set to 1 in order to enable the interrupt by default. 00278 * Bits are set automatically at Power on. 00279 * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31 00280 * @param ExtiLine This parameter can be one of the following values: 00281 * @arg @ref LL_EXTI_LINE_0 00282 * @arg @ref LL_EXTI_LINE_1 00283 * @arg @ref LL_EXTI_LINE_2 00284 * @arg @ref LL_EXTI_LINE_3 00285 * @arg @ref LL_EXTI_LINE_4 00286 * @arg @ref LL_EXTI_LINE_5 00287 * @arg @ref LL_EXTI_LINE_6 00288 * @arg @ref LL_EXTI_LINE_7 00289 * @arg @ref LL_EXTI_LINE_8 00290 * @arg @ref LL_EXTI_LINE_9 00291 * @arg @ref LL_EXTI_LINE_10 00292 * @arg @ref LL_EXTI_LINE_11 00293 * @arg @ref LL_EXTI_LINE_12 00294 * @arg @ref LL_EXTI_LINE_13 00295 * @arg @ref LL_EXTI_LINE_14 00296 * @arg @ref LL_EXTI_LINE_15 00297 * @arg @ref LL_EXTI_LINE_16 00298 * @arg @ref LL_EXTI_LINE_17 00299 * @arg @ref LL_EXTI_LINE_18 00300 * @arg @ref LL_EXTI_LINE_19(*) 00301 * @arg @ref LL_EXTI_LINE_20(*) 00302 * @arg @ref LL_EXTI_LINE_21 00303 * @arg @ref LL_EXTI_LINE_22 00304 * @arg @ref LL_EXTI_LINE_23(*) 00305 * @arg @ref LL_EXTI_LINE_ALL_0_31 00306 * @note (*): Available in some devices 00307 * @note Please check each device line mapping for EXTI Line availability 00308 * @retval None 00309 */ 00310 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) 00311 { 00312 CLEAR_BIT(EXTI->IMR, ExtiLine); 00313 } 00314 00315 00316 /** 00317 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31 00318 * @note The reset value for the direct or internal lines (see RM) 00319 * is set to 1 in order to enable the interrupt by default. 00320 * Bits are set automatically at Power on. 00321 * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31 00322 * @param ExtiLine This parameter can be one of the following values: 00323 * @arg @ref LL_EXTI_LINE_0 00324 * @arg @ref LL_EXTI_LINE_1 00325 * @arg @ref LL_EXTI_LINE_2 00326 * @arg @ref LL_EXTI_LINE_3 00327 * @arg @ref LL_EXTI_LINE_4 00328 * @arg @ref LL_EXTI_LINE_5 00329 * @arg @ref LL_EXTI_LINE_6 00330 * @arg @ref LL_EXTI_LINE_7 00331 * @arg @ref LL_EXTI_LINE_8 00332 * @arg @ref LL_EXTI_LINE_9 00333 * @arg @ref LL_EXTI_LINE_10 00334 * @arg @ref LL_EXTI_LINE_11 00335 * @arg @ref LL_EXTI_LINE_12 00336 * @arg @ref LL_EXTI_LINE_13 00337 * @arg @ref LL_EXTI_LINE_14 00338 * @arg @ref LL_EXTI_LINE_15 00339 * @arg @ref LL_EXTI_LINE_16 00340 * @arg @ref LL_EXTI_LINE_17 00341 * @arg @ref LL_EXTI_LINE_18 00342 * @arg @ref LL_EXTI_LINE_19(*) 00343 * @arg @ref LL_EXTI_LINE_20(*) 00344 * @arg @ref LL_EXTI_LINE_21 00345 * @arg @ref LL_EXTI_LINE_22 00346 * @arg @ref LL_EXTI_LINE_23(*) 00347 * @arg @ref LL_EXTI_LINE_ALL_0_31 00348 * @note (*): Available in some devices 00349 * @note Please check each device line mapping for EXTI Line availability 00350 * @retval State of bit (1 or 0). 00351 */ 00352 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) 00353 { 00354 return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine)); 00355 } 00356 00357 00358 /** 00359 * @} 00360 */ 00361 00362 /** @defgroup EXTI_LL_EF_Event_Management Event_Management 00363 * @{ 00364 */ 00365 00366 /** 00367 * @brief Enable ExtiLine Event request for Lines in range 0 to 31 00368 * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31 00369 * @param ExtiLine This parameter can be one of the following values: 00370 * @arg @ref LL_EXTI_LINE_0 00371 * @arg @ref LL_EXTI_LINE_1 00372 * @arg @ref LL_EXTI_LINE_2 00373 * @arg @ref LL_EXTI_LINE_3 00374 * @arg @ref LL_EXTI_LINE_4 00375 * @arg @ref LL_EXTI_LINE_5 00376 * @arg @ref LL_EXTI_LINE_6 00377 * @arg @ref LL_EXTI_LINE_7 00378 * @arg @ref LL_EXTI_LINE_8 00379 * @arg @ref LL_EXTI_LINE_9 00380 * @arg @ref LL_EXTI_LINE_10 00381 * @arg @ref LL_EXTI_LINE_11 00382 * @arg @ref LL_EXTI_LINE_12 00383 * @arg @ref LL_EXTI_LINE_13 00384 * @arg @ref LL_EXTI_LINE_14 00385 * @arg @ref LL_EXTI_LINE_15 00386 * @arg @ref LL_EXTI_LINE_16 00387 * @arg @ref LL_EXTI_LINE_17 00388 * @arg @ref LL_EXTI_LINE_18 00389 * @arg @ref LL_EXTI_LINE_19(*) 00390 * @arg @ref LL_EXTI_LINE_20(*) 00391 * @arg @ref LL_EXTI_LINE_21 00392 * @arg @ref LL_EXTI_LINE_22 00393 * @arg @ref LL_EXTI_LINE_23(*) 00394 * @arg @ref LL_EXTI_LINE_ALL_0_31 00395 * @note (*): Available in some devices 00396 * @note Please check each device line mapping for EXTI Line availability 00397 * @retval None 00398 */ 00399 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) 00400 { 00401 SET_BIT(EXTI->EMR, ExtiLine); 00402 00403 } 00404 00405 00406 /** 00407 * @brief Disable ExtiLine Event request for Lines in range 0 to 31 00408 * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31 00409 * @param ExtiLine This parameter can be one of the following values: 00410 * @arg @ref LL_EXTI_LINE_0 00411 * @arg @ref LL_EXTI_LINE_1 00412 * @arg @ref LL_EXTI_LINE_2 00413 * @arg @ref LL_EXTI_LINE_3 00414 * @arg @ref LL_EXTI_LINE_4 00415 * @arg @ref LL_EXTI_LINE_5 00416 * @arg @ref LL_EXTI_LINE_6 00417 * @arg @ref LL_EXTI_LINE_7 00418 * @arg @ref LL_EXTI_LINE_8 00419 * @arg @ref LL_EXTI_LINE_9 00420 * @arg @ref LL_EXTI_LINE_10 00421 * @arg @ref LL_EXTI_LINE_11 00422 * @arg @ref LL_EXTI_LINE_12 00423 * @arg @ref LL_EXTI_LINE_13 00424 * @arg @ref LL_EXTI_LINE_14 00425 * @arg @ref LL_EXTI_LINE_15 00426 * @arg @ref LL_EXTI_LINE_16 00427 * @arg @ref LL_EXTI_LINE_17 00428 * @arg @ref LL_EXTI_LINE_18 00429 * @arg @ref LL_EXTI_LINE_19(*) 00430 * @arg @ref LL_EXTI_LINE_20(*) 00431 * @arg @ref LL_EXTI_LINE_21 00432 * @arg @ref LL_EXTI_LINE_22 00433 * @arg @ref LL_EXTI_LINE_23(*) 00434 * @arg @ref LL_EXTI_LINE_ALL_0_31 00435 * @note (*): Available in some devices 00436 * @note Please check each device line mapping for EXTI Line availability 00437 * @retval None 00438 */ 00439 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) 00440 { 00441 CLEAR_BIT(EXTI->EMR, ExtiLine); 00442 } 00443 00444 00445 /** 00446 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31 00447 * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31 00448 * @param ExtiLine This parameter can be one of the following values: 00449 * @arg @ref LL_EXTI_LINE_0 00450 * @arg @ref LL_EXTI_LINE_1 00451 * @arg @ref LL_EXTI_LINE_2 00452 * @arg @ref LL_EXTI_LINE_3 00453 * @arg @ref LL_EXTI_LINE_4 00454 * @arg @ref LL_EXTI_LINE_5 00455 * @arg @ref LL_EXTI_LINE_6 00456 * @arg @ref LL_EXTI_LINE_7 00457 * @arg @ref LL_EXTI_LINE_8 00458 * @arg @ref LL_EXTI_LINE_9 00459 * @arg @ref LL_EXTI_LINE_10 00460 * @arg @ref LL_EXTI_LINE_11 00461 * @arg @ref LL_EXTI_LINE_12 00462 * @arg @ref LL_EXTI_LINE_13 00463 * @arg @ref LL_EXTI_LINE_14 00464 * @arg @ref LL_EXTI_LINE_15 00465 * @arg @ref LL_EXTI_LINE_16 00466 * @arg @ref LL_EXTI_LINE_17 00467 * @arg @ref LL_EXTI_LINE_18 00468 * @arg @ref LL_EXTI_LINE_19(*) 00469 * @arg @ref LL_EXTI_LINE_20(*) 00470 * @arg @ref LL_EXTI_LINE_21 00471 * @arg @ref LL_EXTI_LINE_22 00472 * @arg @ref LL_EXTI_LINE_23(*) 00473 * @arg @ref LL_EXTI_LINE_ALL_0_31 00474 * @note (*): Available in some devices 00475 * @note Please check each device line mapping for EXTI Line availability 00476 * @retval State of bit (1 or 0). 00477 */ 00478 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) 00479 { 00480 return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine)); 00481 00482 } 00483 00484 00485 /** 00486 * @} 00487 */ 00488 00489 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management 00490 * @{ 00491 */ 00492 00493 /** 00494 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 00495 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00496 * generated on these lines. If a rising edge on a configurable interrupt 00497 * line occurs during a write operation in the EXTI_RTSR register, the 00498 * pending bit is not set. 00499 * Rising and falling edge triggers can be set for 00500 * the same interrupt line. In this case, both generate a trigger 00501 * condition. 00502 * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31 00503 * @param ExtiLine This parameter can be a combination of the following values: 00504 * @arg @ref LL_EXTI_LINE_0 00505 * @arg @ref LL_EXTI_LINE_1 00506 * @arg @ref LL_EXTI_LINE_2 00507 * @arg @ref LL_EXTI_LINE_3 00508 * @arg @ref LL_EXTI_LINE_4 00509 * @arg @ref LL_EXTI_LINE_5 00510 * @arg @ref LL_EXTI_LINE_6 00511 * @arg @ref LL_EXTI_LINE_7 00512 * @arg @ref LL_EXTI_LINE_8 00513 * @arg @ref LL_EXTI_LINE_9 00514 * @arg @ref LL_EXTI_LINE_10 00515 * @arg @ref LL_EXTI_LINE_11 00516 * @arg @ref LL_EXTI_LINE_12 00517 * @arg @ref LL_EXTI_LINE_13 00518 * @arg @ref LL_EXTI_LINE_14 00519 * @arg @ref LL_EXTI_LINE_15 00520 * @arg @ref LL_EXTI_LINE_16 00521 * @arg @ref LL_EXTI_LINE_18 00522 * @arg @ref LL_EXTI_LINE_19(*) 00523 * @arg @ref LL_EXTI_LINE_20(*) 00524 * @arg @ref LL_EXTI_LINE_21 00525 * @arg @ref LL_EXTI_LINE_22 00526 * @note (*): Available in some devices 00527 * @note Please check each device line mapping for EXTI Line availability 00528 * @retval None 00529 */ 00530 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine) 00531 { 00532 SET_BIT(EXTI->RTSR, ExtiLine); 00533 00534 } 00535 00536 00537 /** 00538 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 00539 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00540 * generated on these lines. If a rising edge on a configurable interrupt 00541 * line occurs during a write operation in the EXTI_RTSR register, the 00542 * pending bit is not set. 00543 * Rising and falling edge triggers can be set for 00544 * the same interrupt line. In this case, both generate a trigger 00545 * condition. 00546 * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31 00547 * @param ExtiLine This parameter can be a combination of the following values: 00548 * @arg @ref LL_EXTI_LINE_0 00549 * @arg @ref LL_EXTI_LINE_1 00550 * @arg @ref LL_EXTI_LINE_2 00551 * @arg @ref LL_EXTI_LINE_3 00552 * @arg @ref LL_EXTI_LINE_4 00553 * @arg @ref LL_EXTI_LINE_5 00554 * @arg @ref LL_EXTI_LINE_6 00555 * @arg @ref LL_EXTI_LINE_7 00556 * @arg @ref LL_EXTI_LINE_8 00557 * @arg @ref LL_EXTI_LINE_9 00558 * @arg @ref LL_EXTI_LINE_10 00559 * @arg @ref LL_EXTI_LINE_11 00560 * @arg @ref LL_EXTI_LINE_12 00561 * @arg @ref LL_EXTI_LINE_13 00562 * @arg @ref LL_EXTI_LINE_14 00563 * @arg @ref LL_EXTI_LINE_15 00564 * @arg @ref LL_EXTI_LINE_16 00565 * @arg @ref LL_EXTI_LINE_18 00566 * @arg @ref LL_EXTI_LINE_19(*) 00567 * @arg @ref LL_EXTI_LINE_20(*) 00568 * @arg @ref LL_EXTI_LINE_21 00569 * @arg @ref LL_EXTI_LINE_22 00570 * @note (*): Available in some devices 00571 * @note Please check each device line mapping for EXTI Line availability 00572 * @retval None 00573 */ 00574 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine) 00575 { 00576 CLEAR_BIT(EXTI->RTSR, ExtiLine); 00577 00578 } 00579 00580 00581 /** 00582 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31 00583 * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31 00584 * @param ExtiLine This parameter can be a combination of the following values: 00585 * @arg @ref LL_EXTI_LINE_0 00586 * @arg @ref LL_EXTI_LINE_1 00587 * @arg @ref LL_EXTI_LINE_2 00588 * @arg @ref LL_EXTI_LINE_3 00589 * @arg @ref LL_EXTI_LINE_4 00590 * @arg @ref LL_EXTI_LINE_5 00591 * @arg @ref LL_EXTI_LINE_6 00592 * @arg @ref LL_EXTI_LINE_7 00593 * @arg @ref LL_EXTI_LINE_8 00594 * @arg @ref LL_EXTI_LINE_9 00595 * @arg @ref LL_EXTI_LINE_10 00596 * @arg @ref LL_EXTI_LINE_11 00597 * @arg @ref LL_EXTI_LINE_12 00598 * @arg @ref LL_EXTI_LINE_13 00599 * @arg @ref LL_EXTI_LINE_14 00600 * @arg @ref LL_EXTI_LINE_15 00601 * @arg @ref LL_EXTI_LINE_16 00602 * @arg @ref LL_EXTI_LINE_18 00603 * @arg @ref LL_EXTI_LINE_19(*) 00604 * @arg @ref LL_EXTI_LINE_20(*) 00605 * @arg @ref LL_EXTI_LINE_21 00606 * @arg @ref LL_EXTI_LINE_22 00607 * @note (*): Available in some devices 00608 * @note Please check each device line mapping for EXTI Line availability 00609 * @retval State of bit (1 or 0). 00610 */ 00611 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine) 00612 { 00613 return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine)); 00614 } 00615 00616 00617 /** 00618 * @} 00619 */ 00620 00621 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management 00622 * @{ 00623 */ 00624 00625 /** 00626 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 00627 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00628 * generated on these lines. If a falling edge on a configurable interrupt 00629 * line occurs during a write operation in the EXTI_FTSR register, the 00630 * pending bit is not set. 00631 * Rising and falling edge triggers can be set for 00632 * the same interrupt line. In this case, both generate a trigger 00633 * condition. 00634 * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_0_31 00635 * @param ExtiLine This parameter can be a combination of the following values: 00636 * @arg @ref LL_EXTI_LINE_0 00637 * @arg @ref LL_EXTI_LINE_1 00638 * @arg @ref LL_EXTI_LINE_2 00639 * @arg @ref LL_EXTI_LINE_3 00640 * @arg @ref LL_EXTI_LINE_4 00641 * @arg @ref LL_EXTI_LINE_5 00642 * @arg @ref LL_EXTI_LINE_6 00643 * @arg @ref LL_EXTI_LINE_7 00644 * @arg @ref LL_EXTI_LINE_8 00645 * @arg @ref LL_EXTI_LINE_9 00646 * @arg @ref LL_EXTI_LINE_10 00647 * @arg @ref LL_EXTI_LINE_11 00648 * @arg @ref LL_EXTI_LINE_12 00649 * @arg @ref LL_EXTI_LINE_13 00650 * @arg @ref LL_EXTI_LINE_14 00651 * @arg @ref LL_EXTI_LINE_15 00652 * @arg @ref LL_EXTI_LINE_16 00653 * @arg @ref LL_EXTI_LINE_18 00654 * @arg @ref LL_EXTI_LINE_19(*) 00655 * @arg @ref LL_EXTI_LINE_20(*) 00656 * @arg @ref LL_EXTI_LINE_21 00657 * @arg @ref LL_EXTI_LINE_22 00658 * @note (*): Available in some devices 00659 * @note Please check each device line mapping for EXTI Line availability 00660 * @retval None 00661 */ 00662 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine) 00663 { 00664 SET_BIT(EXTI->FTSR, ExtiLine); 00665 } 00666 00667 00668 /** 00669 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 00670 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00671 * generated on these lines. If a Falling edge on a configurable interrupt 00672 * line occurs during a write operation in the EXTI_FTSR register, the 00673 * pending bit is not set. 00674 * Rising and falling edge triggers can be set for the same interrupt line. 00675 * In this case, both generate a trigger condition. 00676 * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31 00677 * @param ExtiLine This parameter can be a combination of the following values: 00678 * @arg @ref LL_EXTI_LINE_0 00679 * @arg @ref LL_EXTI_LINE_1 00680 * @arg @ref LL_EXTI_LINE_2 00681 * @arg @ref LL_EXTI_LINE_3 00682 * @arg @ref LL_EXTI_LINE_4 00683 * @arg @ref LL_EXTI_LINE_5 00684 * @arg @ref LL_EXTI_LINE_6 00685 * @arg @ref LL_EXTI_LINE_7 00686 * @arg @ref LL_EXTI_LINE_8 00687 * @arg @ref LL_EXTI_LINE_9 00688 * @arg @ref LL_EXTI_LINE_10 00689 * @arg @ref LL_EXTI_LINE_11 00690 * @arg @ref LL_EXTI_LINE_12 00691 * @arg @ref LL_EXTI_LINE_13 00692 * @arg @ref LL_EXTI_LINE_14 00693 * @arg @ref LL_EXTI_LINE_15 00694 * @arg @ref LL_EXTI_LINE_16 00695 * @arg @ref LL_EXTI_LINE_18 00696 * @arg @ref LL_EXTI_LINE_19(*) 00697 * @arg @ref LL_EXTI_LINE_20(*) 00698 * @arg @ref LL_EXTI_LINE_21 00699 * @arg @ref LL_EXTI_LINE_22 00700 * @note (*): Available in some devices 00701 * @note Please check each device line mapping for EXTI Line availability 00702 * @retval None 00703 */ 00704 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine) 00705 { 00706 CLEAR_BIT(EXTI->FTSR, ExtiLine); 00707 } 00708 00709 00710 /** 00711 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31 00712 * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31 00713 * @param ExtiLine This parameter can be a combination of the following values: 00714 * @arg @ref LL_EXTI_LINE_0 00715 * @arg @ref LL_EXTI_LINE_1 00716 * @arg @ref LL_EXTI_LINE_2 00717 * @arg @ref LL_EXTI_LINE_3 00718 * @arg @ref LL_EXTI_LINE_4 00719 * @arg @ref LL_EXTI_LINE_5 00720 * @arg @ref LL_EXTI_LINE_6 00721 * @arg @ref LL_EXTI_LINE_7 00722 * @arg @ref LL_EXTI_LINE_8 00723 * @arg @ref LL_EXTI_LINE_9 00724 * @arg @ref LL_EXTI_LINE_10 00725 * @arg @ref LL_EXTI_LINE_11 00726 * @arg @ref LL_EXTI_LINE_12 00727 * @arg @ref LL_EXTI_LINE_13 00728 * @arg @ref LL_EXTI_LINE_14 00729 * @arg @ref LL_EXTI_LINE_15 00730 * @arg @ref LL_EXTI_LINE_16 00731 * @arg @ref LL_EXTI_LINE_18 00732 * @arg @ref LL_EXTI_LINE_19(*) 00733 * @arg @ref LL_EXTI_LINE_20(*) 00734 * @arg @ref LL_EXTI_LINE_21 00735 * @arg @ref LL_EXTI_LINE_22 00736 * @note (*): Available in some devices 00737 * @note Please check each device line mapping for EXTI Line availability 00738 * @retval State of bit (1 or 0). 00739 */ 00740 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine) 00741 { 00742 return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine)); 00743 } 00744 00745 00746 /** 00747 * @} 00748 */ 00749 00750 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management 00751 * @{ 00752 */ 00753 00754 /** 00755 * @brief Generate a software Interrupt Event for Lines in range 0 to 31 00756 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to 00757 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR 00758 * resulting in an interrupt request generation. 00759 * This bit is cleared by clearing the corresponding bit in the EXTI_PR 00760 * register (by writing a 1 into the bit) 00761 * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31 00762 * @param ExtiLine This parameter can be a combination of the following values: 00763 * @arg @ref LL_EXTI_LINE_0 00764 * @arg @ref LL_EXTI_LINE_1 00765 * @arg @ref LL_EXTI_LINE_2 00766 * @arg @ref LL_EXTI_LINE_3 00767 * @arg @ref LL_EXTI_LINE_4 00768 * @arg @ref LL_EXTI_LINE_5 00769 * @arg @ref LL_EXTI_LINE_6 00770 * @arg @ref LL_EXTI_LINE_7 00771 * @arg @ref LL_EXTI_LINE_8 00772 * @arg @ref LL_EXTI_LINE_9 00773 * @arg @ref LL_EXTI_LINE_10 00774 * @arg @ref LL_EXTI_LINE_11 00775 * @arg @ref LL_EXTI_LINE_12 00776 * @arg @ref LL_EXTI_LINE_13 00777 * @arg @ref LL_EXTI_LINE_14 00778 * @arg @ref LL_EXTI_LINE_15 00779 * @arg @ref LL_EXTI_LINE_16 00780 * @arg @ref LL_EXTI_LINE_18 00781 * @arg @ref LL_EXTI_LINE_19(*) 00782 * @arg @ref LL_EXTI_LINE_20(*) 00783 * @arg @ref LL_EXTI_LINE_21 00784 * @arg @ref LL_EXTI_LINE_22 00785 * @note (*): Available in some devices 00786 * @note Please check each device line mapping for EXTI Line availability 00787 * @retval None 00788 */ 00789 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine) 00790 { 00791 SET_BIT(EXTI->SWIER, ExtiLine); 00792 } 00793 00794 00795 /** 00796 * @} 00797 */ 00798 00799 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management 00800 * @{ 00801 */ 00802 00803 /** 00804 * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31 00805 * @note This bit is set when the selected edge event arrives on the interrupt 00806 * line. This bit is cleared by writing a 1 to the bit. 00807 * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_0_31 00808 * @param ExtiLine This parameter can be a combination of the following values: 00809 * @arg @ref LL_EXTI_LINE_0 00810 * @arg @ref LL_EXTI_LINE_1 00811 * @arg @ref LL_EXTI_LINE_2 00812 * @arg @ref LL_EXTI_LINE_3 00813 * @arg @ref LL_EXTI_LINE_4 00814 * @arg @ref LL_EXTI_LINE_5 00815 * @arg @ref LL_EXTI_LINE_6 00816 * @arg @ref LL_EXTI_LINE_7 00817 * @arg @ref LL_EXTI_LINE_8 00818 * @arg @ref LL_EXTI_LINE_9 00819 * @arg @ref LL_EXTI_LINE_10 00820 * @arg @ref LL_EXTI_LINE_11 00821 * @arg @ref LL_EXTI_LINE_12 00822 * @arg @ref LL_EXTI_LINE_13 00823 * @arg @ref LL_EXTI_LINE_14 00824 * @arg @ref LL_EXTI_LINE_15 00825 * @arg @ref LL_EXTI_LINE_16 00826 * @arg @ref LL_EXTI_LINE_18 00827 * @arg @ref LL_EXTI_LINE_19(*) 00828 * @arg @ref LL_EXTI_LINE_20(*) 00829 * @arg @ref LL_EXTI_LINE_21 00830 * @arg @ref LL_EXTI_LINE_22 00831 * @note (*): Available in some devices 00832 * @note Please check each device line mapping for EXTI Line availability 00833 * @retval State of bit (1 or 0). 00834 */ 00835 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine) 00836 { 00837 return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine)); 00838 } 00839 00840 00841 /** 00842 * @brief Read ExtLine Combination Flag for Lines in range 0 to 31 00843 * @note This bit is set when the selected edge event arrives on the interrupt 00844 * line. This bit is cleared by writing a 1 to the bit. 00845 * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31 00846 * @param ExtiLine This parameter can be a combination of the following values: 00847 * @arg @ref LL_EXTI_LINE_0 00848 * @arg @ref LL_EXTI_LINE_1 00849 * @arg @ref LL_EXTI_LINE_2 00850 * @arg @ref LL_EXTI_LINE_3 00851 * @arg @ref LL_EXTI_LINE_4 00852 * @arg @ref LL_EXTI_LINE_5 00853 * @arg @ref LL_EXTI_LINE_6 00854 * @arg @ref LL_EXTI_LINE_7 00855 * @arg @ref LL_EXTI_LINE_8 00856 * @arg @ref LL_EXTI_LINE_9 00857 * @arg @ref LL_EXTI_LINE_10 00858 * @arg @ref LL_EXTI_LINE_11 00859 * @arg @ref LL_EXTI_LINE_12 00860 * @arg @ref LL_EXTI_LINE_13 00861 * @arg @ref LL_EXTI_LINE_14 00862 * @arg @ref LL_EXTI_LINE_15 00863 * @arg @ref LL_EXTI_LINE_16 00864 * @arg @ref LL_EXTI_LINE_18 00865 * @arg @ref LL_EXTI_LINE_19(*) 00866 * @arg @ref LL_EXTI_LINE_20(*) 00867 * @arg @ref LL_EXTI_LINE_21 00868 * @arg @ref LL_EXTI_LINE_22 00869 * @note (*): Available in some devices 00870 * @note Please check each device line mapping for EXTI Line availability 00871 * @retval @note This bit is set when the selected edge event arrives on the interrupt 00872 */ 00873 __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine) 00874 { 00875 return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine)); 00876 } 00877 00878 00879 /** 00880 * @brief Clear ExtLine Flags for Lines in range 0 to 31 00881 * @note This bit is set when the selected edge event arrives on the interrupt 00882 * line. This bit is cleared by writing a 1 to the bit. 00883 * @rmtoll PR PIFx LL_EXTI_ClearFlag_0_31 00884 * @param ExtiLine This parameter can be a combination of the following values: 00885 * @arg @ref LL_EXTI_LINE_0 00886 * @arg @ref LL_EXTI_LINE_1 00887 * @arg @ref LL_EXTI_LINE_2 00888 * @arg @ref LL_EXTI_LINE_3 00889 * @arg @ref LL_EXTI_LINE_4 00890 * @arg @ref LL_EXTI_LINE_5 00891 * @arg @ref LL_EXTI_LINE_6 00892 * @arg @ref LL_EXTI_LINE_7 00893 * @arg @ref LL_EXTI_LINE_8 00894 * @arg @ref LL_EXTI_LINE_9 00895 * @arg @ref LL_EXTI_LINE_10 00896 * @arg @ref LL_EXTI_LINE_11 00897 * @arg @ref LL_EXTI_LINE_12 00898 * @arg @ref LL_EXTI_LINE_13 00899 * @arg @ref LL_EXTI_LINE_14 00900 * @arg @ref LL_EXTI_LINE_15 00901 * @arg @ref LL_EXTI_LINE_16 00902 * @arg @ref LL_EXTI_LINE_18 00903 * @arg @ref LL_EXTI_LINE_19(*) 00904 * @arg @ref LL_EXTI_LINE_20(*) 00905 * @arg @ref LL_EXTI_LINE_21 00906 * @arg @ref LL_EXTI_LINE_22 00907 * @note (*): Available in some devices 00908 * @note Please check each device line mapping for EXTI Line availability 00909 * @retval None 00910 */ 00911 __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine) 00912 { 00913 WRITE_REG(EXTI->PR, ExtiLine); 00914 } 00915 00916 00917 /** 00918 * @} 00919 */ 00920 00921 #if defined(USE_FULL_LL_DRIVER) 00922 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions 00923 * @{ 00924 */ 00925 00926 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct); 00927 uint32_t LL_EXTI_DeInit(void); 00928 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct); 00929 00930 00931 /** 00932 * @} 00933 */ 00934 #endif /* USE_FULL_LL_DRIVER */ 00935 00936 /** 00937 * @} 00938 */ 00939 00940 /** 00941 * @} 00942 */ 00943 00944 #endif /* EXTI */ 00945 00946 /** 00947 * @} 00948 */ 00949 00950 #ifdef __cplusplus 00951 } 00952 #endif 00953 00954 #endif /* __STM32F4xx_LL_EXTI_H */ 00955 00956 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/