1 /**
2   ******************************************************************************
3   * @file    stm32h5xx_hal_gpio_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of GPIO HAL Extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2022 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32H5xx_HAL_GPIO_EX_H
21 #define STM32H5xx_HAL_GPIO_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32h5xx_hal_def.h"
29 
30 /** @addtogroup STM32H5xx_HAL_Driver
31   * @{
32   */
33 
34 /** @defgroup GPIOEx GPIOEx
35   * @brief GPIO Extended HAL module driver
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /* Exported constants --------------------------------------------------------*/
41 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
42   * @{
43   */
44 
45 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
46   * @{
47   */
48 
49 /**
50   * @brief   AF 0 selection
51   */
52 #define GPIO_AF0_RTC_50HZ      ((uint8_t)0x00)  /* RTC_50Hz Alternate Function mapping                       */
53 #define GPIO_AF0_MCO           ((uint8_t)0x00)  /* MCO (MCO1 and MCO2) Alternate Function mapping            */
54 #define GPIO_AF0_SWJ           ((uint8_t)0x00)  /* SWJ (SWD and JTAG) Alternate Function mapping             */
55 #define GPIO_AF0_TRACE         ((uint8_t)0x00)  /* TRACE Alternate Function mapping                          */
56 #define GPIO_AF0_CSLEEP        ((uint8_t)0x00)  /* CSLEEP Alternate Function mapping                         */
57 #define GPIO_AF0_CSTOP         ((uint8_t)0x00)  /* CSTOP Alternate Function mapping                          */
58 #define GPIO_AF0_CRS           ((uint8_t)0x00)  /* CRS Alternate Function mapping                            */
59 
60 /**
61   * @brief   AF 1 selection
62   */
63 #define GPIO_AF1_TIM1          ((uint8_t)0x01)  /* TIM1 Alternate Function mapping                           */
64 #define GPIO_AF1_TIM2          ((uint8_t)0x01)  /* TIM2 Alternate Function mapping                           */
65 #if defined(TIM16)
66 #define GPIO_AF1_TIM16         ((uint8_t)0x01)  /* TIM16 Alternate Function mapping                          */
67 #endif /* TIM16 */
68 #if defined(TIM17)
69 #define GPIO_AF1_TIM17         ((uint8_t)0x01)  /* TIM17 Alternate Function mapping                          */
70 #endif /* TIM17 */
71 #if (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx))
72 #define GPIO_AF1_LPTIM1        ((uint8_t)0x01)  /* LPTIM1 Alternate Function mapping                         */
73 #endif /* defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) */
74 
75 /**
76   * @brief   AF 2 selection
77   */
78 #if defined(STM32H503xx)
79 #define GPIO_AF2_LPTIM1        ((uint8_t)0x02)  /* LPTIM1 Alternate Function mapping                         */
80 #endif /* STM32H503xx */
81 #if defined(LPTIM3)
82 #define GPIO_AF2_LPTIM3        ((uint8_t)0x02)  /* LPTIM3 Alternate Function mapping                         */
83 #endif /* LPTIM3 */
84 #if defined(SAI1)
85 #define GPIO_AF2_SAI1          ((uint8_t)0x02)  /* SAI1 Alternate Function mapping                           */
86 #endif /* SAI1 */
87 #define GPIO_AF2_TIM3          ((uint8_t)0x02)  /* TIM3 Alternate Function mapping                           */
88 #if defined(TIM4)
89 #define GPIO_AF2_TIM4          ((uint8_t)0x02)  /* TIM4 Alternate Function mapping                           */
90 #endif /* TIM4 */
91 #if defined(TIM5)
92 #define GPIO_AF2_TIM5          ((uint8_t)0x02)  /* TIM5 Alternate Function mapping                           */
93 #endif /* TIM5 */
94 #if defined(TIM12)
95 #define GPIO_AF2_TIM12         ((uint8_t)0x02)  /* TIM12 Alternate Function mapping                          */
96 #endif /* TIM12 */
97 #if defined(TIM15)
98 #define GPIO_AF2_TIM15         ((uint8_t)0x02)  /* TIM15 Alternate Function mapping                          */
99 #endif /* TIM15 */
100 /**
101   * @brief   AF 3 selection
102   */
103 #define GPIO_AF3_I3C1          ((uint8_t)0x03)  /* I3C1 Alternate Function mapping                           */
104 #if defined(I3C2)
105 #define GPIO_AF3_I3C2          ((uint8_t)0x03)  /* I3C2 Alternate Function mapping                           */
106 #endif /* I3C2 */
107 #define GPIO_AF3_LPTIM2        ((uint8_t)0x03)  /* LPTIM2 Alternate Function mapping                         */
108 #if defined(LPTIM3)
109 #define GPIO_AF3_LPTIM3        ((uint8_t)0x03)  /* LPTIM3 Alternate Function mapping                         */
110 #endif /* LPTIM3 */
111 #define GPIO_AF3_LPUART1       ((uint8_t)0x03)  /* LPUART1 Alternate Function mapping                        */
112 #if defined(OCTOSPI1)
113 #define GPIO_AF3_OCTOSPI1      ((uint8_t)0x03)  /* OCTOSPI1 Alternate Function mapping                       */
114 #endif /* OCTOSPI1 */
115 #if (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx))
116 #define GPIO_AF3_TIM1          ((uint8_t)0x03)  /* TIM1 Alternate Function mapping                           */
117 #endif /* defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) */
118 #if defined(TIM8)
119 #define GPIO_AF3_TIM8          ((uint8_t)0x03)  /* TIM8 Alternate Function mapping                           */
120 #endif /* TIM8 */
121 
122 /**
123   * @brief   AF 4 selection
124   */
125 #if defined(CEC)
126 #define GPIO_AF4_CEC           ((uint8_t)0x04)  /* CEC Alternate Function mapping                            */
127 #endif /* CEC */
128 #if defined(DCMI)
129 #define GPIO_AF4_DCMI          ((uint8_t)0x04)  /* DCMI Alternate Function mapping                           */
130 #define GPIO_AF4_PSSI          ((uint8_t)0x04)  /* PSSI Alternate Function mapping                           */
131 #endif /* DCMI */
132 #define GPIO_AF4_I2C1          ((uint8_t)0x04)  /* I2C1 Alternate Function mapping                           */
133 #define GPIO_AF4_I2C2          ((uint8_t)0x04)  /* I2C2 Alternate Function mapping                           */
134 #if defined(I2C3)
135 #define GPIO_AF4_I2C3          ((uint8_t)0x04)  /* I2C3 Alternate Function mapping                           */
136 #endif /* I2C3 */
137 #if defined(I2C4)
138 #define GPIO_AF4_I2C4          ((uint8_t)0x04)  /* I2C4 Alternate Function mapping                           */
139 #endif /* I2C4 */
140 #define GPIO_AF4_LPTIM1        ((uint8_t)0x04)  /* LPTIM1 Alternate Function mapping                         */
141 #define GPIO_AF4_LPTIM2        ((uint8_t)0x04)  /* LPTIM2 Alternate Function mapping                         */
142 #define GPIO_AF4_SPI1          ((uint8_t)0x04)  /* SPI1 Alternate Function mapping                           */
143 #if defined(TIM15)
144 #define GPIO_AF4_TIM15         ((uint8_t)0x04)  /* TIM15 Alternate Function mapping                          */
145 #endif /* TIM15 */
146 #define GPIO_AF4_USART1        ((uint8_t)0x04)  /* USART1 Alternate Function mapping                         */
147 #if defined(STM32H503xx)
148 #define GPIO_AF4_USART2        ((uint8_t)0x04)  /* USART2 Alternate Function mapping                         */
149 #endif /* STM32H503xx */
150 
151 /**
152   * @brief   AF 5 selection
153   */
154 #if defined(CEC)
155 #define GPIO_AF5_CEC           ((uint8_t)0x05)  /* CEC Alternate Function mapping                            */
156 #endif /* CEC */
157 #if (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx))
158 #define GPIO_AF5_I3C1          ((uint8_t)0x05)  /* I3C1 Alternate Function mapping                           */
159 #define GPIO_AF5_SPI3          ((uint8_t)0x05)  /* SPI3 Alternate Function mapping                           */
160 #endif /* defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) */
161 #define GPIO_AF5_LPTIM1        ((uint8_t)0x05)  /* LPTIM1 Alternate Function mapping                         */
162 #define GPIO_AF5_SPI1          ((uint8_t)0x05)  /* SPI1 Alternate Function mapping                           */
163 #define GPIO_AF5_SPI2          ((uint8_t)0x05)  /* SPI2 Alternate Function mapping                           */
164 #if defined(SPI4)
165 #define GPIO_AF5_SPI4          ((uint8_t)0x05)  /* SPI4 Alternate Function mapping                           */
166 #endif /* SPI4 */
167 #if defined(SPI5)
168 #define GPIO_AF5_SPI5          ((uint8_t)0x05)  /* SPI5 Alternate Function mapping                           */
169 #endif /* SPI5 */
170 #if defined(SPI6)
171 #define GPIO_AF5_SPI6          ((uint8_t)0x05)  /* SPI6 Alternate Function mapping                           */
172 #endif /* SPI6 */
173 
174 /**
175   * @brief   AF 6 selection
176   */
177 #if defined(I2C4)
178 #define GPIO_AF6_I2C4          ((uint8_t)0x06)  /* I2C4 Alternate Function mapping                           */
179 #endif /* I2C4 */
180 #if defined(OCTOSPI1)
181 #define GPIO_AF6_OCTOSPI1      ((uint8_t)0x06)  /* OCTOSPI1 Alternate Function mapping                       */
182 #endif /* OCTOSPI1 */
183 #if defined(SAI1)
184 #define GPIO_AF6_SAI1          ((uint8_t)0x06)  /* SAI1 Alternate Function mapping                           */
185 #endif /* SAI1 */
186 #if defined(STM32H503xx)
187 #define GPIO_AF6_SPI1          ((uint8_t)0x06)  /* SPI1 Alternate Function mapping                           */
188 #define GPIO_AF6_SPI2          ((uint8_t)0x06)  /* SPI2 Alternate Function mapping                           */
189 #endif /* STM32H503xx */
190 #define GPIO_AF6_SPI3          ((uint8_t)0x06)  /* SPI3 Alternate Function mapping                           */
191 #if defined(SPI4)
192 #define GPIO_AF6_SPI4          ((uint8_t)0x06)  /* SPI4 Alternate Function mapping                           */
193 #endif /* SPI4 */
194 #if defined(UART4)
195 #define GPIO_AF6_UART4         ((uint8_t)0x06)  /* UART4 Alternate Function mapping                          */
196 #endif /* UART4 */
197 #if defined(UART12)
198 #define GPIO_AF6_UART12        ((uint8_t)0x06)  /* UART12 Alternate Function mapping                         */
199 #endif /* UART12 */
200 #if defined(USART10)
201 #define GPIO_AF6_USART10       ((uint8_t)0x06)  /* USART10 Alternate Function mapping                        */
202 #endif /* USART10 */
203 #if defined(UCPD1)
204 #define GPIO_AF6_UCPD1         ((uint8_t)0x06)  /* UCPD1 Alternate Function mapping                          */
205 #endif /* UCPD1 */
206 
207 /**
208   * @brief   AF 7 selection
209   */
210 #if defined(SDMMC1)
211 #define GPIO_AF7_SDMMC1        ((uint8_t)0x07)  /* SDMMC1 Alternate Function mapping                         */
212 #endif /* SDMMC1 */
213 #define GPIO_AF7_SPI2          ((uint8_t)0x07)  /* SPI2 Alternate Function mapping                           */
214 #define GPIO_AF7_SPI3          ((uint8_t)0x07)  /* SPI3 Alternate Function mapping                           */
215 #if defined(SPI6)
216 #define GPIO_AF7_SPI6          ((uint8_t)0x07)  /* SPI6 Alternate Function mapping                           */
217 #endif /* SPI6 */
218 #if defined(UART7)
219 #define GPIO_AF7_UART7         ((uint8_t)0x07)  /* UART7 Alternate Function mapping                          */
220 #endif /* UART7 */
221 #if defined(UART8)
222 #define GPIO_AF7_UART8         ((uint8_t)0x07)  /* UART8 Alternate Function mapping                          */
223 #endif /* UART8 */
224 #if defined(UART12)
225 #define GPIO_AF7_UART12        ((uint8_t)0x07)  /* UART12 Alternate Function mapping                         */
226 #endif /* UART12 */
227 #define GPIO_AF7_USART1        ((uint8_t)0x07)  /* USART1 Alternate Function mapping                         */
228 #define GPIO_AF7_USART2        ((uint8_t)0x07)  /* USART2 Alternate Function mapping                         */
229 #define GPIO_AF7_USART3        ((uint8_t)0x07)  /* USART3 Alternate Function mapping                         */
230 #if defined(USART6)
231 #define GPIO_AF7_USART6        ((uint8_t)0x07)  /* USART6 Alternate Function mapping                         */
232 #endif /* USART6 */
233 #if defined(USART10)
234 #define GPIO_AF7_USART10       ((uint8_t)0x07)  /* USART10 Alternate Function mapping                        */
235 #endif /* USART10 */
236 #if defined(USART11)
237 #define GPIO_AF7_USART11       ((uint8_t)0x07)  /* USART11 Alternate Function mapping                        */
238 #endif /* USART11 */
239 
240 /**
241   * @brief   AF 8 selection
242   */
243 #if defined(STM32H503xx)
244 #define GPIO_AF8_I2C2          ((uint8_t)0x08)  /* I2C2 Alternate Function mapping                           */
245 #define GPIO_AF8_I3C1          ((uint8_t)0x08)  /* I3C1 Alternate Function mapping                           */
246 #define GPIO_AF8_USART1        ((uint8_t)0x08)  /* USART1 Alternate Function mapping                         */
247 #endif /* STM32H503xx */
248 #define GPIO_AF8_LPUART1       ((uint8_t)0x08)  /* LPUART1 Alternate Function mapping                        */
249 #if defined(SAI2)
250 #define GPIO_AF8_SAI2          ((uint8_t)0x08)  /* SAI2 Alternate Function mapping                           */
251 #endif /* SAI2 */
252 #if defined(SDMMC1)
253 #define GPIO_AF8_SDMMC1        ((uint8_t)0x08)  /* SDMMC1 Alternate Function mapping                         */
254 #endif /* SDMMC1 */
255 #if defined(SPI6)
256 #define GPIO_AF8_SPI6          ((uint8_t)0x08)  /* SPI6 Alternate Function mapping                           */
257 #endif /* SPI6 */
258 #if defined(UART4)
259 #define GPIO_AF8_UART4         ((uint8_t)0x08)  /* UART4 Alternate Function mapping                          */
260 #endif /* UART4 */
261 #if defined(UART5)
262 #define GPIO_AF8_UART5         ((uint8_t)0x08)  /* UART5 Alternate Function mapping                          */
263 #endif /* UART5 */
264 #if defined(UART8)
265 #define GPIO_AF8_UART8         ((uint8_t)0x08)  /* UART8 Alternate Function mapping                          */
266 #endif /* UART8 */
267 
268 /**
269   * @brief   AF 9 selection
270   */
271 #define GPIO_AF9_FDCAN1        ((uint8_t)0x09)  /* FDCAN1 Alternate Function mapping                         */
272 #if defined(FDCAN2)
273 #define GPIO_AF9_FDCAN2        ((uint8_t)0x09)  /* FDCAN2 Alternate Function mapping                         */
274 #endif /* FDCAN2 */
275 #if defined(FMC_BANK1)
276 #define GPIO_AF9_FMC           ((uint8_t)0x09)  /* FMC Alternate Function mapping                            */
277 #endif /* FMC_BANK1 */
278 #if defined(OCTOSPI1)
279 #define GPIO_AF9_OCTOSPI1      ((uint8_t)0x09)  /* OCTOSPI1 Alternate Function mapping                       */
280 #endif /* OCTOSPI1 */
281 #if defined(SDMMC2)
282 #define GPIO_AF9_SDMMC2        ((uint8_t)0x09)  /* SDMMC2 Alternate Function mapping                         */
283 #endif /* SDMMC2 */
284 #if defined(TIM13)
285 #define GPIO_AF9_TIM13         ((uint8_t)0x09)  /* TIM13 Alternate Function mapping                          */
286 #endif /* TIM13 */
287 #if defined(TIM14)
288 #define GPIO_AF9_TIM14         ((uint8_t)0x09)  /* TIM14 Alternate Function mapping                          */
289 #endif /* TIM14 */
290 #if defined(STM32H503xx)
291 #define GPIO_AF9_USART2        ((uint8_t)0x09)  /* USART2 Alternate Function mapping                         */
292 #define GPIO_AF9_USART3        ((uint8_t)0x09)  /* USART3 Alternate Function mapping                         */
293 #endif /* STM32H503xx */
294 
295 /**
296   * @brief   AF 10 selection
297   */
298 #define GPIO_AF10_CRS          ((uint8_t)0x0A)  /* CRS Alternate Function mapping                            */
299 #if defined(STM32H503xx)
300 #define GPIO_AF10_I3C1         ((uint8_t)0x0A)  /* I3C1 Alternate Function mapping                           */
301 #define GPIO_AF10_I3C2         ((uint8_t)0x0A)  /* I3C2 Alternate Function mapping                           */
302 #define GPIO_AF10_SPI3         ((uint8_t)0x0A)  /* SPI3 Alternate Function mapping                           */
303 #endif /* STM32H503xx */
304 #if defined(FMC_BANK1)
305 #define GPIO_AF10_FMC          ((uint8_t)0x0A)  /* FMC Alternate Function mapping                            */
306 #endif /* FMC_BANK1 */
307 #if defined(OCTOSPI1)
308 #define GPIO_AF10_OCTOSPI1     ((uint8_t)0x0A)  /* OCTOSPI1 Alternate Function mapping                       */
309 #endif /* OCTOSPI1 */
310 #if defined(SAI2)
311 #define GPIO_AF10_SAI2         ((uint8_t)0x0A)  /* SAI2 Alternate Function mapping                           */
312 #endif /* SAI2 */
313 #if defined(SDMMC2)
314 #define GPIO_AF10_SDMMC2       ((uint8_t)0x0A)  /* SDMMC2 Alternate Function mapping                         */
315 #endif /* SDMMC2 */
316 #if defined(TIM8)
317 #define GPIO_AF10_TIM8         ((uint8_t)0x0A)  /* TIM8 Alternate Function mapping                           */
318 #endif /* TIM8 */
319 #define GPIO_AF10_USB          ((uint8_t)0x0A)  /* USB Alternate Function mapping                            */
320 
321 /**
322   * @brief   AF 11 selection
323   */
324 #if defined(ETH)
325 #define GPIO_AF11_ETH          ((uint8_t)0x0B)  /* ETH Alternate Function mapping                            */
326 #endif /* ETH */
327 #if defined(FMC_BANK1)
328 #define GPIO_AF11_FMC          ((uint8_t)0x0B)  /* FMC Alternate Function mapping                            */
329 #endif /* FMC_BANK1 */
330 #if defined(OCTOSPI1)
331 #define GPIO_AF11_OCTOSPI1     ((uint8_t)0x0B)  /* OCTOSPI1 Alternate Function mapping                       */
332 #endif /* OCTOSPI1 */
333 #if defined(SDMMC2)
334 #define GPIO_AF11_SDMMC2       ((uint8_t)0x0B)  /* SDMMC2 Alternate Function mapping                         */
335 #endif /* SDMMC2 */
336 #if defined(UART7)
337 #define GPIO_AF11_UART7        ((uint8_t)0x0B)  /* UART7 Alternate Function mapping                          */
338 #endif /* UART7 */
339 #if defined(UART9)
340 #define GPIO_AF11_UART9        ((uint8_t)0x0B)  /* UART9 Alternate Function mapping                          */
341 #endif /* UART9 */
342 #if defined(UCPD1)
343 #define GPIO_AF11_UCPD1        ((uint8_t)0x0B)  /* UCPD1 Alternate Function mapping                          */
344 #endif /* UCPD1 */
345 #if defined(STM32H503xx)
346 #define GPIO_AF11_I2C1         ((uint8_t)0x0B)  /* I2C1 Alternate Function mapping                           */
347 #define GPIO_AF11_I2C2         ((uint8_t)0x0B)  /* I2C2 Alternate Function mapping                           */
348 #define GPIO_AF11_SPI2         ((uint8_t)0x0B)  /* SPI2 Alternate Function mapping                           */
349 #define GPIO_AF11_USART2       ((uint8_t)0x0B)  /* USART2 Alternate Function mapping                         */
350 #endif /* STM32H503xx */
351 
352 /**
353   * @brief   AF 12 selection
354   */
355 #if defined(FMC_BANK1)
356 #define GPIO_AF12_FMC          ((uint8_t)0x0C)  /* FMC Alternate Function mapping                            */
357 #endif /* FMC_BANK1 */
358 #if defined(SDMMC1)
359 #define GPIO_AF12_SDMMC1       ((uint8_t)0x0C)  /* SDMMC1 Alternate Function mapping                         */
360 #endif /* SDMMC1 */
361 #if defined(STM32H503xx)
362 #define GPIO_AF12_COMP1        ((uint8_t)0x0C)  /* COMP1 Alternate Function mapping                          */
363 #define GPIO_AF12_SPI1         ((uint8_t)0x0C)  /* SPI1 Alternate Function mapping                           */
364 #endif /* STM32H503xx */
365 
366 /**
367   * @brief   AF 13 selection
368   */
369 #if defined(DCMI)
370 #define GPIO_AF13_DCMI         ((uint8_t)0x0D)  /* DCMI Alternate Function mapping                           */
371 #define GPIO_AF13_PSSI         ((uint8_t)0x0D)  /* PSSI Alternate Function mapping                           */
372 #endif /* DCMI */
373 #if defined(FMC_BANK1)
374 #define GPIO_AF13_FMC          ((uint8_t)0x0D)  /* FMC Alternate Function mapping                            */
375 #endif /* FMC_BANK1 */
376 #if defined(LPTIM5)
377 #define GPIO_AF13_LPTIM5       ((uint8_t)0x0D)  /* LPTIM5 Alternate Function mapping                         */
378 #endif /* LPTIM5 */
379 #if defined(STM32H503xx)
380 #define GPIO_AF13_USART2       ((uint8_t)0x0D)  /* USART2 Alternate Function mapping                         */
381 #define GPIO_AF13_USART3       ((uint8_t)0x0D)  /* USART3 Alternate Function mapping                         */
382 #endif /* STM32H503xx */
383 
384 /**
385   * @brief   AF 14 selection
386   */
387 #if defined(STM32H503xx)
388 #define GPIO_AF14_LPTIM1       ((uint8_t)0x0E)  /* LPTIM1 Alternate Function mapping                         */
389 #define GPIO_AF14_LPTIM2       ((uint8_t)0x0E)  /* LPTIM2 Alternate Function mapping                         */
390 #define GPIO_AF14_TIM1         ((uint8_t)0x0E)  /* TIM1 Alternate Function mapping                           */
391 #define GPIO_AF14_TIM2         ((uint8_t)0x0E)  /* TIM2 Alternate Function mapping                           */
392 #define GPIO_AF14_TIM3         ((uint8_t)0x0E)  /* TIM3 Alternate Function mapping                           */
393 #endif /* STM32H503xx */
394 #if defined(LPTIM3)
395 #define GPIO_AF14_LPTIM3       ((uint8_t)0x0E)  /* LPTIM3 Alternate Function mapping                         */
396 #endif /* LPTIM3 */
397 #if defined(LPTIM4)
398 #define GPIO_AF14_LPTIM4       ((uint8_t)0x0E)  /* LPTIM4 Alternate Function mapping                         */
399 #endif /* LPTIM4 */
400 #if defined(LPTIM5)
401 #define GPIO_AF14_LPTIM5       ((uint8_t)0x0E)  /* LPTIM5 Alternate Function mapping                         */
402 #endif /* LPTIM5 */
403 #if defined(LPTIM6)
404 #define GPIO_AF14_LPTIM6       ((uint8_t)0x0E)  /* LPTIM6 Alternate Function mapping                         */
405 #endif /* LPTIM6 */
406 #if (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx))
407 #define GPIO_AF14_TIM2         ((uint8_t)0x0E)  /* TIM2 Alternate Function mapping                           */
408 #endif /* defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) */
409 #if defined(UART5)
410 #define GPIO_AF14_UART5        ((uint8_t)0x0E)  /* UART5 Alternate Function mapping                          */
411 #endif /* UART5 */
412 
413 /**
414   * @brief   AF 15 selection
415   */
416 #define GPIO_AF15_EVENTOUT     ((uint8_t)0x0F)  /* EVENTOUT Alternate Function mapping */
417 
418 #define IS_GPIO_AF(AF)   ((AF) <= (uint8_t)0x0F)
419 
420 
421 /**
422   * @}
423   */
424 
425 /**
426   * @}
427   */
428 
429 /* Exported macro ------------------------------------------------------------*/
430 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros
431   * @{
432   */
433 
434 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index
435   * @{
436   */
437 
438 
439 /* GPIO_Peripheral_Memory_Mapping Peripheral Memory Mapping */
440 
441 #if (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) || defined(STM32H503xx))
442 #define GPIO_GET_INDEX(__GPIOx__)           (((uint32_t )(__GPIOx__) & (~GPIOA_BASE)) >> 10)
443 #endif /* (defined(STM32H573xx) || defined(STM32H563xx) || defined(STM32H562xx) || defined(STM32H503xx)) */
444 
445 
446 
447 
448 /**
449   * @}
450   */
451 
452 /**
453   * @}
454   */
455 
456 /* Exported functions --------------------------------------------------------*/
457 
458 /**
459   * @}
460   */
461 
462 /**
463   * @}
464   */
465 
466 #ifdef __cplusplus
467 }
468 #endif
469 
470 #endif /* STM32H5xx_HAL_GPIO_EX_H */
471