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