Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Parent:
92:4fc01daae5a5
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
bogdanm 89:552587b429a1 1 /**
bogdanm 89:552587b429a1 2 ******************************************************************************
bogdanm 89:552587b429a1 3 * @file stm32f4xx_hal_gpio_ex.h
bogdanm 89:552587b429a1 4 * @author MCD Application Team
Kojto 99:dbbf35b96557 5 * @version V1.3.0
Kojto 99:dbbf35b96557 6 * @date 09-March-2015
bogdanm 89:552587b429a1 7 * @brief Header file of GPIO HAL Extension module.
bogdanm 89:552587b429a1 8 ******************************************************************************
bogdanm 89:552587b429a1 9 * @attention
bogdanm 89:552587b429a1 10 *
Kojto 99:dbbf35b96557 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 89:552587b429a1 12 *
bogdanm 89:552587b429a1 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 89:552587b429a1 14 * are permitted provided that the following conditions are met:
bogdanm 89:552587b429a1 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 89:552587b429a1 16 * this list of conditions and the following disclaimer.
bogdanm 89:552587b429a1 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 89:552587b429a1 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 89:552587b429a1 19 * and/or other materials provided with the distribution.
bogdanm 89:552587b429a1 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 89:552587b429a1 21 * may be used to endorse or promote products derived from this software
bogdanm 89:552587b429a1 22 * without specific prior written permission.
bogdanm 89:552587b429a1 23 *
bogdanm 89:552587b429a1 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 89:552587b429a1 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 89:552587b429a1 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 89:552587b429a1 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 89:552587b429a1 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 89:552587b429a1 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 89:552587b429a1 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 89:552587b429a1 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 89:552587b429a1 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 89:552587b429a1 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 89:552587b429a1 34 *
bogdanm 89:552587b429a1 35 ******************************************************************************
bogdanm 89:552587b429a1 36 */
bogdanm 89:552587b429a1 37
bogdanm 89:552587b429a1 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 89:552587b429a1 39 #ifndef __STM32F4xx_HAL_GPIO_EX_H
bogdanm 89:552587b429a1 40 #define __STM32F4xx_HAL_GPIO_EX_H
bogdanm 89:552587b429a1 41
bogdanm 89:552587b429a1 42 #ifdef __cplusplus
bogdanm 89:552587b429a1 43 extern "C" {
bogdanm 89:552587b429a1 44 #endif
bogdanm 89:552587b429a1 45
bogdanm 89:552587b429a1 46 /* Includes ------------------------------------------------------------------*/
bogdanm 89:552587b429a1 47 #include "stm32f4xx_hal_def.h"
bogdanm 89:552587b429a1 48
bogdanm 89:552587b429a1 49 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 89:552587b429a1 50 * @{
bogdanm 89:552587b429a1 51 */
bogdanm 89:552587b429a1 52
Kojto 99:dbbf35b96557 53 /** @defgroup GPIOEx GPIOEx
bogdanm 89:552587b429a1 54 * @{
bogdanm 89:552587b429a1 55 */
bogdanm 89:552587b429a1 56
bogdanm 89:552587b429a1 57 /* Exported types ------------------------------------------------------------*/
bogdanm 89:552587b429a1 58 /* Exported constants --------------------------------------------------------*/
Kojto 99:dbbf35b96557 59 /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
bogdanm 89:552587b429a1 60 * @{
bogdanm 89:552587b429a1 61 */
bogdanm 89:552587b429a1 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 --------------------------------------*/
bogdanm 89:552587b429a1 68 #if defined (STM32F429xx) || defined (STM32F439xx)
bogdanm 89:552587b429a1 69 /**
bogdanm 89:552587b429a1 70 * @brief AF 0 selection
bogdanm 89:552587b429a1 71 */
bogdanm 89:552587b429a1 72 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 89:552587b429a1 73 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 89:552587b429a1 74 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 89:552587b429a1 75 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 89:552587b429a1 76 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 89:552587b429a1 77
bogdanm 89:552587b429a1 78 /**
bogdanm 89:552587b429a1 79 * @brief AF 1 selection
bogdanm 89:552587b429a1 80 */
bogdanm 89:552587b429a1 81 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 89:552587b429a1 82 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 89:552587b429a1 83
bogdanm 89:552587b429a1 84 /**
bogdanm 89:552587b429a1 85 * @brief AF 2 selection
bogdanm 89:552587b429a1 86 */
bogdanm 89:552587b429a1 87 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 89:552587b429a1 88 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 89:552587b429a1 89 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 89:552587b429a1 90
bogdanm 89:552587b429a1 91 /**
bogdanm 89:552587b429a1 92 * @brief AF 3 selection
bogdanm 89:552587b429a1 93 */
bogdanm 89:552587b429a1 94 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
bogdanm 89:552587b429a1 95 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 89:552587b429a1 96 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 89:552587b429a1 97 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 89:552587b429a1 98
bogdanm 89:552587b429a1 99 /**
bogdanm 89:552587b429a1 100 * @brief AF 4 selection
bogdanm 89:552587b429a1 101 */
bogdanm 89:552587b429a1 102 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 89:552587b429a1 103 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 104 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 105
bogdanm 89:552587b429a1 106 /**
bogdanm 89:552587b429a1 107 * @brief AF 5 selection
bogdanm 89:552587b429a1 108 */
bogdanm 89:552587b429a1 109 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
bogdanm 89:552587b429a1 110 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 99:dbbf35b96557 111 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 112 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
bogdanm 89:552587b429a1 113 #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
bogdanm 89:552587b429a1 114 #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
bogdanm 89:552587b429a1 115 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 116
bogdanm 89:552587b429a1 117 /**
bogdanm 89:552587b429a1 118 * @brief AF 6 selection
bogdanm 89:552587b429a1 119 */
bogdanm 89:552587b429a1 120 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 121 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 122 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
bogdanm 89:552587b429a1 123
bogdanm 89:552587b429a1 124 /**
bogdanm 89:552587b429a1 125 * @brief AF 7 selection
bogdanm 89:552587b429a1 126 */
bogdanm 89:552587b429a1 127 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 89:552587b429a1 128 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 89:552587b429a1 129 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
bogdanm 89:552587b429a1 130 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 131
bogdanm 89:552587b429a1 132 /**
bogdanm 89:552587b429a1 133 * @brief AF 8 selection
bogdanm 89:552587b429a1 134 */
bogdanm 89:552587b429a1 135 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
bogdanm 89:552587b429a1 136 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
bogdanm 89:552587b429a1 137 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 89:552587b429a1 138 #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */
bogdanm 89:552587b429a1 139 #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
bogdanm 89:552587b429a1 140
bogdanm 89:552587b429a1 141 /**
bogdanm 89:552587b429a1 142 * @brief AF 9 selection
bogdanm 89:552587b429a1 143 */
bogdanm 89:552587b429a1 144 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
bogdanm 89:552587b429a1 145 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
bogdanm 89:552587b429a1 146 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
bogdanm 89:552587b429a1 147 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
bogdanm 89:552587b429a1 148 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 89:552587b429a1 149 #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LCD-TFT Alternate Function mapping */
bogdanm 89:552587b429a1 150
bogdanm 89:552587b429a1 151 /**
bogdanm 89:552587b429a1 152 * @brief AF 10 selection
bogdanm 89:552587b429a1 153 */
bogdanm 89:552587b429a1 154 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 89:552587b429a1 155 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
bogdanm 89:552587b429a1 156
bogdanm 89:552587b429a1 157 /**
bogdanm 89:552587b429a1 158 * @brief AF 11 selection
bogdanm 89:552587b429a1 159 */
bogdanm 89:552587b429a1 160 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
bogdanm 89:552587b429a1 161
bogdanm 89:552587b429a1 162 /**
bogdanm 89:552587b429a1 163 * @brief AF 12 selection
bogdanm 89:552587b429a1 164 */
bogdanm 89:552587b429a1 165 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
bogdanm 89:552587b429a1 166 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
bogdanm 89:552587b429a1 167 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 89:552587b429a1 168
bogdanm 89:552587b429a1 169 /**
bogdanm 89:552587b429a1 170 * @brief AF 13 selection
bogdanm 89:552587b429a1 171 */
bogdanm 89:552587b429a1 172 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
bogdanm 89:552587b429a1 173
bogdanm 89:552587b429a1 174 /**
bogdanm 89:552587b429a1 175 * @brief AF 14 selection
bogdanm 89:552587b429a1 176 */
bogdanm 89:552587b429a1 177 #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LCD-TFT Alternate Function mapping */
bogdanm 89:552587b429a1 178
bogdanm 89:552587b429a1 179 /**
bogdanm 89:552587b429a1 180 * @brief AF 15 selection
bogdanm 89:552587b429a1 181 */
bogdanm 89:552587b429a1 182 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
bogdanm 89:552587b429a1 183 #endif /* STM32F429xx || STM32F439xx */
bogdanm 89:552587b429a1 184 /*------------------------------------------------------------------------------------------*/
bogdanm 89:552587b429a1 185
bogdanm 89:552587b429a1 186 /*---------------------------------- STM32F427xx/STM32F437xx--------------------------------*/
bogdanm 89:552587b429a1 187 #if defined (STM32F427xx) || defined (STM32F437xx)
bogdanm 89:552587b429a1 188 /**
bogdanm 89:552587b429a1 189 * @brief AF 0 selection
bogdanm 89:552587b429a1 190 */
bogdanm 89:552587b429a1 191 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 89:552587b429a1 192 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 89:552587b429a1 193 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 89:552587b429a1 194 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 89:552587b429a1 195 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 89:552587b429a1 196
bogdanm 89:552587b429a1 197 /**
bogdanm 89:552587b429a1 198 * @brief AF 1 selection
bogdanm 89:552587b429a1 199 */
bogdanm 89:552587b429a1 200 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 89:552587b429a1 201 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 89:552587b429a1 202
bogdanm 89:552587b429a1 203 /**
bogdanm 89:552587b429a1 204 * @brief AF 2 selection
bogdanm 89:552587b429a1 205 */
bogdanm 89:552587b429a1 206 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 89:552587b429a1 207 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 89:552587b429a1 208 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 89:552587b429a1 209
bogdanm 89:552587b429a1 210 /**
bogdanm 89:552587b429a1 211 * @brief AF 3 selection
bogdanm 89:552587b429a1 212 */
bogdanm 89:552587b429a1 213 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
bogdanm 89:552587b429a1 214 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 89:552587b429a1 215 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 89:552587b429a1 216 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 89:552587b429a1 217
bogdanm 89:552587b429a1 218 /**
bogdanm 89:552587b429a1 219 * @brief AF 4 selection
bogdanm 89:552587b429a1 220 */
bogdanm 89:552587b429a1 221 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 89:552587b429a1 222 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 223 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 224
bogdanm 89:552587b429a1 225 /**
bogdanm 89:552587b429a1 226 * @brief AF 5 selection
bogdanm 89:552587b429a1 227 */
bogdanm 89:552587b429a1 228 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
bogdanm 89:552587b429a1 229 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 99:dbbf35b96557 230 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 231 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
bogdanm 89:552587b429a1 232 #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
bogdanm 89:552587b429a1 233 #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
Kojto 99:dbbf35b96557 234 /** @brief GPIO_Legacy
Kojto 99:dbbf35b96557 235 */
Kojto 99:dbbf35b96557 236 #define GPIO_AF5_I2S3ext GPIO_AF5_SPI3 /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 237
bogdanm 89:552587b429a1 238 /**
bogdanm 89:552587b429a1 239 * @brief AF 6 selection
bogdanm 89:552587b429a1 240 */
bogdanm 89:552587b429a1 241 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 242 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 243 #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
bogdanm 89:552587b429a1 244
bogdanm 89:552587b429a1 245 /**
bogdanm 89:552587b429a1 246 * @brief AF 7 selection
bogdanm 89:552587b429a1 247 */
bogdanm 89:552587b429a1 248 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 89:552587b429a1 249 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 89:552587b429a1 250 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
bogdanm 89:552587b429a1 251 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 252
bogdanm 89:552587b429a1 253 /**
bogdanm 89:552587b429a1 254 * @brief AF 8 selection
bogdanm 89:552587b429a1 255 */
bogdanm 89:552587b429a1 256 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
bogdanm 89:552587b429a1 257 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
bogdanm 89:552587b429a1 258 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 89:552587b429a1 259 #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */
bogdanm 89:552587b429a1 260 #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
bogdanm 89:552587b429a1 261
bogdanm 89:552587b429a1 262 /**
bogdanm 89:552587b429a1 263 * @brief AF 9 selection
bogdanm 89:552587b429a1 264 */
bogdanm 89:552587b429a1 265 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
bogdanm 89:552587b429a1 266 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
bogdanm 89:552587b429a1 267 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
bogdanm 89:552587b429a1 268 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
bogdanm 89:552587b429a1 269 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 89:552587b429a1 270
bogdanm 89:552587b429a1 271 /**
bogdanm 89:552587b429a1 272 * @brief AF 10 selection
bogdanm 89:552587b429a1 273 */
bogdanm 89:552587b429a1 274 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 89:552587b429a1 275 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
bogdanm 89:552587b429a1 276
bogdanm 89:552587b429a1 277 /**
bogdanm 89:552587b429a1 278 * @brief AF 11 selection
bogdanm 89:552587b429a1 279 */
bogdanm 89:552587b429a1 280 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
bogdanm 89:552587b429a1 281
bogdanm 89:552587b429a1 282 /**
bogdanm 89:552587b429a1 283 * @brief AF 12 selection
bogdanm 89:552587b429a1 284 */
bogdanm 89:552587b429a1 285 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
bogdanm 89:552587b429a1 286 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
bogdanm 89:552587b429a1 287 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 89:552587b429a1 288
bogdanm 89:552587b429a1 289 /**
bogdanm 89:552587b429a1 290 * @brief AF 13 selection
bogdanm 89:552587b429a1 291 */
bogdanm 89:552587b429a1 292 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
bogdanm 89:552587b429a1 293
bogdanm 89:552587b429a1 294 /**
bogdanm 89:552587b429a1 295 * @brief AF 15 selection
bogdanm 89:552587b429a1 296 */
bogdanm 89:552587b429a1 297 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
bogdanm 89:552587b429a1 298 #endif /* STM32F427xx || STM32F437xx */
bogdanm 89:552587b429a1 299 /*------------------------------------------------------------------------------------------*/
bogdanm 89:552587b429a1 300
bogdanm 89:552587b429a1 301 /*---------------------------------- STM32F407xx/STM32F417xx--------------------------------*/
bogdanm 89:552587b429a1 302 #if defined (STM32F407xx) || defined (STM32F417xx)
bogdanm 89:552587b429a1 303 /**
bogdanm 89:552587b429a1 304 * @brief AF 0 selection
bogdanm 89:552587b429a1 305 */
bogdanm 89:552587b429a1 306 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 89:552587b429a1 307 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 89:552587b429a1 308 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 89:552587b429a1 309 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 89:552587b429a1 310 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 89:552587b429a1 311
bogdanm 89:552587b429a1 312 /**
bogdanm 89:552587b429a1 313 * @brief AF 1 selection
bogdanm 89:552587b429a1 314 */
bogdanm 89:552587b429a1 315 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 89:552587b429a1 316 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 89:552587b429a1 317
bogdanm 89:552587b429a1 318 /**
bogdanm 89:552587b429a1 319 * @brief AF 2 selection
bogdanm 89:552587b429a1 320 */
bogdanm 89:552587b429a1 321 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 89:552587b429a1 322 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 89:552587b429a1 323 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 89:552587b429a1 324
bogdanm 89:552587b429a1 325 /**
bogdanm 89:552587b429a1 326 * @brief AF 3 selection
bogdanm 89:552587b429a1 327 */
bogdanm 89:552587b429a1 328 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
bogdanm 89:552587b429a1 329 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 89:552587b429a1 330 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 89:552587b429a1 331 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 89:552587b429a1 332
bogdanm 89:552587b429a1 333 /**
bogdanm 89:552587b429a1 334 * @brief AF 4 selection
bogdanm 89:552587b429a1 335 */
bogdanm 89:552587b429a1 336 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 89:552587b429a1 337 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 338 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 339
bogdanm 89:552587b429a1 340 /**
bogdanm 89:552587b429a1 341 * @brief AF 5 selection
bogdanm 89:552587b429a1 342 */
bogdanm 89:552587b429a1 343 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
bogdanm 89:552587b429a1 344 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
bogdanm 89:552587b429a1 345 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 346
bogdanm 89:552587b429a1 347 /**
bogdanm 89:552587b429a1 348 * @brief AF 6 selection
bogdanm 89:552587b429a1 349 */
bogdanm 89:552587b429a1 350 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 351 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 352
bogdanm 89:552587b429a1 353 /**
bogdanm 89:552587b429a1 354 * @brief AF 7 selection
bogdanm 89:552587b429a1 355 */
bogdanm 89:552587b429a1 356 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 89:552587b429a1 357 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 89:552587b429a1 358 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
bogdanm 89:552587b429a1 359 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 360
bogdanm 89:552587b429a1 361 /**
bogdanm 89:552587b429a1 362 * @brief AF 8 selection
bogdanm 89:552587b429a1 363 */
bogdanm 89:552587b429a1 364 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
bogdanm 89:552587b429a1 365 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
bogdanm 89:552587b429a1 366 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 89:552587b429a1 367
bogdanm 89:552587b429a1 368 /**
bogdanm 89:552587b429a1 369 * @brief AF 9 selection
bogdanm 89:552587b429a1 370 */
bogdanm 89:552587b429a1 371 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
bogdanm 89:552587b429a1 372 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
bogdanm 89:552587b429a1 373 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
bogdanm 89:552587b429a1 374 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
bogdanm 89:552587b429a1 375 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 89:552587b429a1 376
bogdanm 89:552587b429a1 377 /**
bogdanm 89:552587b429a1 378 * @brief AF 10 selection
bogdanm 89:552587b429a1 379 */
bogdanm 89:552587b429a1 380 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 89:552587b429a1 381 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
bogdanm 89:552587b429a1 382
bogdanm 89:552587b429a1 383 /**
bogdanm 89:552587b429a1 384 * @brief AF 11 selection
bogdanm 89:552587b429a1 385 */
bogdanm 89:552587b429a1 386 #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
bogdanm 89:552587b429a1 387
bogdanm 89:552587b429a1 388 /**
bogdanm 89:552587b429a1 389 * @brief AF 12 selection
bogdanm 89:552587b429a1 390 */
bogdanm 89:552587b429a1 391 #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */
bogdanm 89:552587b429a1 392 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
bogdanm 89:552587b429a1 393 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 89:552587b429a1 394
bogdanm 89:552587b429a1 395 /**
bogdanm 89:552587b429a1 396 * @brief AF 13 selection
bogdanm 89:552587b429a1 397 */
bogdanm 89:552587b429a1 398 #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
bogdanm 89:552587b429a1 399
bogdanm 89:552587b429a1 400 /**
bogdanm 89:552587b429a1 401 * @brief AF 15 selection
bogdanm 89:552587b429a1 402 */
bogdanm 89:552587b429a1 403 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
bogdanm 89:552587b429a1 404 #endif /* STM32F407xx || STM32F417xx */
bogdanm 89:552587b429a1 405 /*------------------------------------------------------------------------------------------*/
bogdanm 89:552587b429a1 406
bogdanm 89:552587b429a1 407 /*---------------------------------- STM32F405xx/STM32F415xx--------------------------------*/
bogdanm 89:552587b429a1 408 #if defined (STM32F405xx) || defined (STM32F415xx)
bogdanm 89:552587b429a1 409 /**
bogdanm 89:552587b429a1 410 * @brief AF 0 selection
bogdanm 89:552587b429a1 411 */
bogdanm 89:552587b429a1 412 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 89:552587b429a1 413 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 89:552587b429a1 414 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 89:552587b429a1 415 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 89:552587b429a1 416 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 89:552587b429a1 417
bogdanm 89:552587b429a1 418 /**
bogdanm 89:552587b429a1 419 * @brief AF 1 selection
bogdanm 89:552587b429a1 420 */
bogdanm 89:552587b429a1 421 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 89:552587b429a1 422 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 89:552587b429a1 423
bogdanm 89:552587b429a1 424 /**
bogdanm 89:552587b429a1 425 * @brief AF 2 selection
bogdanm 89:552587b429a1 426 */
bogdanm 89:552587b429a1 427 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 89:552587b429a1 428 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 89:552587b429a1 429 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 89:552587b429a1 430
bogdanm 89:552587b429a1 431 /**
bogdanm 89:552587b429a1 432 * @brief AF 3 selection
bogdanm 89:552587b429a1 433 */
bogdanm 89:552587b429a1 434 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
bogdanm 89:552587b429a1 435 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 89:552587b429a1 436 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 89:552587b429a1 437 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 89:552587b429a1 438
bogdanm 89:552587b429a1 439 /**
bogdanm 89:552587b429a1 440 * @brief AF 4 selection
bogdanm 89:552587b429a1 441 */
bogdanm 89:552587b429a1 442 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 89:552587b429a1 443 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 444 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 445
bogdanm 89:552587b429a1 446 /**
bogdanm 89:552587b429a1 447 * @brief AF 5 selection
bogdanm 89:552587b429a1 448 */
bogdanm 89:552587b429a1 449 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
bogdanm 89:552587b429a1 450 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
bogdanm 89:552587b429a1 451 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 452
bogdanm 89:552587b429a1 453 /**
bogdanm 89:552587b429a1 454 * @brief AF 6 selection
bogdanm 89:552587b429a1 455 */
bogdanm 89:552587b429a1 456 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 99:dbbf35b96557 457 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 458
bogdanm 89:552587b429a1 459 /**
bogdanm 89:552587b429a1 460 * @brief AF 7 selection
bogdanm 89:552587b429a1 461 */
bogdanm 89:552587b429a1 462 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 89:552587b429a1 463 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 89:552587b429a1 464 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
bogdanm 89:552587b429a1 465 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 466
bogdanm 89:552587b429a1 467 /**
bogdanm 89:552587b429a1 468 * @brief AF 8 selection
bogdanm 89:552587b429a1 469 */
bogdanm 89:552587b429a1 470 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
bogdanm 89:552587b429a1 471 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
bogdanm 89:552587b429a1 472 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 89:552587b429a1 473
bogdanm 89:552587b429a1 474 /**
bogdanm 89:552587b429a1 475 * @brief AF 9 selection
bogdanm 89:552587b429a1 476 */
bogdanm 89:552587b429a1 477 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
bogdanm 89:552587b429a1 478 #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
bogdanm 89:552587b429a1 479 #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
bogdanm 89:552587b429a1 480 #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
bogdanm 89:552587b429a1 481 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 89:552587b429a1 482
bogdanm 89:552587b429a1 483 /**
bogdanm 89:552587b429a1 484 * @brief AF 10 selection
bogdanm 89:552587b429a1 485 */
bogdanm 89:552587b429a1 486 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 89:552587b429a1 487 #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
bogdanm 89:552587b429a1 488
bogdanm 89:552587b429a1 489 /**
bogdanm 89:552587b429a1 490 * @brief AF 12 selection
bogdanm 89:552587b429a1 491 */
bogdanm 89:552587b429a1 492 #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */
bogdanm 89:552587b429a1 493 #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
bogdanm 89:552587b429a1 494 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 89:552587b429a1 495
bogdanm 89:552587b429a1 496 /**
bogdanm 89:552587b429a1 497 * @brief AF 15 selection
bogdanm 89:552587b429a1 498 */
bogdanm 89:552587b429a1 499 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
bogdanm 89:552587b429a1 500 #endif /* STM32F405xx || STM32F415xx */
bogdanm 89:552587b429a1 501
bogdanm 89:552587b429a1 502 /*------------------------------------------------------------------------------------------*/
bogdanm 89:552587b429a1 503
bogdanm 89:552587b429a1 504 /*---------------------------------------- STM32F401xx--------------------------------------*/
bogdanm 89:552587b429a1 505 #if defined(STM32F401xC) || defined(STM32F401xE)
bogdanm 89:552587b429a1 506 /**
bogdanm 89:552587b429a1 507 * @brief AF 0 selection
bogdanm 89:552587b429a1 508 */
bogdanm 89:552587b429a1 509 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 89:552587b429a1 510 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 89:552587b429a1 511 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 89:552587b429a1 512 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 89:552587b429a1 513 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 89:552587b429a1 514
bogdanm 89:552587b429a1 515 /**
bogdanm 89:552587b429a1 516 * @brief AF 1 selection
bogdanm 89:552587b429a1 517 */
bogdanm 89:552587b429a1 518 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 89:552587b429a1 519 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 89:552587b429a1 520
bogdanm 89:552587b429a1 521 /**
bogdanm 89:552587b429a1 522 * @brief AF 2 selection
bogdanm 89:552587b429a1 523 */
bogdanm 89:552587b429a1 524 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 89:552587b429a1 525 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 89:552587b429a1 526 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 89:552587b429a1 527
bogdanm 89:552587b429a1 528 /**
bogdanm 89:552587b429a1 529 * @brief AF 3 selection
bogdanm 89:552587b429a1 530 */
bogdanm 89:552587b429a1 531 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 89:552587b429a1 532 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 89:552587b429a1 533 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 89:552587b429a1 534
bogdanm 89:552587b429a1 535 /**
bogdanm 89:552587b429a1 536 * @brief AF 4 selection
bogdanm 89:552587b429a1 537 */
bogdanm 89:552587b429a1 538 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 89:552587b429a1 539 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 540 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 541
bogdanm 89:552587b429a1 542 /**
bogdanm 89:552587b429a1 543 * @brief AF 5 selection
bogdanm 89:552587b429a1 544 */
bogdanm 89:552587b429a1 545 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
bogdanm 89:552587b429a1 546 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
bogdanm 89:552587b429a1 547 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
bogdanm 89:552587b429a1 548 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 549
bogdanm 89:552587b429a1 550 /**
bogdanm 89:552587b429a1 551 * @brief AF 6 selection
bogdanm 89:552587b429a1 552 */
bogdanm 89:552587b429a1 553 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 89:552587b429a1 554 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 555
bogdanm 89:552587b429a1 556 /**
bogdanm 89:552587b429a1 557 * @brief AF 7 selection
bogdanm 89:552587b429a1 558 */
bogdanm 89:552587b429a1 559 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 89:552587b429a1 560 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 89:552587b429a1 561 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 89:552587b429a1 562
bogdanm 89:552587b429a1 563 /**
bogdanm 89:552587b429a1 564 * @brief AF 8 selection
bogdanm 89:552587b429a1 565 */
bogdanm 89:552587b429a1 566 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 89:552587b429a1 567
bogdanm 89:552587b429a1 568 /**
bogdanm 89:552587b429a1 569 * @brief AF 9 selection
bogdanm 89:552587b429a1 570 */
bogdanm 89:552587b429a1 571 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 89:552587b429a1 572 #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */
bogdanm 89:552587b429a1 573 #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */
bogdanm 89:552587b429a1 574
bogdanm 89:552587b429a1 575
bogdanm 89:552587b429a1 576 /**
bogdanm 89:552587b429a1 577 * @brief AF 10 selection
bogdanm 89:552587b429a1 578 */
bogdanm 89:552587b429a1 579 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 89:552587b429a1 580
bogdanm 89:552587b429a1 581 /**
bogdanm 89:552587b429a1 582 * @brief AF 12 selection
bogdanm 89:552587b429a1 583 */
bogdanm 89:552587b429a1 584 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 89:552587b429a1 585
bogdanm 89:552587b429a1 586 /**
bogdanm 89:552587b429a1 587 * @brief AF 15 selection
bogdanm 89:552587b429a1 588 */
bogdanm 89:552587b429a1 589 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
bogdanm 89:552587b429a1 590 #endif /* STM32F401xC || STM32F401xE */
bogdanm 92:4fc01daae5a5 591 /*------------------------------------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 592
bogdanm 92:4fc01daae5a5 593 /*---------------------------------------- STM32F411xx--------------------------------------*/
bogdanm 92:4fc01daae5a5 594 #if defined(STM32F411xE)
bogdanm 92:4fc01daae5a5 595 /**
bogdanm 92:4fc01daae5a5 596 * @brief AF 0 selection
bogdanm 92:4fc01daae5a5 597 */
bogdanm 92:4fc01daae5a5 598 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
bogdanm 92:4fc01daae5a5 599 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
bogdanm 92:4fc01daae5a5 600 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
bogdanm 92:4fc01daae5a5 601 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
bogdanm 92:4fc01daae5a5 602 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
bogdanm 92:4fc01daae5a5 603
bogdanm 92:4fc01daae5a5 604 /**
bogdanm 92:4fc01daae5a5 605 * @brief AF 1 selection
bogdanm 92:4fc01daae5a5 606 */
bogdanm 92:4fc01daae5a5 607 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 608 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 609
bogdanm 92:4fc01daae5a5 610 /**
bogdanm 92:4fc01daae5a5 611 * @brief AF 2 selection
bogdanm 92:4fc01daae5a5 612 */
bogdanm 92:4fc01daae5a5 613 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 614 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 615 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 616
bogdanm 92:4fc01daae5a5 617 /**
bogdanm 92:4fc01daae5a5 618 * @brief AF 3 selection
bogdanm 92:4fc01daae5a5 619 */
bogdanm 92:4fc01daae5a5 620 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 621 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 622 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 623
bogdanm 92:4fc01daae5a5 624 /**
bogdanm 92:4fc01daae5a5 625 * @brief AF 4 selection
bogdanm 92:4fc01daae5a5 626 */
bogdanm 92:4fc01daae5a5 627 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 628 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 629 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 630
bogdanm 92:4fc01daae5a5 631 /**
bogdanm 92:4fc01daae5a5 632 * @brief AF 5 selection
bogdanm 92:4fc01daae5a5 633 */
bogdanm 92:4fc01daae5a5 634 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 635 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 636 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 637 #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 638 #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */
bogdanm 92:4fc01daae5a5 639
bogdanm 92:4fc01daae5a5 640 /**
bogdanm 92:4fc01daae5a5 641 * @brief AF 6 selection
bogdanm 92:4fc01daae5a5 642 */
bogdanm 92:4fc01daae5a5 643 #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 644 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 645 #define GPIO_AF6_SPI4 ((uint8_t)0x06) /* SPI4/I2S4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 646 #define GPIO_AF6_SPI5 ((uint8_t)0x06) /* SPI5/I2S5 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 647 #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */
bogdanm 92:4fc01daae5a5 648 /**
bogdanm 92:4fc01daae5a5 649 * @brief AF 7 selection
bogdanm 92:4fc01daae5a5 650 */
bogdanm 92:4fc01daae5a5 651 #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3/I2S3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 652 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 653 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 654 #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */
bogdanm 92:4fc01daae5a5 655
bogdanm 92:4fc01daae5a5 656 /**
bogdanm 92:4fc01daae5a5 657 * @brief AF 8 selection
bogdanm 92:4fc01daae5a5 658 */
bogdanm 92:4fc01daae5a5 659 #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 660
bogdanm 92:4fc01daae5a5 661 /**
bogdanm 92:4fc01daae5a5 662 * @brief AF 9 selection
bogdanm 92:4fc01daae5a5 663 */
bogdanm 92:4fc01daae5a5 664 #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 665 #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 666 #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 667
bogdanm 92:4fc01daae5a5 668
bogdanm 92:4fc01daae5a5 669 /**
bogdanm 92:4fc01daae5a5 670 * @brief AF 10 selection
bogdanm 92:4fc01daae5a5 671 */
bogdanm 92:4fc01daae5a5 672 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 673
bogdanm 92:4fc01daae5a5 674 /**
bogdanm 92:4fc01daae5a5 675 * @brief AF 12 selection
bogdanm 92:4fc01daae5a5 676 */
bogdanm 92:4fc01daae5a5 677 #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 678
bogdanm 92:4fc01daae5a5 679 /**
bogdanm 92:4fc01daae5a5 680 * @brief AF 15 selection
bogdanm 92:4fc01daae5a5 681 */
bogdanm 92:4fc01daae5a5 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 */
bogdanm 92:4fc01daae5a5 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)
bogdanm 92:4fc01daae5a5 1019 #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
bogdanm 92:4fc01daae5a5 1020 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
bogdanm 92:4fc01daae5a5 1021 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
bogdanm 92:4fc01daae5a5 1022 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
bogdanm 92:4fc01daae5a5 1023 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
bogdanm 92:4fc01daae5a5 1024 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \
bogdanm 92:4fc01daae5a5 1025 ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \
bogdanm 92:4fc01daae5a5 1026 ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
bogdanm 92:4fc01daae5a5 1027 ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF6_SPI4) || \
bogdanm 92:4fc01daae5a5 1028 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
bogdanm 92:4fc01daae5a5 1029 ((AF) == GPIO_AF6_SPI5) || ((AF) == GPIO_AF7_SPI3) || \
bogdanm 92:4fc01daae5a5 1030 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
bogdanm 92:4fc01daae5a5 1031 ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \
bogdanm 92:4fc01daae5a5 1032 ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \
bogdanm 92:4fc01daae5a5 1033 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT))
bogdanm 92:4fc01daae5a5 1034
bogdanm 92:4fc01daae5a5 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
bogdanm 89:552587b429a1 1069 /**
bogdanm 89:552587b429a1 1070 * @}
bogdanm 89:552587b429a1 1071 */
bogdanm 89:552587b429a1 1072
bogdanm 89:552587b429a1 1073 /**
bogdanm 89:552587b429a1 1074 * @}
bogdanm 89:552587b429a1 1075 */
bogdanm 89:552587b429a1 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 */
bogdanm 89:552587b429a1 1081
Kojto 99:dbbf35b96557 1082 /**
Kojto 99:dbbf35b96557 1083 * @}
Kojto 99:dbbf35b96557 1084 */
bogdanm 89:552587b429a1 1085
bogdanm 89:552587b429a1 1086 /**
bogdanm 89:552587b429a1 1087 * @}
bogdanm 89:552587b429a1 1088 */
bogdanm 89:552587b429a1 1089
bogdanm 89:552587b429a1 1090 /**
bogdanm 89:552587b429a1 1091 * @}
bogdanm 89:552587b429a1 1092 */
bogdanm 89:552587b429a1 1093
bogdanm 89:552587b429a1 1094 #ifdef __cplusplus
bogdanm 89:552587b429a1 1095 }
bogdanm 89:552587b429a1 1096 #endif
bogdanm 89:552587b429a1 1097
bogdanm 89:552587b429a1 1098 #endif /* __STM32F4xx_HAL_GPIO_EX_H */
bogdanm 89:552587b429a1 1099
bogdanm 89:552587b429a1 1100 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/