STM32H735xx HAL User Manual
stm32h7xx_hal_gpio_ex.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32h7xx_hal_gpio_ex.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of GPIO HAL Extension module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * Copyright (c) 2017 STMicroelectronics.
00010   * All rights reserved.
00011   *
00012   * This software is licensed under terms that can be found in the LICENSE file
00013   * in the root directory of this software component.
00014   * If no LICENSE file comes with this software, it is provided AS-IS.
00015   *
00016   ******************************************************************************
00017   */
00018 
00019 /* Define to prevent recursive inclusion -------------------------------------*/
00020 #ifndef STM32H7xx_HAL_GPIO_EX_H
00021 #define STM32H7xx_HAL_GPIO_EX_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /* Includes ------------------------------------------------------------------*/
00028 #include "stm32h7xx_hal_def.h"
00029 
00030 /** @addtogroup STM32H7xx_HAL_Driver
00031   * @{
00032   */
00033 
00034 /** @addtogroup GPIOEx GPIOEx
00035   * @{
00036   */
00037 
00038 /* Exported types ------------------------------------------------------------*/
00039 
00040 /* Exported constants --------------------------------------------------------*/
00041 /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
00042   * @{
00043   */
00044 
00045 /** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection
00046   * @{
00047   */
00048 
00049 /**
00050   * @brief   AF 0 selection
00051   */
00052 #define GPIO_AF0_RTC_50Hz      ((uint8_t)0x00)  /* RTC_50Hz Alternate Function mapping                                                     */
00053 #define GPIO_AF0_MCO           ((uint8_t)0x00)  /* MCO (MCO1 and MCO2) Alternate Function mapping                                          */
00054 #define GPIO_AF0_SWJ           ((uint8_t)0x00)  /* SWJ (SWD and JTAG) Alternate Function mapping                                           */
00055 #define GPIO_AF0_LCDBIAS       ((uint8_t)0x00)  /* LCDBIAS Alternate Function mapping                                                      */
00056 #define GPIO_AF0_TRACE         ((uint8_t)0x00)  /* TRACE Alternate Function mapping                                                        */
00057 #if defined (PWR_CPUCR_PDDS_D2) /* PWR D1 and D2 domains exists */
00058 #define GPIO_AF0_C1DSLEEP      ((uint8_t)0x00)  /* Cortex-M7 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above  */
00059 #define GPIO_AF0_C1SLEEP       ((uint8_t)0x00)  /* Cortex-M7 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above       */
00060 #define GPIO_AF0_D1PWREN       ((uint8_t)0x00)  /* Domain 1 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above   */
00061 #define GPIO_AF0_D2PWREN       ((uint8_t)0x00)  /* Domain 2 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above   */
00062 #if defined(DUAL_CORE)
00063 #define GPIO_AF0_C2DSLEEP      ((uint8_t)0x00)  /* Cortex-M4 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above  */
00064 #define GPIO_AF0_C2SLEEP       ((uint8_t)0x00)  /* Cortex-M4 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above       */
00065 #endif /* DUAL_CORE */
00066 #endif /* PWR_CPUCR_PDDS_D2 */
00067 
00068 /**
00069   * @brief   AF 1 selection
00070   */
00071 #define GPIO_AF1_TIM1          ((uint8_t)0x01)  /* TIM1 Alternate Function mapping   */
00072 #define GPIO_AF1_TIM2          ((uint8_t)0x01)  /* TIM2 Alternate Function mapping   */
00073 #define GPIO_AF1_TIM16         ((uint8_t)0x01)  /* TIM16 Alternate Function mapping  */
00074 #define GPIO_AF1_TIM17         ((uint8_t)0x01)  /* TIM17 Alternate Function mapping  */
00075 #define GPIO_AF1_LPTIM1        ((uint8_t)0x01)  /* LPTIM1 Alternate Function mapping */
00076 #if defined(HRTIM1)
00077 #define GPIO_AF1_HRTIM1        ((uint8_t)0x01)  /* HRTIM1 Alternate Function mapping */
00078 #endif /* HRTIM1 */
00079 #if defined(SAI4)
00080 #define GPIO_AF1_SAI4          ((uint8_t)0x01)  /* SAI4 Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
00081 #endif /* SAI4 */
00082 #define GPIO_AF1_FMC           ((uint8_t)0x01)  /* FMC Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
00083 
00084 
00085 /**
00086   * @brief   AF 2 selection
00087   */
00088 #define GPIO_AF2_TIM3          ((uint8_t)0x02)  /* TIM3 Alternate Function mapping   */
00089 #define GPIO_AF2_TIM4          ((uint8_t)0x02)  /* TIM4 Alternate Function mapping   */
00090 #define GPIO_AF2_TIM5          ((uint8_t)0x02)  /* TIM5 Alternate Function mapping   */
00091 #define GPIO_AF2_TIM12         ((uint8_t)0x02)  /* TIM12 Alternate Function mapping  */
00092 #define GPIO_AF2_SAI1          ((uint8_t)0x02)  /* SAI1 Alternate Function mapping   */
00093 #if defined(HRTIM1)
00094 #define GPIO_AF2_HRTIM1        ((uint8_t)0x02)  /* HRTIM1 Alternate Function mapping */
00095 #endif /* HRTIM1 */
00096 #define GPIO_AF2_TIM15         ((uint8_t)0x02)  /* TIM15 Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
00097 #if defined(FDCAN3)
00098 #define GPIO_AF2_FDCAN3        ((uint8_t)0x02)  /* FDCAN3 Alternate Function mapping */
00099 #endif /*FDCAN3*/
00100 
00101 /**
00102   * @brief   AF 3 selection
00103   */
00104 #define GPIO_AF3_TIM8          ((uint8_t)0x03)  /* TIM8 Alternate Function mapping   */
00105 #define GPIO_AF3_LPTIM2        ((uint8_t)0x03)  /* LPTIM2 Alternate Function mapping */
00106 #define GPIO_AF3_DFSDM1        ((uint8_t)0x03)  /* DFSDM Alternate Function mapping  */
00107 #define GPIO_AF3_LPTIM3        ((uint8_t)0x03)  /* LPTIM3 Alternate Function mapping */
00108 #define GPIO_AF3_LPTIM4        ((uint8_t)0x03)  /* LPTIM4 Alternate Function mapping */
00109 #define GPIO_AF3_LPTIM5        ((uint8_t)0x03)  /* LPTIM5 Alternate Function mapping */
00110 #define GPIO_AF3_LPUART        ((uint8_t)0x03)  /* LPUART Alternate Function mapping */
00111 #if defined(OCTOSPIM)
00112 #define GPIO_AF3_OCTOSPIM_P1   ((uint8_t)0x03)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00113 #define GPIO_AF3_OCTOSPIM_P2   ((uint8_t)0x03)  /* OCTOSPI Manager Port 2 Alternate Function mapping */
00114 #endif /* OCTOSPIM */
00115 #if defined(HRTIM1)
00116 #define GPIO_AF3_HRTIM1        ((uint8_t)0x03)  /* HRTIM1 Alternate Function mapping */
00117 #endif /* HRTIM1 */
00118 #define GPIO_AF3_LTDC          ((uint8_t)0x03)  /* LTDC Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
00119 
00120 /**
00121   * @brief   AF 4 selection
00122   */
00123 #define GPIO_AF4_I2C1          ((uint8_t)0x04)  /* I2C1 Alternate Function mapping   */
00124 #define GPIO_AF4_I2C2          ((uint8_t)0x04)  /* I2C2 Alternate Function mapping   */
00125 #define GPIO_AF4_I2C3          ((uint8_t)0x04)  /* I2C3 Alternate Function mapping   */
00126 #define GPIO_AF4_I2C4          ((uint8_t)0x04)  /* I2C4 Alternate Function mapping   */
00127 #if defined(I2C5)
00128 #define GPIO_AF4_I2C5          ((uint8_t)0x04)  /* I2C5 Alternate Function mapping   */
00129 #endif /* I2C5*/
00130 #define GPIO_AF4_TIM15         ((uint8_t)0x04)  /* TIM15 Alternate Function mapping  */
00131 #define GPIO_AF4_CEC           ((uint8_t)0x04)  /* CEC Alternate Function mapping    */
00132 #define GPIO_AF4_LPTIM2        ((uint8_t)0x04)  /* LPTIM2 Alternate Function mapping */
00133 #define GPIO_AF4_USART1        ((uint8_t)0x04)  /* USART1 Alternate Function mapping */
00134 #if defined(USART10)
00135 #define GPIO_AF4_USART10       ((uint8_t)0x04)  /* USART10 Alternate Function mapping : available on STM32H72xxx/STM32H73xxx */
00136 #endif /*USART10*/
00137 #define GPIO_AF4_DFSDM1        ((uint8_t)0x04)  /* DFSDM  Alternate Function mapping */
00138 #if defined(DFSDM2_BASE)
00139 #define GPIO_AF4_DFSDM2        ((uint8_t)0x04)  /* DFSDM2 Alternate Function mapping */
00140 #endif /* DFSDM2_BASE */
00141 #define GPIO_AF4_DCMI          ((uint8_t)0x04)   /* DCMI Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
00142 #if defined(PSSI)
00143 #define GPIO_AF4_PSSI          ((uint8_t)0x04)  /* PSSI Alternate Function mapping   */
00144 #endif /* PSSI */
00145 #if defined(OCTOSPIM)
00146 #define GPIO_AF4_OCTOSPIM_P1   ((uint8_t)0x04)  /* OCTOSPI Manager Port 1 Alternate Function mapping  : available on STM32H72xxx/STM32H73xxx */
00147 #endif /* OCTOSPIM */
00148 
00149 /**
00150   * @brief   AF 5 selection
00151   */
00152 #define GPIO_AF5_SPI1          ((uint8_t)0x05)  /* SPI1 Alternate Function mapping   */
00153 #define GPIO_AF5_SPI2          ((uint8_t)0x05)  /* SPI2 Alternate Function mapping   */
00154 #define GPIO_AF5_SPI3          ((uint8_t)0x05)  /* SPI3 Alternate Function mapping   */
00155 #define GPIO_AF5_SPI4          ((uint8_t)0x05)  /* SPI4 Alternate Function mapping   */
00156 #define GPIO_AF5_SPI5          ((uint8_t)0x05)  /* SPI5 Alternate Function mapping   */
00157 #define GPIO_AF5_SPI6          ((uint8_t)0x05)  /* SPI6 Alternate Function mapping   */
00158 #define GPIO_AF5_CEC           ((uint8_t)0x05)  /* CEC  Alternate Function mapping   */
00159 #if defined(FDCAN3)
00160 #define GPIO_AF5_FDCAN3        ((uint8_t)0x05)  /* FDCAN3 Alternate Function mapping */
00161 #endif /*FDCAN3*/
00162 
00163 /**
00164   * @brief   AF 6 selection
00165   */
00166 #define GPIO_AF6_SPI2          ((uint8_t)0x06)  /* SPI2 Alternate Function mapping   */
00167 #define GPIO_AF6_SPI3          ((uint8_t)0x06)  /* SPI3 Alternate Function mapping   */
00168 #define GPIO_AF6_SAI1          ((uint8_t)0x06)  /* SAI1 Alternate Function mapping   */
00169 #define GPIO_AF6_I2C4          ((uint8_t)0x06)  /* I2C4 Alternate Function mapping   */
00170 #if defined(I2C5)
00171 #define GPIO_AF6_I2C5          ((uint8_t)0x06)  /* I2C5 Alternate Function mapping   */
00172 #endif /* I2C5*/
00173 #define GPIO_AF6_DFSDM1        ((uint8_t)0x06)  /* DFSDM Alternate Function mapping  */
00174 #define GPIO_AF6_UART4         ((uint8_t)0x06)  /* UART4 Alternate Function mapping  */
00175 #if defined(DFSDM2_BASE)
00176 #define GPIO_AF6_DFSDM2        ((uint8_t)0x06)  /* DFSDM2 Alternate Function mapping */
00177 #endif /* DFSDM2_BASE */
00178 #if defined(SAI3)
00179 #define GPIO_AF6_SAI3          ((uint8_t)0x06)  /* SAI3 Alternate Function mapping   */
00180 #endif /* SAI3 */
00181 #if defined(OCTOSPIM)
00182 #define GPIO_AF6_OCTOSPIM_P1   ((uint8_t)0x06)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00183 #endif /* OCTOSPIM */
00184 
00185 /**
00186   * @brief   AF 7 selection
00187   */
00188 #define GPIO_AF7_SPI2          ((uint8_t)0x07)  /* SPI2 Alternate Function mapping   */
00189 #define GPIO_AF7_SPI3          ((uint8_t)0x07)  /* SPI3 Alternate Function mapping   */
00190 #define GPIO_AF7_SPI6          ((uint8_t)0x07)  /* SPI6 Alternate Function mapping   */
00191 #define GPIO_AF7_USART1        ((uint8_t)0x07)  /* USART1 Alternate Function mapping */
00192 #define GPIO_AF7_USART2        ((uint8_t)0x07)  /* USART2 Alternate Function mapping */
00193 #define GPIO_AF7_USART3        ((uint8_t)0x07)  /* USART3 Alternate Function mapping */
00194 #define GPIO_AF7_USART6        ((uint8_t)0x07)  /* USART6 Alternate Function mapping */
00195 #define GPIO_AF7_UART7         ((uint8_t)0x07)  /* UART7 Alternate Function mapping  */
00196 #define GPIO_AF7_SDMMC1        ((uint8_t)0x07)  /* SDMMC1 Alternate Function mapping */
00197 
00198 /**
00199   * @brief   AF 8 selection
00200   */
00201 #define GPIO_AF8_SPI6          ((uint8_t)0x08)  /* SPI6 Alternate Function mapping   */
00202 #if defined(SAI2)
00203 #define GPIO_AF8_SAI2          ((uint8_t)0x08)  /* SAI2 Alternate Function mapping   */
00204 #endif /*SAI2*/
00205 #define GPIO_AF8_UART4         ((uint8_t)0x08)  /* UART4 Alternate Function mapping  */
00206 #define GPIO_AF8_UART5         ((uint8_t)0x08)  /* UART5 Alternate Function mapping  */
00207 #define GPIO_AF8_UART8         ((uint8_t)0x08)  /* UART8 Alternate Function mapping  */
00208 #define GPIO_AF8_SPDIF         ((uint8_t)0x08)  /* SPDIF Alternate Function mapping  */
00209 #define GPIO_AF8_LPUART        ((uint8_t)0x08)  /* LPUART Alternate Function mapping */
00210 #define GPIO_AF8_SDMMC1        ((uint8_t)0x08)  /* SDMMC1 Alternate Function mapping */
00211 #if defined(SAI4)
00212 #define GPIO_AF8_SAI4          ((uint8_t)0x08)  /* SAI4 Alternate Function mapping   */
00213 #endif /* SAI4 */
00214 
00215 /**
00216   * @brief   AF 9 selection
00217   */
00218 #define GPIO_AF9_FDCAN1        ((uint8_t)0x09)  /* FDCAN1 Alternate Function mapping   */
00219 #define GPIO_AF9_FDCAN2        ((uint8_t)0x09)  /* FDCAN2 Alternate Function mapping   */
00220 #define GPIO_AF9_TIM13         ((uint8_t)0x09)  /* TIM13 Alternate Function mapping    */
00221 #define GPIO_AF9_TIM14         ((uint8_t)0x09)  /* TIM14 Alternate Function mapping    */
00222 #define GPIO_AF9_SDMMC2        ((uint8_t)0x09)  /* SDMMC2 Alternate Function mapping   */
00223 #define GPIO_AF9_LTDC          ((uint8_t)0x09)  /* LTDC Alternate Function mapping     */
00224 #define GPIO_AF9_SPDIF         ((uint8_t)0x09)  /* SPDIF Alternate Function mapping    */
00225 #define GPIO_AF9_FMC           ((uint8_t)0x09)  /* FMC Alternate Function mapping      */
00226 #if defined(QUADSPI)
00227 #define GPIO_AF9_QUADSPI       ((uint8_t)0x09)  /* QUADSPI Alternate Function mapping  */
00228 #endif /* QUADSPI */
00229 #if defined(SAI4)
00230 #define GPIO_AF9_SAI4          ((uint8_t)0x09)  /* SAI4 Alternate Function mapping     */
00231 #endif /* SAI4 */
00232 #if defined(OCTOSPIM)
00233 #define GPIO_AF9_OCTOSPIM_P1   ((uint8_t)0x09)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00234 #define GPIO_AF9_OCTOSPIM_P2   ((uint8_t)0x09)  /* OCTOSPI Manager Port 2 Alternate Function mapping */
00235 #endif /* OCTOSPIM */
00236 
00237 /**
00238   * @brief   AF 10 selection
00239   */
00240 #if defined(SAI2)
00241 #define GPIO_AF10_SAI2          ((uint8_t)0x0A)  /* SAI2 Alternate Function mapping                                             */
00242 #endif /*SAI2*/
00243 #define GPIO_AF10_SDMMC2        ((uint8_t)0x0A)  /* SDMMC2 Alternate Function mapping                                           */
00244 #if defined(USB2_OTG_FS)
00245 #define GPIO_AF10_OTG2_FS       ((uint8_t)0x0A)  /* OTG2_FS Alternate Function mapping                                          */
00246 #endif /*USB2_OTG_FS*/
00247 #define GPIO_AF10_COMP1         ((uint8_t)0x0A)  /* COMP1 Alternate Function mapping                                            */
00248 #define GPIO_AF10_COMP2         ((uint8_t)0x0A)  /* COMP2 Alternate Function mapping                                            */
00249 #if defined(LTDC)
00250 #define GPIO_AF10_LTDC          ((uint8_t)0x0A)  /* LTDC Alternate Function mapping                                             */
00251 #endif /*LTDC*/
00252 #define GPIO_AF10_CRS_SYNC      ((uint8_t)0x0A)  /* CRS Sync Alternate Function mapping : available on STM32H7 Rev.B and above  */
00253 #if defined(QUADSPI)
00254 #define GPIO_AF10_QUADSPI       ((uint8_t)0x0A)  /* QUADSPI Alternate Function mapping                                          */
00255 #endif /* QUADSPI */
00256 #if defined(SAI4)
00257 #define GPIO_AF10_SAI4          ((uint8_t)0x0A)  /* SAI4 Alternate Function mapping                                             */
00258 #endif /* SAI4 */
00259 #if !defined(USB2_OTG_FS)
00260 #define GPIO_AF10_OTG1_FS       ((uint8_t)0x0A)  /* OTG1_FS Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
00261 #endif /* !USB2_OTG_FS */
00262 #define GPIO_AF10_OTG1_HS       ((uint8_t)0x0A)  /* OTG1_HS Alternate Function mapping                                          */
00263 #if defined(OCTOSPIM)
00264 #define GPIO_AF10_OCTOSPIM_P1   ((uint8_t)0x0A)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00265 #endif /* OCTOSPIM */
00266 #define GPIO_AF10_TIM8          ((uint8_t)0x0A)  /* TIM8 Alternate Function mapping                                             */
00267 #define GPIO_AF10_FMC           ((uint8_t)0x0A)  /* FMC Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
00268 
00269 /**
00270   * @brief   AF 11 selection
00271   */
00272 #define GPIO_AF11_SWP           ((uint8_t)0x0B)  /* SWP Alternate Function mapping     */
00273 #define GPIO_AF11_MDIOS         ((uint8_t)0x0B)  /* MDIOS Alternate Function mapping   */
00274 #define GPIO_AF11_UART7         ((uint8_t)0x0B)  /* UART7 Alternate Function mapping   */
00275 #define GPIO_AF11_SDMMC2        ((uint8_t)0x0B)  /* SDMMC2 Alternate Function mapping  */
00276 #define GPIO_AF11_DFSDM1        ((uint8_t)0x0B)  /* DFSDM1 Alternate Function mapping  */
00277 #define GPIO_AF11_COMP1         ((uint8_t)0x0B)  /* COMP1 Alternate Function mapping   */
00278 #define GPIO_AF11_COMP2         ((uint8_t)0x0B)  /* COMP2 Alternate Function mapping   */
00279 #define GPIO_AF11_TIM1          ((uint8_t)0x0B)  /* TIM1 Alternate Function mapping    */
00280 #define GPIO_AF11_TIM8          ((uint8_t)0x0B)  /* TIM8 Alternate Function mapping    */
00281 #define GPIO_AF11_I2C4          ((uint8_t)0x0B)  /* I2C4 Alternate Function mapping    */
00282 #if defined(DFSDM2_BASE)
00283 #define GPIO_AF11_DFSDM2        ((uint8_t)0x0B)  /* DFSDM2 Alternate Function mapping  */
00284 #endif /* DFSDM2_BASE */
00285 #if defined(USART10)
00286 #define GPIO_AF11_USART10       ((uint8_t)0x0B)  /* USART10 Alternate Function mapping */
00287 #endif /* USART10 */
00288 #if defined(UART9)
00289 #define GPIO_AF11_UART9         ((uint8_t)0x0B)  /* UART9 Alternate Function mapping   */
00290 #endif /* UART9 */
00291 #if defined(ETH)
00292 #define GPIO_AF11_ETH           ((uint8_t)0x0B)  /* ETH Alternate Function mapping     */
00293 #endif /* ETH */
00294 #if defined(LTDC)
00295 #define GPIO_AF11_LTDC          ((uint8_t)0x0B)  /* LTDC Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx and STM32H72xxx/STM32H73xxx */
00296 #endif /*LTDC*/
00297 #if defined(OCTOSPIM)
00298 #define GPIO_AF11_OCTOSPIM_P1   ((uint8_t)0x0B)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00299 #endif /* OCTOSPIM */
00300 
00301 /**
00302   * @brief   AF 12 selection
00303   */
00304 #define GPIO_AF12_FMC           ((uint8_t)0x0C)  /* FMC Alternate Function mapping     */
00305 #define GPIO_AF12_SDMMC1        ((uint8_t)0x0C)  /* SDMMC1 Alternate Function mapping  */
00306 #define GPIO_AF12_MDIOS         ((uint8_t)0x0C)  /* MDIOS Alternate Function mapping   */
00307 #define GPIO_AF12_COMP1         ((uint8_t)0x0C)  /* COMP1 Alternate Function mapping   */
00308 #define GPIO_AF12_COMP2         ((uint8_t)0x0C)  /* COMP2 Alternate Function mapping   */
00309 #define GPIO_AF12_TIM1          ((uint8_t)0x0C)  /* TIM1 Alternate Function mapping    */
00310 #define GPIO_AF12_TIM8          ((uint8_t)0x0C)  /* TIM8 Alternate Function mapping    */
00311 #if defined(LTDC)
00312 #define GPIO_AF12_LTDC          ((uint8_t)0x0C)  /* LTDC Alternate Function mapping    */
00313 #endif /*LTDC*/
00314 #if defined(USB2_OTG_FS)
00315 #define GPIO_AF12_OTG1_FS       ((uint8_t)0x0C)  /* OTG1_FS Alternate Function mapping */
00316 #endif /* USB2_OTG_FS */
00317 #if defined(OCTOSPIM)
00318 #define GPIO_AF12_OCTOSPIM_P1   ((uint8_t)0x0C)  /* OCTOSPI Manager Port 1 Alternate Function mapping */
00319 #endif /* OCTOSPIM */
00320 
00321 /**
00322   * @brief   AF 13 selection
00323   */
00324 #define GPIO_AF13_DCMI          ((uint8_t)0x0D)   /* DCMI Alternate Function mapping  */
00325 #define GPIO_AF13_COMP1         ((uint8_t)0x0D)   /* COMP1 Alternate Function mapping */
00326 #define GPIO_AF13_COMP2         ((uint8_t)0x0D)   /* COMP2 Alternate Function mapping */
00327 #if defined(LTDC)
00328 #define GPIO_AF13_LTDC          ((uint8_t)0x0D)   /* LTDC Alternate Function mapping  */
00329 #endif /*LTDC*/
00330 #if defined(DSI)
00331 #define GPIO_AF13_DSI           ((uint8_t)0x0D)   /* DSI Alternate Function mapping   */
00332 #endif /* DSI */
00333 #if defined(PSSI)
00334 #define GPIO_AF13_PSSI          ((uint8_t)0x0D)   /* PSSI Alternate Function mapping  */
00335 #endif /* PSSI */
00336 #define GPIO_AF13_TIM1          ((uint8_t)0x0D)    /* TIM1 Alternate Function mapping */
00337 #if defined(TIM23)
00338 #define GPIO_AF13_TIM23         ((uint8_t)0x0D)    /* TIM23 Alternate Function mapping */
00339 #endif  /*TIM23*/
00340 
00341 /**
00342   * @brief   AF 14 selection
00343   */
00344 #define GPIO_AF14_LTDC         ((uint8_t)0x0E)   /* LTDC Alternate Function mapping  */
00345 #define GPIO_AF14_UART5        ((uint8_t)0x0E)   /* UART5 Alternate Function mapping */
00346 #if defined(TIM24)
00347 #define GPIO_AF14_TIM24        ((uint8_t)0x0E)   /* TIM24 Alternate Function mapping */
00348 #endif  /*TIM24*/
00349 
00350 /**
00351   * @brief   AF 15 selection
00352   */
00353 #define GPIO_AF15_EVENTOUT      ((uint8_t)0x0F)  /* EVENTOUT Alternate Function mapping */
00354 
00355 #define IS_GPIO_AF(AF)   ((AF) <= (uint8_t)0x0F)
00356 
00357 
00358 
00359 /**
00360   * @}
00361   */
00362 
00363 /**
00364   * @}
00365   */
00366 
00367 /* Exported macro ------------------------------------------------------------*/
00368 /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros
00369   * @{
00370   */
00371 /**
00372   * @}
00373   */
00374 
00375 /* Exported functions --------------------------------------------------------*/
00376 /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions
00377   * @{
00378   */
00379 /**
00380   * @}
00381   */
00382 /* Private types -------------------------------------------------------------*/
00383 /* Private variables ---------------------------------------------------------*/
00384 /* Private constants ---------------------------------------------------------*/
00385 /** @defgroup GPIOEx_Private_Constants GPIO Private Constants
00386   * @{
00387   */
00388 
00389 /**
00390   * @brief   GPIO pin available on the platform
00391   */
00392 /* Defines the available pins per GPIOs */
00393 #define GPIOA_PIN_AVAILABLE  GPIO_PIN_All
00394 #define GPIOB_PIN_AVAILABLE  GPIO_PIN_All
00395 #define GPIOC_PIN_AVAILABLE  GPIO_PIN_All
00396 #define GPIOD_PIN_AVAILABLE  GPIO_PIN_All
00397 #define GPIOE_PIN_AVAILABLE  GPIO_PIN_All
00398 #define GPIOF_PIN_AVAILABLE  GPIO_PIN_All
00399 #define GPIOG_PIN_AVAILABLE  GPIO_PIN_All
00400 #if defined(GPIOI)
00401 #define GPIOI_PIN_AVAILABLE  GPIO_PIN_All
00402 #endif /*GPIOI*/
00403 #if defined(GPIOI)
00404 #define GPIOJ_PIN_AVAILABLE  GPIO_PIN_All
00405 #else
00406 #define GPIOJ_PIN_AVAILABLE  (GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 )
00407 #endif /* GPIOI */
00408 #define GPIOH_PIN_AVAILABLE  GPIO_PIN_All
00409 #if defined(GPIOI)
00410 #define GPIOK_PIN_AVAILABLE  (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | \
00411                               GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
00412 #else
00413 #define GPIOK_PIN_AVAILABLE  (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 )
00414 #endif /* GPIOI */
00415 
00416 /**
00417   * @}
00418   */
00419 
00420 /* Private macros ------------------------------------------------------------*/
00421 /** @defgroup GPIOEx_Private_Macros GPIO Private Macros
00422   * @{
00423   */
00424 /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index
00425   * @{
00426   */
00427 #if defined(GPIOI)
00428 #define GPIO_GET_INDEX(__GPIOx__)  (((__GPIOx__) == (GPIOA))? 0UL :\
00429                                     ((__GPIOx__) == (GPIOB))? 1UL :\
00430                                     ((__GPIOx__) == (GPIOC))? 2UL :\
00431                                     ((__GPIOx__) == (GPIOD))? 3UL :\
00432                                     ((__GPIOx__) == (GPIOE))? 4UL :\
00433                                     ((__GPIOx__) == (GPIOF))? 5UL :\
00434                                     ((__GPIOx__) == (GPIOG))? 6UL :\
00435                                     ((__GPIOx__) == (GPIOH))? 7UL :\
00436                                     ((__GPIOx__) == (GPIOI))? 8UL :\
00437                                     ((__GPIOx__) == (GPIOJ))? 9UL : 10UL)
00438 #else
00439 #define GPIO_GET_INDEX(__GPIOx__)  (((__GPIOx__) == (GPIOA))? 0UL :\
00440                                     ((__GPIOx__) == (GPIOB))? 1UL :\
00441                                     ((__GPIOx__) == (GPIOC))? 2UL :\
00442                                     ((__GPIOx__) == (GPIOD))? 3UL :\
00443                                     ((__GPIOx__) == (GPIOE))? 4UL :\
00444                                     ((__GPIOx__) == (GPIOF))? 5UL :\
00445                                     ((__GPIOx__) == (GPIOG))? 6UL :\
00446                                     ((__GPIOx__) == (GPIOH))? 7UL :\
00447                                     ((__GPIOx__) == (GPIOJ))? 9UL : 10UL)
00448 #endif /* GPIOI */
00449 
00450 /**
00451   * @}
00452   */
00453 
00454 /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function
00455   * @{
00456   */
00457 /**
00458   * @}
00459   */
00460 
00461 /**
00462   * @}
00463   */
00464 
00465 /* Private functions ---------------------------------------------------------*/
00466 /** @defgroup GPIOEx_Private_Functions GPIO Private Functions
00467   * @{
00468   */
00469 
00470 /**
00471   * @}
00472   */
00473 
00474 /**
00475   * @}
00476   */
00477 
00478 /**
00479   * @}
00480   */
00481 
00482 #ifdef __cplusplus
00483 }
00484 #endif
00485 
00486 #endif /* STM32H7xx_HAL_GPIO_EX_H */
00487