Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 110:165afa46840b 1 /**
Kojto 110:165afa46840b 2 ******************************************************************************
Kojto 110:165afa46840b 3 * @file stm32f4xx_hal_gpio_ex.h
Kojto 110:165afa46840b 4 * @author MCD Application Team
Kojto 110:165afa46840b 5 * @version V1.4.1
Kojto 110:165afa46840b 6 * @date 09-October-2015
Kojto 110:165afa46840b 7 * @brief Header file of GPIO HAL Extension module.
Kojto 110:165afa46840b 8 ******************************************************************************
Kojto 110:165afa46840b 9 * @attention
Kojto 110:165afa46840b 10 *
Kojto 110:165afa46840b 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 110:165afa46840b 12 *
Kojto 110:165afa46840b 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 110:165afa46840b 14 * are permitted provided that the following conditions are met:
Kojto 110:165afa46840b 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 110:165afa46840b 16 * this list of conditions and the following disclaimer.
Kojto 110:165afa46840b 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 110:165afa46840b 18 * this list of conditions and the following disclaimer in the documentation
Kojto 110:165afa46840b 19 * and/or other materials provided with the distribution.
Kojto 110:165afa46840b 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 110:165afa46840b 21 * may be used to endorse or promote products derived from this software
Kojto 110:165afa46840b 22 * without specific prior written permission.
Kojto 110:165afa46840b 23 *
Kojto 110:165afa46840b 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 110:165afa46840b 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 110:165afa46840b 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 110:165afa46840b 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 110:165afa46840b 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 110:165afa46840b 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 110:165afa46840b 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 110:165afa46840b 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 110:165afa46840b 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 110:165afa46840b 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 110:165afa46840b 34 *
Kojto 110:165afa46840b 35 ******************************************************************************
Kojto 110:165afa46840b 36 */
Kojto 110:165afa46840b 37
Kojto 110:165afa46840b 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 110:165afa46840b 39 #ifndef __STM32F4xx_HAL_GPIO_EX_H
Kojto 110:165afa46840b 40 #define __STM32F4xx_HAL_GPIO_EX_H
Kojto 110:165afa46840b 41
Kojto 110:165afa46840b 42 #ifdef __cplusplus
Kojto 110:165afa46840b 43 extern "C" {
Kojto 110:165afa46840b 44 #endif
Kojto 110:165afa46840b 45
Kojto 110:165afa46840b 46 /* Includes ------------------------------------------------------------------*/
Kojto 110:165afa46840b 47 #include "stm32f4xx_hal_def.h"
Kojto 110:165afa46840b 48
Kojto 110:165afa46840b 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 110:165afa46840b 50 * @{
Kojto 110:165afa46840b 51 */
Kojto 110:165afa46840b 52
Kojto 110:165afa46840b 53 /** @defgroup GPIOEx GPIOEx
Kojto 110:165afa46840b 54 * @{
Kojto 110:165afa46840b 55 */
Kojto 110:165afa46840b 56
Kojto 110:165afa46840b 57 /* Exported types ------------------------------------------------------------*/
Kojto 110:165afa46840b 58 /* Exported constants --------------------------------------------------------*/
Kojto 110:165afa46840b 59 /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
Kojto 110:165afa46840b 60 * @{
Kojto 110:165afa46840b 61 */
Kojto 110:165afa46840b 62
Kojto 110:165afa46840b 63 /** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection
Kojto 110:165afa46840b 64 * @{
Kojto 110:165afa46840b 65 */
Kojto 110:165afa46840b 66
Kojto 110:165afa46840b 67 /*------------------------------------------ STM32F429xx/STM32F439xx ---------*/
Kojto 110:165afa46840b 68 #if defined(STM32F429xx) || defined(STM32F439xx)
Kojto 110:165afa46840b 69 /**
Kojto 110:165afa46840b 70 * @brief AF 0 selection
Kojto 110:165afa46840b 71 */
Kojto 110:165afa46840b 72 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 73 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 74 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 75 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 76 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 77
Kojto 110:165afa46840b 78 /**
Kojto 110:165afa46840b 79 * @brief AF 1 selection
Kojto 110:165afa46840b 80 */
Kojto 110:165afa46840b 81 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 82 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 83
Kojto 110:165afa46840b 84 /**
Kojto 110:165afa46840b 85 * @brief AF 2 selection
Kojto 110:165afa46840b 86 */
Kojto 110:165afa46840b 87 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 88 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 89 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 90
Kojto 110:165afa46840b 91 /**
Kojto 110:165afa46840b 92 * @brief AF 3 selection
Kojto 110:165afa46840b 93 */
Kojto 110:165afa46840b 94 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 95 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 96 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 97 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 98
Kojto 110:165afa46840b 99 /**
Kojto 110:165afa46840b 100 * @brief AF 4 selection
Kojto 110:165afa46840b 101 */
Kojto 110:165afa46840b 102 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 103 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 104 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 105
Kojto 110:165afa46840b 106 /**
Kojto 110:165afa46840b 107 * @brief AF 5 selection
Kojto 110:165afa46840b 108 */
Kojto 110:165afa46840b 109 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 110 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 111 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 112 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 113 #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
Kojto 110:165afa46840b 114 #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
Kojto 110:165afa46840b 115 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 116
Kojto 110:165afa46840b 117 /**
Kojto 110:165afa46840b 118 * @brief AF 6 selection
Kojto 110:165afa46840b 119 */
Kojto 110:165afa46840b 120 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 121 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 122 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
Kojto 110:165afa46840b 123
Kojto 110:165afa46840b 124 /**
Kojto 110:165afa46840b 125 * @brief AF 7 selection
Kojto 110:165afa46840b 126 */
Kojto 110:165afa46840b 127 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 128 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 129 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 130 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 131
Kojto 110:165afa46840b 132 /**
Kojto 110:165afa46840b 133 * @brief AF 8 selection
Kojto 110:165afa46840b 134 */
Kojto 110:165afa46840b 135 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 136 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 137 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 138 #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */
Kojto 110:165afa46840b 139 #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
Kojto 110:165afa46840b 140
Kojto 110:165afa46840b 141 /**
Kojto 110:165afa46840b 142 * @brief AF 9 selection
Kojto 110:165afa46840b 143 */
Kojto 110:165afa46840b 144 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 145 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 146 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 147 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 148 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 149 #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LCD-TFT Alternate Function mapping */
Kojto 110:165afa46840b 150
Kojto 110:165afa46840b 151 /**
Kojto 110:165afa46840b 152 * @brief AF 10 selection
Kojto 110:165afa46840b 153 */
Kojto 110:165afa46840b 154 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 155 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 156
Kojto 110:165afa46840b 157 /**
Kojto 110:165afa46840b 158 * @brief AF 11 selection
Kojto 110:165afa46840b 159 */
Kojto 110:165afa46840b 160 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
Kojto 110:165afa46840b 161
Kojto 110:165afa46840b 162 /**
Kojto 110:165afa46840b 163 * @brief AF 12 selection
Kojto 110:165afa46840b 164 */
Kojto 110:165afa46840b 165 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
Kojto 110:165afa46840b 166 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 167 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 168
Kojto 110:165afa46840b 169 /**
Kojto 110:165afa46840b 170 * @brief AF 13 selection
Kojto 110:165afa46840b 171 */
Kojto 110:165afa46840b 172 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
Kojto 110:165afa46840b 173
Kojto 110:165afa46840b 174 /**
Kojto 110:165afa46840b 175 * @brief AF 14 selection
Kojto 110:165afa46840b 176 */
Kojto 110:165afa46840b 177 #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LCD-TFT Alternate Function mapping */
Kojto 110:165afa46840b 178
Kojto 110:165afa46840b 179 /**
Kojto 110:165afa46840b 180 * @brief AF 15 selection
Kojto 110:165afa46840b 181 */
Kojto 110:165afa46840b 182 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 183 #endif /* STM32F429xx || STM32F439xx */
Kojto 110:165afa46840b 184 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 185
Kojto 110:165afa46840b 186 /*---------------------------------- STM32F427xx/STM32F437xx------------------*/
Kojto 110:165afa46840b 187 #if defined(STM32F427xx) || defined(STM32F437xx)
Kojto 110:165afa46840b 188 /**
Kojto 110:165afa46840b 189 * @brief AF 0 selection
Kojto 110:165afa46840b 190 */
Kojto 110:165afa46840b 191 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 192 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 193 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 194 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 195 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 196
Kojto 110:165afa46840b 197 /**
Kojto 110:165afa46840b 198 * @brief AF 1 selection
Kojto 110:165afa46840b 199 */
Kojto 110:165afa46840b 200 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 201 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 202
Kojto 110:165afa46840b 203 /**
Kojto 110:165afa46840b 204 * @brief AF 2 selection
Kojto 110:165afa46840b 205 */
Kojto 110:165afa46840b 206 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 207 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 208 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 209
Kojto 110:165afa46840b 210 /**
Kojto 110:165afa46840b 211 * @brief AF 3 selection
Kojto 110:165afa46840b 212 */
Kojto 110:165afa46840b 213 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 214 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 215 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 216 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 217
Kojto 110:165afa46840b 218 /**
Kojto 110:165afa46840b 219 * @brief AF 4 selection
Kojto 110:165afa46840b 220 */
Kojto 110:165afa46840b 221 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 222 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 223 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 224
Kojto 110:165afa46840b 225 /**
Kojto 110:165afa46840b 226 * @brief AF 5 selection
Kojto 110:165afa46840b 227 */
Kojto 110:165afa46840b 228 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 229 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 230 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 231 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 232 #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
Kojto 110:165afa46840b 233 #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
Kojto 110:165afa46840b 234 /** @brief GPIO_Legacy
Kojto 110:165afa46840b 235 */
Kojto 110:165afa46840b 236 #define GPIO_AF5_I2S3ext GPIO_AF5_SPI3 /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 237
Kojto 110:165afa46840b 238 /**
Kojto 110:165afa46840b 239 * @brief AF 6 selection
Kojto 110:165afa46840b 240 */
Kojto 110:165afa46840b 241 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 242 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 243 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
Kojto 110:165afa46840b 244
Kojto 110:165afa46840b 245 /**
Kojto 110:165afa46840b 246 * @brief AF 7 selection
Kojto 110:165afa46840b 247 */
Kojto 110:165afa46840b 248 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 249 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 250 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 251 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 252
Kojto 110:165afa46840b 253 /**
Kojto 110:165afa46840b 254 * @brief AF 8 selection
Kojto 110:165afa46840b 255 */
Kojto 110:165afa46840b 256 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 257 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 258 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 259 #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */
Kojto 110:165afa46840b 260 #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
Kojto 110:165afa46840b 261
Kojto 110:165afa46840b 262 /**
Kojto 110:165afa46840b 263 * @brief AF 9 selection
Kojto 110:165afa46840b 264 */
Kojto 110:165afa46840b 265 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 266 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 267 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 268 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 269 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 270
Kojto 110:165afa46840b 271 /**
Kojto 110:165afa46840b 272 * @brief AF 10 selection
Kojto 110:165afa46840b 273 */
Kojto 110:165afa46840b 274 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 275 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 276
Kojto 110:165afa46840b 277 /**
Kojto 110:165afa46840b 278 * @brief AF 11 selection
Kojto 110:165afa46840b 279 */
Kojto 110:165afa46840b 280 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
Kojto 110:165afa46840b 281
Kojto 110:165afa46840b 282 /**
Kojto 110:165afa46840b 283 * @brief AF 12 selection
Kojto 110:165afa46840b 284 */
Kojto 110:165afa46840b 285 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
Kojto 110:165afa46840b 286 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 287 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 288
Kojto 110:165afa46840b 289 /**
Kojto 110:165afa46840b 290 * @brief AF 13 selection
Kojto 110:165afa46840b 291 */
Kojto 110:165afa46840b 292 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
Kojto 110:165afa46840b 293
Kojto 110:165afa46840b 294 /**
Kojto 110:165afa46840b 295 * @brief AF 15 selection
Kojto 110:165afa46840b 296 */
Kojto 110:165afa46840b 297 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 298 #endif /* STM32F427xx || STM32F437xx */
Kojto 110:165afa46840b 299 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 300
Kojto 110:165afa46840b 301 /*---------------------------------- STM32F407xx/STM32F417xx------------------*/
Kojto 110:165afa46840b 302 #if defined(STM32F407xx) || defined(STM32F417xx)
Kojto 110:165afa46840b 303 /**
Kojto 110:165afa46840b 304 * @brief AF 0 selection
Kojto 110:165afa46840b 305 */
Kojto 110:165afa46840b 306 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 307 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 308 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 309 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 310 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 311
Kojto 110:165afa46840b 312 /**
Kojto 110:165afa46840b 313 * @brief AF 1 selection
Kojto 110:165afa46840b 314 */
Kojto 110:165afa46840b 315 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 316 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 317
Kojto 110:165afa46840b 318 /**
Kojto 110:165afa46840b 319 * @brief AF 2 selection
Kojto 110:165afa46840b 320 */
Kojto 110:165afa46840b 321 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 322 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 323 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 324
Kojto 110:165afa46840b 325 /**
Kojto 110:165afa46840b 326 * @brief AF 3 selection
Kojto 110:165afa46840b 327 */
Kojto 110:165afa46840b 328 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 329 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 330 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 331 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 332
Kojto 110:165afa46840b 333 /**
Kojto 110:165afa46840b 334 * @brief AF 4 selection
Kojto 110:165afa46840b 335 */
Kojto 110:165afa46840b 336 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 337 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 338 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 339
Kojto 110:165afa46840b 340 /**
Kojto 110:165afa46840b 341 * @brief AF 5 selection
Kojto 110:165afa46840b 342 */
Kojto 110:165afa46840b 343 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 344 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 345 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 346
Kojto 110:165afa46840b 347 /**
Kojto 110:165afa46840b 348 * @brief AF 6 selection
Kojto 110:165afa46840b 349 */
Kojto 110:165afa46840b 350 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 351 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 352
Kojto 110:165afa46840b 353 /**
Kojto 110:165afa46840b 354 * @brief AF 7 selection
Kojto 110:165afa46840b 355 */
Kojto 110:165afa46840b 356 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 357 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 358 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 359 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 360
Kojto 110:165afa46840b 361 /**
Kojto 110:165afa46840b 362 * @brief AF 8 selection
Kojto 110:165afa46840b 363 */
Kojto 110:165afa46840b 364 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 365 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 366 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 367
Kojto 110:165afa46840b 368 /**
Kojto 110:165afa46840b 369 * @brief AF 9 selection
Kojto 110:165afa46840b 370 */
Kojto 110:165afa46840b 371 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 372 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 373 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 374 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 375 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 376
Kojto 110:165afa46840b 377 /**
Kojto 110:165afa46840b 378 * @brief AF 10 selection
Kojto 110:165afa46840b 379 */
Kojto 110:165afa46840b 380 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 381 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 382
Kojto 110:165afa46840b 383 /**
Kojto 110:165afa46840b 384 * @brief AF 11 selection
Kojto 110:165afa46840b 385 */
Kojto 110:165afa46840b 386 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
Kojto 110:165afa46840b 387
Kojto 110:165afa46840b 388 /**
Kojto 110:165afa46840b 389 * @brief AF 12 selection
Kojto 110:165afa46840b 390 */
Kojto 110:165afa46840b 391 #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */
Kojto 110:165afa46840b 392 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 393 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 394
Kojto 110:165afa46840b 395 /**
Kojto 110:165afa46840b 396 * @brief AF 13 selection
Kojto 110:165afa46840b 397 */
Kojto 110:165afa46840b 398 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
Kojto 110:165afa46840b 399
Kojto 110:165afa46840b 400 /**
Kojto 110:165afa46840b 401 * @brief AF 15 selection
Kojto 110:165afa46840b 402 */
Kojto 110:165afa46840b 403 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 404 #endif /* STM32F407xx || STM32F417xx */
Kojto 110:165afa46840b 405 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 406
Kojto 110:165afa46840b 407 /*---------------------------------- STM32F405xx/STM32F415xx------------------*/
Kojto 110:165afa46840b 408 #if defined(STM32F405xx) || defined(STM32F415xx)
Kojto 110:165afa46840b 409 /**
Kojto 110:165afa46840b 410 * @brief AF 0 selection
Kojto 110:165afa46840b 411 */
Kojto 110:165afa46840b 412 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 413 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 414 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 415 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 416 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 417
Kojto 110:165afa46840b 418 /**
Kojto 110:165afa46840b 419 * @brief AF 1 selection
Kojto 110:165afa46840b 420 */
Kojto 110:165afa46840b 421 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 422 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 423
Kojto 110:165afa46840b 424 /**
Kojto 110:165afa46840b 425 * @brief AF 2 selection
Kojto 110:165afa46840b 426 */
Kojto 110:165afa46840b 427 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 428 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 429 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 430
Kojto 110:165afa46840b 431 /**
Kojto 110:165afa46840b 432 * @brief AF 3 selection
Kojto 110:165afa46840b 433 */
Kojto 110:165afa46840b 434 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 435 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 436 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 437 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 438
Kojto 110:165afa46840b 439 /**
Kojto 110:165afa46840b 440 * @brief AF 4 selection
Kojto 110:165afa46840b 441 */
Kojto 110:165afa46840b 442 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 443 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 444 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 445
Kojto 110:165afa46840b 446 /**
Kojto 110:165afa46840b 447 * @brief AF 5 selection
Kojto 110:165afa46840b 448 */
Kojto 110:165afa46840b 449 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 450 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 451 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 452
Kojto 110:165afa46840b 453 /**
Kojto 110:165afa46840b 454 * @brief AF 6 selection
Kojto 110:165afa46840b 455 */
Kojto 110:165afa46840b 456 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 457 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 458
Kojto 110:165afa46840b 459 /**
Kojto 110:165afa46840b 460 * @brief AF 7 selection
Kojto 110:165afa46840b 461 */
Kojto 110:165afa46840b 462 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 463 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 464 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 465 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 466
Kojto 110:165afa46840b 467 /**
Kojto 110:165afa46840b 468 * @brief AF 8 selection
Kojto 110:165afa46840b 469 */
Kojto 110:165afa46840b 470 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 471 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 472 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 473
Kojto 110:165afa46840b 474 /**
Kojto 110:165afa46840b 475 * @brief AF 9 selection
Kojto 110:165afa46840b 476 */
Kojto 110:165afa46840b 477 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 478 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 479 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 480 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 481 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 482
Kojto 110:165afa46840b 483 /**
Kojto 110:165afa46840b 484 * @brief AF 10 selection
Kojto 110:165afa46840b 485 */
Kojto 110:165afa46840b 486 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 487 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 488
Kojto 110:165afa46840b 489 /**
Kojto 110:165afa46840b 490 * @brief AF 12 selection
Kojto 110:165afa46840b 491 */
Kojto 110:165afa46840b 492 #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */
Kojto 110:165afa46840b 493 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 494 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 495
Kojto 110:165afa46840b 496 /**
Kojto 110:165afa46840b 497 * @brief AF 15 selection
Kojto 110:165afa46840b 498 */
Kojto 110:165afa46840b 499 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 500 #endif /* STM32F405xx || STM32F415xx */
Kojto 110:165afa46840b 501
Kojto 110:165afa46840b 502 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 503
Kojto 110:165afa46840b 504 /*---------------------------------------- STM32F401xx------------------------*/
Kojto 110:165afa46840b 505 #if defined(STM32F401xC) || defined(STM32F401xE)
Kojto 110:165afa46840b 506 /**
Kojto 110:165afa46840b 507 * @brief AF 0 selection
Kojto 110:165afa46840b 508 */
Kojto 110:165afa46840b 509 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 510 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 511 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 512 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 513 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 514
Kojto 110:165afa46840b 515 /**
Kojto 110:165afa46840b 516 * @brief AF 1 selection
Kojto 110:165afa46840b 517 */
Kojto 110:165afa46840b 518 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 519 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 520
Kojto 110:165afa46840b 521 /**
Kojto 110:165afa46840b 522 * @brief AF 2 selection
Kojto 110:165afa46840b 523 */
Kojto 110:165afa46840b 524 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 525 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 526 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 527
Kojto 110:165afa46840b 528 /**
Kojto 110:165afa46840b 529 * @brief AF 3 selection
Kojto 110:165afa46840b 530 */
Kojto 110:165afa46840b 531 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 532 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 533 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 534
Kojto 110:165afa46840b 535 /**
Kojto 110:165afa46840b 536 * @brief AF 4 selection
Kojto 110:165afa46840b 537 */
Kojto 110:165afa46840b 538 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 539 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 540 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 541
Kojto 110:165afa46840b 542 /**
Kojto 110:165afa46840b 543 * @brief AF 5 selection
Kojto 110:165afa46840b 544 */
Kojto 110:165afa46840b 545 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 546 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 547 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 548 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 549
Kojto 110:165afa46840b 550 /**
Kojto 110:165afa46840b 551 * @brief AF 6 selection
Kojto 110:165afa46840b 552 */
Kojto 110:165afa46840b 553 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 554 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 555
Kojto 110:165afa46840b 556 /**
Kojto 110:165afa46840b 557 * @brief AF 7 selection
Kojto 110:165afa46840b 558 */
Kojto 110:165afa46840b 559 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 560 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 561 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 562
Kojto 110:165afa46840b 563 /**
Kojto 110:165afa46840b 564 * @brief AF 8 selection
Kojto 110:165afa46840b 565 */
Kojto 110:165afa46840b 566 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 567
Kojto 110:165afa46840b 568 /**
Kojto 110:165afa46840b 569 * @brief AF 9 selection
Kojto 110:165afa46840b 570 */
Kojto 110:165afa46840b 571 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 572 #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 573 #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 574
Kojto 110:165afa46840b 575
Kojto 110:165afa46840b 576 /**
Kojto 110:165afa46840b 577 * @brief AF 10 selection
Kojto 110:165afa46840b 578 */
Kojto 110:165afa46840b 579 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 580
Kojto 110:165afa46840b 581 /**
Kojto 110:165afa46840b 582 * @brief AF 12 selection
Kojto 110:165afa46840b 583 */
Kojto 110:165afa46840b 584 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 585
Kojto 110:165afa46840b 586 /**
Kojto 110:165afa46840b 587 * @brief AF 15 selection
Kojto 110:165afa46840b 588 */
Kojto 110:165afa46840b 589 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 590 #endif /* STM32F401xC || STM32F401xE */
Kojto 110:165afa46840b 591 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 592 /*---------------------------------------- STM32F411xx------------------------*/
Kojto 110:165afa46840b 593 #if defined(STM32F411xE)
Kojto 110:165afa46840b 594 /**
Kojto 110:165afa46840b 595 * @brief AF 0 selection
Kojto 110:165afa46840b 596 */
Kojto 110:165afa46840b 597 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 598 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 599 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 600 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 601 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 602
Kojto 110:165afa46840b 603 /**
Kojto 110:165afa46840b 604 * @brief AF 1 selection
Kojto 110:165afa46840b 605 */
Kojto 110:165afa46840b 606 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 607 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 608
Kojto 110:165afa46840b 609 /**
Kojto 110:165afa46840b 610 * @brief AF 2 selection
Kojto 110:165afa46840b 611 */
Kojto 110:165afa46840b 612 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 613 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 614 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 615
Kojto 110:165afa46840b 616 /**
Kojto 110:165afa46840b 617 * @brief AF 3 selection
Kojto 110:165afa46840b 618 */
Kojto 110:165afa46840b 619 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 620 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 621 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 622
Kojto 110:165afa46840b 623 /**
Kojto 110:165afa46840b 624 * @brief AF 4 selection
Kojto 110:165afa46840b 625 */
Kojto 110:165afa46840b 626 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 627 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 628 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 629
Kojto 110:165afa46840b 630 /**
Kojto 110:165afa46840b 631 * @brief AF 5 selection
Kojto 110:165afa46840b 632 */
Kojto 110:165afa46840b 633 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */
Kojto 110:165afa46840b 634 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 635 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 636 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 637 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 638
Kojto 110:165afa46840b 639 /**
Kojto 110:165afa46840b 640 * @brief AF 6 selection
Kojto 110:165afa46840b 641 */
Kojto 110:165afa46840b 642 #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 643 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 644 #define GPIO_AF6_SPI4 ((uint8_t)0x06) /* SPI4/I2S4 Alternate Function mapping */
Kojto 110:165afa46840b 645 #define GPIO_AF6_SPI5 ((uint8_t)0x06) /* SPI5/I2S5 Alternate Function mapping */
Kojto 110:165afa46840b 646 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 647
Kojto 110:165afa46840b 648 /**
Kojto 110:165afa46840b 649 * @brief AF 7 selection
Kojto 110:165afa46840b 650 */
Kojto 110:165afa46840b 651 #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 652 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 653 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 654 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 655
Kojto 110:165afa46840b 656 /**
Kojto 110:165afa46840b 657 * @brief AF 8 selection
Kojto 110:165afa46840b 658 */
Kojto 110:165afa46840b 659 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 660
Kojto 110:165afa46840b 661 /**
Kojto 110:165afa46840b 662 * @brief AF 9 selection
Kojto 110:165afa46840b 663 */
Kojto 110:165afa46840b 664 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 665 #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 666 #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 667
Kojto 110:165afa46840b 668 /**
Kojto 110:165afa46840b 669 * @brief AF 10 selection
Kojto 110:165afa46840b 670 */
Kojto 110:165afa46840b 671 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 672
Kojto 110:165afa46840b 673 /**
Kojto 110:165afa46840b 674 * @brief AF 12 selection
Kojto 110:165afa46840b 675 */
Kojto 110:165afa46840b 676 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 677
Kojto 110:165afa46840b 678 /**
Kojto 110:165afa46840b 679 * @brief AF 15 selection
Kojto 110:165afa46840b 680 */
Kojto 110:165afa46840b 681 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 682 #endif /* STM32F411xE */
Kojto 110:165afa46840b 683
Kojto 110:165afa46840b 684 /*---------------------------------------- STM32F410xx------------------------*/
Kojto 110:165afa46840b 685 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 110:165afa46840b 686 /**
Kojto 110:165afa46840b 687 * @brief AF 0 selection
Kojto 110:165afa46840b 688 */
Kojto 110:165afa46840b 689 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 690 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 691 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 692 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 693 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 694
Kojto 110:165afa46840b 695 /**
Kojto 110:165afa46840b 696 * @brief AF 1 selection
Kojto 110:165afa46840b 697 */
Kojto 110:165afa46840b 698 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 699 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
Kojto 110:165afa46840b 700
Kojto 110:165afa46840b 701 /**
Kojto 110:165afa46840b 702 * @brief AF 2 selection
Kojto 110:165afa46840b 703 */
Kojto 110:165afa46840b 704 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 705
Kojto 110:165afa46840b 706 /**
Kojto 110:165afa46840b 707 * @brief AF 3 selection
Kojto 110:165afa46840b 708 */
Kojto 110:165afa46840b 709 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 710 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 711
Kojto 110:165afa46840b 712 /**
Kojto 110:165afa46840b 713 * @brief AF 4 selection
Kojto 110:165afa46840b 714 */
Kojto 110:165afa46840b 715 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 716 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 717 #define GPIO_AF4_FMPI2C1 ((uint8_t)0x04) /* FMPI2C1 Alternate Function mapping */
Kojto 110:165afa46840b 718
Kojto 110:165afa46840b 719 /**
Kojto 110:165afa46840b 720 * @brief AF 5 selection
Kojto 110:165afa46840b 721 */
Kojto 110:165afa46840b 722 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */
Kojto 110:165afa46840b 723 #if defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 110:165afa46840b 724 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 725 #endif /* STM32F410Cx || STM32F410Rx */
Kojto 110:165afa46840b 726
Kojto 110:165afa46840b 727 /**
Kojto 110:165afa46840b 728 * @brief AF 6 selection
Kojto 110:165afa46840b 729 */
Kojto 110:165afa46840b 730 #define GPIO_AF6_SPI1 ((uint8_t)0x06) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 731 #if defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 110:165afa46840b 732 #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 733 #endif /* STM32F410Cx || STM32F410Rx */
Kojto 110:165afa46840b 734 #define GPIO_AF6_SPI5 ((uint8_t)0x06) /* SPI5/I2S5 Alternate Function mapping */
Kojto 110:165afa46840b 735 /**
Kojto 110:165afa46840b 736 * @brief AF 7 selection
Kojto 110:165afa46840b 737 */
Kojto 110:165afa46840b 738 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 739 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 740
Kojto 110:165afa46840b 741 /**
Kojto 110:165afa46840b 742 * @brief AF 8 selection
Kojto 110:165afa46840b 743 */
Kojto 110:165afa46840b 744 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 745
Kojto 110:165afa46840b 746 /**
Kojto 110:165afa46840b 747 * @brief AF 9 selection
Kojto 110:165afa46840b 748 */
Kojto 110:165afa46840b 749 #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 750 #define GPIO_AF9_FMPI2C1 ((uint8_t)0x09) /* FMPI2C1 Alternate Function mapping */
Kojto 110:165afa46840b 751
Kojto 110:165afa46840b 752 /**
Kojto 110:165afa46840b 753 * @brief AF 15 selection
Kojto 110:165afa46840b 754 */
Kojto 110:165afa46840b 755 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 756 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 110:165afa46840b 757
Kojto 110:165afa46840b 758 /*---------------------------------------- STM32F446xx -----------------------*/
Kojto 110:165afa46840b 759 #if defined(STM32F446xx)
Kojto 110:165afa46840b 760 /**
Kojto 110:165afa46840b 761 * @brief AF 0 selection
Kojto 110:165afa46840b 762 */
Kojto 110:165afa46840b 763 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 764 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 765 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 766 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 767 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 768
Kojto 110:165afa46840b 769 /**
Kojto 110:165afa46840b 770 * @brief AF 1 selection
Kojto 110:165afa46840b 771 */
Kojto 110:165afa46840b 772 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 773 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 774
Kojto 110:165afa46840b 775 /**
Kojto 110:165afa46840b 776 * @brief AF 2 selection
Kojto 110:165afa46840b 777 */
Kojto 110:165afa46840b 778 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 779 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 780 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 781
Kojto 110:165afa46840b 782 /**
Kojto 110:165afa46840b 783 * @brief AF 3 selection
Kojto 110:165afa46840b 784 */
Kojto 110:165afa46840b 785 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 786 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 787 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 788 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 789 #define GPIO_AF3_CEC ((uint8_t)0x03) /* CEC Alternate Function mapping */
Kojto 110:165afa46840b 790
Kojto 110:165afa46840b 791 /**
Kojto 110:165afa46840b 792 * @brief AF 4 selection
Kojto 110:165afa46840b 793 */
Kojto 110:165afa46840b 794 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 795 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 796 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 797 #define GPIO_AF4_FMPI2C1 ((uint8_t)0x04) /* FMPI2C1 Alternate Function mapping */
Kojto 110:165afa46840b 798 #define GPIO_AF4_CEC ((uint8_t)0x04) /* CEC Alternate Function mapping */
Kojto 110:165afa46840b 799
Kojto 110:165afa46840b 800 /**
Kojto 110:165afa46840b 801 * @brief AF 5 selection
Kojto 110:165afa46840b 802 */
Kojto 110:165afa46840b 803 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */
Kojto 110:165afa46840b 804 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 805 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 806 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 807
Kojto 110:165afa46840b 808 /**
Kojto 110:165afa46840b 809 * @brief AF 6 selection
Kojto 110:165afa46840b 810 */
Kojto 110:165afa46840b 811 #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 812 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 813 #define GPIO_AF6_SPI4 ((uint8_t)0x06) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 814 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
Kojto 110:165afa46840b 815
Kojto 110:165afa46840b 816 /**
Kojto 110:165afa46840b 817 * @brief AF 7 selection
Kojto 110:165afa46840b 818 */
Kojto 110:165afa46840b 819 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 820 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 821 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 822 #define GPIO_AF7_UART5 ((uint8_t)0x07) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 823 #define GPIO_AF7_SPI2 ((uint8_t)0x07) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 824 #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 825 #define GPIO_AF7_SPDIFRX ((uint8_t)0x07) /* SPDIFRX Alternate Function mapping */
Kojto 110:165afa46840b 826
Kojto 110:165afa46840b 827 /**
Kojto 110:165afa46840b 828 * @brief AF 8 selection
Kojto 110:165afa46840b 829 */
Kojto 110:165afa46840b 830 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 831 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 832 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 833 #define GPIO_AF8_SPDIFRX ((uint8_t)0x08) /* SPDIFRX Alternate Function mapping */
Kojto 110:165afa46840b 834 #define GPIO_AF8_SAI2 ((uint8_t)0x08) /* SAI2 Alternate Function mapping */
Kojto 110:165afa46840b 835
Kojto 110:165afa46840b 836 /**
Kojto 110:165afa46840b 837 * @brief AF 9 selection
Kojto 110:165afa46840b 838 */
Kojto 110:165afa46840b 839 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 840 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 841 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 842 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 843 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 844 #define GPIO_AF9_QSPI ((uint8_t)0x09) /* QSPI Alternate Function mapping */
Kojto 110:165afa46840b 845
Kojto 110:165afa46840b 846 /**
Kojto 110:165afa46840b 847 * @brief AF 10 selection
Kojto 110:165afa46840b 848 */
Kojto 110:165afa46840b 849 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 850 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 851 #define GPIO_AF10_SAI2 ((uint8_t)0xA) /* SAI2 Alternate Function mapping */
Kojto 110:165afa46840b 852 #define GPIO_AF10_QSPI ((uint8_t)0xA) /* QSPI Alternate Function mapping */
Kojto 110:165afa46840b 853
Kojto 110:165afa46840b 854 /**
Kojto 110:165afa46840b 855 * @brief AF 11 selection
Kojto 110:165afa46840b 856 */
Kojto 110:165afa46840b 857 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
Kojto 110:165afa46840b 858
Kojto 110:165afa46840b 859 /**
Kojto 110:165afa46840b 860 * @brief AF 12 selection
Kojto 110:165afa46840b 861 */
Kojto 110:165afa46840b 862 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
Kojto 110:165afa46840b 863 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 864 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 865
Kojto 110:165afa46840b 866 /**
Kojto 110:165afa46840b 867 * @brief AF 13 selection
Kojto 110:165afa46840b 868 */
Kojto 110:165afa46840b 869 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
Kojto 110:165afa46840b 870
Kojto 110:165afa46840b 871 /**
Kojto 110:165afa46840b 872 * @brief AF 15 selection
Kojto 110:165afa46840b 873 */
Kojto 110:165afa46840b 874 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 875
Kojto 110:165afa46840b 876 #endif /* STM32F446xx */
Kojto 110:165afa46840b 877 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 878
Kojto 110:165afa46840b 879 /*-------------------------------- STM32F469xx/STM32F479xx--------------------*/
Kojto 110:165afa46840b 880 #if defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 881 /**
Kojto 110:165afa46840b 882 * @brief AF 0 selection
Kojto 110:165afa46840b 883 */
Kojto 110:165afa46840b 884 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 110:165afa46840b 885 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 110:165afa46840b 886 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
Kojto 110:165afa46840b 887 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 110:165afa46840b 888 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 110:165afa46840b 889
Kojto 110:165afa46840b 890 /**
Kojto 110:165afa46840b 891 * @brief AF 1 selection
Kojto 110:165afa46840b 892 */
Kojto 110:165afa46840b 893 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 110:165afa46840b 894 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 110:165afa46840b 895
Kojto 110:165afa46840b 896 /**
Kojto 110:165afa46840b 897 * @brief AF 2 selection
Kojto 110:165afa46840b 898 */
Kojto 110:165afa46840b 899 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 110:165afa46840b 900 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 110:165afa46840b 901 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 110:165afa46840b 902
Kojto 110:165afa46840b 903 /**
Kojto 110:165afa46840b 904 * @brief AF 3 selection
Kojto 110:165afa46840b 905 */
Kojto 110:165afa46840b 906 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 110:165afa46840b 907 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 110:165afa46840b 908 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 110:165afa46840b 909 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 110:165afa46840b 910
Kojto 110:165afa46840b 911 /**
Kojto 110:165afa46840b 912 * @brief AF 4 selection
Kojto 110:165afa46840b 913 */
Kojto 110:165afa46840b 914 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 110:165afa46840b 915 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 110:165afa46840b 916 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 110:165afa46840b 917
Kojto 110:165afa46840b 918 /**
Kojto 110:165afa46840b 919 * @brief AF 5 selection
Kojto 110:165afa46840b 920 */
Kojto 110:165afa46840b 921 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 110:165afa46840b 922 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 110:165afa46840b 923 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 924 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
Kojto 110:165afa46840b 925 #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
Kojto 110:165afa46840b 926 #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
Kojto 110:165afa46840b 927 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 928
Kojto 110:165afa46840b 929 /**
Kojto 110:165afa46840b 930 * @brief AF 6 selection
Kojto 110:165afa46840b 931 */
Kojto 110:165afa46840b 932 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 110:165afa46840b 933 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 934 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
Kojto 110:165afa46840b 935
Kojto 110:165afa46840b 936 /**
Kojto 110:165afa46840b 937 * @brief AF 7 selection
Kojto 110:165afa46840b 938 */
Kojto 110:165afa46840b 939 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 110:165afa46840b 940 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 110:165afa46840b 941 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 110:165afa46840b 942 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
Kojto 110:165afa46840b 943
Kojto 110:165afa46840b 944 /**
Kojto 110:165afa46840b 945 * @brief AF 8 selection
Kojto 110:165afa46840b 946 */
Kojto 110:165afa46840b 947 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 110:165afa46840b 948 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 110:165afa46840b 949 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
Kojto 110:165afa46840b 950 #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */
Kojto 110:165afa46840b 951 #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
Kojto 110:165afa46840b 952
Kojto 110:165afa46840b 953 /**
Kojto 110:165afa46840b 954 * @brief AF 9 selection
Kojto 110:165afa46840b 955 */
Kojto 110:165afa46840b 956 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 110:165afa46840b 957 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
Kojto 110:165afa46840b 958 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
Kojto 110:165afa46840b 959 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
Kojto 110:165afa46840b 960 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
Kojto 110:165afa46840b 961 #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LCD-TFT Alternate Function mapping */
Kojto 110:165afa46840b 962 #define GPIO_AF9_QSPI ((uint8_t)0x09) /* QSPI Alternate Function mapping */
Kojto 110:165afa46840b 963
Kojto 110:165afa46840b 964
Kojto 110:165afa46840b 965 /**
Kojto 110:165afa46840b 966 * @brief AF 10 selection
Kojto 110:165afa46840b 967 */
Kojto 110:165afa46840b 968 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 110:165afa46840b 969 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
Kojto 110:165afa46840b 970 #define GPIO_AF10_QSPI ((uint8_t)0xA) /* QSPI Alternate Function mapping */
Kojto 110:165afa46840b 971
Kojto 110:165afa46840b 972
Kojto 110:165afa46840b 973 /**
Kojto 110:165afa46840b 974 * @brief AF 11 selection
Kojto 110:165afa46840b 975 */
Kojto 110:165afa46840b 976 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
Kojto 110:165afa46840b 977
Kojto 110:165afa46840b 978 /**
Kojto 110:165afa46840b 979 * @brief AF 12 selection
Kojto 110:165afa46840b 980 */
Kojto 110:165afa46840b 981 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
Kojto 110:165afa46840b 982 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
Kojto 110:165afa46840b 983 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
Kojto 110:165afa46840b 984
Kojto 110:165afa46840b 985 /**
Kojto 110:165afa46840b 986 * @brief AF 13 selection
Kojto 110:165afa46840b 987 */
Kojto 110:165afa46840b 988 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
Kojto 110:165afa46840b 989 #define GPIO_AF13_DSI ((uint8_t)0x0D) /* DSI Alternate Function mapping */
Kojto 110:165afa46840b 990
Kojto 110:165afa46840b 991 /**
Kojto 110:165afa46840b 992 * @brief AF 14 selection
Kojto 110:165afa46840b 993 */
Kojto 110:165afa46840b 994 #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LCD-TFT Alternate Function mapping */
Kojto 110:165afa46840b 995
Kojto 110:165afa46840b 996 /**
Kojto 110:165afa46840b 997 * @brief AF 15 selection
Kojto 110:165afa46840b 998 */
Kojto 110:165afa46840b 999 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 110:165afa46840b 1000
Kojto 110:165afa46840b 1001 #endif /* STM32F469xx || STM32F479xx */
Kojto 110:165afa46840b 1002 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1003 /**
Kojto 110:165afa46840b 1004 * @}
Kojto 110:165afa46840b 1005 */
Kojto 110:165afa46840b 1006
Kojto 110:165afa46840b 1007 /**
Kojto 110:165afa46840b 1008 * @}
Kojto 110:165afa46840b 1009 */
Kojto 110:165afa46840b 1010
Kojto 110:165afa46840b 1011 /* Exported macro ------------------------------------------------------------*/
Kojto 110:165afa46840b 1012 /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros
Kojto 110:165afa46840b 1013 * @{
Kojto 110:165afa46840b 1014 */
Kojto 110:165afa46840b 1015 /**
Kojto 110:165afa46840b 1016 * @}
Kojto 110:165afa46840b 1017 */
Kojto 110:165afa46840b 1018
Kojto 110:165afa46840b 1019 /* Exported functions --------------------------------------------------------*/
Kojto 110:165afa46840b 1020 /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions
Kojto 110:165afa46840b 1021 * @{
Kojto 110:165afa46840b 1022 */
Kojto 110:165afa46840b 1023 /**
Kojto 110:165afa46840b 1024 * @}
Kojto 110:165afa46840b 1025 */
Kojto 110:165afa46840b 1026
Kojto 110:165afa46840b 1027 /* Private types -------------------------------------------------------------*/
Kojto 110:165afa46840b 1028 /* Private variables ---------------------------------------------------------*/
Kojto 110:165afa46840b 1029 /* Private constants ---------------------------------------------------------*/
Kojto 110:165afa46840b 1030 /** @defgroup GPIOEx_Private_Constants GPIO Private Constants
Kojto 110:165afa46840b 1031 * @{
Kojto 110:165afa46840b 1032 */
Kojto 110:165afa46840b 1033 /**
Kojto 110:165afa46840b 1034 * @}
Kojto 110:165afa46840b 1035 */
Kojto 110:165afa46840b 1036
Kojto 110:165afa46840b 1037 /* Private macros ------------------------------------------------------------*/
Kojto 110:165afa46840b 1038 /** @defgroup GPIOEx_Private_Macros GPIO Private Macros
Kojto 110:165afa46840b 1039 * @{
Kojto 110:165afa46840b 1040 */
Kojto 110:165afa46840b 1041 /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index
Kojto 110:165afa46840b 1042 * @{
Kojto 110:165afa46840b 1043 */
Kojto 110:165afa46840b 1044 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)
Kojto 110:165afa46840b 1045 #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
Kojto 110:165afa46840b 1046 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 110:165afa46840b 1047 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 110:165afa46840b 1048 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 110:165afa46840b 1049 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 110:165afa46840b 1050 ((__GPIOx__) == (GPIOF))? 5U :\
Kojto 110:165afa46840b 1051 ((__GPIOx__) == (GPIOG))? 6U :\
Kojto 110:165afa46840b 1052 ((__GPIOx__) == (GPIOH))? 7U :\
Kojto 110:165afa46840b 1053 ((__GPIOx__) == (GPIOI))? 8U : 9U)
Kojto 110:165afa46840b 1054 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
Kojto 110:165afa46840b 1055
Kojto 110:165afa46840b 1056 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 110:165afa46840b 1057 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 1058 #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
Kojto 110:165afa46840b 1059 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 110:165afa46840b 1060 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 110:165afa46840b 1061 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 110:165afa46840b 1062 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 110:165afa46840b 1063 ((__GPIOx__) == (GPIOF))? 5U :\
Kojto 110:165afa46840b 1064 ((__GPIOx__) == (GPIOG))? 6U :\
Kojto 110:165afa46840b 1065 ((__GPIOx__) == (GPIOH))? 7U :\
Kojto 110:165afa46840b 1066 ((__GPIOx__) == (GPIOI))? 8U :\
Kojto 110:165afa46840b 1067 ((__GPIOx__) == (GPIOJ))? 9U : 10U)
Kojto 110:165afa46840b 1068 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 110:165afa46840b 1069
Kojto 110:165afa46840b 1070 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 110:165afa46840b 1071 #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
Kojto 110:165afa46840b 1072 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 110:165afa46840b 1073 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 110:165afa46840b 1074 ((__GPIOx__) == (GPIOH))? 7U : 8U)
Kojto 110:165afa46840b 1075 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 110:165afa46840b 1076
Kojto 110:165afa46840b 1077 #if defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
Kojto 110:165afa46840b 1078 #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
Kojto 110:165afa46840b 1079 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 110:165afa46840b 1080 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 110:165afa46840b 1081 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 110:165afa46840b 1082 ((__GPIOx__) == (GPIOE))? 4U : 5U)
Kojto 110:165afa46840b 1083 #endif /* STM32F401xC || STM32F401xE || STM32F411xE */
Kojto 110:165afa46840b 1084
Kojto 110:165afa46840b 1085 #if defined(STM32F446xx)
Kojto 110:165afa46840b 1086 #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
Kojto 110:165afa46840b 1087 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 110:165afa46840b 1088 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 110:165afa46840b 1089 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 110:165afa46840b 1090 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 110:165afa46840b 1091 ((__GPIOx__) == (GPIOF))? 5U :\
Kojto 110:165afa46840b 1092 ((__GPIOx__) == (GPIOG))? 6U : 8U)
Kojto 110:165afa46840b 1093 #endif /* STM32F446xx */
Kojto 110:165afa46840b 1094
Kojto 110:165afa46840b 1095 /**
Kojto 110:165afa46840b 1096 * @}
Kojto 110:165afa46840b 1097 */
Kojto 110:165afa46840b 1098
Kojto 110:165afa46840b 1099 /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function
Kojto 110:165afa46840b 1100 * @{
Kojto 110:165afa46840b 1101 */
Kojto 110:165afa46840b 1102 /*------------------------- STM32F429xx/STM32F439xx---------------------------*/
Kojto 110:165afa46840b 1103 #if defined(STM32F429xx) || defined(STM32F439xx)
Kojto 110:165afa46840b 1104 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1105 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1106 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1107 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1108 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1109 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1110 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1111 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1112 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1113 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1114 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1115 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1116 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1117 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1118 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1119 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
Kojto 110:165afa46840b 1120 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
Kojto 110:165afa46840b 1121 ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1122 ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
Kojto 110:165afa46840b 1123 ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
Kojto 110:165afa46840b 1124 ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \
Kojto 110:165afa46840b 1125 ((AF) == GPIO_AF14_LTDC))
Kojto 110:165afa46840b 1126
Kojto 110:165afa46840b 1127 #endif /* STM32F429xx || STM32F439xx */
Kojto 110:165afa46840b 1128 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1129
Kojto 110:165afa46840b 1130 /*---------------------------------- STM32F427xx/STM32F437xx------------------*/
Kojto 110:165afa46840b 1131 #if defined(STM32F427xx) || defined(STM32F437xx)
Kojto 110:165afa46840b 1132 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1133 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1134 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1135 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1136 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1137 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1138 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1139 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1140 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1141 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1142 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1143 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1144 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1145 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1146 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1147 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
Kojto 110:165afa46840b 1148 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
Kojto 110:165afa46840b 1149 ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1150 ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
Kojto 110:165afa46840b 1151 ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
Kojto 110:165afa46840b 1152 ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1))
Kojto 110:165afa46840b 1153
Kojto 110:165afa46840b 1154 #endif /* STM32F427xx || STM32F437xx */
Kojto 110:165afa46840b 1155 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1156
Kojto 110:165afa46840b 1157 /*---------------------------------- STM32F407xx/STM32F417xx------------------*/
Kojto 110:165afa46840b 1158 #if defined(STM32F407xx) || defined(STM32F417xx)
Kojto 110:165afa46840b 1159 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1160 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1161 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1162 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1163 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1164 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1165 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1166 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1167 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1168 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1169 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1170 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1171 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1172 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1173 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1174 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
Kojto 110:165afa46840b 1175 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
Kojto 110:165afa46840b 1176 ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
Kojto 110:165afa46840b 1177
Kojto 110:165afa46840b 1178 #endif /* STM32F407xx || STM32F417xx */
Kojto 110:165afa46840b 1179 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1180
Kojto 110:165afa46840b 1181 /*---------------------------------- STM32F405xx/STM32F415xx------------------*/
Kojto 110:165afa46840b 1182 #if defined(STM32F405xx) || defined(STM32F415xx)
Kojto 110:165afa46840b 1183 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1184 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1185 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1186 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1187 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1188 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1189 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1190 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1191 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1192 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1193 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1194 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1195 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1196 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1197 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1198 ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \
Kojto 110:165afa46840b 1199 ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
Kojto 110:165afa46840b 1200
Kojto 110:165afa46840b 1201 #endif /* STM32F405xx || STM32F415xx */
Kojto 110:165afa46840b 1202
Kojto 110:165afa46840b 1203 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1204
Kojto 110:165afa46840b 1205 /*---------------------------------------- STM32F401xx------------------------*/
Kojto 110:165afa46840b 1206 #if defined(STM32F401xC) || defined(STM32F401xE)
Kojto 110:165afa46840b 1207 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1208 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1209 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1210 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1211 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1212 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \
Kojto 110:165afa46840b 1213 ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \
Kojto 110:165afa46840b 1214 ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
Kojto 110:165afa46840b 1215 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1216 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1217 ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \
Kojto 110:165afa46840b 1218 ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \
Kojto 110:165afa46840b 1219 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT))
Kojto 110:165afa46840b 1220
Kojto 110:165afa46840b 1221 #endif /* STM32F401xC || STM32F401xE */
Kojto 110:165afa46840b 1222 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1223 /*---------------------------------------- STM32F410xx------------------------*/
Kojto 110:165afa46840b 1224 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
Kojto 110:165afa46840b 1225 #define IS_GPIO_AF(AF) (((AF) < 10) || ((AF) == 15))
Kojto 110:165afa46840b 1226 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
Kojto 110:165afa46840b 1227
Kojto 110:165afa46840b 1228 /*---------------------------------------- STM32F411xx------------------------*/
Kojto 110:165afa46840b 1229 #if defined(STM32F411xE)
Kojto 110:165afa46840b 1230 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1231 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1232 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1233 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1234 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1235 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \
Kojto 110:165afa46840b 1236 ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \
Kojto 110:165afa46840b 1237 ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
Kojto 110:165afa46840b 1238 ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF6_SPI4) || \
Kojto 110:165afa46840b 1239 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1240 ((AF) == GPIO_AF6_SPI5) || ((AF) == GPIO_AF7_SPI3) || \
Kojto 110:165afa46840b 1241 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1242 ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \
Kojto 110:165afa46840b 1243 ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \
Kojto 110:165afa46840b 1244 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT))
Kojto 110:165afa46840b 1245
Kojto 110:165afa46840b 1246 #endif /* STM32F411xE */
Kojto 110:165afa46840b 1247 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1248
Kojto 110:165afa46840b 1249 /*----------------------------------------------- STM32F446xx ----------------*/
Kojto 110:165afa46840b 1250 #if defined(STM32F446xx)
Kojto 110:165afa46840b 1251 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1252 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1253 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1254 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1255 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1256 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1257 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1258 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1259 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1260 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1261 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1262 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1263 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1264 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1265 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1266 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
Kojto 110:165afa46840b 1267 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
Kojto 110:165afa46840b 1268 ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1269 ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \
Kojto 110:165afa46840b 1270 ((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
Kojto 110:165afa46840b 1271 ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF6_SPI2) || \
Kojto 110:165afa46840b 1272 ((AF) == GPIO_AF6_SPI4) || ((AF) == GPIO_AF7_UART5) || \
Kojto 110:165afa46840b 1273 ((AF) == GPIO_AF7_SPI2) || ((AF) == GPIO_AF7_SPI3) || \
Kojto 110:165afa46840b 1274 ((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
Kojto 110:165afa46840b 1275 ((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF9_QSPI) || \
Kojto 110:165afa46840b 1276 ((AF) == GPIO_AF10_SAI2) || ((AF) == GPIO_AF10_QSPI))
Kojto 110:165afa46840b 1277
Kojto 110:165afa46840b 1278 #endif /* STM32F446xx */
Kojto 110:165afa46840b 1279 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1280
Kojto 110:165afa46840b 1281 /*------------------------------------------- STM32F469xx/STM32F479xx --------*/
Kojto 110:165afa46840b 1282 #if defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 1283 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
Kojto 110:165afa46840b 1284 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
Kojto 110:165afa46840b 1285 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
Kojto 110:165afa46840b 1286 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
Kojto 110:165afa46840b 1287 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
Kojto 110:165afa46840b 1288 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
Kojto 110:165afa46840b 1289 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
Kojto 110:165afa46840b 1290 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
Kojto 110:165afa46840b 1291 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
Kojto 110:165afa46840b 1292 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
Kojto 110:165afa46840b 1293 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
Kojto 110:165afa46840b 1294 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
Kojto 110:165afa46840b 1295 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
Kojto 110:165afa46840b 1296 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
Kojto 110:165afa46840b 1297 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
Kojto 110:165afa46840b 1298 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
Kojto 110:165afa46840b 1299 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
Kojto 110:165afa46840b 1300 ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \
Kojto 110:165afa46840b 1301 ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
Kojto 110:165afa46840b 1302 ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
Kojto 110:165afa46840b 1303 ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \
Kojto 110:165afa46840b 1304 ((AF) == GPIO_AF14_LTDC) || ((AF) == GPIO_AF13_DSI) || \
Kojto 110:165afa46840b 1305 ((AF) == GPIO_AF9_QSPI) || ((AF) == GPIO_AF10_QSPI))
Kojto 110:165afa46840b 1306
Kojto 110:165afa46840b 1307 #endif /* STM32F469xx || STM32F479xx */
Kojto 110:165afa46840b 1308 /*----------------------------------------------------------------------------*/
Kojto 110:165afa46840b 1309
Kojto 110:165afa46840b 1310 /**
Kojto 110:165afa46840b 1311 * @}
Kojto 110:165afa46840b 1312 */
Kojto 110:165afa46840b 1313
Kojto 110:165afa46840b 1314 /**
Kojto 110:165afa46840b 1315 * @}
Kojto 110:165afa46840b 1316 */
Kojto 110:165afa46840b 1317
Kojto 110:165afa46840b 1318 /* Private functions ---------------------------------------------------------*/
Kojto 110:165afa46840b 1319 /** @defgroup GPIOEx_Private_Functions GPIO Private Functions
Kojto 110:165afa46840b 1320 * @{
Kojto 110:165afa46840b 1321 */
Kojto 110:165afa46840b 1322
Kojto 110:165afa46840b 1323 /**
Kojto 110:165afa46840b 1324 * @}
Kojto 110:165afa46840b 1325 */
Kojto 110:165afa46840b 1326
Kojto 110:165afa46840b 1327 /**
Kojto 110:165afa46840b 1328 * @}
Kojto 110:165afa46840b 1329 */
Kojto 110:165afa46840b 1330
Kojto 110:165afa46840b 1331 /**
Kojto 110:165afa46840b 1332 * @}
Kojto 110:165afa46840b 1333 */
Kojto 110:165afa46840b 1334
Kojto 110:165afa46840b 1335 #ifdef __cplusplus
Kojto 110:165afa46840b 1336 }
Kojto 110:165afa46840b 1337 #endif
Kojto 110:165afa46840b 1338
Kojto 110:165afa46840b 1339 #endif /* __STM32F4xx_HAL_GPIO_EX_H */
Kojto 110:165afa46840b 1340
Kojto 110:165afa46840b 1341 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/