mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
110:165afa46840b
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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