mikroSDK Reference Manual
stm32f2xx_hal_gpio_ex.h
Go to the documentation of this file.
1
20/* Define to prevent recursive inclusion -------------------------------------*/
21#ifndef __STM32F2xx_HAL_GPIO_EX_H
22#define __STM32F2xx_HAL_GPIO_EX_H
23
24#ifdef __cplusplus
25 extern "C" {
26#endif
27
28/* Includes ------------------------------------------------------------------*/
29#include "stm32f2xx_hal_def.h"
30
39/* Exported types ------------------------------------------------------------*/
40/* Exported constants --------------------------------------------------------*/
41/* Exported constants --------------------------------------------------------*/
42
54#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
55#define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
56#define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
57#define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
58#define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
59
63#define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
64#define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
65
69#define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
70#define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
71#define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
72
76#define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
77#define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
78#define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
79#define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
80
84#define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
85#define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
86#define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
87
91#define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
92#define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
96#define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
97
101#define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
102#define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
103#define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
104
108#define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
109#define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
110#define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
111
115#define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
116#define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
117#define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
118#define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
119#define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
120
124#define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */
125#define GPIO_AF10_OTG_HS ((uint8_t)0x0A) /* OTG_HS Alternate Function mapping */
126
130#if defined(STM32F207xx) || defined(STM32F217xx)
131#define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
132#endif /* STM32F207xx || STM32F217xx */
133
137#define GPIO_AF12_FSMC ((uint8_t)0x0C) /* FSMC Alternate Function mapping */
138#define GPIO_AF12_OTG_HS_FS ((uint8_t)0x0C) /* OTG HS configured in FS, Alternate Function mapping */
139#define GPIO_AF12_SDIO ((uint8_t)0x0C) /* SDIO Alternate Function mapping */
140
144#if defined(STM32F207xx) || defined(STM32F217xx)
145#define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
146#endif /* STM32F207xx || STM32F217xx */
147
151#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
152
161/* Exported macro ------------------------------------------------------------*/
169/* Exported functions --------------------------------------------------------*/
177/* Private types -------------------------------------------------------------*/
178/* Private variables ---------------------------------------------------------*/
179/* Private constants ---------------------------------------------------------*/
187/* Private macros ------------------------------------------------------------*/
194#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
195 ((__GPIOx__) == (GPIOB))? 1U :\
196 ((__GPIOx__) == (GPIOC))? 2U :\
197 ((__GPIOx__) == (GPIOD))? 3U :\
198 ((__GPIOx__) == (GPIOE))? 4U :\
199 ((__GPIOx__) == (GPIOF))? 5U :\
200 ((__GPIOx__) == (GPIOG))? 6U :\
201 ((__GPIOx__) == (GPIOH))? 7U :\
202 ((__GPIOx__) == (GPIOI))? 8U : 9U)
210#if defined(STM32F207xx) || defined(STM32F217xx)
211
212#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
213 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
214 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
215 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
216 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
217 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
218 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
219 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
220 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
221 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
222 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
223 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
224 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
225 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
226 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
227 ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
228 ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
229 ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
230#else /* STM32F207xx || STM32F217xx */
231#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
232 ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
233 ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
234 ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
235 ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
236 ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
237 ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
238 ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
239 ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
240 ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
241 ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
242 ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
243 ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
244 ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
245 ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
246 ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \
247 ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
248#endif /* STM32F207xx || STM32F217xx */
249
258/* Private functions ---------------------------------------------------------*/
275#ifdef __cplusplus
276}
277#endif
278
279#endif /* __STM32F2xx_HAL_GPIO_EX_H */
280
281/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
This file contains HAL common defines, enumeration, macros and structures definitions.