STM32F103xB HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f1xx_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 STM32F1xx_LL_EXTI_H 00022 #define STM32F1xx_LL_EXTI_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 /* Includes ------------------------------------------------------------------*/ 00029 #include "stm32f1xx.h" 00030 00031 /** @addtogroup STM32F1xx_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 #if defined(EXTI_IMR_IM19) 00111 #define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */ 00112 #endif 00113 #if defined(EXTI_IMR_IM20) 00114 #define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */ 00115 #endif 00116 #if defined(EXTI_IMR_IM21) 00117 #define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */ 00118 #endif 00119 #if defined(EXTI_IMR_IM22) 00120 #define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */ 00121 #endif 00122 #if defined(EXTI_IMR_IM23) 00123 #define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */ 00124 #endif 00125 #if defined(EXTI_IMR_IM24) 00126 #define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */ 00127 #endif 00128 #if defined(EXTI_IMR_IM25) 00129 #define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */ 00130 #endif 00131 #if defined(EXTI_IMR_IM26) 00132 #define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */ 00133 #endif 00134 #if defined(EXTI_IMR_IM27) 00135 #define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */ 00136 #endif 00137 #if defined(EXTI_IMR_IM28) 00138 #define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */ 00139 #endif 00140 #if defined(EXTI_IMR_IM29) 00141 #define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */ 00142 #endif 00143 #if defined(EXTI_IMR_IM30) 00144 #define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */ 00145 #endif 00146 #if defined(EXTI_IMR_IM31) 00147 #define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */ 00148 #endif 00149 #define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/ 00150 00151 00152 #define LL_EXTI_LINE_ALL (0xFFFFFFFFU) /*!< All Extended line */ 00153 00154 #if defined(USE_FULL_LL_DRIVER) 00155 #define LL_EXTI_LINE_NONE (0x00000000U) /*!< None Extended line */ 00156 #endif /*USE_FULL_LL_DRIVER*/ 00157 00158 /** 00159 * @} 00160 */ 00161 #if defined(USE_FULL_LL_DRIVER) 00162 00163 /** @defgroup EXTI_LL_EC_MODE Mode 00164 * @{ 00165 */ 00166 #define LL_EXTI_MODE_IT ((uint8_t)0x00) /*!< Interrupt Mode */ 00167 #define LL_EXTI_MODE_EVENT ((uint8_t)0x01) /*!< Event Mode */ 00168 #define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02) /*!< Interrupt & Event Mode */ 00169 /** 00170 * @} 00171 */ 00172 00173 /** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger 00174 * @{ 00175 */ 00176 #define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00) /*!< No Trigger Mode */ 00177 #define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01) /*!< Trigger Rising Mode */ 00178 #define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02) /*!< Trigger Falling Mode */ 00179 #define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03) /*!< Trigger Rising & Falling Mode */ 00180 00181 /** 00182 * @} 00183 */ 00184 00185 00186 #endif /*USE_FULL_LL_DRIVER*/ 00187 00188 00189 /** 00190 * @} 00191 */ 00192 00193 /* Exported macro ------------------------------------------------------------*/ 00194 /** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros 00195 * @{ 00196 */ 00197 00198 /** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros 00199 * @{ 00200 */ 00201 00202 /** 00203 * @brief Write a value in EXTI register 00204 * @param __REG__ Register to be written 00205 * @param __VALUE__ Value to be written in the register 00206 * @retval None 00207 */ 00208 #define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__)) 00209 00210 /** 00211 * @brief Read a value in EXTI register 00212 * @param __REG__ Register to be read 00213 * @retval Register value 00214 */ 00215 #define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__) 00216 /** 00217 * @} 00218 */ 00219 00220 00221 /** 00222 * @} 00223 */ 00224 00225 00226 00227 /* Exported functions --------------------------------------------------------*/ 00228 /** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions 00229 * @{ 00230 */ 00231 /** @defgroup EXTI_LL_EF_IT_Management IT_Management 00232 * @{ 00233 */ 00234 00235 /** 00236 * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31 00237 * @note The reset value for the direct or internal lines (see RM) 00238 * is set to 1 in order to enable the interrupt by default. 00239 * Bits are set automatically at Power on. 00240 * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31 00241 * @param ExtiLine This parameter can be one of the following values: 00242 * @arg @ref LL_EXTI_LINE_0 00243 * @arg @ref LL_EXTI_LINE_1 00244 * @arg @ref LL_EXTI_LINE_2 00245 * @arg @ref LL_EXTI_LINE_3 00246 * @arg @ref LL_EXTI_LINE_4 00247 * @arg @ref LL_EXTI_LINE_5 00248 * @arg @ref LL_EXTI_LINE_6 00249 * @arg @ref LL_EXTI_LINE_7 00250 * @arg @ref LL_EXTI_LINE_8 00251 * @arg @ref LL_EXTI_LINE_9 00252 * @arg @ref LL_EXTI_LINE_10 00253 * @arg @ref LL_EXTI_LINE_11 00254 * @arg @ref LL_EXTI_LINE_12 00255 * @arg @ref LL_EXTI_LINE_13 00256 * @arg @ref LL_EXTI_LINE_14 00257 * @arg @ref LL_EXTI_LINE_15 00258 * @arg @ref LL_EXTI_LINE_16 00259 * @arg @ref LL_EXTI_LINE_17 00260 * @arg @ref LL_EXTI_LINE_18 00261 * @arg @ref LL_EXTI_LINE_19 00262 * @arg @ref LL_EXTI_LINE_ALL_0_31 00263 * @note Please check each device line mapping for EXTI Line availability 00264 * @retval None 00265 */ 00266 __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) 00267 { 00268 SET_BIT(EXTI->IMR, ExtiLine); 00269 } 00270 00271 /** 00272 * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31 00273 * @note The reset value for the direct or internal lines (see RM) 00274 * is set to 1 in order to enable the interrupt by default. 00275 * Bits are set automatically at Power on. 00276 * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31 00277 * @param ExtiLine This parameter can be one of the following values: 00278 * @arg @ref LL_EXTI_LINE_0 00279 * @arg @ref LL_EXTI_LINE_1 00280 * @arg @ref LL_EXTI_LINE_2 00281 * @arg @ref LL_EXTI_LINE_3 00282 * @arg @ref LL_EXTI_LINE_4 00283 * @arg @ref LL_EXTI_LINE_5 00284 * @arg @ref LL_EXTI_LINE_6 00285 * @arg @ref LL_EXTI_LINE_7 00286 * @arg @ref LL_EXTI_LINE_8 00287 * @arg @ref LL_EXTI_LINE_9 00288 * @arg @ref LL_EXTI_LINE_10 00289 * @arg @ref LL_EXTI_LINE_11 00290 * @arg @ref LL_EXTI_LINE_12 00291 * @arg @ref LL_EXTI_LINE_13 00292 * @arg @ref LL_EXTI_LINE_14 00293 * @arg @ref LL_EXTI_LINE_15 00294 * @arg @ref LL_EXTI_LINE_16 00295 * @arg @ref LL_EXTI_LINE_17 00296 * @arg @ref LL_EXTI_LINE_18 00297 * @arg @ref LL_EXTI_LINE_19 00298 * @arg @ref LL_EXTI_LINE_ALL_0_31 00299 * @note Please check each device line mapping for EXTI Line availability 00300 * @retval None 00301 */ 00302 __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) 00303 { 00304 CLEAR_BIT(EXTI->IMR, ExtiLine); 00305 } 00306 00307 00308 /** 00309 * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31 00310 * @note The reset value for the direct or internal lines (see RM) 00311 * is set to 1 in order to enable the interrupt by default. 00312 * Bits are set automatically at Power on. 00313 * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31 00314 * @param ExtiLine This parameter can be one of the following values: 00315 * @arg @ref LL_EXTI_LINE_0 00316 * @arg @ref LL_EXTI_LINE_1 00317 * @arg @ref LL_EXTI_LINE_2 00318 * @arg @ref LL_EXTI_LINE_3 00319 * @arg @ref LL_EXTI_LINE_4 00320 * @arg @ref LL_EXTI_LINE_5 00321 * @arg @ref LL_EXTI_LINE_6 00322 * @arg @ref LL_EXTI_LINE_7 00323 * @arg @ref LL_EXTI_LINE_8 00324 * @arg @ref LL_EXTI_LINE_9 00325 * @arg @ref LL_EXTI_LINE_10 00326 * @arg @ref LL_EXTI_LINE_11 00327 * @arg @ref LL_EXTI_LINE_12 00328 * @arg @ref LL_EXTI_LINE_13 00329 * @arg @ref LL_EXTI_LINE_14 00330 * @arg @ref LL_EXTI_LINE_15 00331 * @arg @ref LL_EXTI_LINE_16 00332 * @arg @ref LL_EXTI_LINE_17 00333 * @arg @ref LL_EXTI_LINE_18 00334 * @arg @ref LL_EXTI_LINE_19 00335 * @arg @ref LL_EXTI_LINE_ALL_0_31 00336 * @note Please check each device line mapping for EXTI Line availability 00337 * @retval State of bit (1 or 0). 00338 */ 00339 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) 00340 { 00341 return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine)); 00342 } 00343 00344 00345 /** 00346 * @} 00347 */ 00348 00349 /** @defgroup EXTI_LL_EF_Event_Management Event_Management 00350 * @{ 00351 */ 00352 00353 /** 00354 * @brief Enable ExtiLine Event request for Lines in range 0 to 31 00355 * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31 00356 * @param ExtiLine This parameter can be one of the following values: 00357 * @arg @ref LL_EXTI_LINE_0 00358 * @arg @ref LL_EXTI_LINE_1 00359 * @arg @ref LL_EXTI_LINE_2 00360 * @arg @ref LL_EXTI_LINE_3 00361 * @arg @ref LL_EXTI_LINE_4 00362 * @arg @ref LL_EXTI_LINE_5 00363 * @arg @ref LL_EXTI_LINE_6 00364 * @arg @ref LL_EXTI_LINE_7 00365 * @arg @ref LL_EXTI_LINE_8 00366 * @arg @ref LL_EXTI_LINE_9 00367 * @arg @ref LL_EXTI_LINE_10 00368 * @arg @ref LL_EXTI_LINE_11 00369 * @arg @ref LL_EXTI_LINE_12 00370 * @arg @ref LL_EXTI_LINE_13 00371 * @arg @ref LL_EXTI_LINE_14 00372 * @arg @ref LL_EXTI_LINE_15 00373 * @arg @ref LL_EXTI_LINE_16 00374 * @arg @ref LL_EXTI_LINE_17 00375 * @arg @ref LL_EXTI_LINE_18 00376 * @arg @ref LL_EXTI_LINE_19 00377 * @arg @ref LL_EXTI_LINE_ALL_0_31 00378 * @note Please check each device line mapping for EXTI Line availability 00379 * @retval None 00380 */ 00381 __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) 00382 { 00383 SET_BIT(EXTI->EMR, ExtiLine); 00384 00385 } 00386 00387 00388 /** 00389 * @brief Disable ExtiLine Event request for Lines in range 0 to 31 00390 * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31 00391 * @param ExtiLine This parameter can be one of the following values: 00392 * @arg @ref LL_EXTI_LINE_0 00393 * @arg @ref LL_EXTI_LINE_1 00394 * @arg @ref LL_EXTI_LINE_2 00395 * @arg @ref LL_EXTI_LINE_3 00396 * @arg @ref LL_EXTI_LINE_4 00397 * @arg @ref LL_EXTI_LINE_5 00398 * @arg @ref LL_EXTI_LINE_6 00399 * @arg @ref LL_EXTI_LINE_7 00400 * @arg @ref LL_EXTI_LINE_8 00401 * @arg @ref LL_EXTI_LINE_9 00402 * @arg @ref LL_EXTI_LINE_10 00403 * @arg @ref LL_EXTI_LINE_11 00404 * @arg @ref LL_EXTI_LINE_12 00405 * @arg @ref LL_EXTI_LINE_13 00406 * @arg @ref LL_EXTI_LINE_14 00407 * @arg @ref LL_EXTI_LINE_15 00408 * @arg @ref LL_EXTI_LINE_16 00409 * @arg @ref LL_EXTI_LINE_17 00410 * @arg @ref LL_EXTI_LINE_18 00411 * @arg @ref LL_EXTI_LINE_19 00412 * @arg @ref LL_EXTI_LINE_ALL_0_31 00413 * @note Please check each device line mapping for EXTI Line availability 00414 * @retval None 00415 */ 00416 __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) 00417 { 00418 CLEAR_BIT(EXTI->EMR, ExtiLine); 00419 } 00420 00421 00422 /** 00423 * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31 00424 * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31 00425 * @param ExtiLine This parameter can be one of the following values: 00426 * @arg @ref LL_EXTI_LINE_0 00427 * @arg @ref LL_EXTI_LINE_1 00428 * @arg @ref LL_EXTI_LINE_2 00429 * @arg @ref LL_EXTI_LINE_3 00430 * @arg @ref LL_EXTI_LINE_4 00431 * @arg @ref LL_EXTI_LINE_5 00432 * @arg @ref LL_EXTI_LINE_6 00433 * @arg @ref LL_EXTI_LINE_7 00434 * @arg @ref LL_EXTI_LINE_8 00435 * @arg @ref LL_EXTI_LINE_9 00436 * @arg @ref LL_EXTI_LINE_10 00437 * @arg @ref LL_EXTI_LINE_11 00438 * @arg @ref LL_EXTI_LINE_12 00439 * @arg @ref LL_EXTI_LINE_13 00440 * @arg @ref LL_EXTI_LINE_14 00441 * @arg @ref LL_EXTI_LINE_15 00442 * @arg @ref LL_EXTI_LINE_16 00443 * @arg @ref LL_EXTI_LINE_17 00444 * @arg @ref LL_EXTI_LINE_18 00445 * @arg @ref LL_EXTI_LINE_19 00446 * @arg @ref LL_EXTI_LINE_ALL_0_31 00447 * @note Please check each device line mapping for EXTI Line availability 00448 * @retval State of bit (1 or 0). 00449 */ 00450 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) 00451 { 00452 return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine)); 00453 00454 } 00455 00456 00457 /** 00458 * @} 00459 */ 00460 00461 /** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management 00462 * @{ 00463 */ 00464 00465 /** 00466 * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 00467 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00468 * generated on these lines. If a rising edge on a configurable interrupt 00469 * line occurs during a write operation in the EXTI_RTSR register, the 00470 * pending bit is not set. 00471 * Rising and falling edge triggers can be set for 00472 * the same interrupt line. In this case, both generate a trigger 00473 * condition. 00474 * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31 00475 * @param ExtiLine This parameter can be a combination of the following values: 00476 * @arg @ref LL_EXTI_LINE_0 00477 * @arg @ref LL_EXTI_LINE_1 00478 * @arg @ref LL_EXTI_LINE_2 00479 * @arg @ref LL_EXTI_LINE_3 00480 * @arg @ref LL_EXTI_LINE_4 00481 * @arg @ref LL_EXTI_LINE_5 00482 * @arg @ref LL_EXTI_LINE_6 00483 * @arg @ref LL_EXTI_LINE_7 00484 * @arg @ref LL_EXTI_LINE_8 00485 * @arg @ref LL_EXTI_LINE_9 00486 * @arg @ref LL_EXTI_LINE_10 00487 * @arg @ref LL_EXTI_LINE_11 00488 * @arg @ref LL_EXTI_LINE_12 00489 * @arg @ref LL_EXTI_LINE_13 00490 * @arg @ref LL_EXTI_LINE_14 00491 * @arg @ref LL_EXTI_LINE_15 00492 * @arg @ref LL_EXTI_LINE_16 00493 * @arg @ref LL_EXTI_LINE_18 00494 * @arg @ref LL_EXTI_LINE_19 00495 * @note Please check each device line mapping for EXTI Line availability 00496 * @retval None 00497 */ 00498 __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine) 00499 { 00500 SET_BIT(EXTI->RTSR, ExtiLine); 00501 00502 } 00503 00504 00505 /** 00506 * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 00507 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00508 * generated on these lines. If a rising edge on a configurable interrupt 00509 * line occurs during a write operation in the EXTI_RTSR register, the 00510 * pending bit is not set. 00511 * Rising and falling edge triggers can be set for 00512 * the same interrupt line. In this case, both generate a trigger 00513 * condition. 00514 * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31 00515 * @param ExtiLine This parameter can be a combination of the following values: 00516 * @arg @ref LL_EXTI_LINE_0 00517 * @arg @ref LL_EXTI_LINE_1 00518 * @arg @ref LL_EXTI_LINE_2 00519 * @arg @ref LL_EXTI_LINE_3 00520 * @arg @ref LL_EXTI_LINE_4 00521 * @arg @ref LL_EXTI_LINE_5 00522 * @arg @ref LL_EXTI_LINE_6 00523 * @arg @ref LL_EXTI_LINE_7 00524 * @arg @ref LL_EXTI_LINE_8 00525 * @arg @ref LL_EXTI_LINE_9 00526 * @arg @ref LL_EXTI_LINE_10 00527 * @arg @ref LL_EXTI_LINE_11 00528 * @arg @ref LL_EXTI_LINE_12 00529 * @arg @ref LL_EXTI_LINE_13 00530 * @arg @ref LL_EXTI_LINE_14 00531 * @arg @ref LL_EXTI_LINE_15 00532 * @arg @ref LL_EXTI_LINE_16 00533 * @arg @ref LL_EXTI_LINE_18 00534 * @arg @ref LL_EXTI_LINE_19 00535 * @note Please check each device line mapping for EXTI Line availability 00536 * @retval None 00537 */ 00538 __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine) 00539 { 00540 CLEAR_BIT(EXTI->RTSR, ExtiLine); 00541 00542 } 00543 00544 00545 /** 00546 * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31 00547 * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31 00548 * @param ExtiLine This parameter can be a combination of the following values: 00549 * @arg @ref LL_EXTI_LINE_0 00550 * @arg @ref LL_EXTI_LINE_1 00551 * @arg @ref LL_EXTI_LINE_2 00552 * @arg @ref LL_EXTI_LINE_3 00553 * @arg @ref LL_EXTI_LINE_4 00554 * @arg @ref LL_EXTI_LINE_5 00555 * @arg @ref LL_EXTI_LINE_6 00556 * @arg @ref LL_EXTI_LINE_7 00557 * @arg @ref LL_EXTI_LINE_8 00558 * @arg @ref LL_EXTI_LINE_9 00559 * @arg @ref LL_EXTI_LINE_10 00560 * @arg @ref LL_EXTI_LINE_11 00561 * @arg @ref LL_EXTI_LINE_12 00562 * @arg @ref LL_EXTI_LINE_13 00563 * @arg @ref LL_EXTI_LINE_14 00564 * @arg @ref LL_EXTI_LINE_15 00565 * @arg @ref LL_EXTI_LINE_16 00566 * @arg @ref LL_EXTI_LINE_18 00567 * @arg @ref LL_EXTI_LINE_19 00568 * @note Please check each device line mapping for EXTI Line availability 00569 * @retval State of bit (1 or 0). 00570 */ 00571 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine) 00572 { 00573 return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine)); 00574 } 00575 00576 00577 /** 00578 * @} 00579 */ 00580 00581 /** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management 00582 * @{ 00583 */ 00584 00585 /** 00586 * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 00587 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00588 * generated on these lines. If a falling edge on a configurable interrupt 00589 * line occurs during a write operation in the EXTI_FTSR register, the 00590 * pending bit is not set. 00591 * Rising and falling edge triggers can be set for 00592 * the same interrupt line. In this case, both generate a trigger 00593 * condition. 00594 * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_0_31 00595 * @param ExtiLine This parameter can be a combination of the following values: 00596 * @arg @ref LL_EXTI_LINE_0 00597 * @arg @ref LL_EXTI_LINE_1 00598 * @arg @ref LL_EXTI_LINE_2 00599 * @arg @ref LL_EXTI_LINE_3 00600 * @arg @ref LL_EXTI_LINE_4 00601 * @arg @ref LL_EXTI_LINE_5 00602 * @arg @ref LL_EXTI_LINE_6 00603 * @arg @ref LL_EXTI_LINE_7 00604 * @arg @ref LL_EXTI_LINE_8 00605 * @arg @ref LL_EXTI_LINE_9 00606 * @arg @ref LL_EXTI_LINE_10 00607 * @arg @ref LL_EXTI_LINE_11 00608 * @arg @ref LL_EXTI_LINE_12 00609 * @arg @ref LL_EXTI_LINE_13 00610 * @arg @ref LL_EXTI_LINE_14 00611 * @arg @ref LL_EXTI_LINE_15 00612 * @arg @ref LL_EXTI_LINE_16 00613 * @arg @ref LL_EXTI_LINE_18 00614 * @arg @ref LL_EXTI_LINE_19 00615 * @note Please check each device line mapping for EXTI Line availability 00616 * @retval None 00617 */ 00618 __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine) 00619 { 00620 SET_BIT(EXTI->FTSR, ExtiLine); 00621 } 00622 00623 00624 /** 00625 * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 00626 * @note The configurable wakeup lines are edge-triggered. No glitch must be 00627 * generated on these lines. If a Falling edge on a configurable interrupt 00628 * line occurs during a write operation in the EXTI_FTSR register, the 00629 * pending bit is not set. 00630 * Rising and falling edge triggers can be set for the same interrupt line. 00631 * In this case, both generate a trigger condition. 00632 * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31 00633 * @param ExtiLine This parameter can be a combination of the following values: 00634 * @arg @ref LL_EXTI_LINE_0 00635 * @arg @ref LL_EXTI_LINE_1 00636 * @arg @ref LL_EXTI_LINE_2 00637 * @arg @ref LL_EXTI_LINE_3 00638 * @arg @ref LL_EXTI_LINE_4 00639 * @arg @ref LL_EXTI_LINE_5 00640 * @arg @ref LL_EXTI_LINE_6 00641 * @arg @ref LL_EXTI_LINE_7 00642 * @arg @ref LL_EXTI_LINE_8 00643 * @arg @ref LL_EXTI_LINE_9 00644 * @arg @ref LL_EXTI_LINE_10 00645 * @arg @ref LL_EXTI_LINE_11 00646 * @arg @ref LL_EXTI_LINE_12 00647 * @arg @ref LL_EXTI_LINE_13 00648 * @arg @ref LL_EXTI_LINE_14 00649 * @arg @ref LL_EXTI_LINE_15 00650 * @arg @ref LL_EXTI_LINE_16 00651 * @arg @ref LL_EXTI_LINE_18 00652 * @arg @ref LL_EXTI_LINE_19 00653 * @note Please check each device line mapping for EXTI Line availability 00654 * @retval None 00655 */ 00656 __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine) 00657 { 00658 CLEAR_BIT(EXTI->FTSR, ExtiLine); 00659 } 00660 00661 00662 /** 00663 * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31 00664 * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31 00665 * @param ExtiLine This parameter can be a combination of the following values: 00666 * @arg @ref LL_EXTI_LINE_0 00667 * @arg @ref LL_EXTI_LINE_1 00668 * @arg @ref LL_EXTI_LINE_2 00669 * @arg @ref LL_EXTI_LINE_3 00670 * @arg @ref LL_EXTI_LINE_4 00671 * @arg @ref LL_EXTI_LINE_5 00672 * @arg @ref LL_EXTI_LINE_6 00673 * @arg @ref LL_EXTI_LINE_7 00674 * @arg @ref LL_EXTI_LINE_8 00675 * @arg @ref LL_EXTI_LINE_9 00676 * @arg @ref LL_EXTI_LINE_10 00677 * @arg @ref LL_EXTI_LINE_11 00678 * @arg @ref LL_EXTI_LINE_12 00679 * @arg @ref LL_EXTI_LINE_13 00680 * @arg @ref LL_EXTI_LINE_14 00681 * @arg @ref LL_EXTI_LINE_15 00682 * @arg @ref LL_EXTI_LINE_16 00683 * @arg @ref LL_EXTI_LINE_18 00684 * @arg @ref LL_EXTI_LINE_19 00685 * @note Please check each device line mapping for EXTI Line availability 00686 * @retval State of bit (1 or 0). 00687 */ 00688 __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine) 00689 { 00690 return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine)); 00691 } 00692 00693 00694 /** 00695 * @} 00696 */ 00697 00698 /** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management 00699 * @{ 00700 */ 00701 00702 /** 00703 * @brief Generate a software Interrupt Event for Lines in range 0 to 31 00704 * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to 00705 * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR 00706 * resulting in an interrupt request generation. 00707 * This bit is cleared by clearing the corresponding bit in the EXTI_PR 00708 * register (by writing a 1 into the bit) 00709 * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31 00710 * @param ExtiLine This parameter can be a combination of the following values: 00711 * @arg @ref LL_EXTI_LINE_0 00712 * @arg @ref LL_EXTI_LINE_1 00713 * @arg @ref LL_EXTI_LINE_2 00714 * @arg @ref LL_EXTI_LINE_3 00715 * @arg @ref LL_EXTI_LINE_4 00716 * @arg @ref LL_EXTI_LINE_5 00717 * @arg @ref LL_EXTI_LINE_6 00718 * @arg @ref LL_EXTI_LINE_7 00719 * @arg @ref LL_EXTI_LINE_8 00720 * @arg @ref LL_EXTI_LINE_9 00721 * @arg @ref LL_EXTI_LINE_10 00722 * @arg @ref LL_EXTI_LINE_11 00723 * @arg @ref LL_EXTI_LINE_12 00724 * @arg @ref LL_EXTI_LINE_13 00725 * @arg @ref LL_EXTI_LINE_14 00726 * @arg @ref LL_EXTI_LINE_15 00727 * @arg @ref LL_EXTI_LINE_16 00728 * @arg @ref LL_EXTI_LINE_18 00729 * @arg @ref LL_EXTI_LINE_19 00730 * @note Please check each device line mapping for EXTI Line availability 00731 * @retval None 00732 */ 00733 __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine) 00734 { 00735 SET_BIT(EXTI->SWIER, ExtiLine); 00736 } 00737 00738 00739 /** 00740 * @} 00741 */ 00742 00743 /** @defgroup EXTI_LL_EF_Flag_Management Flag_Management 00744 * @{ 00745 */ 00746 00747 /** 00748 * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31 00749 * @note This bit is set when the selected edge event arrives on the interrupt 00750 * line. This bit is cleared by writing a 1 to the bit. 00751 * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_0_31 00752 * @param ExtiLine This parameter can be a combination of the following values: 00753 * @arg @ref LL_EXTI_LINE_0 00754 * @arg @ref LL_EXTI_LINE_1 00755 * @arg @ref LL_EXTI_LINE_2 00756 * @arg @ref LL_EXTI_LINE_3 00757 * @arg @ref LL_EXTI_LINE_4 00758 * @arg @ref LL_EXTI_LINE_5 00759 * @arg @ref LL_EXTI_LINE_6 00760 * @arg @ref LL_EXTI_LINE_7 00761 * @arg @ref LL_EXTI_LINE_8 00762 * @arg @ref LL_EXTI_LINE_9 00763 * @arg @ref LL_EXTI_LINE_10 00764 * @arg @ref LL_EXTI_LINE_11 00765 * @arg @ref LL_EXTI_LINE_12 00766 * @arg @ref LL_EXTI_LINE_13 00767 * @arg @ref LL_EXTI_LINE_14 00768 * @arg @ref LL_EXTI_LINE_15 00769 * @arg @ref LL_EXTI_LINE_16 00770 * @arg @ref LL_EXTI_LINE_18 00771 * @arg @ref LL_EXTI_LINE_19 00772 * @note Please check each device line mapping for EXTI Line availability 00773 * @retval State of bit (1 or 0). 00774 */ 00775 __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine) 00776 { 00777 return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine)); 00778 } 00779 00780 00781 /** 00782 * @brief Read ExtLine Combination Flag for Lines in range 0 to 31 00783 * @note This bit is set when the selected edge event arrives on the interrupt 00784 * line. This bit is cleared by writing a 1 to the bit. 00785 * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31 00786 * @param ExtiLine This parameter can be a combination of the following values: 00787 * @arg @ref LL_EXTI_LINE_0 00788 * @arg @ref LL_EXTI_LINE_1 00789 * @arg @ref LL_EXTI_LINE_2 00790 * @arg @ref LL_EXTI_LINE_3 00791 * @arg @ref LL_EXTI_LINE_4 00792 * @arg @ref LL_EXTI_LINE_5 00793 * @arg @ref LL_EXTI_LINE_6 00794 * @arg @ref LL_EXTI_LINE_7 00795 * @arg @ref LL_EXTI_LINE_8 00796 * @arg @ref LL_EXTI_LINE_9 00797 * @arg @ref LL_EXTI_LINE_10 00798 * @arg @ref LL_EXTI_LINE_11 00799 * @arg @ref LL_EXTI_LINE_12 00800 * @arg @ref LL_EXTI_LINE_13 00801 * @arg @ref LL_EXTI_LINE_14 00802 * @arg @ref LL_EXTI_LINE_15 00803 * @arg @ref LL_EXTI_LINE_16 00804 * @arg @ref LL_EXTI_LINE_18 00805 * @arg @ref LL_EXTI_LINE_19 00806 * @note Please check each device line mapping for EXTI Line availability 00807 * @retval @note This bit is set when the selected edge event arrives on the interrupt 00808 */ 00809 __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine) 00810 { 00811 return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine)); 00812 } 00813 00814 00815 /** 00816 * @brief Clear ExtLine Flags for Lines in range 0 to 31 00817 * @note This bit is set when the selected edge event arrives on the interrupt 00818 * line. This bit is cleared by writing a 1 to the bit. 00819 * @rmtoll PR PIFx LL_EXTI_ClearFlag_0_31 00820 * @param ExtiLine This parameter can be a combination of the following values: 00821 * @arg @ref LL_EXTI_LINE_0 00822 * @arg @ref LL_EXTI_LINE_1 00823 * @arg @ref LL_EXTI_LINE_2 00824 * @arg @ref LL_EXTI_LINE_3 00825 * @arg @ref LL_EXTI_LINE_4 00826 * @arg @ref LL_EXTI_LINE_5 00827 * @arg @ref LL_EXTI_LINE_6 00828 * @arg @ref LL_EXTI_LINE_7 00829 * @arg @ref LL_EXTI_LINE_8 00830 * @arg @ref LL_EXTI_LINE_9 00831 * @arg @ref LL_EXTI_LINE_10 00832 * @arg @ref LL_EXTI_LINE_11 00833 * @arg @ref LL_EXTI_LINE_12 00834 * @arg @ref LL_EXTI_LINE_13 00835 * @arg @ref LL_EXTI_LINE_14 00836 * @arg @ref LL_EXTI_LINE_15 00837 * @arg @ref LL_EXTI_LINE_16 00838 * @arg @ref LL_EXTI_LINE_18 00839 * @arg @ref LL_EXTI_LINE_19 00840 * @note Please check each device line mapping for EXTI Line availability 00841 * @retval None 00842 */ 00843 __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine) 00844 { 00845 WRITE_REG(EXTI->PR, ExtiLine); 00846 } 00847 00848 00849 /** 00850 * @} 00851 */ 00852 00853 #if defined(USE_FULL_LL_DRIVER) 00854 /** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions 00855 * @{ 00856 */ 00857 00858 uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct); 00859 uint32_t LL_EXTI_DeInit(void); 00860 void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct); 00861 00862 00863 /** 00864 * @} 00865 */ 00866 #endif /* USE_FULL_LL_DRIVER */ 00867 00868 /** 00869 * @} 00870 */ 00871 00872 /** 00873 * @} 00874 */ 00875 00876 #endif /* EXTI */ 00877 00878 /** 00879 * @} 00880 */ 00881 00882 #ifdef __cplusplus 00883 } 00884 #endif 00885 00886 #endif /* STM32F1xx_LL_EXTI_H */ 00887 00888 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/