File indexing completed on 2025-05-11 08:23:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef STM32H7xx_HAL_GPIO_EX_H
0021 #define STM32H7xx_HAL_GPIO_EX_H
0022
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026
0027
0028 #include "stm32h7xx_hal_def.h"
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00)
0055 #define GPIO_AF0_MCO ((uint8_t)0x00)
0056 #define GPIO_AF0_SWJ ((uint8_t)0x00)
0057 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00)
0058 #define GPIO_AF0_TRACE ((uint8_t)0x00)
0059 #if defined(PWR_CPUCR_RETDS_CD)
0060 #define GPIO_AF0_CSLEEP ((uint8_t)0x00)
0061 #define GPIO_AF0_CSTOP ((uint8_t)0x00)
0062 #define GPIO_AF0_NDSTOP2 ((uint8_t)0x00)
0063 #endif
0064 #if defined(PWR_CPUCR_PDDS_D2)
0065 #define GPIO_AF0_C1DSLEEP ((uint8_t)0x00)
0066 #define GPIO_AF0_C1SLEEP ((uint8_t)0x00)
0067 #define GPIO_AF0_D1PWREN ((uint8_t)0x00)
0068 #define GPIO_AF0_D2PWREN ((uint8_t)0x00)
0069 #if defined(DUAL_CORE)
0070 #define GPIO_AF0_C2DSLEEP ((uint8_t)0x00)
0071 #define GPIO_AF0_C2SLEEP ((uint8_t)0x00)
0072 #endif
0073 #endif
0074
0075
0076
0077
0078 #define GPIO_AF1_TIM1 ((uint8_t)0x01)
0079 #define GPIO_AF1_TIM2 ((uint8_t)0x01)
0080 #define GPIO_AF1_TIM16 ((uint8_t)0x01)
0081 #define GPIO_AF1_TIM17 ((uint8_t)0x01)
0082 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01)
0083 #if defined(HRTIM1)
0084 #define GPIO_AF1_HRTIM1 ((uint8_t)0x01)
0085 #endif
0086 #if defined(SAI4)
0087 #define GPIO_AF1_SAI4 ((uint8_t)0x01)
0088 #endif
0089 #define GPIO_AF1_FMC ((uint8_t)0x01)
0090
0091
0092
0093
0094
0095 #define GPIO_AF2_TIM3 ((uint8_t)0x02)
0096 #define GPIO_AF2_TIM4 ((uint8_t)0x02)
0097 #define GPIO_AF2_TIM5 ((uint8_t)0x02)
0098 #define GPIO_AF2_TIM12 ((uint8_t)0x02)
0099 #define GPIO_AF2_SAI1 ((uint8_t)0x02)
0100 #if defined(HRTIM1)
0101 #define GPIO_AF2_HRTIM1 ((uint8_t)0x02)
0102 #endif
0103 #define GPIO_AF2_TIM15 ((uint8_t)0x02)
0104 #if defined(FDCAN3)
0105 #define GPIO_AF2_FDCAN3 ((uint8_t)0x02)
0106 #endif
0107
0108
0109
0110
0111 #define GPIO_AF3_TIM8 ((uint8_t)0x03)
0112 #define GPIO_AF3_LPTIM2 ((uint8_t)0x03)
0113 #define GPIO_AF3_DFSDM1 ((uint8_t)0x03)
0114 #define GPIO_AF3_LPTIM3 ((uint8_t)0x03)
0115 #define GPIO_AF3_LPTIM4 ((uint8_t)0x03)
0116 #define GPIO_AF3_LPTIM5 ((uint8_t)0x03)
0117 #define GPIO_AF3_LPUART ((uint8_t)0x03)
0118 #if defined(OCTOSPIM)
0119 #define GPIO_AF3_OCTOSPIM_P1 ((uint8_t)0x03)
0120 #define GPIO_AF3_OCTOSPIM_P2 ((uint8_t)0x03)
0121 #endif
0122 #if defined(HRTIM1)
0123 #define GPIO_AF3_HRTIM1 ((uint8_t)0x03)
0124 #endif
0125 #define GPIO_AF3_LTDC ((uint8_t)0x03)
0126
0127
0128
0129
0130 #define GPIO_AF4_I2C1 ((uint8_t)0x04)
0131 #define GPIO_AF4_I2C2 ((uint8_t)0x04)
0132 #define GPIO_AF4_I2C3 ((uint8_t)0x04)
0133 #define GPIO_AF4_I2C4 ((uint8_t)0x04)
0134 #if defined(I2C5)
0135 #define GPIO_AF4_I2C5 ((uint8_t)0x04)
0136 #endif
0137 #define GPIO_AF4_TIM15 ((uint8_t)0x04)
0138 #define GPIO_AF4_CEC ((uint8_t)0x04)
0139 #define GPIO_AF4_LPTIM2 ((uint8_t)0x04)
0140 #define GPIO_AF4_USART1 ((uint8_t)0x04)
0141 #if defined(USART10)
0142 #define GPIO_AF4_USART10 ((uint8_t)0x04)
0143 #endif
0144 #define GPIO_AF4_DFSDM1 ((uint8_t)0x04)
0145 #if defined(DFSDM2_BASE)
0146 #define GPIO_AF4_DFSDM2 ((uint8_t)0x04)
0147 #endif
0148 #define GPIO_AF4_DCMI ((uint8_t)0x04)
0149 #if defined(PSSI)
0150 #define GPIO_AF4_PSSI ((uint8_t)0x04)
0151 #endif
0152 #if defined(OCTOSPIM)
0153 #define GPIO_AF4_OCTOSPIM_P1 ((uint8_t)0x04)
0154 #endif
0155
0156
0157
0158
0159 #define GPIO_AF5_SPI1 ((uint8_t)0x05)
0160 #define GPIO_AF5_SPI2 ((uint8_t)0x05)
0161 #define GPIO_AF5_SPI3 ((uint8_t)0x05)
0162 #define GPIO_AF5_SPI4 ((uint8_t)0x05)
0163 #define GPIO_AF5_SPI5 ((uint8_t)0x05)
0164 #define GPIO_AF5_SPI6 ((uint8_t)0x05)
0165 #define GPIO_AF5_CEC ((uint8_t)0x05)
0166 #if defined(FDCAN3)
0167 #define GPIO_AF5_FDCAN3 ((uint8_t)0x05)
0168 #endif
0169
0170
0171
0172
0173 #define GPIO_AF6_SPI2 ((uint8_t)0x06)
0174 #define GPIO_AF6_SPI3 ((uint8_t)0x06)
0175 #define GPIO_AF6_SAI1 ((uint8_t)0x06)
0176 #define GPIO_AF6_I2C4 ((uint8_t)0x06)
0177 #if defined(I2C5)
0178 #define GPIO_AF6_I2C5 ((uint8_t)0x06)
0179 #endif
0180 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06)
0181 #define GPIO_AF6_UART4 ((uint8_t)0x06)
0182 #if defined(DFSDM2_BASE)
0183 #define GPIO_AF6_DFSDM2 ((uint8_t)0x06)
0184 #endif
0185 #if defined(SAI3)
0186 #define GPIO_AF6_SAI3 ((uint8_t)0x06)
0187 #endif
0188 #if defined(OCTOSPIM)
0189 #define GPIO_AF6_OCTOSPIM_P1 ((uint8_t)0x06)
0190 #endif
0191
0192
0193
0194
0195 #define GPIO_AF7_SPI2 ((uint8_t)0x07)
0196 #define GPIO_AF7_SPI3 ((uint8_t)0x07)
0197 #define GPIO_AF7_SPI6 ((uint8_t)0x07)
0198 #define GPIO_AF7_USART1 ((uint8_t)0x07)
0199 #define GPIO_AF7_USART2 ((uint8_t)0x07)
0200 #define GPIO_AF7_USART3 ((uint8_t)0x07)
0201 #define GPIO_AF7_USART6 ((uint8_t)0x07)
0202 #define GPIO_AF7_UART7 ((uint8_t)0x07)
0203 #define GPIO_AF7_SDMMC1 ((uint8_t)0x07)
0204
0205
0206
0207
0208 #define GPIO_AF8_SPI6 ((uint8_t)0x08)
0209 #if defined(SAI2)
0210 #define GPIO_AF8_SAI2 ((uint8_t)0x08)
0211 #endif
0212 #define GPIO_AF8_UART4 ((uint8_t)0x08)
0213 #define GPIO_AF8_UART5 ((uint8_t)0x08)
0214 #define GPIO_AF8_UART8 ((uint8_t)0x08)
0215 #define GPIO_AF8_SPDIF ((uint8_t)0x08)
0216 #define GPIO_AF8_LPUART ((uint8_t)0x08)
0217 #define GPIO_AF8_SDMMC1 ((uint8_t)0x08)
0218 #if defined(SAI4)
0219 #define GPIO_AF8_SAI4 ((uint8_t)0x08)
0220 #endif
0221
0222
0223
0224
0225 #define GPIO_AF9_FDCAN1 ((uint8_t)0x09)
0226 #define GPIO_AF9_FDCAN2 ((uint8_t)0x09)
0227 #define GPIO_AF9_TIM13 ((uint8_t)0x09)
0228 #define GPIO_AF9_TIM14 ((uint8_t)0x09)
0229 #define GPIO_AF9_SDMMC2 ((uint8_t)0x09)
0230 #define GPIO_AF9_LTDC ((uint8_t)0x09)
0231 #define GPIO_AF9_SPDIF ((uint8_t)0x09)
0232 #define GPIO_AF9_FMC ((uint8_t)0x09)
0233 #if defined(QUADSPI)
0234 #define GPIO_AF9_QUADSPI ((uint8_t)0x09)
0235 #endif
0236 #if defined(SAI4)
0237 #define GPIO_AF9_SAI4 ((uint8_t)0x09)
0238 #endif
0239 #if defined(OCTOSPIM)
0240 #define GPIO_AF9_OCTOSPIM_P1 ((uint8_t)0x09)
0241 #define GPIO_AF9_OCTOSPIM_P2 ((uint8_t)0x09)
0242 #endif
0243
0244
0245
0246
0247 #if defined(SAI2)
0248 #define GPIO_AF10_SAI2 ((uint8_t)0x0A)
0249 #endif
0250 #define GPIO_AF10_SDMMC2 ((uint8_t)0x0A)
0251 #if defined(USB2_OTG_FS)
0252 #define GPIO_AF10_OTG2_FS ((uint8_t)0x0A)
0253 #endif
0254 #define GPIO_AF10_COMP1 ((uint8_t)0x0A)
0255 #define GPIO_AF10_COMP2 ((uint8_t)0x0A)
0256 #if defined(LTDC)
0257 #define GPIO_AF10_LTDC ((uint8_t)0x0A)
0258 #endif
0259 #define GPIO_AF10_CRS_SYNC ((uint8_t)0x0A)
0260 #if defined(QUADSPI)
0261 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A)
0262 #endif
0263 #if defined(SAI4)
0264 #define GPIO_AF10_SAI4 ((uint8_t)0x0A)
0265 #endif
0266 #if !defined(USB2_OTG_FS)
0267 #define GPIO_AF10_OTG1_FS ((uint8_t)0x0A)
0268 #endif
0269 #define GPIO_AF10_OTG1_HS ((uint8_t)0x0A)
0270 #if defined(OCTOSPIM)
0271 #define GPIO_AF10_OCTOSPIM_P1 ((uint8_t)0x0A)
0272 #endif
0273 #define GPIO_AF10_TIM8 ((uint8_t)0x0A)
0274 #define GPIO_AF10_FMC ((uint8_t)0x0A)
0275
0276
0277
0278
0279 #define GPIO_AF11_SWP ((uint8_t)0x0B)
0280 #define GPIO_AF11_MDIOS ((uint8_t)0x0B)
0281 #define GPIO_AF11_UART7 ((uint8_t)0x0B)
0282 #define GPIO_AF11_SDMMC2 ((uint8_t)0x0B)
0283 #define GPIO_AF11_DFSDM1 ((uint8_t)0x0B)
0284 #define GPIO_AF11_COMP1 ((uint8_t)0x0B)
0285 #define GPIO_AF11_COMP2 ((uint8_t)0x0B)
0286 #define GPIO_AF11_TIM1 ((uint8_t)0x0B)
0287 #define GPIO_AF11_TIM8 ((uint8_t)0x0B)
0288 #define GPIO_AF11_I2C4 ((uint8_t)0x0B)
0289 #if defined(DFSDM2_BASE)
0290 #define GPIO_AF11_DFSDM2 ((uint8_t)0x0B)
0291 #endif
0292 #if defined(USART10)
0293 #define GPIO_AF11_USART10 ((uint8_t)0x0B)
0294 #endif
0295 #if defined(UART9)
0296 #define GPIO_AF11_UART9 ((uint8_t)0x0B)
0297 #endif
0298 #if defined(ETH)
0299 #define GPIO_AF11_ETH ((uint8_t)0x0B)
0300 #endif
0301 #if defined(LTDC)
0302 #define GPIO_AF11_LTDC ((uint8_t)0x0B)
0303 #endif
0304 #if defined(OCTOSPIM)
0305 #define GPIO_AF11_OCTOSPIM_P1 ((uint8_t)0x0B)
0306 #endif
0307
0308
0309
0310
0311 #define GPIO_AF12_FMC ((uint8_t)0x0C)
0312 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C)
0313 #define GPIO_AF12_MDIOS ((uint8_t)0x0C)
0314 #define GPIO_AF12_COMP1 ((uint8_t)0x0C)
0315 #define GPIO_AF12_COMP2 ((uint8_t)0x0C)
0316 #define GPIO_AF12_TIM1 ((uint8_t)0x0C)
0317 #define GPIO_AF12_TIM8 ((uint8_t)0x0C)
0318 #if defined(LTDC)
0319 #define GPIO_AF12_LTDC ((uint8_t)0x0C)
0320 #endif
0321 #if defined(USB2_OTG_FS)
0322 #define GPIO_AF12_OTG1_FS ((uint8_t)0x0C)
0323 #endif
0324 #if defined(OCTOSPIM)
0325 #define GPIO_AF12_OCTOSPIM_P1 ((uint8_t)0x0C)
0326 #endif
0327
0328
0329
0330
0331 #define GPIO_AF13_DCMI ((uint8_t)0x0D)
0332 #define GPIO_AF13_COMP1 ((uint8_t)0x0D)
0333 #define GPIO_AF13_COMP2 ((uint8_t)0x0D)
0334 #if defined(LTDC)
0335 #define GPIO_AF13_LTDC ((uint8_t)0x0D)
0336 #endif
0337 #if defined(DSI)
0338 #define GPIO_AF13_DSI ((uint8_t)0x0D)
0339 #endif
0340 #if defined(PSSI)
0341 #define GPIO_AF13_PSSI ((uint8_t)0x0D)
0342 #endif
0343 #define GPIO_AF13_TIM1 ((uint8_t)0x0D)
0344 #if defined(TIM23)
0345 #define GPIO_AF13_TIM23 ((uint8_t)0x0D)
0346 #endif
0347
0348
0349
0350
0351 #define GPIO_AF14_LTDC ((uint8_t)0x0E)
0352 #define GPIO_AF14_UART5 ((uint8_t)0x0E)
0353 #if defined(TIM24)
0354 #define GPIO_AF14_TIM24 ((uint8_t)0x0E)
0355 #endif
0356
0357
0358
0359
0360 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F)
0361
0362 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403 #define GPIOA_PIN_AVAILABLE GPIO_PIN_All
0404 #define GPIOB_PIN_AVAILABLE GPIO_PIN_All
0405 #define GPIOC_PIN_AVAILABLE GPIO_PIN_All
0406 #define GPIOD_PIN_AVAILABLE GPIO_PIN_All
0407 #define GPIOE_PIN_AVAILABLE GPIO_PIN_All
0408 #define GPIOF_PIN_AVAILABLE GPIO_PIN_All
0409 #define GPIOG_PIN_AVAILABLE GPIO_PIN_All
0410 #if defined(GPIOI)
0411 #define GPIOI_PIN_AVAILABLE GPIO_PIN_All
0412 #endif
0413 #if defined(GPIOI)
0414 #define GPIOJ_PIN_AVAILABLE GPIO_PIN_All
0415 #else
0416 #define GPIOJ_PIN_AVAILABLE (GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 )
0417 #endif
0418 #define GPIOH_PIN_AVAILABLE GPIO_PIN_All
0419 #if defined(GPIOI)
0420 #define GPIOK_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | \
0421 GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
0422 #else
0423 #define GPIOK_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 )
0424 #endif
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439 #if defined(GPIOI)
0440 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
0441 ((__GPIOx__) == (GPIOB))? 1UL :\
0442 ((__GPIOx__) == (GPIOC))? 2UL :\
0443 ((__GPIOx__) == (GPIOD))? 3UL :\
0444 ((__GPIOx__) == (GPIOE))? 4UL :\
0445 ((__GPIOx__) == (GPIOF))? 5UL :\
0446 ((__GPIOx__) == (GPIOG))? 6UL :\
0447 ((__GPIOx__) == (GPIOH))? 7UL :\
0448 ((__GPIOx__) == (GPIOI))? 8UL :\
0449 ((__GPIOx__) == (GPIOJ))? 9UL : 10UL)
0450 #else
0451 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
0452 ((__GPIOx__) == (GPIOB))? 1UL :\
0453 ((__GPIOx__) == (GPIOC))? 2UL :\
0454 ((__GPIOx__) == (GPIOD))? 3UL :\
0455 ((__GPIOx__) == (GPIOE))? 4UL :\
0456 ((__GPIOx__) == (GPIOF))? 5UL :\
0457 ((__GPIOx__) == (GPIOG))? 6UL :\
0458 ((__GPIOx__) == (GPIOH))? 7UL :\
0459 ((__GPIOx__) == (GPIOJ))? 9UL : 10UL)
0460 #endif
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496 #ifdef __cplusplus
0497 }
0498 #endif
0499
0500 #endif
0501