Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:35

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_hal_gpio_ex.h
0004   * @author  MCD Application Team
0005   * @brief   Header file of GPIO HAL Extension module.
0006   ******************************************************************************
0007   * @attention
0008   *
0009   * Copyright (c) 2017 STMicroelectronics.
0010   * All rights reserved.
0011   *
0012   * This software is licensed under terms that can be found in the LICENSE file
0013   * in the root directory of this software component.
0014   * If no LICENSE file comes with this software, it is provided AS-IS.
0015   *
0016   ******************************************************************************
0017   */
0018 
0019 /* Define to prevent recursive inclusion -------------------------------------*/
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 /* Includes ------------------------------------------------------------------*/
0028 #include "stm32h7xx_hal_def.h"
0029 
0030 /** @addtogroup STM32H7xx_HAL_Driver
0031   * @{
0032   */
0033 
0034 /** @addtogroup GPIOEx GPIOEx
0035   * @{
0036   */
0037 
0038 /* Exported types ------------------------------------------------------------*/
0039 
0040 /* Exported constants --------------------------------------------------------*/
0041 /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
0042   * @ingroup RTEMSBSPsARMSTM32H7
0043   * @{
0044   */
0045 
0046 /** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection
0047   * @ingroup RTEMSBSPsARMSTM32H7
0048   * @{
0049   */
0050 
0051 /**
0052   * @brief   AF 0 selection
0053   */
0054 #define GPIO_AF0_RTC_50Hz      ((uint8_t)0x00)  /* RTC_50Hz Alternate Function mapping                                                     */
0055 #define GPIO_AF0_MCO           ((uint8_t)0x00)  /* MCO (MCO1 and MCO2) Alternate Function mapping                                          */
0056 #define GPIO_AF0_SWJ           ((uint8_t)0x00)  /* SWJ (SWD and JTAG) Alternate Function mapping                                           */
0057 #define GPIO_AF0_LCDBIAS       ((uint8_t)0x00)  /* LCDBIAS Alternate Function mapping                                                      */
0058 #define GPIO_AF0_TRACE         ((uint8_t)0x00)  /* TRACE Alternate Function mapping                                                        */
0059 #if defined(PWR_CPUCR_RETDS_CD) /* CPU domain power down Deepsleep */
0060 #define GPIO_AF0_CSLEEP        ((uint8_t)0x00)  /* CSLEEP Alternate Function mapping                                                       */
0061 #define GPIO_AF0_CSTOP         ((uint8_t)0x00)  /* CSTOP Alternate Function mapping                                                        */
0062 #define GPIO_AF0_NDSTOP2       ((uint8_t)0x00)  /* NDSTOP2 Alternate Function mapping                                                      */
0063 #endif /* PWR_CPUCR_RETDS_CD */
0064 #if defined(PWR_CPUCR_PDDS_D2) /* PWR D1 and D2 domains exists */
0065 #define GPIO_AF0_C1DSLEEP      ((uint8_t)0x00)  /* Cortex-M7 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above  */
0066 #define GPIO_AF0_C1SLEEP       ((uint8_t)0x00)  /* Cortex-M7 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above       */
0067 #define GPIO_AF0_D1PWREN       ((uint8_t)0x00)  /* Domain 1 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above   */
0068 #define GPIO_AF0_D2PWREN       ((uint8_t)0x00)  /* Domain 2 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above   */
0069 #if defined(DUAL_CORE)
0070 #define GPIO_AF0_C2DSLEEP      ((uint8_t)0x00)  /* Cortex-M4 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above  */
0071 #define GPIO_AF0_C2SLEEP       ((uint8_t)0x00)  /* Cortex-M4 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above       */
0072 #endif /* DUAL_CORE */
0073 #endif /* PWR_CPUCR_PDDS_D2 */
0074 
0075 /**
0076   * @brief   AF 1 selection
0077   */
0078 #define GPIO_AF1_TIM1          ((uint8_t)0x01)  /* TIM1 Alternate Function mapping   */
0079 #define GPIO_AF1_TIM2          ((uint8_t)0x01)  /* TIM2 Alternate Function mapping   */
0080 #define GPIO_AF1_TIM16         ((uint8_t)0x01)  /* TIM16 Alternate Function mapping  */
0081 #define GPIO_AF1_TIM17         ((uint8_t)0x01)  /* TIM17 Alternate Function mapping  */
0082 #define GPIO_AF1_LPTIM1        ((uint8_t)0x01)  /* LPTIM1 Alternate Function mapping */
0083 #if defined(HRTIM1)
0084 #define GPIO_AF1_HRTIM1        ((uint8_t)0x01)  /* HRTIM1 Alternate Function mapping */
0085 #endif /* HRTIM1 */
0086 #if defined(SAI4)
0087 #define GPIO_AF1_SAI4          ((uint8_t)0x01)  /* SAI4 Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
0088 #endif /* SAI4 */
0089 #define GPIO_AF1_FMC           ((uint8_t)0x01)  /* FMC Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
0090 
0091 
0092 /**
0093   * @brief   AF 2 selection
0094   */
0095 #define GPIO_AF2_TIM3          ((uint8_t)0x02)  /* TIM3 Alternate Function mapping   */
0096 #define GPIO_AF2_TIM4          ((uint8_t)0x02)  /* TIM4 Alternate Function mapping   */
0097 #define GPIO_AF2_TIM5          ((uint8_t)0x02)  /* TIM5 Alternate Function mapping   */
0098 #define GPIO_AF2_TIM12         ((uint8_t)0x02)  /* TIM12 Alternate Function mapping  */
0099 #define GPIO_AF2_SAI1          ((uint8_t)0x02)  /* SAI1 Alternate Function mapping   */
0100 #if defined(HRTIM1)
0101 #define GPIO_AF2_HRTIM1        ((uint8_t)0x02)  /* HRTIM1 Alternate Function mapping */
0102 #endif /* HRTIM1 */
0103 #define GPIO_AF2_TIM15         ((uint8_t)0x02)  /* TIM15 Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
0104 #if defined(FDCAN3)
0105 #define GPIO_AF2_FDCAN3        ((uint8_t)0x02)  /* FDCAN3 Alternate Function mapping */
0106 #endif /*FDCAN3*/
0107 
0108 /**
0109   * @brief   AF 3 selection
0110   */
0111 #define GPIO_AF3_TIM8          ((uint8_t)0x03)  /* TIM8 Alternate Function mapping   */
0112 #define GPIO_AF3_LPTIM2        ((uint8_t)0x03)  /* LPTIM2 Alternate Function mapping */
0113 #define GPIO_AF3_DFSDM1        ((uint8_t)0x03)  /* DFSDM Alternate Function mapping  */
0114 #define GPIO_AF3_LPTIM3        ((uint8_t)0x03)  /* LPTIM3 Alternate Function mapping */
0115 #define GPIO_AF3_LPTIM4        ((uint8_t)0x03)  /* LPTIM4 Alternate Function mapping */
0116 #define GPIO_AF3_LPTIM5        ((uint8_t)0x03)  /* LPTIM5 Alternate Function mapping */
0117 #define GPIO_AF3_LPUART        ((uint8_t)0x03)  /* LPUART Alternate Function mapping */
0118 #if defined(OCTOSPIM)
0119 #define GPIO_AF3_OCTOSPIM_P1   ((uint8_t)0x03)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0120 #define GPIO_AF3_OCTOSPIM_P2   ((uint8_t)0x03)  /* OCTOSPI Manager Port 2 Alternate Function mapping */
0121 #endif /* OCTOSPIM */
0122 #if defined(HRTIM1)
0123 #define GPIO_AF3_HRTIM1        ((uint8_t)0x03)  /* HRTIM1 Alternate Function mapping */
0124 #endif /* HRTIM1 */
0125 #define GPIO_AF3_LTDC          ((uint8_t)0x03)  /* LTDC Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
0126 
0127 /**
0128   * @brief   AF 4 selection
0129   */
0130 #define GPIO_AF4_I2C1          ((uint8_t)0x04)  /* I2C1 Alternate Function mapping   */
0131 #define GPIO_AF4_I2C2          ((uint8_t)0x04)  /* I2C2 Alternate Function mapping   */
0132 #define GPIO_AF4_I2C3          ((uint8_t)0x04)  /* I2C3 Alternate Function mapping   */
0133 #define GPIO_AF4_I2C4          ((uint8_t)0x04)  /* I2C4 Alternate Function mapping   */
0134 #if defined(I2C5)
0135 #define GPIO_AF4_I2C5          ((uint8_t)0x04)  /* I2C5 Alternate Function mapping   */
0136 #endif /* I2C5*/
0137 #define GPIO_AF4_TIM15         ((uint8_t)0x04)  /* TIM15 Alternate Function mapping  */
0138 #define GPIO_AF4_CEC           ((uint8_t)0x04)  /* CEC Alternate Function mapping    */
0139 #define GPIO_AF4_LPTIM2        ((uint8_t)0x04)  /* LPTIM2 Alternate Function mapping */
0140 #define GPIO_AF4_USART1        ((uint8_t)0x04)  /* USART1 Alternate Function mapping */
0141 #if defined(USART10)
0142 #define GPIO_AF4_USART10       ((uint8_t)0x04)  /* USART10 Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
0143 #endif /*USART10*/
0144 #define GPIO_AF4_DFSDM1        ((uint8_t)0x04)  /* DFSDM  Alternate Function mapping */
0145 #if defined(DFSDM2_BASE)
0146 #define GPIO_AF4_DFSDM2        ((uint8_t)0x04)  /* DFSDM2 Alternate Function mapping */
0147 #endif /* DFSDM2_BASE */
0148 #define GPIO_AF4_DCMI          ((uint8_t)0x04)   /* DCMI Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
0149 #if defined(PSSI)
0150 #define GPIO_AF4_PSSI          ((uint8_t)0x04)  /* PSSI Alternate Function mapping   */
0151 #endif /* PSSI */
0152 #if defined(OCTOSPIM)
0153 #define GPIO_AF4_OCTOSPIM_P1   ((uint8_t)0x04)  /* OCTOSPI Manager Port 1 Alternate Function mapping  : available on STM32H72xxx/STM32H73xxx */
0154 #endif /* OCTOSPIM */
0155 
0156 /**
0157   * @brief   AF 5 selection
0158   */
0159 #define GPIO_AF5_SPI1          ((uint8_t)0x05)  /* SPI1 Alternate Function mapping   */
0160 #define GPIO_AF5_SPI2          ((uint8_t)0x05)  /* SPI2 Alternate Function mapping   */
0161 #define GPIO_AF5_SPI3          ((uint8_t)0x05)  /* SPI3 Alternate Function mapping   */
0162 #define GPIO_AF5_SPI4          ((uint8_t)0x05)  /* SPI4 Alternate Function mapping   */
0163 #define GPIO_AF5_SPI5          ((uint8_t)0x05)  /* SPI5 Alternate Function mapping   */
0164 #define GPIO_AF5_SPI6          ((uint8_t)0x05)  /* SPI6 Alternate Function mapping   */
0165 #define GPIO_AF5_CEC           ((uint8_t)0x05)  /* CEC  Alternate Function mapping   */
0166 #if defined(FDCAN3)
0167 #define GPIO_AF5_FDCAN3        ((uint8_t)0x05)  /* FDCAN3 Alternate Function mapping */
0168 #endif /*FDCAN3*/
0169 
0170 /**
0171   * @brief   AF 6 selection
0172   */
0173 #define GPIO_AF6_SPI2          ((uint8_t)0x06)  /* SPI2 Alternate Function mapping   */
0174 #define GPIO_AF6_SPI3          ((uint8_t)0x06)  /* SPI3 Alternate Function mapping   */
0175 #define GPIO_AF6_SAI1          ((uint8_t)0x06)  /* SAI1 Alternate Function mapping   */
0176 #define GPIO_AF6_I2C4          ((uint8_t)0x06)  /* I2C4 Alternate Function mapping   */
0177 #if defined(I2C5)
0178 #define GPIO_AF6_I2C5          ((uint8_t)0x06)  /* I2C5 Alternate Function mapping   */
0179 #endif /* I2C5*/
0180 #define GPIO_AF6_DFSDM1        ((uint8_t)0x06)  /* DFSDM Alternate Function mapping  */
0181 #define GPIO_AF6_UART4         ((uint8_t)0x06)  /* UART4 Alternate Function mapping  */
0182 #if defined(DFSDM2_BASE)
0183 #define GPIO_AF6_DFSDM2        ((uint8_t)0x06)  /* DFSDM2 Alternate Function mapping */
0184 #endif /* DFSDM2_BASE */
0185 #if defined(SAI3)
0186 #define GPIO_AF6_SAI3          ((uint8_t)0x06)  /* SAI3 Alternate Function mapping   */
0187 #endif /* SAI3 */
0188 #if defined(OCTOSPIM)
0189 #define GPIO_AF6_OCTOSPIM_P1   ((uint8_t)0x06)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0190 #endif /* OCTOSPIM */
0191 
0192 /**
0193   * @brief   AF 7 selection
0194   */
0195 #define GPIO_AF7_SPI2          ((uint8_t)0x07)  /* SPI2 Alternate Function mapping   */
0196 #define GPIO_AF7_SPI3          ((uint8_t)0x07)  /* SPI3 Alternate Function mapping   */
0197 #define GPIO_AF7_SPI6          ((uint8_t)0x07)  /* SPI6 Alternate Function mapping   */
0198 #define GPIO_AF7_USART1        ((uint8_t)0x07)  /* USART1 Alternate Function mapping */
0199 #define GPIO_AF7_USART2        ((uint8_t)0x07)  /* USART2 Alternate Function mapping */
0200 #define GPIO_AF7_USART3        ((uint8_t)0x07)  /* USART3 Alternate Function mapping */
0201 #define GPIO_AF7_USART6        ((uint8_t)0x07)  /* USART6 Alternate Function mapping */
0202 #define GPIO_AF7_UART7         ((uint8_t)0x07)  /* UART7 Alternate Function mapping  */
0203 #define GPIO_AF7_SDMMC1        ((uint8_t)0x07)  /* SDMMC1 Alternate Function mapping */
0204 
0205 /**
0206   * @brief   AF 8 selection
0207   */
0208 #define GPIO_AF8_SPI6          ((uint8_t)0x08)  /* SPI6 Alternate Function mapping   */
0209 #if defined(SAI2)
0210 #define GPIO_AF8_SAI2          ((uint8_t)0x08)  /* SAI2 Alternate Function mapping   */
0211 #endif /*SAI2*/
0212 #define GPIO_AF8_UART4         ((uint8_t)0x08)  /* UART4 Alternate Function mapping  */
0213 #define GPIO_AF8_UART5         ((uint8_t)0x08)  /* UART5 Alternate Function mapping  */
0214 #define GPIO_AF8_UART8         ((uint8_t)0x08)  /* UART8 Alternate Function mapping  */
0215 #define GPIO_AF8_SPDIF         ((uint8_t)0x08)  /* SPDIF Alternate Function mapping  */
0216 #define GPIO_AF8_LPUART        ((uint8_t)0x08)  /* LPUART Alternate Function mapping */
0217 #define GPIO_AF8_SDMMC1        ((uint8_t)0x08)  /* SDMMC1 Alternate Function mapping */
0218 #if defined(SAI4)
0219 #define GPIO_AF8_SAI4          ((uint8_t)0x08)  /* SAI4 Alternate Function mapping   */
0220 #endif /* SAI4 */
0221 
0222 /**
0223   * @brief   AF 9 selection
0224   */
0225 #define GPIO_AF9_FDCAN1        ((uint8_t)0x09)  /* FDCAN1 Alternate Function mapping   */
0226 #define GPIO_AF9_FDCAN2        ((uint8_t)0x09)  /* FDCAN2 Alternate Function mapping   */
0227 #define GPIO_AF9_TIM13         ((uint8_t)0x09)  /* TIM13 Alternate Function mapping    */
0228 #define GPIO_AF9_TIM14         ((uint8_t)0x09)  /* TIM14 Alternate Function mapping    */
0229 #define GPIO_AF9_SDMMC2        ((uint8_t)0x09)  /* SDMMC2 Alternate Function mapping   */
0230 #define GPIO_AF9_LTDC          ((uint8_t)0x09)  /* LTDC Alternate Function mapping     */
0231 #define GPIO_AF9_SPDIF         ((uint8_t)0x09)  /* SPDIF Alternate Function mapping    */
0232 #define GPIO_AF9_FMC           ((uint8_t)0x09)  /* FMC Alternate Function mapping      */
0233 #if defined(QUADSPI)
0234 #define GPIO_AF9_QUADSPI       ((uint8_t)0x09)  /* QUADSPI Alternate Function mapping  */
0235 #endif /* QUADSPI */
0236 #if defined(SAI4)
0237 #define GPIO_AF9_SAI4          ((uint8_t)0x09)  /* SAI4 Alternate Function mapping     */
0238 #endif /* SAI4 */
0239 #if defined(OCTOSPIM)
0240 #define GPIO_AF9_OCTOSPIM_P1   ((uint8_t)0x09)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0241 #define GPIO_AF9_OCTOSPIM_P2   ((uint8_t)0x09)  /* OCTOSPI Manager Port 2 Alternate Function mapping */
0242 #endif /* OCTOSPIM */
0243 
0244 /**
0245   * @brief   AF 10 selection
0246   */
0247 #if defined(SAI2)
0248 #define GPIO_AF10_SAI2          ((uint8_t)0x0A)  /* SAI2 Alternate Function mapping                                             */
0249 #endif /*SAI2*/
0250 #define GPIO_AF10_SDMMC2        ((uint8_t)0x0A)  /* SDMMC2 Alternate Function mapping                                           */
0251 #if defined(USB2_OTG_FS)
0252 #define GPIO_AF10_OTG2_FS       ((uint8_t)0x0A)  /* OTG2_FS Alternate Function mapping                                          */
0253 #endif /*USB2_OTG_FS*/
0254 #define GPIO_AF10_COMP1         ((uint8_t)0x0A)  /* COMP1 Alternate Function mapping                                            */
0255 #define GPIO_AF10_COMP2         ((uint8_t)0x0A)  /* COMP2 Alternate Function mapping                                            */
0256 #if defined(LTDC)
0257 #define GPIO_AF10_LTDC          ((uint8_t)0x0A)  /* LTDC Alternate Function mapping                                             */
0258 #endif /*LTDC*/
0259 #define GPIO_AF10_CRS_SYNC      ((uint8_t)0x0A)  /* CRS Sync Alternate Function mapping : available on STM32H7 Rev.B and above  */
0260 #if defined(QUADSPI)
0261 #define GPIO_AF10_QUADSPI       ((uint8_t)0x0A)  /* QUADSPI Alternate Function mapping                                          */
0262 #endif /* QUADSPI */
0263 #if defined(SAI4)
0264 #define GPIO_AF10_SAI4          ((uint8_t)0x0A)  /* SAI4 Alternate Function mapping                                             */
0265 #endif /* SAI4 */
0266 #if !defined(USB2_OTG_FS)
0267 #define GPIO_AF10_OTG1_FS       ((uint8_t)0x0A)  /* OTG1_FS Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
0268 #endif /* !USB2_OTG_FS */
0269 #define GPIO_AF10_OTG1_HS       ((uint8_t)0x0A)  /* OTG1_HS Alternate Function mapping                                          */
0270 #if defined(OCTOSPIM)
0271 #define GPIO_AF10_OCTOSPIM_P1   ((uint8_t)0x0A)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0272 #endif /* OCTOSPIM */
0273 #define GPIO_AF10_TIM8          ((uint8_t)0x0A)  /* TIM8 Alternate Function mapping                                             */
0274 #define GPIO_AF10_FMC           ((uint8_t)0x0A)  /* FMC Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
0275 
0276 /**
0277   * @brief   AF 11 selection
0278   */
0279 #define GPIO_AF11_SWP           ((uint8_t)0x0B)  /* SWP Alternate Function mapping     */
0280 #define GPIO_AF11_MDIOS         ((uint8_t)0x0B)  /* MDIOS Alternate Function mapping   */
0281 #define GPIO_AF11_UART7         ((uint8_t)0x0B)  /* UART7 Alternate Function mapping   */
0282 #define GPIO_AF11_SDMMC2        ((uint8_t)0x0B)  /* SDMMC2 Alternate Function mapping  */
0283 #define GPIO_AF11_DFSDM1        ((uint8_t)0x0B)  /* DFSDM1 Alternate Function mapping  */
0284 #define GPIO_AF11_COMP1         ((uint8_t)0x0B)  /* COMP1 Alternate Function mapping   */
0285 #define GPIO_AF11_COMP2         ((uint8_t)0x0B)  /* COMP2 Alternate Function mapping   */
0286 #define GPIO_AF11_TIM1          ((uint8_t)0x0B)  /* TIM1 Alternate Function mapping    */
0287 #define GPIO_AF11_TIM8          ((uint8_t)0x0B)  /* TIM8 Alternate Function mapping    */
0288 #define GPIO_AF11_I2C4          ((uint8_t)0x0B)  /* I2C4 Alternate Function mapping    */
0289 #if defined(DFSDM2_BASE)
0290 #define GPIO_AF11_DFSDM2        ((uint8_t)0x0B)  /* DFSDM2 Alternate Function mapping  */
0291 #endif /* DFSDM2_BASE */
0292 #if defined(USART10)
0293 #define GPIO_AF11_USART10       ((uint8_t)0x0B)  /* USART10 Alternate Function mapping */
0294 #endif /* USART10 */
0295 #if defined(UART9)
0296 #define GPIO_AF11_UART9         ((uint8_t)0x0B)  /* UART9 Alternate Function mapping   */
0297 #endif /* UART9 */
0298 #if defined(ETH)
0299 #define GPIO_AF11_ETH           ((uint8_t)0x0B)  /* ETH Alternate Function mapping     */
0300 #endif /* ETH */
0301 #if defined(LTDC)
0302 #define GPIO_AF11_LTDC          ((uint8_t)0x0B)  /* LTDC Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
0303 #endif /*LTDC*/
0304 #if defined(OCTOSPIM)
0305 #define GPIO_AF11_OCTOSPIM_P1   ((uint8_t)0x0B)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0306 #endif /* OCTOSPIM */
0307 
0308 /**
0309   * @brief   AF 12 selection
0310   */
0311 #define GPIO_AF12_FMC           ((uint8_t)0x0C)  /* FMC Alternate Function mapping     */
0312 #define GPIO_AF12_SDMMC1        ((uint8_t)0x0C)  /* SDMMC1 Alternate Function mapping  */
0313 #define GPIO_AF12_MDIOS         ((uint8_t)0x0C)  /* MDIOS Alternate Function mapping   */
0314 #define GPIO_AF12_COMP1         ((uint8_t)0x0C)  /* COMP1 Alternate Function mapping   */
0315 #define GPIO_AF12_COMP2         ((uint8_t)0x0C)  /* COMP2 Alternate Function mapping   */
0316 #define GPIO_AF12_TIM1          ((uint8_t)0x0C)  /* TIM1 Alternate Function mapping    */
0317 #define GPIO_AF12_TIM8          ((uint8_t)0x0C)  /* TIM8 Alternate Function mapping    */
0318 #if defined(LTDC)
0319 #define GPIO_AF12_LTDC          ((uint8_t)0x0C)  /* LTDC Alternate Function mapping    */
0320 #endif /*LTDC*/
0321 #if defined(USB2_OTG_FS)
0322 #define GPIO_AF12_OTG1_FS       ((uint8_t)0x0C)  /* OTG1_FS Alternate Function mapping */
0323 #endif /* USB2_OTG_FS */
0324 #if defined(OCTOSPIM)
0325 #define GPIO_AF12_OCTOSPIM_P1   ((uint8_t)0x0C)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
0326 #endif /* OCTOSPIM */
0327 
0328 /**
0329   * @brief   AF 13 selection
0330   */
0331 #define GPIO_AF13_DCMI          ((uint8_t)0x0D)   /* DCMI Alternate Function mapping  */
0332 #define GPIO_AF13_COMP1         ((uint8_t)0x0D)   /* COMP1 Alternate Function mapping */
0333 #define GPIO_AF13_COMP2         ((uint8_t)0x0D)   /* COMP2 Alternate Function mapping */
0334 #if defined(LTDC)
0335 #define GPIO_AF13_LTDC          ((uint8_t)0x0D)   /* LTDC Alternate Function mapping  */
0336 #endif /*LTDC*/
0337 #if defined(DSI)
0338 #define GPIO_AF13_DSI           ((uint8_t)0x0D)   /* DSI Alternate Function mapping   */
0339 #endif /* DSI */
0340 #if defined(PSSI)
0341 #define GPIO_AF13_PSSI          ((uint8_t)0x0D)   /* PSSI Alternate Function mapping  */
0342 #endif /* PSSI */
0343 #define GPIO_AF13_TIM1          ((uint8_t)0x0D)    /* TIM1 Alternate Function mapping */
0344 #if defined(TIM23)
0345 #define GPIO_AF13_TIM23         ((uint8_t)0x0D)    /* TIM23 Alternate Function mapping */
0346 #endif  /*TIM23*/
0347 
0348 /**
0349   * @brief   AF 14 selection
0350   */
0351 #define GPIO_AF14_LTDC         ((uint8_t)0x0E)   /* LTDC Alternate Function mapping  */
0352 #define GPIO_AF14_UART5        ((uint8_t)0x0E)   /* UART5 Alternate Function mapping */
0353 #if defined(TIM24)
0354 #define GPIO_AF14_TIM24        ((uint8_t)0x0E)   /* TIM24 Alternate Function mapping */
0355 #endif  /*TIM24*/
0356 
0357 /**
0358   * @brief   AF 15 selection
0359   */
0360 #define GPIO_AF15_EVENTOUT      ((uint8_t)0x0F)  /* EVENTOUT Alternate Function mapping */
0361 
0362 #define IS_GPIO_AF(AF)   ((AF) <= (uint8_t)0x0F)
0363 
0364 
0365 
0366 /**
0367   * @}
0368   */
0369 
0370 /**
0371   * @}
0372   */
0373 
0374 /* Exported macro ------------------------------------------------------------*/
0375 /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros
0376   * @ingroup RTEMSBSPsARMSTM32H7
0377   * @{
0378   */
0379 /**
0380   * @}
0381   */
0382 
0383 /* Exported functions --------------------------------------------------------*/
0384 /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions
0385   * @ingroup RTEMSBSPsARMSTM32H7
0386   * @{
0387   */
0388 /**
0389   * @}
0390   */
0391 /* Private types -------------------------------------------------------------*/
0392 /* Private variables ---------------------------------------------------------*/
0393 /* Private constants ---------------------------------------------------------*/
0394 /** @defgroup GPIOEx_Private_Constants GPIO Private Constants
0395   * @ingroup RTEMSBSPsARMSTM32H7
0396   * @{
0397   */
0398 
0399 /**
0400   * @brief   GPIO pin available on the platform
0401   */
0402 /* Defines the available pins per GPIOs */
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 /*GPIOI*/
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 /* GPIOI */
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 /* GPIOI */
0425 
0426 /**
0427   * @}
0428   */
0429 
0430 /* Private macros ------------------------------------------------------------*/
0431 /** @defgroup GPIOEx_Private_Macros GPIO Private Macros
0432   * @ingroup RTEMSBSPsARMSTM32H7
0433   * @{
0434   */
0435 /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index
0436   * @ingroup RTEMSBSPsARMSTM32H7
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 /* GPIOI */
0461 
0462 /**
0463   * @}
0464   */
0465 
0466 /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function
0467   * @ingroup RTEMSBSPsARMSTM32H7
0468   * @{
0469   */
0470 /**
0471   * @}
0472   */
0473 
0474 /**
0475   * @}
0476   */
0477 
0478 /* Private functions ---------------------------------------------------------*/
0479 /** @defgroup GPIOEx_Private_Functions GPIO Private Functions
0480   * @ingroup RTEMSBSPsARMSTM32H7
0481   * @{
0482   */
0483 
0484 /**
0485   * @}
0486   */
0487 
0488 /**
0489   * @}
0490   */
0491 
0492 /**
0493   * @}
0494   */
0495 
0496 #ifdef __cplusplus
0497 }
0498 #endif
0499 
0500 #endif /* STM32H7xx_HAL_GPIO_EX_H */
0501