mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Tue Feb 16 14:28:01 2016 +0000
Revision:
114:252557024ec3
Parent:
109:9296ab0bfc11
Child:
122:f9eeca106725
Release 114 of the mbed library

Changes:
- Atmel SAM - warnings fixes
- B96B F446VE - hw control flow addition
- Remove of GCC CW which was not active
- Remove GCC CS, not released anymore - deprecated

Who changed what in which revision?

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