Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

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