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.
 
 
 

969 lines
34 KiB

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