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