my fork

Dependents:   Nucleo_blueNRG

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Parent:
92:4fc01daae5a5
Release 93 of the mbed library

Main changes:

- Renesas RZ_A1H bugfixes - i2c, ticker
- new targets - Nucleo F303RE, Nucleo F070RB, BLE SMURFS,
Dragonfly 411RE,
- BusXXX - is connected method, plus operators addition
- LPC8xx - I2c fixes
- timestamp_t reverted to uint32_t
- RTX - fixes regarding stack (alignment, magic word)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 85:024bf7f99721 3 * @file stm32f0xx_hal_gpio_ex.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
Kojto 93:e188a91d3eaa 5 * @version V1.2.0
Kojto 93:e188a91d3eaa 6 * @date 11-December-2014
bogdanm 85:024bf7f99721 7 * @brief Header file of GPIO HAL Extension module.
bogdanm 85:024bf7f99721 8 ******************************************************************************
bogdanm 85:024bf7f99721 9 * @attention
bogdanm 85:024bf7f99721 10 *
bogdanm 85:024bf7f99721 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 12 *
bogdanm 85:024bf7f99721 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 14 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 16 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 19 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 21 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 22 * without specific prior written permission.
bogdanm 85:024bf7f99721 23 *
bogdanm 85:024bf7f99721 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 34 *
bogdanm 85:024bf7f99721 35 ******************************************************************************
bogdanm 85:024bf7f99721 36 */
bogdanm 85:024bf7f99721 37
bogdanm 85:024bf7f99721 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 85:024bf7f99721 39 #ifndef __STM32F0xx_HAL_GPIO_EX_H
bogdanm 85:024bf7f99721 40 #define __STM32F0xx_HAL_GPIO_EX_H
bogdanm 85:024bf7f99721 41
bogdanm 85:024bf7f99721 42 #ifdef __cplusplus
bogdanm 85:024bf7f99721 43 extern "C" {
bogdanm 85:024bf7f99721 44 #endif
bogdanm 85:024bf7f99721 45
bogdanm 85:024bf7f99721 46 /* Includes ------------------------------------------------------------------*/
bogdanm 85:024bf7f99721 47 #include "stm32f0xx_hal_def.h"
bogdanm 85:024bf7f99721 48
bogdanm 85:024bf7f99721 49 /** @addtogroup STM32F0xx_HAL_Driver
bogdanm 85:024bf7f99721 50 * @{
bogdanm 85:024bf7f99721 51 */
bogdanm 85:024bf7f99721 52
bogdanm 92:4fc01daae5a5 53 /** @defgroup GPIOEx GPIOEx Extended HAL module driver
bogdanm 85:024bf7f99721 54 * @{
bogdanm 85:024bf7f99721 55 */
bogdanm 85:024bf7f99721 56
bogdanm 85:024bf7f99721 57 /* Exported types ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 58 /* Exported constants --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 59 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
bogdanm 85:024bf7f99721 60 * @{
bogdanm 85:024bf7f99721 61 */
bogdanm 85:024bf7f99721 62
bogdanm 92:4fc01daae5a5 63 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
bogdanm 85:024bf7f99721 64 * @{
bogdanm 85:024bf7f99721 65 */
bogdanm 85:024bf7f99721 66
bogdanm 85:024bf7f99721 67 #if defined (STM32F030x6)
bogdanm 85:024bf7f99721 68 /*------------------------- STM32F030x6---------------------------*/
bogdanm 92:4fc01daae5a5 69 /* AF 0 */
bogdanm 92:4fc01daae5a5 70 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 71 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 72 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 73 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 74 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 75 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 76 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 77 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 78 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 85:024bf7f99721 79
bogdanm 92:4fc01daae5a5 80 /* AF 1 */
bogdanm 92:4fc01daae5a5 81 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 82 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 83 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 84 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 85
bogdanm 92:4fc01daae5a5 86 /* AF 2 */
bogdanm 92:4fc01daae5a5 87 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 88 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 89 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 90 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 91
bogdanm 92:4fc01daae5a5 92 /* AF 3 */
bogdanm 92:4fc01daae5a5 93 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 94 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 95
bogdanm 92:4fc01daae5a5 96 /* AF 4 */
bogdanm 92:4fc01daae5a5 97 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 98 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 99
bogdanm 92:4fc01daae5a5 100 /* AF 5 */
bogdanm 92:4fc01daae5a5 101 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 102 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 85:024bf7f99721 103
bogdanm 92:4fc01daae5a5 104 /* AF 6 */
bogdanm 92:4fc01daae5a5 105 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 106
bogdanm 92:4fc01daae5a5 107 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
bogdanm 85:024bf7f99721 108
bogdanm 85:024bf7f99721 109 #endif /* STM32F030x6 */
bogdanm 85:024bf7f99721 110
bogdanm 85:024bf7f99721 111 /*---------------------------------- STM32F030x8 -------------------------------------------*/
bogdanm 85:024bf7f99721 112 #if defined (STM32F030x8)
bogdanm 92:4fc01daae5a5 113 /* AF 0 */
bogdanm 92:4fc01daae5a5 114 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 115 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 116 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 117 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 118 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 119 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 120 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 121 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 122 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 123 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 124 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 85:024bf7f99721 125
bogdanm 92:4fc01daae5a5 126 /* AF 1 */
bogdanm 92:4fc01daae5a5 127 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 128 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 129 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 130 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 131 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 132 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 133 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 134 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 85:024bf7f99721 135
bogdanm 92:4fc01daae5a5 136 /* AF 2 */
bogdanm 92:4fc01daae5a5 137 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 138 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 139 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 140 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 141
bogdanm 92:4fc01daae5a5 142 /* AF 3 */
bogdanm 92:4fc01daae5a5 143 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 144 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 145 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
bogdanm 85:024bf7f99721 146
bogdanm 92:4fc01daae5a5 147 /* AF 4 */
bogdanm 92:4fc01daae5a5 148 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 85:024bf7f99721 149
bogdanm 92:4fc01daae5a5 150 /* AF 5 */
bogdanm 92:4fc01daae5a5 151 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 152 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 85:024bf7f99721 153
bogdanm 92:4fc01daae5a5 154 /* AF 6 */
bogdanm 92:4fc01daae5a5 155 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 156
bogdanm 92:4fc01daae5a5 157 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
bogdanm 85:024bf7f99721 158
bogdanm 85:024bf7f99721 159 #endif /* STM32F030x8 */
bogdanm 85:024bf7f99721 160
bogdanm 85:024bf7f99721 161 #if defined (STM32F031x6) || defined (STM32F038xx)
bogdanm 85:024bf7f99721 162 /*--------------------------- STM32F031x6/STM32F038xx ---------------------------*/
bogdanm 92:4fc01daae5a5 163 /* AF 0 */
bogdanm 92:4fc01daae5a5 164 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 165 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 166 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 167 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 168 #define GPIO_AF0_SWDAT ((uint8_t)0x00) /*!< AF0: SWDAT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 169 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 170 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 171 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 172 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 85:024bf7f99721 173
bogdanm 92:4fc01daae5a5 174 /* AF 1 */
bogdanm 92:4fc01daae5a5 175 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 176 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 177 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 178 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 179 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 180
bogdanm 92:4fc01daae5a5 181 /* AF 2 */
bogdanm 92:4fc01daae5a5 182 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 183 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 184 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 185 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 186 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 187
bogdanm 92:4fc01daae5a5 188 /* AF 3 */
bogdanm 92:4fc01daae5a5 189 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 190 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 191
bogdanm 92:4fc01daae5a5 192 /* AF 4 */
bogdanm 92:4fc01daae5a5 193 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 194 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 195
bogdanm 92:4fc01daae5a5 196 /* AF 5 */
bogdanm 92:4fc01daae5a5 197 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 198 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 85:024bf7f99721 199
bogdanm 92:4fc01daae5a5 200 /* AF 6 */
bogdanm 92:4fc01daae5a5 201 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 202
bogdanm 92:4fc01daae5a5 203 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
bogdanm 85:024bf7f99721 204
bogdanm 85:024bf7f99721 205 #endif /* STM32F031x6 || STM32F038xx */
bogdanm 85:024bf7f99721 206
bogdanm 85:024bf7f99721 207 #if defined (STM32F051x8) || defined (STM32F058xx)
bogdanm 85:024bf7f99721 208 /*--------------------------- STM32F051x8/STM32F058xx---------------------------*/
bogdanm 92:4fc01daae5a5 209 /* AF 0 */
bogdanm 92:4fc01daae5a5 210 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 211 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 212 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 213 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 214 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 215 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 216 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 217 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 218 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 219 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 220 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 221 #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */
bogdanm 85:024bf7f99721 222
bogdanm 92:4fc01daae5a5 223 /* AF 1 */
bogdanm 92:4fc01daae5a5 224 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 225 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 226 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 227 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 228 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 229 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 230 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 231 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 232 #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */
bogdanm 85:024bf7f99721 233
bogdanm 92:4fc01daae5a5 234 /* AF 2 */
bogdanm 92:4fc01daae5a5 235 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 236 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 237 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 238 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 239 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 240
bogdanm 92:4fc01daae5a5 241 /* AF 3 */
bogdanm 92:4fc01daae5a5 242 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 243 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 244 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 245 #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */
bogdanm 85:024bf7f99721 246
bogdanm 92:4fc01daae5a5 247 /* AF 4 */
bogdanm 92:4fc01daae5a5 248 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 85:024bf7f99721 249
bogdanm 92:4fc01daae5a5 250 /* AF 5 */
bogdanm 92:4fc01daae5a5 251 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 252 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 85:024bf7f99721 253
bogdanm 92:4fc01daae5a5 254 /* AF 6 */
bogdanm 92:4fc01daae5a5 255 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 256
bogdanm 92:4fc01daae5a5 257 /* AF 7 */
bogdanm 92:4fc01daae5a5 258 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 259 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */
bogdanm 85:024bf7f99721 260
bogdanm 92:4fc01daae5a5 261 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07)
bogdanm 85:024bf7f99721 262
bogdanm 85:024bf7f99721 263 #endif /* STM32F051x8/STM32F058xx */
bogdanm 85:024bf7f99721 264
bogdanm 85:024bf7f99721 265 #if defined (STM32F071xB)
bogdanm 85:024bf7f99721 266 /*--------------------------- STM32F071xB ---------------------------*/
bogdanm 92:4fc01daae5a5 267 /* AF 0 */
bogdanm 92:4fc01daae5a5 268 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: AEVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 269 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 270 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 271 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 272 #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 273 #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 274 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 275 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 276 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 277 #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 278 #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 279 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 280 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 281 #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 282 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 283 #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 284 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 285 #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 286 #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 287 #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */
bogdanm 85:024bf7f99721 288
bogdanm 92:4fc01daae5a5 289 /* AF 1 */
bogdanm 92:4fc01daae5a5 290 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 291 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 292 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 293 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 294 #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 295 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 296 #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 297 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 298 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 299 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 300 #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 301 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 302 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */
bogdanm 85:024bf7f99721 303
bogdanm 92:4fc01daae5a5 304 /* AF 2 */
bogdanm 92:4fc01daae5a5 305 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 306 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 307 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 308 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 309 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 310
bogdanm 92:4fc01daae5a5 311 /* AF 3 */
bogdanm 92:4fc01daae5a5 312 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 313 #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 314 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 315 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 316
bogdanm 92:4fc01daae5a5 317 /* AF 4 */
bogdanm 92:4fc01daae5a5 318 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 319 #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 320 #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 321 #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */
bogdanm 85:024bf7f99721 322
bogdanm 92:4fc01daae5a5 323 /* AF 5 */
bogdanm 92:4fc01daae5a5 324 #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 325 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 326 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 327 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 328 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
bogdanm 85:024bf7f99721 329
bogdanm 92:4fc01daae5a5 330 /* AF 6 */
bogdanm 92:4fc01daae5a5 331 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 332
bogdanm 92:4fc01daae5a5 333 /* AF 7 */
bogdanm 92:4fc01daae5a5 334 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 335 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */
bogdanm 85:024bf7f99721 336
bogdanm 92:4fc01daae5a5 337 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07)
bogdanm 85:024bf7f99721 338
bogdanm 85:024bf7f99721 339 #endif /* STM32F071xB */
bogdanm 85:024bf7f99721 340
bogdanm 85:024bf7f99721 341
bogdanm 92:4fc01daae5a5 342 #if defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 92:4fc01daae5a5 343 /*--------------------------- STM32F091xC || STM32F098xx ------------------------------*/
bogdanm 92:4fc01daae5a5 344 /* AF 0 */
bogdanm 92:4fc01daae5a5 345 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 346 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 347 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 348 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 349 #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 350 #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 351 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 352 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 353 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 354 #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 355 #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 356 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 357 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 358 #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 359 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 360 #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 361 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 362 #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 363 #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 364 #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 365 #define GPIO_AF0_USART8 ((uint8_t)0x00) /*!< AF0: USART8 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 366 #define GPIO_AF0_CAN ((uint8_t)0x00) /*!< AF0: CAN Alternate Function mapping */
bogdanm 92:4fc01daae5a5 367
bogdanm 92:4fc01daae5a5 368 /* AF 1 */
bogdanm 92:4fc01daae5a5 369 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 370 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 371 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 372 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 373 #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 374 #define GPIO_AF1_USART4 ((uint8_t)0x01) /*!< AF1: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 375 #define GPIO_AF1_USART5 ((uint8_t)0x01) /*!< AF1: USART5 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 376 #define GPIO_AF1_USART6 ((uint8_t)0x01) /*!< AF1: USART6 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 377 #define GPIO_AF1_USART7 ((uint8_t)0x01) /*!< AF1: USART7 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 378 #define GPIO_AF1_USART8 ((uint8_t)0x01) /*!< AF1: USART8 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 379 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 380 #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 381 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 382 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 383 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 384 #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 385 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 386 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 387
bogdanm 92:4fc01daae5a5 388 /* AF 2 */
bogdanm 92:4fc01daae5a5 389 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 390 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 391 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 392 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 393 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 394 #define GPIO_AF2_USART5 ((uint8_t)0x02) /*!< AF2: USART5 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 395 #define GPIO_AF2_USART6 ((uint8_t)0x02) /*!< AF2: USART6 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 396 #define GPIO_AF2_USART7 ((uint8_t)0x02) /*!< AF2: USART7 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 397 #define GPIO_AF2_USART8 ((uint8_t)0x02) /*!< AF2: USART8 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 398
bogdanm 92:4fc01daae5a5 399 /* AF 3 */
bogdanm 92:4fc01daae5a5 400 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 401 #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 402 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 403 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 404
bogdanm 92:4fc01daae5a5 405 /* AF 4 */
bogdanm 92:4fc01daae5a5 406 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 407 #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 408 #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 409 #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 410 #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */
bogdanm 92:4fc01daae5a5 411 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 412 #define GPIO_AF4_USART5 ((uint8_t)0x04) /*!< AF4: USART5 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 413
bogdanm 92:4fc01daae5a5 414 /* AF 5 */
bogdanm 92:4fc01daae5a5 415 #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 416 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 417 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 418 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 419 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 420 #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 421 #define GPIO_AF5_USART6 ((uint8_t)0x05) /*!< AF5: USART6 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 422
bogdanm 92:4fc01daae5a5 423 /* AF 6 */
bogdanm 92:4fc01daae5a5 424 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 425
bogdanm 92:4fc01daae5a5 426 /* AF 7 */
bogdanm 92:4fc01daae5a5 427 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 428 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 429
bogdanm 92:4fc01daae5a5 430 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07)
bogdanm 92:4fc01daae5a5 431
bogdanm 92:4fc01daae5a5 432 #endif /* STM32F091xC || STM32F098xx */
bogdanm 92:4fc01daae5a5 433
Kojto 93:e188a91d3eaa 434 #if defined(STM32F030xC)
Kojto 93:e188a91d3eaa 435 /*--------------------------- STM32F030xC ----------------------------------------------------*/
Kojto 93:e188a91d3eaa 436 /* AF 0 */
Kojto 93:e188a91d3eaa 437 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 438 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
Kojto 93:e188a91d3eaa 439 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
Kojto 93:e188a91d3eaa 440 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
Kojto 93:e188a91d3eaa 441 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 442 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 443 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 444 #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 445 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 446 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 447 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 448 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 449 #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */
Kojto 93:e188a91d3eaa 450
Kojto 93:e188a91d3eaa 451 /* AF 1 */
Kojto 93:e188a91d3eaa 452 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 453 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 454 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 455 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 456 #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 457 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 458 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 459 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 460 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 461 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 462
Kojto 93:e188a91d3eaa 463 /* AF 2 */
Kojto 93:e188a91d3eaa 464 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 465 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 466 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 467 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 468 #define GPIO_AF2_USART5 ((uint8_t)0x02) /*!< AF2: USART5 Alternate Function mapping */
Kojto 93:e188a91d3eaa 469 #define GPIO_AF2_USART6 ((uint8_t)0x02) /*!< AF2: USART6 Alternate Function mapping */
Kojto 93:e188a91d3eaa 470
Kojto 93:e188a91d3eaa 471 /* AF 3 */
Kojto 93:e188a91d3eaa 472 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 473 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 474 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 475
Kojto 93:e188a91d3eaa 476 /* AF 4 */
Kojto 93:e188a91d3eaa 477 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 478 #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */
Kojto 93:e188a91d3eaa 479 #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 480 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 481 #define GPIO_AF4_USART5 ((uint8_t)0x04) /*!< AF4: USART5 Alternate Function mapping */
Kojto 93:e188a91d3eaa 482
Kojto 93:e188a91d3eaa 483 /* AF 5 */
Kojto 93:e188a91d3eaa 484 #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 485 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 486 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 487 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 488 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 489 #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */
Kojto 93:e188a91d3eaa 490 #define GPIO_AF5_USART6 ((uint8_t)0x05) /*!< AF5: USART6 Alternate Function mapping */
Kojto 93:e188a91d3eaa 491
Kojto 93:e188a91d3eaa 492 /* AF 6 */
Kojto 93:e188a91d3eaa 493 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 494
Kojto 93:e188a91d3eaa 495 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
Kojto 93:e188a91d3eaa 496
Kojto 93:e188a91d3eaa 497 #endif /* STM32F030xC */
Kojto 93:e188a91d3eaa 498
bogdanm 85:024bf7f99721 499 #if defined (STM32F072xB) || defined (STM32F078xx)
bogdanm 85:024bf7f99721 500 /*--------------------------- STM32F072xB/STM32F078xx ---------------------------*/
bogdanm 92:4fc01daae5a5 501 /* AF 0 */
bogdanm 92:4fc01daae5a5 502 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 503 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 504 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 505 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 506 #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 507 #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 508 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 509 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 510 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 511 #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 512 #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 513 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 514 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 515 #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 516 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 517 #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 518 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 519 #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 520 #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 521 #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 522 #define GPIO_AF0_CAN ((uint8_t)0x00) /*!< AF0: CAN Alternate Function mapping */
bogdanm 85:024bf7f99721 523
bogdanm 92:4fc01daae5a5 524 /* AF 1 */
bogdanm 92:4fc01daae5a5 525 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 526 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 527 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 528 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 529 #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 530 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 531 #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 532 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 533 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 534 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 535 #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 536 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 537 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */
bogdanm 85:024bf7f99721 538
bogdanm 92:4fc01daae5a5 539 /* AF 2 */
bogdanm 92:4fc01daae5a5 540 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 541 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 542 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 543 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 544 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 545 #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */
bogdanm 85:024bf7f99721 546
bogdanm 92:4fc01daae5a5 547 /* AF 3 */
bogdanm 92:4fc01daae5a5 548 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 549 #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 550 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 551 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 552
bogdanm 92:4fc01daae5a5 553 /* AF 4 */
bogdanm 92:4fc01daae5a5 554 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 555 #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 556 #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 557 #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 558 #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */
bogdanm 85:024bf7f99721 559
bogdanm 92:4fc01daae5a5 560 /* AF 5 */
bogdanm 92:4fc01daae5a5 561 #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 562 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 563 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 564 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 565 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
bogdanm 85:024bf7f99721 566
bogdanm 92:4fc01daae5a5 567 /* AF 6 */
bogdanm 92:4fc01daae5a5 568 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 569
bogdanm 92:4fc01daae5a5 570 /* AF 7 */
bogdanm 92:4fc01daae5a5 571 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 572 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */
bogdanm 85:024bf7f99721 573
bogdanm 92:4fc01daae5a5 574 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07)
bogdanm 85:024bf7f99721 575
bogdanm 85:024bf7f99721 576 #endif /* STM32F072xB || STM32F078xx */
bogdanm 85:024bf7f99721 577
Kojto 93:e188a91d3eaa 578 #if defined (STM32F070xB)
Kojto 93:e188a91d3eaa 579 /*---------------------------------- STM32F070xB ---------------------------------------------*/
Kojto 93:e188a91d3eaa 580 /* AF 0 */
Kojto 93:e188a91d3eaa 581 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 582 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
Kojto 93:e188a91d3eaa 583 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
Kojto 93:e188a91d3eaa 584 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
Kojto 93:e188a91d3eaa 585 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 586 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 587 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 588 #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 589 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 590 #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 591 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 592 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 593 #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */
Kojto 93:e188a91d3eaa 594
Kojto 93:e188a91d3eaa 595 /* AF 1 */
Kojto 93:e188a91d3eaa 596 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 597 #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 598 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 599 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 600 #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART4 Alternate Function mapping */
Kojto 93:e188a91d3eaa 601 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 602 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 603 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 604 #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 605 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 606
Kojto 93:e188a91d3eaa 607 /* AF 2 */
Kojto 93:e188a91d3eaa 608 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 609 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 610 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 611 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 612 #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */
Kojto 93:e188a91d3eaa 613
Kojto 93:e188a91d3eaa 614 /* AF 3 */
Kojto 93:e188a91d3eaa 615 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 616 #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 617
Kojto 93:e188a91d3eaa 618 /* AF 4 */
Kojto 93:e188a91d3eaa 619 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 620 #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */
Kojto 93:e188a91d3eaa 621 #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 622
Kojto 93:e188a91d3eaa 623 /* AF 5 */
Kojto 93:e188a91d3eaa 624 #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */
Kojto 93:e188a91d3eaa 625 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 626 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 627 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 628 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 629
Kojto 93:e188a91d3eaa 630 /* AF 6 */
Kojto 93:e188a91d3eaa 631 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 632
Kojto 93:e188a91d3eaa 633 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
Kojto 93:e188a91d3eaa 634
Kojto 93:e188a91d3eaa 635 #endif /* STM32F070xB */
Kojto 93:e188a91d3eaa 636
bogdanm 85:024bf7f99721 637 #if defined (STM32F042x6) || defined (STM32F048xx)
bogdanm 85:024bf7f99721 638 /*--------------------------- STM32F042x6/STM32F048xx ---------------------------*/
bogdanm 92:4fc01daae5a5 639 /* AF 0 */
bogdanm 92:4fc01daae5a5 640 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 641 #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 642 #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 643 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 644 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 645 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 646 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 647 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 648 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
bogdanm 92:4fc01daae5a5 649 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 650 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 651 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
bogdanm 85:024bf7f99721 652
bogdanm 92:4fc01daae5a5 653 /* AF 1 */
bogdanm 92:4fc01daae5a5 654 #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */
bogdanm 92:4fc01daae5a5 655 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 656 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 657 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
bogdanm 92:4fc01daae5a5 658 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 659 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 660 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
bogdanm 85:024bf7f99721 661
bogdanm 92:4fc01daae5a5 662 /* AF 2 */
bogdanm 92:4fc01daae5a5 663 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 664 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 665 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 666 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 667 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 668 #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */
bogdanm 85:024bf7f99721 669
bogdanm 92:4fc01daae5a5 670 /* AF 3 */
bogdanm 92:4fc01daae5a5 671 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
bogdanm 92:4fc01daae5a5 672 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 673 #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */
bogdanm 85:024bf7f99721 674
bogdanm 92:4fc01daae5a5 675 /* AF 4 */
bogdanm 92:4fc01daae5a5 676 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 677 #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */
bogdanm 92:4fc01daae5a5 678 #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */
bogdanm 92:4fc01daae5a5 679 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
bogdanm 85:024bf7f99721 680
bogdanm 92:4fc01daae5a5 681 /* AF 5 */
bogdanm 92:4fc01daae5a5 682 #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */
bogdanm 92:4fc01daae5a5 683 #define GPIO_AF5_I2C1 ((uint8_t)0x05) /*!< AF5: I2C1 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 684 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 685 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 686 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 687 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
bogdanm 92:4fc01daae5a5 688 #define GPIO_AF5_USB ((uint8_t)0x05) /*!< AF5: USB Alternate Function mapping */
bogdanm 85:024bf7f99721 689
bogdanm 92:4fc01daae5a5 690 /* AF 6 */
bogdanm 92:4fc01daae5a5 691 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
bogdanm 85:024bf7f99721 692
bogdanm 92:4fc01daae5a5 693 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
bogdanm 85:024bf7f99721 694
bogdanm 85:024bf7f99721 695 #endif /* STM32F042x6 || STM32F048xx */
Kojto 93:e188a91d3eaa 696
Kojto 93:e188a91d3eaa 697 #if defined (STM32F070x6)
Kojto 93:e188a91d3eaa 698 /*--------------------------------------- STM32F070x6 ----------------------------------------*/
Kojto 93:e188a91d3eaa 699 /* AF 0 */
Kojto 93:e188a91d3eaa 700 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 701 #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 702 #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */
Kojto 93:e188a91d3eaa 703 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 704 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */
Kojto 93:e188a91d3eaa 705 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */
Kojto 93:e188a91d3eaa 706 #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 707 #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 708 #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 709
Kojto 93:e188a91d3eaa 710 /* AF 1 */
Kojto 93:e188a91d3eaa 711 #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 712 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 713 #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */
Kojto 93:e188a91d3eaa 714 #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 715 #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */
Kojto 93:e188a91d3eaa 716 #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */
Kojto 93:e188a91d3eaa 717
Kojto 93:e188a91d3eaa 718 /* AF 2 */
Kojto 93:e188a91d3eaa 719 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 720 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 721 #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 722 #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 723 #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */
Kojto 93:e188a91d3eaa 724
Kojto 93:e188a91d3eaa 725 /* AF 3 */
Kojto 93:e188a91d3eaa 726 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 727 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 728
Kojto 93:e188a91d3eaa 729 /* AF 4 */
Kojto 93:e188a91d3eaa 730 #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */
Kojto 93:e188a91d3eaa 731 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 732
Kojto 93:e188a91d3eaa 733 /* AF 5 */
Kojto 93:e188a91d3eaa 734 #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */
Kojto 93:e188a91d3eaa 735 #define GPIO_AF5_I2C1 ((uint8_t)0x05) /*!< AF5: I2C1 Alternate Function mapping */
Kojto 93:e188a91d3eaa 736 #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */
Kojto 93:e188a91d3eaa 737 #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */
Kojto 93:e188a91d3eaa 738 #define GPIO_AF5_USB ((uint8_t)0x05) /*!< AF5: USB Alternate Function mapping */
Kojto 93:e188a91d3eaa 739
Kojto 93:e188a91d3eaa 740 /* AF 6 */
Kojto 93:e188a91d3eaa 741 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */
Kojto 93:e188a91d3eaa 742
Kojto 93:e188a91d3eaa 743 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06)
Kojto 93:e188a91d3eaa 744
Kojto 93:e188a91d3eaa 745 #endif /* STM32F070x6 */
bogdanm 85:024bf7f99721 746 /**
bogdanm 85:024bf7f99721 747 * @}
bogdanm 85:024bf7f99721 748 */
bogdanm 85:024bf7f99721 749
bogdanm 85:024bf7f99721 750 /**
bogdanm 85:024bf7f99721 751 * @}
bogdanm 85:024bf7f99721 752 */
bogdanm 85:024bf7f99721 753
bogdanm 85:024bf7f99721 754 /* Exported macro ------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 755 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros
bogdanm 92:4fc01daae5a5 756 * @{
bogdanm 92:4fc01daae5a5 757 */
bogdanm 92:4fc01daae5a5 758
bogdanm 92:4fc01daae5a5 759 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index
bogdanm 92:4fc01daae5a5 760 * @{
bogdanm 92:4fc01daae5a5 761 */
bogdanm 92:4fc01daae5a5 762 #if defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \
bogdanm 92:4fc01daae5a5 763 defined (STM32F091xC) || defined (STM32F098xx)
Kojto 93:e188a91d3eaa 764 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
bogdanm 92:4fc01daae5a5 765 ((__GPIOx__) == (GPIOB))? 1U :\
bogdanm 92:4fc01daae5a5 766 ((__GPIOx__) == (GPIOC))? 2U :\
bogdanm 92:4fc01daae5a5 767 ((__GPIOx__) == (GPIOD))? 3U :\
bogdanm 92:4fc01daae5a5 768 ((__GPIOx__) == (GPIOE))? 4U : 5U)
bogdanm 92:4fc01daae5a5 769 #endif
bogdanm 85:024bf7f99721 770
Kojto 93:e188a91d3eaa 771 #if defined (STM32F030x6) || defined (STM32F030x8) || defined (STM32F070xB) || defined (STM32F030xC) || \
bogdanm 92:4fc01daae5a5 772 defined (STM32F051x8) || defined (STM32F058xx)
Kojto 93:e188a91d3eaa 773 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
bogdanm 92:4fc01daae5a5 774 ((__GPIOx__) == (GPIOB))? 1U :\
bogdanm 92:4fc01daae5a5 775 ((__GPIOx__) == (GPIOC))? 2U :\
bogdanm 92:4fc01daae5a5 776 ((__GPIOx__) == (GPIOD))? 3U : 5U)
bogdanm 92:4fc01daae5a5 777 #endif
bogdanm 85:024bf7f99721 778
bogdanm 92:4fc01daae5a5 779 #if defined (STM32F031x6) || defined (STM32F038xx) || \
Kojto 93:e188a91d3eaa 780 defined (STM32F042x6) || defined (STM32F048xx) || defined (STM32F070x6)
Kojto 93:e188a91d3eaa 781 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
bogdanm 92:4fc01daae5a5 782 ((__GPIOx__) == (GPIOB))? 1U :\
bogdanm 92:4fc01daae5a5 783 ((__GPIOx__) == (GPIOC))? 2U : 5U)
bogdanm 92:4fc01daae5a5 784 #endif
bogdanm 92:4fc01daae5a5 785
bogdanm 92:4fc01daae5a5 786 /**
bogdanm 92:4fc01daae5a5 787 * @}
bogdanm 92:4fc01daae5a5 788 */
bogdanm 92:4fc01daae5a5 789
bogdanm 92:4fc01daae5a5 790 /**
bogdanm 92:4fc01daae5a5 791 * @}
bogdanm 92:4fc01daae5a5 792 */
bogdanm 92:4fc01daae5a5 793
bogdanm 92:4fc01daae5a5 794 /* Exported functions --------------------------------------------------------*/
bogdanm 85:024bf7f99721 795 /**
bogdanm 85:024bf7f99721 796 * @}
bogdanm 85:024bf7f99721 797 */
bogdanm 85:024bf7f99721 798
bogdanm 85:024bf7f99721 799 /**
bogdanm 85:024bf7f99721 800 * @}
bogdanm 85:024bf7f99721 801 */
bogdanm 85:024bf7f99721 802
bogdanm 85:024bf7f99721 803 #ifdef __cplusplus
bogdanm 85:024bf7f99721 804 }
bogdanm 85:024bf7f99721 805 #endif
bogdanm 85:024bf7f99721 806
bogdanm 85:024bf7f99721 807 #endif /* __STM32F0xx_HAL_GPIO_EX_H */
bogdanm 85:024bf7f99721 808
bogdanm 85:024bf7f99721 809 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
bogdanm 92:4fc01daae5a5 810