TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elmot 1:d0dfbce63a89 1 /**
elmot 1:d0dfbce63a89 2 ******************************************************************************
elmot 1:d0dfbce63a89 3 * @file stm32l4xx_hal_gpio_ex.h
elmot 1:d0dfbce63a89 4 * @author MCD Application Team
elmot 1:d0dfbce63a89 5 * @version V1.5.1
elmot 1:d0dfbce63a89 6 * @date 31-May-2016
elmot 1:d0dfbce63a89 7 * @brief Header file of GPIO HAL Extended module.
elmot 1:d0dfbce63a89 8 ******************************************************************************
elmot 1:d0dfbce63a89 9 * @attention
elmot 1:d0dfbce63a89 10 *
elmot 1:d0dfbce63a89 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
elmot 1:d0dfbce63a89 12 *
elmot 1:d0dfbce63a89 13 * Redistribution and use in source and binary forms, with or without modification,
elmot 1:d0dfbce63a89 14 * are permitted provided that the following conditions are met:
elmot 1:d0dfbce63a89 15 * 1. Redistributions of source code must retain the above copyright notice,
elmot 1:d0dfbce63a89 16 * this list of conditions and the following disclaimer.
elmot 1:d0dfbce63a89 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
elmot 1:d0dfbce63a89 18 * this list of conditions and the following disclaimer in the documentation
elmot 1:d0dfbce63a89 19 * and/or other materials provided with the distribution.
elmot 1:d0dfbce63a89 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
elmot 1:d0dfbce63a89 21 * may be used to endorse or promote products derived from this software
elmot 1:d0dfbce63a89 22 * without specific prior written permission.
elmot 1:d0dfbce63a89 23 *
elmot 1:d0dfbce63a89 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
elmot 1:d0dfbce63a89 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
elmot 1:d0dfbce63a89 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
elmot 1:d0dfbce63a89 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
elmot 1:d0dfbce63a89 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
elmot 1:d0dfbce63a89 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
elmot 1:d0dfbce63a89 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
elmot 1:d0dfbce63a89 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
elmot 1:d0dfbce63a89 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
elmot 1:d0dfbce63a89 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
elmot 1:d0dfbce63a89 34 *
elmot 1:d0dfbce63a89 35 ******************************************************************************
elmot 1:d0dfbce63a89 36 */
elmot 1:d0dfbce63a89 37
elmot 1:d0dfbce63a89 38 /* Define to prevent recursive inclusion -------------------------------------*/
elmot 1:d0dfbce63a89 39 #ifndef __STM32L4xx_HAL_GPIO_EX_H
elmot 1:d0dfbce63a89 40 #define __STM32L4xx_HAL_GPIO_EX_H
elmot 1:d0dfbce63a89 41
elmot 1:d0dfbce63a89 42 #ifdef __cplusplus
elmot 1:d0dfbce63a89 43 extern "C" {
elmot 1:d0dfbce63a89 44 #endif
elmot 1:d0dfbce63a89 45
elmot 1:d0dfbce63a89 46 /* Includes ------------------------------------------------------------------*/
elmot 1:d0dfbce63a89 47 #include "stm32l4xx_hal_def.h"
elmot 1:d0dfbce63a89 48
elmot 1:d0dfbce63a89 49 /** @addtogroup STM32L4xx_HAL_Driver
elmot 1:d0dfbce63a89 50 * @{
elmot 1:d0dfbce63a89 51 */
elmot 1:d0dfbce63a89 52
elmot 1:d0dfbce63a89 53 /** @defgroup GPIOEx GPIOEx
elmot 1:d0dfbce63a89 54 * @brief GPIO Extended HAL module driver
elmot 1:d0dfbce63a89 55 * @{
elmot 1:d0dfbce63a89 56 */
elmot 1:d0dfbce63a89 57
elmot 1:d0dfbce63a89 58 /* Exported types ------------------------------------------------------------*/
elmot 1:d0dfbce63a89 59 /* Exported constants --------------------------------------------------------*/
elmot 1:d0dfbce63a89 60 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
elmot 1:d0dfbce63a89 61 * @{
elmot 1:d0dfbce63a89 62 */
elmot 1:d0dfbce63a89 63
elmot 1:d0dfbce63a89 64 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
elmot 1:d0dfbce63a89 65 * @{
elmot 1:d0dfbce63a89 66 */
elmot 1:d0dfbce63a89 67
elmot 1:d0dfbce63a89 68 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
elmot 1:d0dfbce63a89 69 /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx---*/
elmot 1:d0dfbce63a89 70 /**
elmot 1:d0dfbce63a89 71 * @brief AF 0 selection
elmot 1:d0dfbce63a89 72 */
elmot 1:d0dfbce63a89 73 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
elmot 1:d0dfbce63a89 74 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
elmot 1:d0dfbce63a89 75 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
elmot 1:d0dfbce63a89 76 #if defined(STM32L476xx) || defined(STM32L486xx)
elmot 1:d0dfbce63a89 77 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
elmot 1:d0dfbce63a89 78 #endif /* STM32L476xx || STM32L486xx */
elmot 1:d0dfbce63a89 79 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
elmot 1:d0dfbce63a89 80
elmot 1:d0dfbce63a89 81 /**
elmot 1:d0dfbce63a89 82 * @brief AF 1 selection
elmot 1:d0dfbce63a89 83 */
elmot 1:d0dfbce63a89 84 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 85 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 86 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */
elmot 1:d0dfbce63a89 87 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */
elmot 1:d0dfbce63a89 88 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 89 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
elmot 1:d0dfbce63a89 90
elmot 1:d0dfbce63a89 91 /**
elmot 1:d0dfbce63a89 92 * @brief AF 2 selection
elmot 1:d0dfbce63a89 93 */
elmot 1:d0dfbce63a89 94 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 95 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 96 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
elmot 1:d0dfbce63a89 97 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
elmot 1:d0dfbce63a89 98 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
elmot 1:d0dfbce63a89 99
elmot 1:d0dfbce63a89 100 /**
elmot 1:d0dfbce63a89 101 * @brief AF 3 selection
elmot 1:d0dfbce63a89 102 */
elmot 1:d0dfbce63a89 103 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
elmot 1:d0dfbce63a89 104 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 105 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 106
elmot 1:d0dfbce63a89 107 /**
elmot 1:d0dfbce63a89 108 * @brief AF 4 selection
elmot 1:d0dfbce63a89 109 */
elmot 1:d0dfbce63a89 110 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
elmot 1:d0dfbce63a89 111 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
elmot 1:d0dfbce63a89 112 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
elmot 1:d0dfbce63a89 113
elmot 1:d0dfbce63a89 114 /**
elmot 1:d0dfbce63a89 115 * @brief AF 5 selection
elmot 1:d0dfbce63a89 116 */
elmot 1:d0dfbce63a89 117 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 118 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
elmot 1:d0dfbce63a89 119
elmot 1:d0dfbce63a89 120 /**
elmot 1:d0dfbce63a89 121 * @brief AF 6 selection
elmot 1:d0dfbce63a89 122 */
elmot 1:d0dfbce63a89 123 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
elmot 1:d0dfbce63a89 124 #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 125
elmot 1:d0dfbce63a89 126 /**
elmot 1:d0dfbce63a89 127 * @brief AF 7 selection
elmot 1:d0dfbce63a89 128 */
elmot 1:d0dfbce63a89 129 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
elmot 1:d0dfbce63a89 130 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
elmot 1:d0dfbce63a89 131 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
elmot 1:d0dfbce63a89 132
elmot 1:d0dfbce63a89 133 /**
elmot 1:d0dfbce63a89 134 * @brief AF 8 selection
elmot 1:d0dfbce63a89 135 */
elmot 1:d0dfbce63a89 136 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
elmot 1:d0dfbce63a89 137 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
elmot 1:d0dfbce63a89 138 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
elmot 1:d0dfbce63a89 139
elmot 1:d0dfbce63a89 140
elmot 1:d0dfbce63a89 141 /**
elmot 1:d0dfbce63a89 142 * @brief AF 9 selection
elmot 1:d0dfbce63a89 143 */
elmot 1:d0dfbce63a89 144 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
elmot 1:d0dfbce63a89 145 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
elmot 1:d0dfbce63a89 146
elmot 1:d0dfbce63a89 147 /**
elmot 1:d0dfbce63a89 148 * @brief AF 10 selection
elmot 1:d0dfbce63a89 149 */
elmot 1:d0dfbce63a89 150 #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
elmot 1:d0dfbce63a89 151 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
elmot 1:d0dfbce63a89 152 #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
elmot 1:d0dfbce63a89 153 #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */
elmot 1:d0dfbce63a89 154
elmot 1:d0dfbce63a89 155 #if defined(STM32L476xx) || defined(STM32L486xx)
elmot 1:d0dfbce63a89 156 /**
elmot 1:d0dfbce63a89 157 * @brief AF 11 selection
elmot 1:d0dfbce63a89 158 */
elmot 1:d0dfbce63a89 159 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
elmot 1:d0dfbce63a89 160 #endif /* STM32L476xx || STM32L486xx */
elmot 1:d0dfbce63a89 161
elmot 1:d0dfbce63a89 162 /**
elmot 1:d0dfbce63a89 163 * @brief AF 12 selection
elmot 1:d0dfbce63a89 164 */
elmot 1:d0dfbce63a89 165 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
elmot 1:d0dfbce63a89 166 #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 167 #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */
elmot 1:d0dfbce63a89 168 #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */
elmot 1:d0dfbce63a89 169 #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */
elmot 1:d0dfbce63a89 170
elmot 1:d0dfbce63a89 171 /**
elmot 1:d0dfbce63a89 172 * @brief AF 13 selection
elmot 1:d0dfbce63a89 173 */
elmot 1:d0dfbce63a89 174 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 175 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */
elmot 1:d0dfbce63a89 176 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 177 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 178
elmot 1:d0dfbce63a89 179 /**
elmot 1:d0dfbce63a89 180 * @brief AF 14 selection
elmot 1:d0dfbce63a89 181 */
elmot 1:d0dfbce63a89 182 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 183 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
elmot 1:d0dfbce63a89 184 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
elmot 1:d0dfbce63a89 185 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
elmot 1:d0dfbce63a89 186 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 187 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 188
elmot 1:d0dfbce63a89 189 /**
elmot 1:d0dfbce63a89 190 * @brief AF 15 selection
elmot 1:d0dfbce63a89 191 */
elmot 1:d0dfbce63a89 192 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
elmot 1:d0dfbce63a89 193
elmot 1:d0dfbce63a89 194 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
elmot 1:d0dfbce63a89 195
elmot 1:d0dfbce63a89 196 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
elmot 1:d0dfbce63a89 197
elmot 1:d0dfbce63a89 198 #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx)
elmot 1:d0dfbce63a89 199 /*--------------STM32L431xx/STM32L432xx/STM32L433xx/STM32L442xx/STM32L443xx---*/
elmot 1:d0dfbce63a89 200 /**
elmot 1:d0dfbce63a89 201 * @brief AF 0 selection
elmot 1:d0dfbce63a89 202 */
elmot 1:d0dfbce63a89 203 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
elmot 1:d0dfbce63a89 204 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
elmot 1:d0dfbce63a89 205 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
elmot 1:d0dfbce63a89 206 #if defined(STM32L433xx) || defined(STM32L443xx)
elmot 1:d0dfbce63a89 207 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
elmot 1:d0dfbce63a89 208 #endif /* STM32L433xx || STM32L443xx */
elmot 1:d0dfbce63a89 209 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
elmot 1:d0dfbce63a89 210
elmot 1:d0dfbce63a89 211 /**
elmot 1:d0dfbce63a89 212 * @brief AF 1 selection
elmot 1:d0dfbce63a89 213 */
elmot 1:d0dfbce63a89 214 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 215 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 216 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 217 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
elmot 1:d0dfbce63a89 218
elmot 1:d0dfbce63a89 219 /**
elmot 1:d0dfbce63a89 220 * @brief AF 2 selection
elmot 1:d0dfbce63a89 221 */
elmot 1:d0dfbce63a89 222 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
elmot 1:d0dfbce63a89 223 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 224
elmot 1:d0dfbce63a89 225 /**
elmot 1:d0dfbce63a89 226 * @brief AF 3 selection
elmot 1:d0dfbce63a89 227 */
elmot 1:d0dfbce63a89 228 #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */
elmot 1:d0dfbce63a89 229 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 230 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
elmot 1:d0dfbce63a89 231
elmot 1:d0dfbce63a89 232 /**
elmot 1:d0dfbce63a89 233 * @brief AF 4 selection
elmot 1:d0dfbce63a89 234 */
elmot 1:d0dfbce63a89 235 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
elmot 1:d0dfbce63a89 236 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
elmot 1:d0dfbce63a89 237 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
elmot 1:d0dfbce63a89 238
elmot 1:d0dfbce63a89 239 /**
elmot 1:d0dfbce63a89 240 * @brief AF 5 selection
elmot 1:d0dfbce63a89 241 */
elmot 1:d0dfbce63a89 242 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 243 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
elmot 1:d0dfbce63a89 244
elmot 1:d0dfbce63a89 245 /**
elmot 1:d0dfbce63a89 246 * @brief AF 6 selection
elmot 1:d0dfbce63a89 247 */
elmot 1:d0dfbce63a89 248 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
elmot 1:d0dfbce63a89 249 #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */
elmot 1:d0dfbce63a89 250
elmot 1:d0dfbce63a89 251 /**
elmot 1:d0dfbce63a89 252 * @brief AF 7 selection
elmot 1:d0dfbce63a89 253 */
elmot 1:d0dfbce63a89 254 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
elmot 1:d0dfbce63a89 255 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
elmot 1:d0dfbce63a89 256 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
elmot 1:d0dfbce63a89 257
elmot 1:d0dfbce63a89 258 /**
elmot 1:d0dfbce63a89 259 * @brief AF 8 selection
elmot 1:d0dfbce63a89 260 */
elmot 1:d0dfbce63a89 261 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
elmot 1:d0dfbce63a89 262
elmot 1:d0dfbce63a89 263 /**
elmot 1:d0dfbce63a89 264 * @brief AF 9 selection
elmot 1:d0dfbce63a89 265 */
elmot 1:d0dfbce63a89 266 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
elmot 1:d0dfbce63a89 267 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
elmot 1:d0dfbce63a89 268
elmot 1:d0dfbce63a89 269 /**
elmot 1:d0dfbce63a89 270 * @brief AF 10 selection
elmot 1:d0dfbce63a89 271 */
elmot 1:d0dfbce63a89 272 #if defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx)
elmot 1:d0dfbce63a89 273 #define GPIO_AF10_USB_FS ((uint8_t)0xA) /* USB_FS Alternate Function mapping */
elmot 1:d0dfbce63a89 274 #endif /* STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */
elmot 1:d0dfbce63a89 275 #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */
elmot 1:d0dfbce63a89 276
elmot 1:d0dfbce63a89 277 #if defined(STM32L433xx) || defined(STM32L443xx)
elmot 1:d0dfbce63a89 278 /**
elmot 1:d0dfbce63a89 279 * @brief AF 11 selection
elmot 1:d0dfbce63a89 280 */
elmot 1:d0dfbce63a89 281 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
elmot 1:d0dfbce63a89 282 #endif /* STM32L433xx || STM32L443xx */
elmot 1:d0dfbce63a89 283
elmot 1:d0dfbce63a89 284 /**
elmot 1:d0dfbce63a89 285 * @brief AF 12 selection
elmot 1:d0dfbce63a89 286 */
elmot 1:d0dfbce63a89 287 #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 288 #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */
elmot 1:d0dfbce63a89 289 #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */
elmot 1:d0dfbce63a89 290 #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */
elmot 1:d0dfbce63a89 291
elmot 1:d0dfbce63a89 292 /**
elmot 1:d0dfbce63a89 293 * @brief AF 13 selection
elmot 1:d0dfbce63a89 294 */
elmot 1:d0dfbce63a89 295 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
elmot 1:d0dfbce63a89 296
elmot 1:d0dfbce63a89 297 /**
elmot 1:d0dfbce63a89 298 * @brief AF 14 selection
elmot 1:d0dfbce63a89 299 */
elmot 1:d0dfbce63a89 300 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 301 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
elmot 1:d0dfbce63a89 302 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
elmot 1:d0dfbce63a89 303 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
elmot 1:d0dfbce63a89 304
elmot 1:d0dfbce63a89 305 /**
elmot 1:d0dfbce63a89 306 * @brief AF 15 selection
elmot 1:d0dfbce63a89 307 */
elmot 1:d0dfbce63a89 308 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
elmot 1:d0dfbce63a89 309
elmot 1:d0dfbce63a89 310 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
elmot 1:d0dfbce63a89 311
elmot 1:d0dfbce63a89 312 #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */
elmot 1:d0dfbce63a89 313
elmot 1:d0dfbce63a89 314 /**
elmot 1:d0dfbce63a89 315 * @}
elmot 1:d0dfbce63a89 316 */
elmot 1:d0dfbce63a89 317
elmot 1:d0dfbce63a89 318 /**
elmot 1:d0dfbce63a89 319 * @}
elmot 1:d0dfbce63a89 320 */
elmot 1:d0dfbce63a89 321
elmot 1:d0dfbce63a89 322 /* Exported macro ------------------------------------------------------------*/
elmot 1:d0dfbce63a89 323 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros
elmot 1:d0dfbce63a89 324 * @{
elmot 1:d0dfbce63a89 325 */
elmot 1:d0dfbce63a89 326
elmot 1:d0dfbce63a89 327 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index
elmot 1:d0dfbce63a89 328 * @{
elmot 1:d0dfbce63a89 329 */
elmot 1:d0dfbce63a89 330 #if defined(STM32L431xx) || defined(STM32L433xx) || defined(STM32L443xx)
elmot 1:d0dfbce63a89 331
elmot 1:d0dfbce63a89 332 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
elmot 1:d0dfbce63a89 333 ((__GPIOx__) == (GPIOB))? 1U :\
elmot 1:d0dfbce63a89 334 ((__GPIOx__) == (GPIOC))? 2U :\
elmot 1:d0dfbce63a89 335 ((__GPIOx__) == (GPIOD))? 3U :\
elmot 1:d0dfbce63a89 336 ((__GPIOx__) == (GPIOE))? 4U : 7U)
elmot 1:d0dfbce63a89 337
elmot 1:d0dfbce63a89 338 #endif /* STM32L431xx || STM32L433xx || STM32L443xx */
elmot 1:d0dfbce63a89 339
elmot 1:d0dfbce63a89 340 #if defined(STM32L432xx) || defined(STM32L442xx)
elmot 1:d0dfbce63a89 341
elmot 1:d0dfbce63a89 342 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
elmot 1:d0dfbce63a89 343 ((__GPIOx__) == (GPIOB))? 1U :\
elmot 1:d0dfbce63a89 344 ((__GPIOx__) == (GPIOC))? 2U : 7U)
elmot 1:d0dfbce63a89 345
elmot 1:d0dfbce63a89 346 #endif /* STM32L432xx || STM32L442xx */
elmot 1:d0dfbce63a89 347
elmot 1:d0dfbce63a89 348 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
elmot 1:d0dfbce63a89 349
elmot 1:d0dfbce63a89 350 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
elmot 1:d0dfbce63a89 351 ((__GPIOx__) == (GPIOB))? 1U :\
elmot 1:d0dfbce63a89 352 ((__GPIOx__) == (GPIOC))? 2U :\
elmot 1:d0dfbce63a89 353 ((__GPIOx__) == (GPIOD))? 3U :\
elmot 1:d0dfbce63a89 354 ((__GPIOx__) == (GPIOE))? 4U :\
elmot 1:d0dfbce63a89 355 ((__GPIOx__) == (GPIOF))? 5U :\
elmot 1:d0dfbce63a89 356 ((__GPIOx__) == (GPIOG))? 6U : 7U)
elmot 1:d0dfbce63a89 357
elmot 1:d0dfbce63a89 358 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
elmot 1:d0dfbce63a89 359
elmot 1:d0dfbce63a89 360 /**
elmot 1:d0dfbce63a89 361 * @}
elmot 1:d0dfbce63a89 362 */
elmot 1:d0dfbce63a89 363
elmot 1:d0dfbce63a89 364 /**
elmot 1:d0dfbce63a89 365 * @}
elmot 1:d0dfbce63a89 366 */
elmot 1:d0dfbce63a89 367
elmot 1:d0dfbce63a89 368 /* Exported functions --------------------------------------------------------*/
elmot 1:d0dfbce63a89 369 /**
elmot 1:d0dfbce63a89 370 * @}
elmot 1:d0dfbce63a89 371 */
elmot 1:d0dfbce63a89 372
elmot 1:d0dfbce63a89 373 /**
elmot 1:d0dfbce63a89 374 * @}
elmot 1:d0dfbce63a89 375 */
elmot 1:d0dfbce63a89 376
elmot 1:d0dfbce63a89 377 #ifdef __cplusplus
elmot 1:d0dfbce63a89 378 }
elmot 1:d0dfbce63a89 379 #endif
elmot 1:d0dfbce63a89 380
elmot 1:d0dfbce63a89 381 #endif /* __STM32L4xx_HAL_GPIO_EX_H */
elmot 1:d0dfbce63a89 382
elmot 1:d0dfbce63a89 383 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/