STM32L486xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_gpio_ex.h 00004 * @author MCD Application Team 00005 * @brief Header file of GPIO HAL Extended module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> 00010 * 00011 * Redistribution and use in source and binary forms, with or without modification, 00012 * are permitted provided that the following conditions are met: 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00019 * may be used to endorse or promote products derived from this software 00020 * without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00025 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00027 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00028 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00030 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 ****************************************************************************** 00034 */ 00035 00036 /* Define to prevent recursive inclusion -------------------------------------*/ 00037 #ifndef __STM32L4xx_HAL_GPIO_EX_H 00038 #define __STM32L4xx_HAL_GPIO_EX_H 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 /* Includes ------------------------------------------------------------------*/ 00045 #include "stm32l4xx_hal_def.h" 00046 00047 /** @addtogroup STM32L4xx_HAL_Driver 00048 * @{ 00049 */ 00050 00051 /** @defgroup GPIOEx GPIOEx 00052 * @brief GPIO Extended HAL module driver 00053 * @{ 00054 */ 00055 00056 /* Exported types ------------------------------------------------------------*/ 00057 /* Exported constants --------------------------------------------------------*/ 00058 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants 00059 * @{ 00060 */ 00061 00062 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection 00063 * @{ 00064 */ 00065 00066 #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) 00067 /*--------------STM32L431xx/STM32L432xx/STM32L433xx/STM32L442xx/STM32L443xx---*/ 00068 /** 00069 * @brief AF 0 selection 00070 */ 00071 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00072 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00073 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00074 #if defined(STM32L433xx) || defined(STM32L443xx) 00075 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ 00076 #endif /* STM32L433xx || STM32L443xx */ 00077 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00078 00079 /** 00080 * @brief AF 1 selection 00081 */ 00082 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00083 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00084 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00085 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00086 00087 /** 00088 * @brief AF 2 selection 00089 */ 00090 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00091 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00092 00093 /** 00094 * @brief AF 3 selection 00095 */ 00096 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */ 00097 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00098 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00099 00100 /** 00101 * @brief AF 4 selection 00102 */ 00103 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00104 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00105 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00106 00107 /** 00108 * @brief AF 5 selection 00109 */ 00110 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00111 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00112 00113 /** 00114 * @brief AF 6 selection 00115 */ 00116 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00117 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */ 00118 00119 /** 00120 * @brief AF 7 selection 00121 */ 00122 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00123 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00124 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00125 00126 /** 00127 * @brief AF 8 selection 00128 */ 00129 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00130 00131 /** 00132 * @brief AF 9 selection 00133 */ 00134 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00135 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00136 00137 /** 00138 * @brief AF 10 selection 00139 */ 00140 #if defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) 00141 #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */ 00142 #endif /* STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ 00143 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ 00144 00145 #if defined(STM32L433xx) || defined(STM32L443xx) 00146 /** 00147 * @brief AF 11 selection 00148 */ 00149 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ 00150 #endif /* STM32L433xx || STM32L443xx */ 00151 00152 /** 00153 * @brief AF 12 selection 00154 */ 00155 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ 00156 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ 00157 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ 00158 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ 00159 00160 /** 00161 * @brief AF 13 selection 00162 */ 00163 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00164 00165 /** 00166 * @brief AF 14 selection 00167 */ 00168 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ 00169 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00170 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00171 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00172 00173 /** 00174 * @brief AF 15 selection 00175 */ 00176 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00177 00178 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00179 00180 #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ 00181 00182 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 00183 /*--------------STM32L451xx/STM32L452xx/STM32L462xx---------------------------*/ 00184 /** 00185 * @brief AF 0 selection 00186 */ 00187 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00188 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00189 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00190 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00191 00192 /** 00193 * @brief AF 1 selection 00194 */ 00195 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00196 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00197 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00198 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00199 00200 /** 00201 * @brief AF 2 selection 00202 */ 00203 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00204 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00205 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ 00206 #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */ 00207 00208 /** 00209 * @brief AF 3 selection 00210 */ 00211 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00212 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00213 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */ 00214 #define GPIO_AF3_CAN1 ((uint8_t)0x03) /* CAN1 Alternate Function mapping */ 00215 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */ 00216 00217 /** 00218 * @brief AF 4 selection 00219 */ 00220 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00221 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00222 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00223 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ 00224 00225 /** 00226 * @brief AF 5 selection 00227 */ 00228 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00229 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00230 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */ 00231 00232 /** 00233 * @brief AF 6 selection 00234 */ 00235 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00236 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ 00237 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */ 00238 00239 /** 00240 * @brief AF 7 selection 00241 */ 00242 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00243 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00244 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00245 00246 /** 00247 * @brief AF 8 selection 00248 */ 00249 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ 00250 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00251 #define GPIO_AF8_CAN1 ((uint8_t)0x08) /* CAN1 Alternate Function mapping */ 00252 00253 00254 /** 00255 * @brief AF 9 selection 00256 */ 00257 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00258 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00259 00260 /** 00261 * @brief AF 10 selection 00262 */ 00263 #if defined(STM32L452xx) || defined(STM32L462xx) 00264 #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */ 00265 #endif /* STM32L452xx || STM32L462xx */ 00266 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ 00267 #define GPIO_AF10_CAN1 ((uint8_t)0x0A) /* CAN1 Alternate Function mapping */ 00268 00269 /** 00270 * @brief AF 11 selection 00271 */ 00272 00273 /** 00274 * @brief AF 12 selection 00275 */ 00276 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ 00277 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ 00278 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ 00279 00280 /** 00281 * @brief AF 13 selection 00282 */ 00283 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00284 00285 /** 00286 * @brief AF 14 selection 00287 */ 00288 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ 00289 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00290 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00291 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ 00292 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00293 00294 /** 00295 * @brief AF 15 selection 00296 */ 00297 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00298 00299 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00300 00301 #endif /* STM32L451xx || STM32L452xx || STM32L462xx */ 00302 00303 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) 00304 /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx---*/ 00305 /** 00306 * @brief AF 0 selection 00307 */ 00308 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00309 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00310 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00311 #if defined(STM32L476xx) || defined(STM32L486xx) 00312 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ 00313 #endif /* STM32L476xx || STM32L486xx */ 00314 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00315 00316 /** 00317 * @brief AF 1 selection 00318 */ 00319 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00320 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00321 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ 00322 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ 00323 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00324 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00325 00326 /** 00327 * @brief AF 2 selection 00328 */ 00329 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00330 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00331 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ 00332 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ 00333 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ 00334 00335 /** 00336 * @brief AF 3 selection 00337 */ 00338 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ 00339 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00340 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00341 00342 /** 00343 * @brief AF 4 selection 00344 */ 00345 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00346 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00347 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00348 00349 /** 00350 * @brief AF 5 selection 00351 */ 00352 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00353 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00354 00355 /** 00356 * @brief AF 6 selection 00357 */ 00358 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00359 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ 00360 00361 /** 00362 * @brief AF 7 selection 00363 */ 00364 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00365 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00366 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00367 00368 /** 00369 * @brief AF 8 selection 00370 */ 00371 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ 00372 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ 00373 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00374 00375 00376 /** 00377 * @brief AF 9 selection 00378 */ 00379 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00380 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00381 00382 /** 00383 * @brief AF 10 selection 00384 */ 00385 #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) 00386 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */ 00387 #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ 00388 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ 00389 00390 #if defined(STM32L476xx) || defined(STM32L486xx) 00391 /** 00392 * @brief AF 11 selection 00393 */ 00394 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ 00395 #endif /* STM32L476xx || STM32L486xx */ 00396 00397 /** 00398 * @brief AF 12 selection 00399 */ 00400 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */ 00401 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ 00402 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ 00403 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ 00404 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ 00405 00406 /** 00407 * @brief AF 13 selection 00408 */ 00409 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00410 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ 00411 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ 00412 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ 00413 00414 /** 00415 * @brief AF 14 selection 00416 */ 00417 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ 00418 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00419 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00420 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ 00421 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00422 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ 00423 00424 /** 00425 * @brief AF 15 selection 00426 */ 00427 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00428 00429 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00430 00431 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ 00432 00433 #if defined(STM32L496xx) || defined(STM32L4A6xx) 00434 /*--------------------------------STM32L496xx/STM32L4A6xx---------------------*/ 00435 /** 00436 * @brief AF 0 selection 00437 */ 00438 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00439 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00440 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00441 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00442 00443 /** 00444 * @brief AF 1 selection 00445 */ 00446 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00447 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00448 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ 00449 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ 00450 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00451 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00452 00453 /** 00454 * @brief AF 2 selection 00455 */ 00456 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00457 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00458 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ 00459 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ 00460 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ 00461 #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */ 00462 00463 /** 00464 * @brief AF 3 selection 00465 */ 00466 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ 00467 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00468 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00469 #define GPIO_AF3_CAN2 ((uint8_t)0x03) /* CAN2 Alternate Function mapping */ 00470 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */ 00471 #define GPIO_AF3_QUADSPI ((uint8_t)0x03) /* QUADSPI Alternate Function mapping */ 00472 #define GPIO_AF3_SPI2 ((uint8_t)0x03) /* SPI2 Alternate Function mapping */ 00473 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */ 00474 00475 /** 00476 * @brief AF 4 selection 00477 */ 00478 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00479 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00480 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00481 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ 00482 #define GPIO_AF4_DCMI ((uint8_t)0x04) /* DCMI Alternate Function mapping */ 00483 00484 /** 00485 * @brief AF 5 selection 00486 */ 00487 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00488 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00489 #define GPIO_AF5_DCMI ((uint8_t)0x05) /* DCMI Alternate Function mapping */ 00490 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */ 00491 #define GPIO_AF5_QUADSPI ((uint8_t)0x05) /* QUADSPI Alternate Function mapping */ 00492 00493 /** 00494 * @brief AF 6 selection 00495 */ 00496 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00497 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ 00498 #define GPIO_AF6_I2C3 ((uint8_t)0x06) /* I2C3 Alternate Function mapping */ 00499 00500 /** 00501 * @brief AF 7 selection 00502 */ 00503 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00504 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00505 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00506 00507 /** 00508 * @brief AF 8 selection 00509 */ 00510 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ 00511 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ 00512 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00513 #define GPIO_AF8_CAN2 ((uint8_t)0x08) /* CAN2 Alternate Function mapping */ 00514 00515 /** 00516 * @brief AF 9 selection 00517 */ 00518 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00519 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00520 00521 /** 00522 * @brief AF 10 selection 00523 */ 00524 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */ 00525 #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ 00526 #define GPIO_AF10_CAN2 ((uint8_t)0x0A) /* CAN2 Alternate Function mapping */ 00527 #define GPIO_AF10_DCMI ((uint8_t)0x0A) /* DCMI Alternate Function mapping */ 00528 00529 /** 00530 * @brief AF 11 selection 00531 */ 00532 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ 00533 00534 /** 00535 * @brief AF 12 selection 00536 */ 00537 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */ 00538 #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ 00539 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ 00540 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ 00541 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ 00542 #define GPIO_AF12_TIM1_COMP2 ((uint8_t)0x0C) /* TIM1/COMP2 Break in Alternate Function mapping */ 00543 #define GPIO_AF12_TIM1_COMP1 ((uint8_t)0x0C) /* TIM1/COMP1 Break in Alternate Function mapping */ 00544 #define GPIO_AF12_TIM8_COMP2 ((uint8_t)0x0C) /* TIM8/COMP2 Break in Alternate Function mapping */ 00545 00546 /** 00547 * @brief AF 13 selection 00548 */ 00549 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00550 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ 00551 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ 00552 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ 00553 00554 /** 00555 * @brief AF 14 selection 00556 */ 00557 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ 00558 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00559 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00560 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ 00561 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00562 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ 00563 00564 /** 00565 * @brief AF 15 selection 00566 */ 00567 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00568 00569 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00570 00571 #endif /* STM32L496xx || STM32L4A6xx */ 00572 00573 #if defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx) 00574 /*---STM32L4R5xx/STM32L4R7xx/STM32L4R9xx/STM32L4S5xx/STM32L4S7xx/STM32L4S9xx--*/ 00575 /** 00576 * @brief AF 0 selection 00577 */ 00578 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00579 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00580 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00581 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00582 00583 /** 00584 * @brief AF 1 selection 00585 */ 00586 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00587 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00588 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ 00589 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ 00590 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00591 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00592 00593 /** 00594 * @brief AF 2 selection 00595 */ 00596 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00597 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00598 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ 00599 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ 00600 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ 00601 00602 /** 00603 * @brief AF 3 selection 00604 */ 00605 #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */ 00606 #define GPIO_AF3_OCTOSPIM_P1 ((uint8_t)0x03) /* OctoSPI Manager Port 1 Alternate Function mapping */ 00607 #define GPIO_AF3_SAI1 ((uint8_t)0x03) /* SAI1 Alternate Function mapping */ 00608 #define GPIO_AF3_SPI2 ((uint8_t)0x03) /* SPI2 Alternate Function mapping */ 00609 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00610 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00611 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ 00612 #define GPIO_AF3_TIM8_COMP1 ((uint8_t)0x03) /* TIM8/COMP1 Break in Alternate Function mapping */ 00613 #define GPIO_AF3_TIM8_COMP2 ((uint8_t)0x03) /* TIM8/COMP2 Break in Alternate Function mapping */ 00614 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */ 00615 00616 /** 00617 * @brief AF 4 selection 00618 */ 00619 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00620 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00621 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00622 #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ 00623 #define GPIO_AF4_DCMI ((uint8_t)0x04) /* DCMI Alternate Function mapping */ 00624 00625 /** 00626 * @brief AF 5 selection 00627 */ 00628 #define GPIO_AF5_DCMI ((uint8_t)0x05) /* DCMI Alternate Function mapping */ 00629 #define GPIO_AF5_DFSDM1 ((uint8_t)0x05) /* DFSDM1 Alternate Function mapping */ 00630 #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */ 00631 #define GPIO_AF5_OCTOSPIM_P1 ((uint8_t)0x05) /* OctoSPI Manager Port 1 Alternate Function mapping */ 00632 #define GPIO_AF5_OCTOSPIM_P2 ((uint8_t)0x05) /* OctoSPI Manager Port 2 Alternate Function mapping */ 00633 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00634 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00635 #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00636 00637 /** 00638 * @brief AF 6 selection 00639 */ 00640 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ 00641 #define GPIO_AF6_I2C3 ((uint8_t)0x06) /* I2C3 Alternate Function mapping */ 00642 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00643 00644 /** 00645 * @brief AF 7 selection 00646 */ 00647 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00648 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00649 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00650 00651 /** 00652 * @brief AF 8 selection 00653 */ 00654 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00655 #define GPIO_AF8_SDMMC1 ((uint8_t)0x08) /* SDMMC1 Alternate Function mapping */ 00656 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ 00657 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ 00658 00659 /** 00660 * @brief AF 9 selection 00661 */ 00662 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00663 #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LTDC Alternate Function mapping */ 00664 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00665 00666 /** 00667 * @brief AF 10 selection 00668 */ 00669 #define GPIO_AF10_DCMI ((uint8_t)0x0A) /* DCMI Alternate Function mapping */ 00670 #define GPIO_AF10_OCTOSPIM_P1 ((uint8_t)0x0A) /* OctoSPI Manager Port 1 Alternate Function mapping */ 00671 #define GPIO_AF10_OCTOSPIM_P2 ((uint8_t)0x0A) /* OctoSPI Manager Port 2 Alternate Function mapping */ 00672 #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */ 00673 00674 /** 00675 * @brief AF 11 selection 00676 */ 00677 #define GPIO_AF11_DSI ((uint8_t)0x0B) /* DSI Alternate Function mapping */ 00678 #define GPIO_AF11_LTDC ((uint8_t)0x0B) /* LTDC Alternate Function mapping */ 00679 00680 /** 00681 * @brief AF 12 selection 00682 */ 00683 #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ 00684 #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ 00685 #define GPIO_AF12_DSI ((uint8_t)0x0C) /* DSI Alternate Function mapping */ 00686 #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */ 00687 #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ 00688 #define GPIO_AF12_TIM1_COMP1 ((uint8_t)0x0C) /* TIM1/COMP1 Break in Alternate Function mapping */ 00689 #define GPIO_AF12_TIM1_COMP2 ((uint8_t)0x0C) /* TIM1/COMP2 Break in Alternate Function mapping */ 00690 #define GPIO_AF12_TIM8_COMP2 ((uint8_t)0x0C) /* TIM8/COMP2 Break in Alternate Function mapping */ 00691 00692 /** 00693 * @brief AF 13 selection 00694 */ 00695 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00696 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ 00697 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ 00698 00699 /** 00700 * @brief AF 14 selection 00701 */ 00702 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00703 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00704 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ 00705 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00706 #define GPIO_AF14_TIM8_COMP2 ((uint8_t)0x0E) /* TIM8/COMP2 Break in Alternate Function mapping */ 00707 00708 /** 00709 * @brief AF 15 selection 00710 */ 00711 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00712 00713 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00714 00715 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */ 00716 00717 /** 00718 * @} 00719 */ 00720 00721 /** 00722 * @} 00723 */ 00724 00725 /* Exported macro ------------------------------------------------------------*/ 00726 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros 00727 * @{ 00728 */ 00729 00730 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index 00731 * @{ 00732 */ 00733 #if defined(STM32L431xx) || defined(STM32L433xx) || defined(STM32L443xx) 00734 00735 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00736 ((__GPIOx__) == (GPIOB))? 1U :\ 00737 ((__GPIOx__) == (GPIOC))? 2U :\ 00738 ((__GPIOx__) == (GPIOD))? 3U :\ 00739 ((__GPIOx__) == (GPIOE))? 4U : 7U) 00740 00741 #endif /* STM32L431xx || STM32L433xx || STM32L443xx */ 00742 00743 #if defined(STM32L432xx) || defined(STM32L442xx) 00744 00745 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00746 ((__GPIOx__) == (GPIOB))? 1U :\ 00747 ((__GPIOx__) == (GPIOC))? 2U : 7U) 00748 00749 #endif /* STM32L432xx || STM32L442xx */ 00750 00751 #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) 00752 00753 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00754 ((__GPIOx__) == (GPIOB))? 1U :\ 00755 ((__GPIOx__) == (GPIOC))? 2U :\ 00756 ((__GPIOx__) == (GPIOD))? 3U :\ 00757 ((__GPIOx__) == (GPIOE))? 4U : 7U) 00758 00759 #endif /* STM32L451xx || STM32L452xx || STM32L462xx */ 00760 00761 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) 00762 00763 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00764 ((__GPIOx__) == (GPIOB))? 1U :\ 00765 ((__GPIOx__) == (GPIOC))? 2U :\ 00766 ((__GPIOx__) == (GPIOD))? 3U :\ 00767 ((__GPIOx__) == (GPIOE))? 4U :\ 00768 ((__GPIOx__) == (GPIOF))? 5U :\ 00769 ((__GPIOx__) == (GPIOG))? 6U : 7U) 00770 00771 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ 00772 00773 #if defined(STM32L496xx) || defined(STM32L4A6xx) 00774 00775 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00776 ((__GPIOx__) == (GPIOB))? 1U :\ 00777 ((__GPIOx__) == (GPIOC))? 2U :\ 00778 ((__GPIOx__) == (GPIOD))? 3U :\ 00779 ((__GPIOx__) == (GPIOE))? 4U :\ 00780 ((__GPIOx__) == (GPIOF))? 5U :\ 00781 ((__GPIOx__) == (GPIOG))? 6U :\ 00782 ((__GPIOx__) == (GPIOH))? 7U : 8U) 00783 00784 #endif /* STM32L496xx || STM32L4A6xx */ 00785 00786 #if defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx) 00787 00788 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00789 ((__GPIOx__) == (GPIOB))? 1U :\ 00790 ((__GPIOx__) == (GPIOC))? 2U :\ 00791 ((__GPIOx__) == (GPIOD))? 3U :\ 00792 ((__GPIOx__) == (GPIOE))? 4U :\ 00793 ((__GPIOx__) == (GPIOF))? 5U :\ 00794 ((__GPIOx__) == (GPIOG))? 6U :\ 00795 ((__GPIOx__) == (GPIOH))? 7U : 8U) 00796 00797 #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */ 00798 00799 /** 00800 * @} 00801 */ 00802 00803 /** 00804 * @} 00805 */ 00806 00807 /* Exported functions --------------------------------------------------------*/ 00808 /** 00809 * @} 00810 */ 00811 00812 /** 00813 * @} 00814 */ 00815 00816 #ifdef __cplusplus 00817 } 00818 #endif 00819 00820 #endif /* __STM32L4xx_HAL_GPIO_EX_H */ 00821 00822 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/