Set blackbox file handler to NULL after closing file
[inav.git] / lib / main / STM32H7 / Drivers / STM32H7xx_HAL_Driver / Inc / stm32h7xx_hal_exti.h
blob94a6ea30c763dd484430d144c06b8ec21f1fc5a7
1 /**
2 ******************************************************************************
3 * @file stm32h7xx_hal_exti.h
4 * @author MCD Application Team
5 * @brief Header file of EXTI HAL module.
6 ******************************************************************************
7 * @attention
9 * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
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
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_HAL_EXTI_H
22 #define STM32H7xx_HAL_EXTI_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx_hal_def.h"
31 /** @addtogroup STM32H7xx_HAL_Driver
32 * @{
35 /** @defgroup EXTI EXTI
36 * @brief EXTI HAL module driver
37 * @{
40 /* Exported types ------------------------------------------------------------*/
42 /** @defgroup EXTI_Exported_Types EXTI Exported Types
43 * @{
45 typedef enum
47 HAL_EXTI_COMMON_CB_ID = 0x00U,
48 } EXTI_CallbackIDTypeDef;
51 /**
52 * @brief EXTI Handle structure definition
54 typedef struct
56 uint32_t Line; /*!< Exti line number */
57 void (* PendingCallback)(void); /*!< Exti pending callback */
58 } EXTI_HandleTypeDef;
60 /**
61 * @brief EXTI Configuration structure definition
63 typedef struct
65 uint32_t Line; /*!< The Exti line to be configured. This parameter
66 can be a value of @ref EXTI_Line */
67 uint32_t Mode; /*!< The Exit Mode to be configured for a core.
68 This parameter can be a combination of @ref EXTI_Mode */
69 uint32_t Trigger; /*!< The Exti Trigger to be configured. This parameter
70 can be a value of @ref EXTI_Trigger */
71 uint32_t GPIOSel; /*!< The Exti GPIO multiplexer selection to be configured.
72 This parameter is only possible for line 0 to 15. It
73 can be a value of @ref EXTI_GPIOSel */
75 uint32_t PendClearSource; /*!< Specifies the event pending clear source for D3/SRD
76 domain. This parameter can be a value of @ref
77 EXTI_PendClear_Source */
79 } EXTI_ConfigTypeDef;
81 /**
82 * @}
85 /* Exported constants --------------------------------------------------------*/
86 /** @defgroup EXTI_Exported_Constants EXTI Exported Constants
87 * @{
90 /** @defgroup EXTI_Line EXTI Line
91 * @{
93 #define EXTI_LINE_0 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x00U)
94 #define EXTI_LINE_1 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x01U)
95 #define EXTI_LINE_2 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x02U)
96 #define EXTI_LINE_3 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x03U)
97 #define EXTI_LINE_4 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x04U)
98 #define EXTI_LINE_5 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x05U)
99 #define EXTI_LINE_6 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x06U)
100 #define EXTI_LINE_7 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x07U)
101 #define EXTI_LINE_8 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x08U)
102 #define EXTI_LINE_9 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x09U)
103 #define EXTI_LINE_10 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0AU)
104 #define EXTI_LINE_11 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0BU)
105 #define EXTI_LINE_12 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0CU)
106 #define EXTI_LINE_13 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0DU)
107 #define EXTI_LINE_14 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0EU)
108 #define EXTI_LINE_15 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x0FU)
109 #define EXTI_LINE_16 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x10U)
110 #define EXTI_LINE_17 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x11U)
111 #define EXTI_LINE_18 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x12U)
112 #define EXTI_LINE_19 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x13U)
113 #define EXTI_LINE_20 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x14U)
114 #define EXTI_LINE_21 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x15U)
115 #define EXTI_LINE_22 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x16U)
116 #define EXTI_LINE_23 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x17U)
117 #define EXTI_LINE_24 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x18U)
118 #define EXTI_LINE_25 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL | 0x19U)
119 #define EXTI_LINE_26 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1AU)
120 #define EXTI_LINE_27 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1BU)
121 #define EXTI_LINE_28 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1CU)
122 #define EXTI_LINE_29 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1DU)
123 #define EXTI_LINE_30 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1EU)
124 #define EXTI_LINE_31 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG1 | EXTI_TARGET_MSK_ALL_CPU | 0x1FU)
125 #define EXTI_LINE_32 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x00U)
126 #define EXTI_LINE_33 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x01U)
127 #define EXTI_LINE_34 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x02U)
128 #define EXTI_LINE_35 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x03U)
129 #define EXTI_LINE_36 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x04U)
130 #define EXTI_LINE_37 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x05U)
131 #define EXTI_LINE_38 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x06U)
132 #define EXTI_LINE_39 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x07U)
133 #define EXTI_LINE_40 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x08U)
134 #define EXTI_LINE_41 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x09U)
135 #define EXTI_LINE_42 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x0AU)
136 #define EXTI_LINE_43 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x0BU)
137 #if !defined(USB2_OTG_FS)
138 #define EXTI_LINE_44 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_NONE | 0x0CU)
139 #else
140 #define EXTI_LINE_44 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x0CU)
141 #endif /* USB2_OTG_FS */
142 #define EXTI_LINE_45 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_NONE | 0x0DU)
143 #if defined(DSI)
144 #define EXTI_LINE_46 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x0EU)
145 #else
146 #define EXTI_LINE_46 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_NONE | 0x0EU)
147 #endif /* DSI */
148 #define EXTI_LINE_47 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x0FU)
149 #define EXTI_LINE_48 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x10U)
150 #define EXTI_LINE_49 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x11U)
151 #define EXTI_LINE_50 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x12U)
152 #define EXTI_LINE_51 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x13U)
153 #if !defined(UART9)
154 #define EXTI_LINE_52 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x14U)
155 #else
156 #define EXTI_LINE_52 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x14U)
157 #endif /* UART9 */
158 #if !defined(USART10)
159 #define EXTI_LINE_53 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL | 0x15U)
160 #else
161 #define EXTI_LINE_53 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x15U)
162 #endif /* USART10 */
163 #define EXTI_LINE_54 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x16U)
164 #define EXTI_LINE_55 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x17U)
165 #define EXTI_LINE_56 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x18U)
166 #define EXTI_LINE_57 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x19U)
167 #define EXTI_LINE_58 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1AU)
168 #define EXTI_LINE_59 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1BU)
169 #define EXTI_LINE_60 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1CU)
170 #define EXTI_LINE_61 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1DU)
171 #define EXTI_LINE_62 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1EU)
172 #define EXTI_LINE_63 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG2 | EXTI_TARGET_MSK_ALL_CPU | 0x1FU)
173 #define EXTI_LINE_64 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x00U)
174 #define EXTI_LINE_65 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x01U)
175 #define EXTI_LINE_66 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x02U)
176 #define EXTI_LINE_67 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x03U)
177 #define EXTI_LINE_68 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x04U)
178 #define EXTI_LINE_69 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x05U)
179 #define EXTI_LINE_70 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x06U)
180 #define EXTI_LINE_71 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x07U)
181 #define EXTI_LINE_72 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x08U)
182 #define EXTI_LINE_73 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x09U)
183 #define EXTI_LINE_74 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x0AU)
184 #if defined(ADC3)
185 #define EXTI_LINE_75 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x0BU)
186 #else
187 #define EXTI_LINE_75 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE | 0x0BU)
188 #endif /* ADC3 */
189 #if defined(SAI4)
190 #define EXTI_LINE_76 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x0CU)
191 #else
192 #define EXTI_LINE_76 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE | 0x0CU)
193 #endif /* SAI4 */
194 #if defined (DUAL_CORE)
195 #define EXTI_LINE_77 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU1| 0x0DU)
196 #define EXTI_LINE_78 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU2| 0x0EU)
197 #define EXTI_LINE_79 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU1| 0x0FU)
198 #define EXTI_LINE_80 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU2| 0x10U)
199 #else
200 #define EXTI_LINE_77 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x0DU)
201 #define EXTI_LINE_78 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x0EU)
202 #define EXTI_LINE_79 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x0FU)
203 #define EXTI_LINE_80 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x10U)
204 #endif /* DUAL_CORE */
206 #define EXTI_LINE_81 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x11U)
208 #if defined (DUAL_CORE)
209 #define EXTI_LINE_82 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU2| 0x12U)
210 #else
211 #define EXTI_LINE_82 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x12U)
212 #endif /* DUAL_CORE */
214 #define EXTI_LINE_83 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x13U)
215 #if defined (DUAL_CORE)
216 #define EXTI_LINE_84 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_CPU1| 0x14U)
217 #else
218 #define EXTI_LINE_84 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x14U)
219 #endif /* DUAL_CORE */
220 #define EXTI_LINE_85 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x15U)
221 #if defined(ETH)
222 #define EXTI_LINE_86 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x16U)
223 #else
224 #define EXTI_LINE_86 (EXTI_RESERVED | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_NONE| 0x16U)
225 #endif /* ETH */
226 #define EXTI_LINE_87 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL_CPU | 0x17U)
227 #if defined(DTS)
228 #define EXTI_LINE_88 (EXTI_DIRECT | EXTI_EVENT | EXTI_REG3 | EXTI_TARGET_MSK_ALL | 0x18U)
229 #endif /* DTS */
232 * @}
235 /** @defgroup EXTI_Mode EXTI Mode
236 * @{
238 #define EXTI_MODE_NONE 0x00000000U
239 #define EXTI_MODE_INTERRUPT 0x00000001U
240 #define EXTI_MODE_EVENT 0x00000002U
241 #if defined(DUAL_CORE)
242 #define EXTI_MODE_CORE1_INTERRUPT EXTI_MODE_INTERRUPT
243 #define EXTI_MODE_CORE1_EVENT EXTI_MODE_EVENT
244 #define EXTI_MODE_CORE2_INTERRUPT 0x00000010U
245 #define EXTI_MODE_CORE2_EVENT 0x00000020U
246 #endif /* DUAL_CORE */
248 * @}
251 /** @defgroup EXTI_Trigger EXTI Trigger
252 * @{
254 #define EXTI_TRIGGER_NONE 0x00000000U
255 #define EXTI_TRIGGER_RISING 0x00000001U
256 #define EXTI_TRIGGER_FALLING 0x00000002U
257 #define EXTI_TRIGGER_RISING_FALLING (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
259 * @}
262 /** @defgroup EXTI_GPIOSel EXTI GPIOSel
263 * @brief
264 * @{
266 #define EXTI_GPIOA 0x00000000U
267 #define EXTI_GPIOB 0x00000001U
268 #define EXTI_GPIOC 0x00000002U
269 #define EXTI_GPIOD 0x00000003U
270 #define EXTI_GPIOE 0x00000004U
271 #define EXTI_GPIOF 0x00000005U
272 #define EXTI_GPIOG 0x00000006U
273 #define EXTI_GPIOH 0x00000007U
274 #define EXTI_GPIOI 0x00000008U
275 #define EXTI_GPIOJ 0x00000009U
276 #define EXTI_GPIOK 0x0000000AU
279 * @}
282 /** @defgroup EXTI_PendClear_Source EXTI PendClear Source
283 * @brief
284 * @{
286 #define EXTI_D3_PENDCLR_SRC_NONE 0x00000000U /*!< No D3 domain pendclear source , PMRx register to be set to zero */
287 #define EXTI_D3_PENDCLR_SRC_DMACH6 0x00000001U /*!< DMA ch6 event selected as D3 domain pendclear source, PMRx register to be set to 1 */
288 #define EXTI_D3_PENDCLR_SRC_DMACH7 0x00000002U /*!< DMA ch7 event selected as D3 domain pendclear source, PMRx register to be set to 1*/
289 #if defined (LPTIM4)
290 #define EXTI_D3_PENDCLR_SRC_LPTIM4 0x00000003U /*!< LPTIM4 out selected as D3 domain pendclear source, PMRx register to be set to 1 */
291 #else
292 #define EXTI_D3_PENDCLR_SRC_LPTIM2 0x00000003U /*!< LPTIM2 out selected as D3 domain pendclear source, PMRx register to be set to 1 */
293 #endif
294 #if defined (LPTIM5)
295 #define EXTI_D3_PENDCLR_SRC_LPTIM5 0x00000004U /*!< LPTIM5 out selected as D3 domain pendclear source, PMRx register to be set to 1 */
296 #else
297 #define EXTI_D3_PENDCLR_SRC_LPTIM3 0x00000004U /*!< LPTIM3 out selected as D3 domain pendclear source, PMRx register to be set to 1 */
298 #endif
300 * @}
304 * @}
307 /* Exported macro ------------------------------------------------------------*/
308 /** @defgroup EXTI_Exported_Macros EXTI Exported Macros
309 * @{
313 * @}
316 /* Private constants --------------------------------------------------------*/
317 /** @defgroup EXTI_Private_Constants EXTI Private Constants
318 * @{
321 * @brief EXTI Line property definition
323 #define EXTI_PROPERTY_SHIFT 24U
324 #define EXTI_DIRECT (0x01UL << EXTI_PROPERTY_SHIFT)
325 #define EXTI_CONFIG (0x02UL << EXTI_PROPERTY_SHIFT)
326 #define EXTI_GPIO ((0x04UL << EXTI_PROPERTY_SHIFT) | EXTI_CONFIG)
327 #define EXTI_RESERVED (0x08UL << EXTI_PROPERTY_SHIFT)
328 #define EXTI_PROPERTY_MASK (EXTI_DIRECT | EXTI_CONFIG | EXTI_GPIO)
331 * @brief EXTI Event presence definition
333 #define EXTI_EVENT_PRESENCE_SHIFT 28U
334 #define EXTI_EVENT (0x01UL << EXTI_EVENT_PRESENCE_SHIFT)
335 #define EXTI_EVENT_PRESENCE_MASK (EXTI_EVENT)
338 * @brief EXTI Register and bit usage
340 #define EXTI_REG_SHIFT 16U
341 #define EXTI_REG1 (0x00UL << EXTI_REG_SHIFT)
342 #define EXTI_REG2 (0x01UL << EXTI_REG_SHIFT)
343 #define EXTI_REG3 (0x02UL << EXTI_REG_SHIFT)
344 #define EXTI_REG_MASK (EXTI_REG1 | EXTI_REG2 | EXTI_REG3)
345 #define EXTI_PIN_MASK 0x0000001FUL
348 * @brief EXTI Target and bit usage
350 #define EXTI_TARGET_SHIFT 20U
351 #define EXTI_TARGET_MSK_NONE (0x00UL << EXTI_TARGET_SHIFT)
352 #define EXTI_TARGET_MSK_D3SRD (0x01UL << EXTI_TARGET_SHIFT)
353 #define EXTI_TARGET_MSK_CPU1 (0x02UL << EXTI_TARGET_SHIFT)
354 #if defined (DUAL_CORE)
355 #define EXTI_TARGET_MSK_CPU2 (0x04UL << EXTI_TARGET_SHIFT)
356 #define EXTI_TARGET_MASK (EXTI_TARGET_MSK_D3SRD | EXTI_TARGET_MSK_CPU1 | EXTI_TARGET_MSK_CPU2)
357 #define EXTI_TARGET_MSK_ALL_CPU (EXTI_TARGET_MSK_CPU1 | EXTI_TARGET_MSK_CPU2)
358 #else
359 #define EXTI_TARGET_MASK (EXTI_TARGET_MSK_D3SRD | EXTI_TARGET_MSK_CPU1)
360 #define EXTI_TARGET_MSK_ALL_CPU EXTI_TARGET_MSK_CPU1
361 #endif /* DUAL_CORE */
362 #define EXTI_TARGET_MSK_ALL EXTI_TARGET_MASK
365 * @brief EXTI Mask for interrupt & event mode
367 #if defined (DUAL_CORE)
368 #define EXTI_MODE_MASK (EXTI_MODE_CORE1_EVENT | EXTI_MODE_CORE1_INTERRUPT | EXTI_MODE_CORE2_INTERRUPT | EXTI_MODE_CORE2_EVENT)
369 #else
370 #define EXTI_MODE_MASK (EXTI_MODE_EVENT | EXTI_MODE_INTERRUPT)
371 #endif /* DUAL_CORE */
374 * @brief EXTI Mask for trigger possibilities
376 #define EXTI_TRIGGER_MASK (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
379 * @brief EXTI Line number
381 #if defined (EXTI_LINE_88)
382 #define EXTI_LINE_NB 89UL
383 #else
384 #define EXTI_LINE_NB 88UL
385 #endif /* EXTI_LINE_88 */
388 * @}
391 /* Private macros ------------------------------------------------------------*/
392 /** @defgroup EXTI_Private_Macros EXTI Private Macros
393 * @{
395 #define IS_EXTI_PROPERTY(__LINE__) ((((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_DIRECT) || \
396 (((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_CONFIG) || \
397 (((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_GPIO))
398 #if defined (DUAL_CORE)
399 #define IS_EXTI_TARGET(__LINE__) ((((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_CPU1) || \
400 (((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_CPU2) || \
401 (((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_ALL_CPU) || \
402 (((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_ALL))
403 #else
404 #define IS_EXTI_TARGET(__LINE__) ((((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_CPU1) || \
405 (((__LINE__) & EXTI_TARGET_MASK) == EXTI_TARGET_MSK_ALL))
406 #endif
408 #define IS_EXTI_LINE(__LINE__) ((((__LINE__) & ~(EXTI_PROPERTY_MASK | EXTI_EVENT_PRESENCE_MASK | EXTI_REG_MASK | EXTI_PIN_MASK | EXTI_TARGET_MASK)) == 0x00UL) && \
409 IS_EXTI_PROPERTY(__LINE__) && IS_EXTI_TARGET(__LINE__) && \
410 (((__LINE__) & (EXTI_REG_MASK | EXTI_PIN_MASK)) < \
411 (((EXTI_LINE_NB / 32UL) << EXTI_REG_SHIFT) | (EXTI_LINE_NB % 32UL))))
413 #define IS_EXTI_MODE(__MODE__) (((__MODE__) & ~EXTI_MODE_MASK) == 0x00UL)
415 #define IS_EXTI_TRIGGER(__LINE__) (((__LINE__) & ~EXTI_TRIGGER_MASK) == 0x00UL)
417 #define IS_EXTI_PENDING_EDGE(__LINE__) (((__LINE__) == EXTI_TRIGGER_RISING) || \
418 ((__LINE__) == EXTI_TRIGGER_FALLING)|| \
419 ((__LINE__) == EXTI_TRIGGER_RISING_FALLING))
421 #define IS_EXTI_CONFIG_LINE(__LINE__) (((__LINE__) & EXTI_CONFIG) != 0x00UL)
423 #define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \
424 ((__PORT__) == EXTI_GPIOB) || \
425 ((__PORT__) == EXTI_GPIOC) || \
426 ((__PORT__) == EXTI_GPIOD) || \
427 ((__PORT__) == EXTI_GPIOE) || \
428 ((__PORT__) == EXTI_GPIOF) || \
429 ((__PORT__) == EXTI_GPIOG) || \
430 ((__PORT__) == EXTI_GPIOH) || \
431 ((__PORT__) == EXTI_GPIOI) || \
432 ((__PORT__) == EXTI_GPIOJ) || \
433 ((__PORT__) == EXTI_GPIOK))
435 #define IS_EXTI_GPIO_PIN(__PIN__) ((__PIN__) < 16UL)
436 #if defined (LPTIM4) && defined (LPTIM5)
437 #define IS_EXTI_D3_PENDCLR_SRC(__SRC__) (((__SRC__) == EXTI_D3_PENDCLR_SRC_NONE) || \
438 ((__SRC__) == EXTI_D3_PENDCLR_SRC_DMACH6) || \
439 ((__SRC__) == EXTI_D3_PENDCLR_SRC_DMACH7) || \
440 ((__SRC__) == EXTI_D3_PENDCLR_SRC_LPTIM4) || \
441 ((__SRC__) == EXTI_D3_PENDCLR_SRC_LPTIM5))
442 #else
443 #define IS_EXTI_D3_PENDCLR_SRC(__SRC__) (((__SRC__) == EXTI_D3_PENDCLR_SRC_NONE) || \
444 ((__SRC__) == EXTI_D3_PENDCLR_SRC_DMACH6) || \
445 ((__SRC__) == EXTI_D3_PENDCLR_SRC_DMACH7) || \
446 ((__SRC__) == EXTI_D3_PENDCLR_SRC_LPTIM2) || \
447 ((__SRC__) == EXTI_D3_PENDCLR_SRC_LPTIM3))
448 #endif /* LPTIM4 && LPTIM5 */
451 * @}
455 /* Exported functions --------------------------------------------------------*/
456 /** @defgroup EXTI_Exported_Functions EXTI Exported Functions
457 * @brief EXTI Exported Functions
458 * @{
461 /** @defgroup EXTI_Exported_Functions_Group1 Configuration functions
462 * @brief Configuration functions
463 * @{
465 /* Configuration functions ****************************************************/
466 HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
467 HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
468 HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti);
469 HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void));
470 HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine);
472 * @}
475 /** @defgroup EXTI_Exported_Functions_Group2 IO operation functions
476 * @brief IO operation functions
477 * @{
479 /* IO operation functions *****************************************************/
480 void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti);
481 uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
482 void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
483 void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti);
486 * @}
490 * @}
494 * @}
498 * @}
501 #ifdef __cplusplus
503 #endif
505 #endif /* STM32H7xx_HAL_EXTI_H */
507 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/