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