2 ******************************************************************************
\r
3 * @file stm32f7xx_hal_exti.h
\r
4 * @author MCD Application Team
\r
5 * @brief Header file of EXTI HAL module.
\r
6 ******************************************************************************
\r
9 * <h2><center>© Copyright (c) 2018 STMicroelectronics.
\r
10 * All rights reserved.</center></h2>
\r
12 * This software component is licensed by ST under BSD 3-Clause license,
\r
13 * the "License"; You may not use this file except in compliance with the
\r
14 * License. You may obtain a copy of the License at:
\r
15 * opensource.org/licenses/BSD-3-Clause
\r
17 ******************************************************************************
\r
20 /* Define to prevent recursive inclusion -------------------------------------*/
\r
21 #ifndef __STM32F7xx_HAL_EXTI_H
\r
22 #define __STM32F7xx_HAL_EXTI_H
\r
28 /* Includes ------------------------------------------------------------------*/
\r
29 #include "stm32f7xx_hal_def.h"
\r
31 /** @addtogroup STM32F7xx_HAL_Driver
\r
35 /** @defgroup EXTI EXTI
\r
36 * @brief EXTI HAL module driver
\r
40 /* Exported types ------------------------------------------------------------*/
\r
41 /** @defgroup EXTI_Exported_Types EXTI Exported Types
\r
46 HAL_EXTI_COMMON_CB_ID = 0x00U,
\r
47 HAL_EXTI_RISING_CB_ID = 0x01U,
\r
48 HAL_EXTI_FALLING_CB_ID = 0x02U,
\r
49 } EXTI_CallbackIDTypeDef;
\r
52 * @brief EXTI Handle structure definition
\r
56 uint32_t Line; /*!< Exti line number */
\r
57 void (* PendingCallback)(void); /*!< Exti pending callback */
\r
58 } EXTI_HandleTypeDef;
\r
61 * @brief EXTI Configuration structure definition
\r
65 uint32_t Line; /*!< The Exti line to be configured. This parameter
\r
66 can be a value of @ref EXTI_Line */
\r
67 uint32_t Mode; /*!< The Exit Mode to be configured for a core.
\r
68 This parameter can be a combination of @ref EXTI_Mode */
\r
69 uint32_t Trigger; /*!< The Exti Trigger to be configured. This parameter
\r
70 can be a value of @ref EXTI_Trigger */
\r
71 } EXTI_ConfigTypeDef;
\r
77 /* Exported constants --------------------------------------------------------*/
\r
78 /** @defgroup EXTI_Exported_Constants EXTI Exported Constants
\r
82 /** @defgroup EXTI_Line EXTI Line
\r
85 #define EXTI_LINE_0 EXTI_IMR_IM0 /*!< External interrupt line 0 */
\r
86 #define EXTI_LINE_1 EXTI_IMR_IM1 /*!< External interrupt line 1 */
\r
87 #define EXTI_LINE_2 EXTI_IMR_IM2 /*!< External interrupt line 2 */
\r
88 #define EXTI_LINE_3 EXTI_IMR_IM3 /*!< External interrupt line 3 */
\r
89 #define EXTI_LINE_4 EXTI_IMR_IM4 /*!< External interrupt line 4 */
\r
90 #define EXTI_LINE_5 EXTI_IMR_IM5 /*!< External interrupt line 5 */
\r
91 #define EXTI_LINE_6 EXTI_IMR_IM6 /*!< External interrupt line 6 */
\r
92 #define EXTI_LINE_7 EXTI_IMR_IM7 /*!< External interrupt line 7 */
\r
93 #define EXTI_LINE_8 EXTI_IMR_IM8 /*!< External interrupt line 8 */
\r
94 #define EXTI_LINE_9 EXTI_IMR_IM9 /*!< External interrupt line 9 */
\r
95 #define EXTI_LINE_10 EXTI_IMR_IM10 /*!< External interrupt line 10 */
\r
96 #define EXTI_LINE_11 EXTI_IMR_IM11 /*!< External interrupt line 11 */
\r
97 #define EXTI_LINE_12 EXTI_IMR_IM12 /*!< External interrupt line 12 */
\r
98 #define EXTI_LINE_13 EXTI_IMR_IM13 /*!< External interrupt line 13 */
\r
99 #define EXTI_LINE_14 EXTI_IMR_IM14 /*!< External interrupt line 14 */
\r
100 #define EXTI_LINE_15 EXTI_IMR_IM15 /*!< External interrupt line 15 */
\r
101 #if defined(EXTI_IMR_IM16)
\r
102 #define EXTI_LINE_16 EXTI_IMR_IM16 /*!< External interrupt line 16 Connected to the PVD Output */
\r
103 #endif /* EXTI_IMR_IM16 */
\r
104 #if defined(EXTI_IMR_IM17)
\r
105 #define EXTI_LINE_17 EXTI_IMR_IM17 /*!< External interrupt line 17 Connected to the RTC Alarm event */
\r
106 #endif /* EXTI_IMR_IM17 */
\r
107 #if defined(EXTI_IMR_IM18)
\r
108 #define EXTI_LINE_18 EXTI_IMR_IM18 /*!< External interrupt line 18 Connected to the USB OTG FS Wakeup from suspend event */
\r
109 #endif /* EXTI_IMR_IM18 */
\r
110 #if defined(EXTI_IMR_IM19)
\r
111 #define EXTI_LINE_19 EXTI_IMR_IM19 /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */
\r
112 #endif /* EXTI_IMR_IM19 */
\r
113 #if defined(EXTI_IMR_IM20)
\r
114 #define EXTI_LINE_20 EXTI_IMR_IM20 /*!< External interrupt line 20 Connected to the USB OTG HS (configured in FS) Wakeup event */
\r
115 #endif /* EXTI_IMR_IM20 */
\r
116 #if defined(EXTI_IMR_IM21)
\r
117 #define EXTI_LINE_21 EXTI_IMR_IM21 /*!< External interrupt line 21 Connected to the RTC Tamper and Time Stamp events */
\r
118 #endif /* EXTI_IMR_IM21 */
\r
119 #if defined(EXTI_IMR_IM22)
\r
120 #define EXTI_LINE_22 EXTI_IMR_IM22 /*!< External interrupt line 22 Connected to the RTC Wakeup event */
\r
121 #endif /* EXTI_IMR_IM22 */
\r
122 #if defined(EXTI_IMR_IM23)
\r
123 #define EXTI_LINE_23 EXTI_IMR_IM23 /*!< External interrupt line 23 Connected to the LPTIM Wakeup event */
\r
124 #endif /* EXTI_IMR_IM23 */
\r
125 #if defined(EXTI_IMR_IM24)
\r
126 #define EXTI_LINE_24 EXTI_IMR_IM24 /*!< External interrupt line 24 Connected to the MDIO Slave global Interrupt Wakeup event */
\r
127 #endif /* EXTI_IMR_IM24 */
\r
132 /** @defgroup EXTI_Mode EXTI Mode
\r
135 #define EXTI_MODE_NONE 0x00000000u
\r
136 #define EXTI_MODE_INTERRUPT 0x00000001u
\r
137 #define EXTI_MODE_EVENT 0x00000002u
\r
142 /** @defgroup EXTI_Trigger EXTI Trigger
\r
145 #define EXTI_TRIGGER_NONE 0x00000000u
\r
146 #define EXTI_TRIGGER_RISING 0x00000001u
\r
147 #define EXTI_TRIGGER_FALLING 0x00000002u
\r
148 #define EXTI_TRIGGER_RISING_FALLING (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
\r
157 /* Exported macro ------------------------------------------------------------*/
\r
158 /** @defgroup EXTI_Exported_Macros EXTI Exported Macros
\r
166 /* Private constants --------------------------------------------------------*/
\r
167 /** @defgroup EXTI_Private_Constants EXTI Private Constants
\r
171 * @brief EXTI Mask for interrupt & event mode
\r
173 #define EXTI_MODE_MASK (EXTI_MODE_EVENT | EXTI_MODE_INTERRUPT)
\r
176 * @brief EXTI Mask for trigger possibilities
\r
178 #define EXTI_TRIGGER_MASK (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING | EXTI_TRIGGER_RISING_FALLING)
\r
181 * @brief EXTI Line number
\r
183 #define EXTI_LINE_NB 25u
\r
189 /* Private macros ------------------------------------------------------------*/
\r
190 /** @defgroup EXTI_Private_Macros EXTI Private Macros
\r
193 #define IS_EXTI_LINE(__LINE__) ((((__LINE__) & ~EXTI_IMR_IM) == 0x00U) && (__LINE__))
\r
195 #define IS_EXTI_MODE(__LINE__) ((((__LINE__) & ~EXTI_MODE_MASK) == 0x00U))
\r
197 #define IS_EXTI_TRIGGER(__LINE__) (((__LINE__) & ~EXTI_TRIGGER_MASK) == 0x00U)
\r
199 #define IS_EXTI_PENDING_EDGE(__LINE__) (((__LINE__) == EXTI_TRIGGER_FALLING) || \
\r
200 ((__LINE__) == EXTI_TRIGGER_RISING) || \
\r
201 ((__LINE__) == EXTI_TRIGGER_RISING_FALLING))
\r
203 #define IS_EXTI_GPIO_PIN(__PIN__) ((__PIN__) < 16U)
\r
208 /* Exported functions --------------------------------------------------------*/
\r
209 /** @defgroup EXTI_Exported_Functions EXTI Exported Functions
\r
210 * @brief EXTI Exported Functions
\r
214 /** @defgroup EXTI_Exported_Functions_Group1 Configuration functions
\r
215 * @brief Configuration functions
\r
218 /* Configuration functions ****************************************************/
\r
219 HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
\r
220 HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
\r
221 HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti);
\r
222 HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void));
\r
223 HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine);
\r
228 /** @defgroup EXTI_Exported_Functions_Group2 IO operation functions
\r
229 * @brief IO operation functions
\r
232 /* IO operation functions *****************************************************/
\r
233 void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti);
\r
234 uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
\r
235 void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
\r
236 void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti);
\r
258 #endif /* __STM32F7xx_HAL_EXTI_H */
\r
260 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r