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

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

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

Who changed what in which revision?

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