meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Parent:
90:cb3d968589d8
Child:
106:ba1f97679dad
Release 99 of the mbed library

Changes:
- new targets - MAXWSNENV, DISCO_L053C8
- STM32F4xx - ST Cube driver
- KSDK mcu - SPI timing fix
- Nordic - update to softdevice s130

Who changed what in which revision?

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