2 ******************************************************************************
\r
3 * @file stm32l4xx_hal_gpio_ex.h
\r
4 * @author MCD Application Team
\r
5 * @brief Header file of GPIO HAL Extended module.
\r
6 ******************************************************************************
\r
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
\r
10 * All rights reserved.</center></h2>
\r
12 * This software component is licensed by ST under BSD 3-Clause license,
\r
13 * the "License"; You may not use this file except in compliance with the
\r
14 * License. You may obtain a copy of the License at:
\r
15 * opensource.org/licenses/BSD-3-Clause
\r
17 ******************************************************************************
\r
20 /* Define to prevent recursive inclusion -------------------------------------*/
\r
21 #ifndef __STM32L4xx_HAL_GPIO_EX_H
\r
22 #define __STM32L4xx_HAL_GPIO_EX_H
\r
28 /* Includes ------------------------------------------------------------------*/
\r
29 #include "stm32l4xx_hal_def.h"
\r
31 /** @addtogroup STM32L4xx_HAL_Driver
\r
35 /** @defgroup GPIOEx GPIOEx
\r
36 * @brief GPIO Extended HAL module driver
\r
40 /* Exported types ------------------------------------------------------------*/
\r
41 /* Exported constants --------------------------------------------------------*/
\r
42 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
\r
46 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
\r
50 #if defined(STM32L412xx) || defined(STM32L422xx)
\r
51 /*--------------STM32L412xx/STM32L422xx---*/
\r
53 * @brief AF 0 selection
\r
55 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
56 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
57 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
58 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
61 * @brief AF 1 selection
\r
63 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
64 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
65 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
66 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
69 * @brief AF 2 selection
\r
71 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
72 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
75 * @brief AF 3 selection
\r
77 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */
\r
78 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
81 * @brief AF 4 selection
\r
83 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
84 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
85 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
88 * @brief AF 5 selection
\r
90 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
91 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
94 * @brief AF 6 selection
\r
96 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */
\r
99 * @brief AF 7 selection
\r
101 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
102 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
103 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
106 * @brief AF 8 selection
\r
108 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
111 * @brief AF 9 selection
\r
113 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
116 * @brief AF 10 selection
\r
118 #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */
\r
119 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
\r
122 * @brief AF 12 selection
\r
124 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
128 * @brief AF 14 selection
\r
130 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
\r
131 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
132 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
133 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
136 * @brief AF 15 selection
\r
138 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
140 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
142 #endif /* STM32L412xx || STM32L422xx */
\r
144 #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx)
\r
145 /*--------------STM32L431xx/STM32L432xx/STM32L433xx/STM32L442xx/STM32L443xx---*/
\r
147 * @brief AF 0 selection
\r
149 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
150 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
151 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
152 #if defined(STM32L433xx) || defined(STM32L443xx)
\r
153 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
\r
154 #endif /* STM32L433xx || STM32L443xx */
\r
155 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
158 * @brief AF 1 selection
\r
160 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
161 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
162 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
163 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
166 * @brief AF 2 selection
\r
168 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
169 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
172 * @brief AF 3 selection
\r
174 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */
\r
175 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
176 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
179 * @brief AF 4 selection
\r
181 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
182 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
183 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
186 * @brief AF 5 selection
\r
188 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
189 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
192 * @brief AF 6 selection
\r
194 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
\r
195 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */
\r
198 * @brief AF 7 selection
\r
200 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
201 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
202 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
205 * @brief AF 8 selection
\r
207 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
210 * @brief AF 9 selection
\r
212 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
\r
213 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
216 * @brief AF 10 selection
\r
218 #if defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx)
\r
219 #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */
\r
220 #endif /* STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */
\r
221 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
\r
223 #if defined(STM32L433xx) || defined(STM32L443xx)
\r
225 * @brief AF 11 selection
\r
227 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
\r
228 #endif /* STM32L433xx || STM32L443xx */
\r
231 * @brief AF 12 selection
\r
233 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */
\r
234 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
235 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
\r
236 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
\r
239 * @brief AF 13 selection
\r
241 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
\r
244 * @brief AF 14 selection
\r
246 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
\r
247 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
248 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
249 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
252 * @brief AF 15 selection
\r
254 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
256 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
258 #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */
\r
260 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx)
\r
261 /*--------------STM32L451xx/STM32L452xx/STM32L462xx---------------------------*/
\r
263 * @brief AF 0 selection
\r
265 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
266 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
267 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
268 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
271 * @brief AF 1 selection
\r
273 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
274 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
275 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
276 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
279 * @brief AF 2 selection
\r
281 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
282 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
283 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
\r
284 #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */
\r
287 * @brief AF 3 selection
\r
289 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
290 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
291 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */
\r
292 #define GPIO_AF3_CAN1 ((uint8_t)0x03) /* CAN1 Alternate Function mapping */
\r
293 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */
\r
296 * @brief AF 4 selection
\r
298 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
299 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
300 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
301 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */
\r
304 * @brief AF 5 selection
\r
306 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
307 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
308 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */
\r
311 * @brief AF 6 selection
\r
313 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
\r
314 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
\r
315 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */
\r
318 * @brief AF 7 selection
\r
320 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
321 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
322 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
325 * @brief AF 8 selection
\r
327 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
\r
328 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
329 #define GPIO_AF8_CAN1 ((uint8_t)0x08) /* CAN1 Alternate Function mapping */
\r
333 * @brief AF 9 selection
\r
335 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
\r
336 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
339 * @brief AF 10 selection
\r
341 #if defined(STM32L452xx) || defined(STM32L462xx)
\r
342 #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */
\r
343 #endif /* STM32L452xx || STM32L462xx */
\r
344 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
\r
345 #define GPIO_AF10_CAN1 ((uint8_t)0x0A) /* CAN1 Alternate Function mapping */
\r
348 * @brief AF 11 selection
\r
352 * @brief AF 12 selection
\r
354 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
355 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
\r
356 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
\r
359 * @brief AF 13 selection
\r
361 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
\r
364 * @brief AF 14 selection
\r
366 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
\r
367 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
368 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
369 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
\r
370 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
373 * @brief AF 15 selection
\r
375 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
377 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
379 #endif /* STM32L451xx || STM32L452xx || STM32L462xx */
\r
381 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
\r
382 /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx---*/
\r
384 * @brief AF 0 selection
\r
386 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
387 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
388 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
389 #if defined(STM32L476xx) || defined(STM32L486xx)
\r
390 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
\r
391 #endif /* STM32L476xx || STM32L486xx */
\r
392 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
395 * @brief AF 1 selection
\r
397 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
398 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
399 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */
\r
400 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */
\r
401 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
402 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
405 * @brief AF 2 selection
\r
407 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
408 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
409 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
\r
410 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
\r
411 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
\r
414 * @brief AF 3 selection
\r
416 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
\r
417 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
418 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
421 * @brief AF 4 selection
\r
423 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
424 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
425 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
428 * @brief AF 5 selection
\r
430 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
431 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
434 * @brief AF 6 selection
\r
436 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
\r
437 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
\r
440 * @brief AF 7 selection
\r
442 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
443 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
444 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
447 * @brief AF 8 selection
\r
449 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
\r
450 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
\r
451 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
455 * @brief AF 9 selection
\r
457 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
\r
458 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
461 * @brief AF 10 selection
\r
463 #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
\r
464 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */
\r
465 #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
\r
466 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
\r
468 #if defined(STM32L476xx) || defined(STM32L486xx)
\r
470 * @brief AF 11 selection
\r
472 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
\r
473 #endif /* STM32L476xx || STM32L486xx */
\r
476 * @brief AF 12 selection
\r
478 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */
\r
479 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */
\r
480 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
481 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
\r
482 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
\r
485 * @brief AF 13 selection
\r
487 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
\r
488 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */
\r
489 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
490 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
493 * @brief AF 14 selection
\r
495 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
\r
496 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
497 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
498 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
\r
499 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
500 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
503 * @brief AF 15 selection
\r
505 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
507 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
509 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
\r
511 #if defined(STM32L496xx) || defined(STM32L4A6xx)
\r
512 /*--------------------------------STM32L496xx/STM32L4A6xx---------------------*/
\r
514 * @brief AF 0 selection
\r
516 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
517 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
518 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
519 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
522 * @brief AF 1 selection
\r
524 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
525 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
526 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */
\r
527 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */
\r
528 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
529 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
532 * @brief AF 2 selection
\r
534 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
535 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
536 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
\r
537 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
\r
538 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
\r
539 #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */
\r
542 * @brief AF 3 selection
\r
544 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
\r
545 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
546 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
547 #define GPIO_AF3_CAN2 ((uint8_t)0x03) /* CAN2 Alternate Function mapping */
\r
548 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */
\r
549 #define GPIO_AF3_QUADSPI ((uint8_t)0x03) /* QUADSPI Alternate Function mapping */
\r
550 #define GPIO_AF3_SPI2 ((uint8_t)0x03) /* SPI2 Alternate Function mapping */
\r
551 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */
\r
554 * @brief AF 4 selection
\r
556 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
557 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
558 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
559 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */
\r
560 #define GPIO_AF4_DCMI ((uint8_t)0x04) /* DCMI Alternate Function mapping */
\r
563 * @brief AF 5 selection
\r
565 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
566 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
567 #define GPIO_AF5_DCMI ((uint8_t)0x05) /* DCMI Alternate Function mapping */
\r
568 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */
\r
569 #define GPIO_AF5_QUADSPI ((uint8_t)0x05) /* QUADSPI Alternate Function mapping */
\r
572 * @brief AF 6 selection
\r
574 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
\r
575 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
\r
576 #define GPIO_AF6_I2C3 ((uint8_t)0x06) /* I2C3 Alternate Function mapping */
\r
579 * @brief AF 7 selection
\r
581 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
582 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
583 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
586 * @brief AF 8 selection
\r
588 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
\r
589 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
\r
590 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
591 #define GPIO_AF8_CAN2 ((uint8_t)0x08) /* CAN2 Alternate Function mapping */
\r
594 * @brief AF 9 selection
\r
596 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
\r
597 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
600 * @brief AF 10 selection
\r
602 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */
\r
603 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
\r
604 #define GPIO_AF10_CAN2 ((uint8_t)0x0A) /* CAN2 Alternate Function mapping */
\r
605 #define GPIO_AF10_DCMI ((uint8_t)0x0A) /* DCMI Alternate Function mapping */
\r
608 * @brief AF 11 selection
\r
610 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
\r
613 * @brief AF 12 selection
\r
615 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */
\r
616 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */
\r
617 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
618 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
\r
619 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
\r
620 #define GPIO_AF12_TIM1_COMP2 ((uint8_t)0x0C) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
621 #define GPIO_AF12_TIM1_COMP1 ((uint8_t)0x0C) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
622 #define GPIO_AF12_TIM8_COMP2 ((uint8_t)0x0C) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
625 * @brief AF 13 selection
\r
627 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
\r
628 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */
\r
629 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
630 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
633 * @brief AF 14 selection
\r
635 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
\r
636 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
637 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
638 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
\r
639 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
640 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
643 * @brief AF 15 selection
\r
645 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
647 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
649 #endif /* STM32L496xx || STM32L4A6xx */
\r
651 #if defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
\r
652 /*---STM32L4R5xx/STM32L4R7xx/STM32L4R9xx/STM32L4S5xx/STM32L4S7xx/STM32L4S9xx--*/
\r
654 * @brief AF 0 selection
\r
656 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
\r
657 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
\r
658 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
\r
659 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
\r
662 * @brief AF 1 selection
\r
664 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
\r
665 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
\r
666 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */
\r
667 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */
\r
668 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
\r
669 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
\r
672 * @brief AF 2 selection
\r
674 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
\r
675 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
\r
676 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
\r
677 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
\r
678 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
\r
681 * @brief AF 3 selection
\r
683 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */
\r
684 #define GPIO_AF3_OCTOSPIM_P1 ((uint8_t)0x03) /* OctoSPI Manager Port 1 Alternate Function mapping */
\r
685 #define GPIO_AF3_SAI1 ((uint8_t)0x03) /* SAI1 Alternate Function mapping */
\r
686 #define GPIO_AF3_SPI2 ((uint8_t)0x03) /* SPI2 Alternate Function mapping */
\r
687 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
688 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
689 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
\r
690 #define GPIO_AF3_TIM8_COMP1 ((uint8_t)0x03) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
691 #define GPIO_AF3_TIM8_COMP2 ((uint8_t)0x03) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
692 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */
\r
695 * @brief AF 4 selection
\r
697 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
\r
698 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
\r
699 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
\r
700 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */
\r
701 #define GPIO_AF4_DCMI ((uint8_t)0x04) /* DCMI Alternate Function mapping */
\r
704 * @brief AF 5 selection
\r
706 #define GPIO_AF5_DCMI ((uint8_t)0x05) /* DCMI Alternate Function mapping */
\r
707 #define GPIO_AF5_DFSDM1 ((uint8_t)0x05) /* DFSDM1 Alternate Function mapping */
\r
708 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */
\r
709 #define GPIO_AF5_OCTOSPIM_P1 ((uint8_t)0x05) /* OctoSPI Manager Port 1 Alternate Function mapping */
\r
710 #define GPIO_AF5_OCTOSPIM_P2 ((uint8_t)0x05) /* OctoSPI Manager Port 2 Alternate Function mapping */
\r
711 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
\r
712 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
713 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
\r
716 * @brief AF 6 selection
\r
718 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
\r
719 #define GPIO_AF6_I2C3 ((uint8_t)0x06) /* I2C3 Alternate Function mapping */
\r
720 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
\r
723 * @brief AF 7 selection
\r
725 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
\r
726 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
\r
727 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
\r
730 * @brief AF 8 selection
\r
732 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
\r
733 #define GPIO_AF8_SDMMC1 ((uint8_t)0x08) /* SDMMC1 Alternate Function mapping */
\r
734 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
\r
735 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
\r
738 * @brief AF 9 selection
\r
740 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
\r
741 #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LTDC Alternate Function mapping */
\r
742 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
\r
745 * @brief AF 10 selection
\r
747 #define GPIO_AF10_DCMI ((uint8_t)0x0A) /* DCMI Alternate Function mapping */
\r
748 #define GPIO_AF10_OCTOSPIM_P1 ((uint8_t)0x0A) /* OctoSPI Manager Port 1 Alternate Function mapping */
\r
749 #define GPIO_AF10_OCTOSPIM_P2 ((uint8_t)0x0A) /* OctoSPI Manager Port 2 Alternate Function mapping */
\r
750 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */
\r
753 * @brief AF 11 selection
\r
755 #define GPIO_AF11_DSI ((uint8_t)0x0B) /* DSI Alternate Function mapping */
\r
756 #define GPIO_AF11_LTDC ((uint8_t)0x0B) /* LTDC Alternate Function mapping */
\r
759 * @brief AF 12 selection
\r
761 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
\r
762 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
\r
763 #define GPIO_AF12_DSI ((uint8_t)0x0C) /* DSI Alternate Function mapping */
\r
764 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */
\r
765 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
\r
766 #define GPIO_AF12_TIM1_COMP1 ((uint8_t)0x0C) /* TIM1/COMP1 Break in Alternate Function mapping */
\r
767 #define GPIO_AF12_TIM1_COMP2 ((uint8_t)0x0C) /* TIM1/COMP2 Break in Alternate Function mapping */
\r
768 #define GPIO_AF12_TIM8_COMP2 ((uint8_t)0x0C) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
771 * @brief AF 13 selection
\r
773 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
\r
774 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */
\r
775 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */
\r
778 * @brief AF 14 selection
\r
780 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
\r
781 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
\r
782 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
\r
783 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
\r
784 #define GPIO_AF14_TIM8_COMP2 ((uint8_t)0x0E) /* TIM8/COMP2 Break in Alternate Function mapping */
\r
787 * @brief AF 15 selection
\r
789 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
\r
791 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
\r
793 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
803 /* Exported macro ------------------------------------------------------------*/
\r
804 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros
\r
808 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index
\r
811 #if defined(STM32L412xx) || defined(STM32L422xx)
\r
813 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
814 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
815 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
816 ((__GPIOx__) == (GPIOD))? 3uL : 7uL)
\r
818 #endif /* STM32L412xx || STM32L422xx */
\r
820 #if defined(STM32L431xx) || defined(STM32L433xx) || defined(STM32L443xx)
\r
822 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
823 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
824 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
825 ((__GPIOx__) == (GPIOD))? 3uL :\
\r
826 ((__GPIOx__) == (GPIOE))? 4uL : 7uL)
\r
828 #endif /* STM32L431xx || STM32L433xx || STM32L443xx */
\r
830 #if defined(STM32L432xx) || defined(STM32L442xx)
\r
832 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
833 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
834 ((__GPIOx__) == (GPIOC))? 2uL : 7uL)
\r
836 #endif /* STM32L432xx || STM32L442xx */
\r
838 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx)
\r
840 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
841 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
842 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
843 ((__GPIOx__) == (GPIOD))? 3uL :\
\r
844 ((__GPIOx__) == (GPIOE))? 4uL : 7uL)
\r
846 #endif /* STM32L451xx || STM32L452xx || STM32L462xx */
\r
848 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
\r
850 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
851 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
852 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
853 ((__GPIOx__) == (GPIOD))? 3uL :\
\r
854 ((__GPIOx__) == (GPIOE))? 4uL :\
\r
855 ((__GPIOx__) == (GPIOF))? 5uL :\
\r
856 ((__GPIOx__) == (GPIOG))? 6uL : 7uL)
\r
858 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
\r
860 #if defined(STM32L496xx) || defined(STM32L4A6xx)
\r
862 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
863 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
864 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
865 ((__GPIOx__) == (GPIOD))? 3uL :\
\r
866 ((__GPIOx__) == (GPIOE))? 4uL :\
\r
867 ((__GPIOx__) == (GPIOF))? 5uL :\
\r
868 ((__GPIOx__) == (GPIOG))? 6uL :\
\r
869 ((__GPIOx__) == (GPIOH))? 7uL : 8uL)
\r
871 #endif /* STM32L496xx || STM32L4A6xx */
\r
873 #if defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
\r
875 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\
\r
876 ((__GPIOx__) == (GPIOB))? 1uL :\
\r
877 ((__GPIOx__) == (GPIOC))? 2uL :\
\r
878 ((__GPIOx__) == (GPIOD))? 3uL :\
\r
879 ((__GPIOx__) == (GPIOE))? 4uL :\
\r
880 ((__GPIOx__) == (GPIOF))? 5uL :\
\r
881 ((__GPIOx__) == (GPIOG))? 6uL :\
\r
882 ((__GPIOx__) == (GPIOH))? 7uL : 8uL)
\r
884 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */
\r
894 /* Exported functions --------------------------------------------------------*/
\r
907 #endif /* __STM32L4xx_HAL_GPIO_EX_H */
\r
909 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r