stm32f7xx_ll_exti.h 34 KB

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