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:
112:6f327212ef96
.

Who changed what in which revision?

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