extern
porcupine
demo
mcu
stm32f769
stm32f769i-disco
Drivers
STM32F7xx_HAL_Driver
Inc
stm32f7xx_hal_gpio_ex.h
Go to the documentation of this file.
1
20
/* Define to prevent recursive inclusion -------------------------------------*/
21
#ifndef __STM32F7xx_HAL_GPIO_EX_H
22
#define __STM32F7xx_HAL_GPIO_EX_H
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
/* Includes ------------------------------------------------------------------*/
29
#include "
stm32f7xx_hal_def.h
"
30
39
/* Exported types ------------------------------------------------------------*/
40
41
/* Exported constants --------------------------------------------------------*/
49
/*--------------- STM32F74xxx/STM32F75xxx/STM32F76xxx/STM32F77xxx -------------*/
50
#if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) || defined (STM32F767xx) ||\
51
defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)
52
55
#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U)
/* RTC_50Hz Alternate Function mapping */
56
#define GPIO_AF0_MCO ((uint8_t)0x00U)
/* MCO (MCO1 and MCO2) Alternate Function mapping */
57
#define GPIO_AF0_SWJ ((uint8_t)0x00U)
/* SWJ (SWD and JTAG) Alternate Function mapping */
58
#define GPIO_AF0_TRACE ((uint8_t)0x00U)
/* TRACE Alternate Function mapping */
59
63
#define GPIO_AF1_TIM1 ((uint8_t)0x01U)
/* TIM1 Alternate Function mapping */
64
#define GPIO_AF1_TIM2 ((uint8_t)0x01U)
/* TIM2 Alternate Function mapping */
65
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
66
#define GPIO_AF1_UART5 ((uint8_t)0x01U)
/* UART5 Alternate Function mapping */
67
#define GPIO_AF1_I2C4 ((uint8_t)0x01U)
/* I2C4 Alternate Function mapping */
68
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
69
73
#define GPIO_AF2_TIM3 ((uint8_t)0x02U)
/* TIM3 Alternate Function mapping */
74
#define GPIO_AF2_TIM4 ((uint8_t)0x02U)
/* TIM4 Alternate Function mapping */
75
#define GPIO_AF2_TIM5 ((uint8_t)0x02U)
/* TIM5 Alternate Function mapping */
76
80
#define GPIO_AF3_TIM8 ((uint8_t)0x03U)
/* TIM8 Alternate Function mapping */
81
#define GPIO_AF3_TIM9 ((uint8_t)0x03U)
/* TIM9 Alternate Function mapping */
82
#define GPIO_AF3_TIM10 ((uint8_t)0x03U)
/* TIM10 Alternate Function mapping */
83
#define GPIO_AF3_TIM11 ((uint8_t)0x03U)
/* TIM11 Alternate Function mapping */
84
#define GPIO_AF3_LPTIM1 ((uint8_t)0x03U)
/* LPTIM1 Alternate Function mapping */
85
#define GPIO_AF3_CEC ((uint8_t)0x03U)
/* CEC Alternate Function mapping */
86
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
87
#define GPIO_AF3_DFSDM1 ((uint8_t)0x03U)
/* DFSDM1 Alternate Function mapping */
88
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
89
92
#define GPIO_AF4_I2C1 ((uint8_t)0x04U)
/* I2C1 Alternate Function mapping */
93
#define GPIO_AF4_I2C2 ((uint8_t)0x04U)
/* I2C2 Alternate Function mapping */
94
#define GPIO_AF4_I2C3 ((uint8_t)0x04U)
/* I2C3 Alternate Function mapping */
95
#define GPIO_AF4_I2C4 ((uint8_t)0x04U)
/* I2C4 Alternate Function mapping */
96
#define GPIO_AF4_CEC ((uint8_t)0x04U)
/* CEC Alternate Function mapping */
97
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
98
#define GPIO_AF4_USART1 ((uint8_t)0x04)
/* USART1 Alternate Function mapping */
99
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
100
104
#define GPIO_AF5_SPI1 ((uint8_t)0x05U)
/* SPI1 Alternate Function mapping */
105
#define GPIO_AF5_SPI2 ((uint8_t)0x05U)
/* SPI2/I2S2 Alternate Function mapping */
106
#define GPIO_AF5_SPI3 ((uint8_t)0x05U)
/* SPI3/I2S3 Alternate Function mapping */
107
#define GPIO_AF5_SPI4 ((uint8_t)0x05U)
/* SPI4 Alternate Function mapping */
108
#define GPIO_AF5_SPI5 ((uint8_t)0x05U)
/* SPI5 Alternate Function mapping */
109
#define GPIO_AF5_SPI6 ((uint8_t)0x05U)
/* SPI6 Alternate Function mapping */
110
114
#define GPIO_AF6_SPI3 ((uint8_t)0x06U)
/* SPI3/I2S3 Alternate Function mapping */
115
#define GPIO_AF6_SAI1 ((uint8_t)0x06U)
/* SAI1 Alternate Function mapping */
116
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
117
#define GPIO_AF6_UART4 ((uint8_t)0x06U)
/* UART4 Alternate Function mapping */
118
#define GPIO_AF6_DFSDM1 ((uint8_t)0x06U)
/* DFSDM1 Alternate Function mapping */
119
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
120
124
#define GPIO_AF7_USART1 ((uint8_t)0x07U)
/* USART1 Alternate Function mapping */
125
#define GPIO_AF7_USART2 ((uint8_t)0x07U)
/* USART2 Alternate Function mapping */
126
#define GPIO_AF7_USART3 ((uint8_t)0x07U)
/* USART3 Alternate Function mapping */
127
#define GPIO_AF7_UART5 ((uint8_t)0x07U)
/* UART5 Alternate Function mapping */
128
#define GPIO_AF7_SPDIFRX ((uint8_t)0x07U)
/* SPDIF-RX Alternate Function mapping */
129
#define GPIO_AF7_SPI2 ((uint8_t)0x07U)
/* SPI2 Alternate Function mapping */
130
#define GPIO_AF7_SPI3 ((uint8_t)0x07U)
/* SPI3 Alternate Function mapping */
131
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
132
#define GPIO_AF7_SPI6 ((uint8_t)0x07U)
/* SPI6 Alternate Function mapping */
133
#define GPIO_AF7_DFSDM1 ((uint8_t)0x07U)
/* DFSDM1 Alternate Function mapping */
134
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
135
139
#define GPIO_AF8_UART4 ((uint8_t)0x08U)
/* UART4 Alternate Function mapping */
140
#define GPIO_AF8_UART5 ((uint8_t)0x08U)
/* UART5 Alternate Function mapping */
141
#define GPIO_AF8_USART6 ((uint8_t)0x08U)
/* USART6 Alternate Function mapping */
142
#define GPIO_AF8_UART7 ((uint8_t)0x08U)
/* UART7 Alternate Function mapping */
143
#define GPIO_AF8_UART8 ((uint8_t)0x08U)
/* UART8 Alternate Function mapping */
144
#define GPIO_AF8_SPDIFRX ((uint8_t)0x08U)
/* SPIDIF-RX Alternate Function mapping */
145
#define GPIO_AF8_SAI2 ((uint8_t)0x08U)
/* SAI2 Alternate Function mapping */
146
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
147
#define GPIO_AF8_SPI6 ((uint8_t)0x08U)
/* SPI6 Alternate Function mapping */
148
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
149
150
154
#define GPIO_AF9_CAN1 ((uint8_t)0x09U)
/* CAN1 Alternate Function mapping */
155
#define GPIO_AF9_CAN2 ((uint8_t)0x09U)
/* CAN2 Alternate Function mapping */
156
#define GPIO_AF9_TIM12 ((uint8_t)0x09U)
/* TIM12 Alternate Function mapping */
157
#define GPIO_AF9_TIM13 ((uint8_t)0x09U)
/* TIM13 Alternate Function mapping */
158
#define GPIO_AF9_TIM14 ((uint8_t)0x09U)
/* TIM14 Alternate Function mapping */
159
#define GPIO_AF9_QUADSPI ((uint8_t)0x09U)
/* QUADSPI Alternate Function mapping */
160
#if defined(STM32F746xx) || defined(STM32F756xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx) || defined(STM32F750xx)
161
#define GPIO_AF9_LTDC ((uint8_t)0x09U)
/* LCD-TFT Alternate Function mapping */
162
#endif
/* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */
163
#if defined(STM32F746xx) || defined(STM32F756xx) || defined(STM32F765xx) || defined(STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx) || defined(STM32F750xx)
164
#define GPIO_AF9_FMC ((uint8_t)0x09U)
/* FMC Alternate Function mapping */
165
#endif
/* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */
166
169
#define GPIO_AF10_OTG_FS ((uint8_t)0xAU)
/* OTG_FS Alternate Function mapping */
170
#define GPIO_AF10_OTG_HS ((uint8_t)0xAU)
/* OTG_HS Alternate Function mapping */
171
#define GPIO_AF10_QUADSPI ((uint8_t)0xAU)
/* QUADSPI Alternate Function mapping */
172
#define GPIO_AF10_SAI2 ((uint8_t)0xAU)
/* SAI2 Alternate Function mapping */
173
#if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
174
#define GPIO_AF10_DFSDM1 ((uint8_t)0x0AU)
/* DFSDM1 Alternate Function mapping */
175
#define GPIO_AF10_SDMMC2 ((uint8_t)0x0AU)
/* SDMMC2 Alternate Function mapping */
176
#define GPIO_AF10_LTDC ((uint8_t)0x0AU)
/* LCD-TFT Alternate Function mapping */
177
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
178
182
#define GPIO_AF11_ETH ((uint8_t)0x0BU)
/* ETHERNET Alternate Function mapping */
183
#if defined(STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)
184
#define GPIO_AF11_CAN3 ((uint8_t)0x0BU)
/* CAN3 Alternate Function mapping */
185
#define GPIO_AF11_SDMMC2 ((uint8_t)0x0BU)
/* SDMMC2 Alternate Function mapping */
186
#define GPIO_AF11_I2C4 ((uint8_t)0x0BU)
/* I2C4 Alternate Function mapping */
187
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
188
192
#define GPIO_AF12_FMC ((uint8_t)0xCU)
/* FMC Alternate Function mapping */
193
#define GPIO_AF12_OTG_HS_FS ((uint8_t)0xCU)
/* OTG HS configured in FS, Alternate Function mapping */
194
#define GPIO_AF12_SDMMC1 ((uint8_t)0xCU)
/* SDMMC1 Alternate Function mapping */
195
#if defined(STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)
196
#define GPIO_AF12_MDIOS ((uint8_t)0xCU)
/* SDMMC1 Alternate Function mapping */
197
#define GPIO_AF12_UART7 ((uint8_t)0xCU)
/* UART7 Alternate Function mapping */
198
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
199
203
#define GPIO_AF13_DCMI ((uint8_t)0x0DU)
/* DCMI Alternate Function mapping */
204
#if defined (STM32F769xx) || defined (STM32F779xx)
205
#define GPIO_AF13_DSI ((uint8_t)0x0DU)
/* DSI Alternate Function mapping */
206
#endif
/* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
207
#if defined(STM32F746xx) || defined(STM32F756xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx) || defined(STM32F750xx)
208
#define GPIO_AF13_LTDC ((uint8_t)0x0DU)
/* LTDC Alternate Function mapping */
209
213
#define GPIO_AF14_LTDC ((uint8_t)0x0EU)
/* LCD-TFT Alternate Function mapping */
214
#endif
/* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */
215
218
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU)
/* EVENTOUT Alternate Function mapping */
219
#endif
/* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
220
/*----------------------------------------------------------------------------*/
221
222
/*---------------------------- STM32F72xxx/STM32F73xxx -----------------------*/
223
#if defined(STM32F722xx) || defined(STM32F723xx) || defined(STM32F732xx) || defined(STM32F733xx) || defined(STM32F730xx)
224
227
#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U)
/* RTC_50Hz Alternate Function mapping */
228
#define GPIO_AF0_MCO ((uint8_t)0x00U)
/* MCO (MCO1 and MCO2) Alternate Function mapping */
229
#define GPIO_AF0_SWJ ((uint8_t)0x00U)
/* SWJ (SWD and JTAG) Alternate Function mapping */
230
#define GPIO_AF0_TRACE ((uint8_t)0x00U)
/* TRACE Alternate Function mapping */
231
235
#define GPIO_AF1_TIM1 ((uint8_t)0x01U)
/* TIM1 Alternate Function mapping */
236
#define GPIO_AF1_TIM2 ((uint8_t)0x01U)
/* TIM2 Alternate Function mapping */
237
241
#define GPIO_AF2_TIM3 ((uint8_t)0x02U)
/* TIM3 Alternate Function mapping */
242
#define GPIO_AF2_TIM4 ((uint8_t)0x02U)
/* TIM4 Alternate Function mapping */
243
#define GPIO_AF2_TIM5 ((uint8_t)0x02U)
/* TIM5 Alternate Function mapping */
244
248
#define GPIO_AF3_TIM8 ((uint8_t)0x03U)
/* TIM8 Alternate Function mapping */
249
#define GPIO_AF3_TIM9 ((uint8_t)0x03U)
/* TIM9 Alternate Function mapping */
250
#define GPIO_AF3_TIM10 ((uint8_t)0x03U)
/* TIM10 Alternate Function mapping */
251
#define GPIO_AF3_TIM11 ((uint8_t)0x03U)
/* TIM11 Alternate Function mapping */
252
#define GPIO_AF3_LPTIM1 ((uint8_t)0x03U)
/* LPTIM1 Alternate Function mapping */
253
257
#define GPIO_AF4_I2C1 ((uint8_t)0x04U)
/* I2C1 Alternate Function mapping */
258
#define GPIO_AF4_I2C2 ((uint8_t)0x04U)
/* I2C2 Alternate Function mapping */
259
#define GPIO_AF4_I2C3 ((uint8_t)0x04U)
/* I2C3 Alternate Function mapping */
260
264
#define GPIO_AF5_SPI1 ((uint8_t)0x05U)
/* SPI1 Alternate Function mapping */
265
#define GPIO_AF5_SPI2 ((uint8_t)0x05U)
/* SPI2/I2S2 Alternate Function mapping */
266
#define GPIO_AF5_SPI3 ((uint8_t)0x05U)
/* SPI3/I2S3 Alternate Function mapping */
267
#define GPIO_AF5_SPI4 ((uint8_t)0x05U)
/* SPI4 Alternate Function mapping */
268
#define GPIO_AF5_SPI5 ((uint8_t)0x05U)
/* SPI5 Alternate Function mapping */
269
273
#define GPIO_AF6_SPI3 ((uint8_t)0x06U)
/* SPI3/I2S3 Alternate Function mapping */
274
#define GPIO_AF6_SAI1 ((uint8_t)0x06U)
/* SAI1 Alternate Function mapping */
275
279
#define GPIO_AF7_USART1 ((uint8_t)0x07U)
/* USART1 Alternate Function mapping */
280
#define GPIO_AF7_USART2 ((uint8_t)0x07U)
/* USART2 Alternate Function mapping */
281
#define GPIO_AF7_USART3 ((uint8_t)0x07U)
/* USART3 Alternate Function mapping */
282
#define GPIO_AF7_UART5 ((uint8_t)0x07U)
/* UART5 Alternate Function mapping */
283
#define GPIO_AF7_SPI2 ((uint8_t)0x07U)
/* SPI2 Alternate Function mapping */
284
#define GPIO_AF7_SPI3 ((uint8_t)0x07U)
/* SPI3 Alternate Function mapping */
285
289
#define GPIO_AF8_UART4 ((uint8_t)0x08U)
/* UART4 Alternate Function mapping */
290
#define GPIO_AF8_UART5 ((uint8_t)0x08U)
/* UART5 Alternate Function mapping */
291
#define GPIO_AF8_USART6 ((uint8_t)0x08U)
/* USART6 Alternate Function mapping */
292
#define GPIO_AF8_UART7 ((uint8_t)0x08U)
/* UART7 Alternate Function mapping */
293
#define GPIO_AF8_UART8 ((uint8_t)0x08U)
/* UART8 Alternate Function mapping */
294
#define GPIO_AF8_SAI2 ((uint8_t)0x08U)
/* SAI2 Alternate Function mapping */
295
299
#define GPIO_AF9_CAN1 ((uint8_t)0x09U)
/* CAN1 Alternate Function mapping */
300
#define GPIO_AF9_TIM12 ((uint8_t)0x09U)
/* TIM12 Alternate Function mapping */
301
#define GPIO_AF9_TIM13 ((uint8_t)0x09U)
/* TIM13 Alternate Function mapping */
302
#define GPIO_AF9_TIM14 ((uint8_t)0x09U)
/* TIM14 Alternate Function mapping */
303
#define GPIO_AF9_QUADSPI ((uint8_t)0x09U)
/* QUADSPI Alternate Function mapping */
304
308
#define GPIO_AF10_OTG_FS ((uint8_t)0xAU)
/* OTG_FS Alternate Function mapping */
309
#define GPIO_AF10_OTG_HS ((uint8_t)0xAU)
/* OTG_HS Alternate Function mapping */
310
#define GPIO_AF10_QUADSPI ((uint8_t)0xAU)
/* QUADSPI Alternate Function mapping */
311
#define GPIO_AF10_SAI2 ((uint8_t)0xAU)
/* SAI2 Alternate Function mapping */
312
#define GPIO_AF10_SDMMC2 ((uint8_t)0x0AU)
/* SDMMC2 Alternate Function mapping */
313
317
#define GPIO_AF11_SDMMC2 ((uint8_t)0x0BU)
/* SDMMC2 Alternate Function mapping */
318
322
#define GPIO_AF12_FMC ((uint8_t)0xCU)
/* FMC Alternate Function mapping */
323
#define GPIO_AF12_OTG_HS_FS ((uint8_t)0xCU)
/* OTG HS configured in FS, Alternate Function mapping */
324
#define GPIO_AF12_SDMMC1 ((uint8_t)0xCU)
/* SDMMC1 Alternate Function mapping */
325
329
#define GPIO_AF13_RNG ((uint8_t)0x0DU)
/* RNG Alternate Function mapping */
330
334
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU)
/* EVENTOUT Alternate Function mapping */
335
#endif
/* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F730xx */
336
/*----------------------------------------------------------------------------*/
337
346
/* Exported macro ------------------------------------------------------------*/
354
/* Exported functions --------------------------------------------------------*/
361
/* Private types -------------------------------------------------------------*/
362
/* Private variables ---------------------------------------------------------*/
363
/* Private constants ---------------------------------------------------------*/
371
/* Defines the available pins per GPIOs */
372
#define GPIOA_PIN_AVAILABLE GPIO_PIN_All
373
#define GPIOB_PIN_AVAILABLE GPIO_PIN_All
374
#define GPIOC_PIN_AVAILABLE GPIO_PIN_All
375
#define GPIOD_PIN_AVAILABLE GPIO_PIN_All
376
#define GPIOE_PIN_AVAILABLE GPIO_PIN_All
377
#define GPIOF_PIN_AVAILABLE GPIO_PIN_All
378
#define GPIOG_PIN_AVAILABLE GPIO_PIN_All
379
#define GPIOI_PIN_AVAILABLE GPIO_PIN_All
380
#define GPIOJ_PIN_AVAILABLE GPIO_PIN_All
381
#define GPIOH_PIN_AVAILABLE GPIO_PIN_All
382
#define GPIOK_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | \
383
GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
384
389
/* Private macros ------------------------------------------------------------*/
396
#if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\
397
defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\
398
defined (STM32F750xx)
399
#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
400
((__GPIOx__) == (GPIOB))? 1U :\
401
((__GPIOx__) == (GPIOC))? 2U :\
402
((__GPIOx__) == (GPIOD))? 3U :\
403
((__GPIOx__) == (GPIOE))? 4U :\
404
((__GPIOx__) == (GPIOF))? 5U :\
405
((__GPIOx__) == (GPIOG))? 6U :\
406
((__GPIOx__) == (GPIOH))? 7U :\
407
((__GPIOx__) == (GPIOI))? 8U :\
408
((__GPIOx__) == (GPIOJ))? 9U : 10U)
409
#endif
/* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */
410
411
#if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)
412
#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
413
((__GPIOx__) == (GPIOB))? 1U :\
414
((__GPIOx__) == (GPIOC))? 2U :\
415
((__GPIOx__) == (GPIOD))? 3U :\
416
((__GPIOx__) == (GPIOE))? 4U :\
417
((__GPIOx__) == (GPIOF))? 5U :\
418
((__GPIOx__) == (GPIOG))? 6U :\
419
((__GPIOx__) == (GPIOH))? 7U : 8U)
420
#endif
/* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F730xx */
421
425
#define IS_GPIO_PIN_AVAILABLE(__INSTANCE__,__PIN__) \
426
((((__INSTANCE__) == GPIOA) && (((__PIN__) & (GPIOA_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOA_PIN_AVAILABLE)) == (GPIOA_PIN_AVAILABLE))) || \
427
(((__INSTANCE__) == GPIOB) && (((__PIN__) & (GPIOB_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOB_PIN_AVAILABLE)) == (GPIOB_PIN_AVAILABLE))) || \
428
(((__INSTANCE__) == GPIOC) && (((__PIN__) & (GPIOC_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOC_PIN_AVAILABLE)) == (GPIOC_PIN_AVAILABLE))) || \
429
(((__INSTANCE__) == GPIOD) && (((__PIN__) & (GPIOD_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOD_PIN_AVAILABLE)) == (GPIOD_PIN_AVAILABLE))) || \
430
(((__INSTANCE__) == GPIOE) && (((__PIN__) & (GPIOE_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOE_PIN_AVAILABLE)) == (GPIOE_PIN_AVAILABLE))) || \
431
(((__INSTANCE__) == GPIOF) && (((__PIN__) & (GPIOF_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOF_PIN_AVAILABLE)) == (GPIOF_PIN_AVAILABLE))) || \
432
(((__INSTANCE__) == GPIOG) && (((__PIN__) & (GPIOG_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOG_PIN_AVAILABLE)) == (GPIOG_PIN_AVAILABLE))) || \
433
(((__INSTANCE__) == GPIOI) && (((__PIN__) & (GPIOI_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOI_PIN_AVAILABLE)) == (GPIOI_PIN_AVAILABLE))) || \
434
(((__INSTANCE__) == GPIOJ) && (((__PIN__) & (GPIOJ_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOJ_PIN_AVAILABLE)) == (GPIOJ_PIN_AVAILABLE))) || \
435
(((__INSTANCE__) == GPIOK) && (((__PIN__) & (GPIOK_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOK_PIN_AVAILABLE)) == (GPIOK_PIN_AVAILABLE))) || \
436
(((__INSTANCE__) == GPIOH) && (((__PIN__) & (GPIOH_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOH_PIN_AVAILABLE)) == (GPIOH_PIN_AVAILABLE))))
437
440
#if defined(STM32F756xx) || defined(STM32F746xx) || defined(STM32F750xx)
441
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
442
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
443
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
444
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
445
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
446
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
447
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
448
((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
449
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
450
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \
451
((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
452
((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
453
((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
454
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
455
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
456
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
457
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
458
((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
459
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
460
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
461
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
462
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
463
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \
464
((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \
465
((AF) == GPIO_AF9_LTDC) || ((AF) == GPIO_AF10_OTG_FS) || \
466
((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \
467
((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \
468
((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDMMC1) || \
469
((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF15_EVENTOUT) || \
470
((AF) == GPIO_AF13_DCMI) || ((AF) == GPIO_AF14_LTDC))
471
#elif defined(STM32F745xx)
472
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
473
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
474
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
475
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
476
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
477
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
478
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
479
((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
480
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
481
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \
482
((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
483
((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
484
((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
485
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
486
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
487
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
488
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
489
((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
490
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
491
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
492
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
493
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
494
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \
495
((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \
496
((AF) == GPIO_AF13_DCMI) || ((AF) == GPIO_AF10_OTG_FS) || \
497
((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \
498
((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \
499
((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDMMC1) || \
500
((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF15_EVENTOUT))
501
#elif defined(STM32F767xx) || defined(STM32F777xx)
502
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
503
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
504
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
505
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
506
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
507
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
508
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
509
((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
510
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
511
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \
512
((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
513
((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
514
((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
515
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
516
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
517
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
518
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
519
((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
520
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
521
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
522
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
523
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
524
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \
525
((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \
526
((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF9_LTDC) || \
527
((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \
528
((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \
529
((AF) == GPIO_AF10_SDMMC2) || ((AF) == GPIO_AF11_SDMMC2) || \
530
((AF) == GPIO_AF11_CAN3) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
531
((AF) == GPIO_AF12_SDMMC1) || ((AF) == GPIO_AF12_FMC) || \
532
((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF13_DCMI) || \
533
((AF) == GPIO_AF14_LTDC))
534
#elif defined(STM32F769xx) || defined(STM32F779xx)
535
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
536
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
537
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
538
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
539
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
540
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
541
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
542
((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
543
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
544
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \
545
((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
546
((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
547
((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
548
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
549
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
550
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
551
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
552
((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
553
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
554
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
555
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
556
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
557
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \
558
((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \
559
((AF) == GPIO_AF9_LTDC) || ((AF) == GPIO_AF10_OTG_FS) || \
560
((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \
561
((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \
562
((AF) == GPIO_AF10_SDMMC2) || ((AF) == GPIO_AF11_SDMMC2) || \
563
((AF) == GPIO_AF11_CAN3) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
564
((AF) == GPIO_AF12_SDMMC1) || ((AF) == GPIO_AF12_FMC) || \
565
((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF13_DCMI) || \
566
((AF) == GPIO_AF14_LTDC) || ((AF) == GPIO_AF13_DSI))
567
#elif defined(STM32F765xx)
568
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
569
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
570
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
571
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
572
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
573
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
574
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
575
((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \
576
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
577
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \
578
((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \
579
((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \
580
((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \
581
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
582
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
583
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
584
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
585
((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \
586
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
587
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
588
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
589
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
590
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \
591
((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \
592
((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \
593
((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \
594
((AF) == GPIO_AF10_SDMMC2) || ((AF) == GPIO_AF11_SDMMC2) || \
595
((AF) == GPIO_AF11_CAN3) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
596
((AF) == GPIO_AF12_SDMMC1) || ((AF) == GPIO_AF12_FMC) || \
597
((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF13_DCMI) || \
598
((AF) == GPIO_AF10_OTG_FS))
599
#elif defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)
600
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \
601
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
602
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \
603
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
604
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
605
((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \
606
((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \
607
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
608
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
609
((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF5_SPI3) || \
610
((AF) == GPIO_AF5_SPI4) || ((AF) == GPIO_AF5_SPI5) || \
611
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \
612
((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \
613
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
614
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \
615
((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \
616
((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \
617
((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \
618
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_TIM12) || \
619
((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM14) || \
620
((AF) == GPIO_AF9_QUADSPI) || ((AF) == GPIO_AF10_OTG_HS) || \
621
((AF) == GPIO_AF10_SAI2) || ((AF) == GPIO_AF10_QUADSPI) || \
622
((AF) == GPIO_AF10_SDMMC2) || ((AF) == GPIO_AF11_SDMMC2) || \
623
((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDMMC1) || \
624
((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF15_EVENTOUT) || \
625
((AF) == GPIO_AF10_OTG_FS))
626
#endif
/* STM32F756xx || STM32F746xx || STM32F750xx */
627
635
/* Private functions ---------------------------------------------------------*/
652
#ifdef __cplusplus
653
}
654
#endif
655
656
#endif
/* __STM32F7xx_HAL_GPIO_EX_H */
657
658
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
stm32f7xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.
picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53