Projet voilier 4IRA1 Arnaud Vergnet Marino Benassai Bastien Picco Yohan Simard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stm32f1xx_ll_exti.h 31KB

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