The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_L486RG/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_gpio_ex.h@145:64910690c574, 2017-06-21 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Jun 21 17:31:38 2017 +0100
- Revision:
- 145:64910690c574
- Parent:
- 128:9bcdf88f62b0
Release 145 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 122:f9eeca106725 | 1 | /** |
Kojto | 122:f9eeca106725 | 2 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 3 | * @file stm32l4xx_hal_gpio_ex.h |
Kojto | 122:f9eeca106725 | 4 | * @author MCD Application Team |
AnnaBridge | 145:64910690c574 | 5 | * @version V1.7.1 |
AnnaBridge | 145:64910690c574 | 6 | * @date 21-April-2017 |
Kojto | 122:f9eeca106725 | 7 | * @brief Header file of GPIO HAL Extended module. |
Kojto | 122:f9eeca106725 | 8 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 9 | * @attention |
Kojto | 122:f9eeca106725 | 10 | * |
AnnaBridge | 145:64910690c574 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
Kojto | 122:f9eeca106725 | 12 | * |
Kojto | 122:f9eeca106725 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 122:f9eeca106725 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 122:f9eeca106725 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 122:f9eeca106725 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 122:f9eeca106725 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 122:f9eeca106725 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 122:f9eeca106725 | 19 | * and/or other materials provided with the distribution. |
Kojto | 122:f9eeca106725 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 122:f9eeca106725 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 122:f9eeca106725 | 22 | * without specific prior written permission. |
Kojto | 122:f9eeca106725 | 23 | * |
Kojto | 122:f9eeca106725 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 122:f9eeca106725 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 122:f9eeca106725 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 122:f9eeca106725 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 122:f9eeca106725 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 122:f9eeca106725 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 122:f9eeca106725 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 122:f9eeca106725 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 122:f9eeca106725 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 122:f9eeca106725 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 122:f9eeca106725 | 34 | * |
Kojto | 122:f9eeca106725 | 35 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 36 | */ |
Kojto | 122:f9eeca106725 | 37 | |
Kojto | 122:f9eeca106725 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 122:f9eeca106725 | 39 | #ifndef __STM32L4xx_HAL_GPIO_EX_H |
Kojto | 122:f9eeca106725 | 40 | #define __STM32L4xx_HAL_GPIO_EX_H |
Kojto | 122:f9eeca106725 | 41 | |
Kojto | 122:f9eeca106725 | 42 | #ifdef __cplusplus |
Kojto | 122:f9eeca106725 | 43 | extern "C" { |
Kojto | 122:f9eeca106725 | 44 | #endif |
Kojto | 122:f9eeca106725 | 45 | |
Kojto | 122:f9eeca106725 | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 47 | #include "stm32l4xx_hal_def.h" |
Kojto | 122:f9eeca106725 | 48 | |
Kojto | 122:f9eeca106725 | 49 | /** @addtogroup STM32L4xx_HAL_Driver |
Kojto | 122:f9eeca106725 | 50 | * @{ |
Kojto | 122:f9eeca106725 | 51 | */ |
Kojto | 122:f9eeca106725 | 52 | |
Kojto | 122:f9eeca106725 | 53 | /** @defgroup GPIOEx GPIOEx |
Kojto | 122:f9eeca106725 | 54 | * @brief GPIO Extended HAL module driver |
Kojto | 122:f9eeca106725 | 55 | * @{ |
Kojto | 122:f9eeca106725 | 56 | */ |
Kojto | 122:f9eeca106725 | 57 | |
Kojto | 122:f9eeca106725 | 58 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 59 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 60 | /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants |
Kojto | 122:f9eeca106725 | 61 | * @{ |
Kojto | 122:f9eeca106725 | 62 | */ |
Kojto | 122:f9eeca106725 | 63 | |
Kojto | 122:f9eeca106725 | 64 | /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection |
Kojto | 122:f9eeca106725 | 65 | * @{ |
Kojto | 122:f9eeca106725 | 66 | */ |
Kojto | 122:f9eeca106725 | 67 | |
AnnaBridge | 145:64910690c574 | 68 | #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) |
AnnaBridge | 145:64910690c574 | 69 | /*--------------STM32L431xx/STM32L432xx/STM32L433xx/STM32L442xx/STM32L443xx---*/ |
AnnaBridge | 145:64910690c574 | 70 | /** |
AnnaBridge | 145:64910690c574 | 71 | * @brief AF 0 selection |
AnnaBridge | 145:64910690c574 | 72 | */ |
AnnaBridge | 145:64910690c574 | 73 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 74 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 75 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 76 | #if defined(STM32L433xx) || defined(STM32L443xx) |
AnnaBridge | 145:64910690c574 | 77 | #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 78 | #endif /* STM32L433xx || STM32L443xx */ |
AnnaBridge | 145:64910690c574 | 79 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 80 | |
AnnaBridge | 145:64910690c574 | 81 | /** |
AnnaBridge | 145:64910690c574 | 82 | * @brief AF 1 selection |
AnnaBridge | 145:64910690c574 | 83 | */ |
AnnaBridge | 145:64910690c574 | 84 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 85 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 86 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 87 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 88 | |
AnnaBridge | 145:64910690c574 | 89 | /** |
AnnaBridge | 145:64910690c574 | 90 | * @brief AF 2 selection |
AnnaBridge | 145:64910690c574 | 91 | */ |
AnnaBridge | 145:64910690c574 | 92 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 93 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 94 | |
AnnaBridge | 145:64910690c574 | 95 | /** |
AnnaBridge | 145:64910690c574 | 96 | * @brief AF 3 selection |
AnnaBridge | 145:64910690c574 | 97 | */ |
AnnaBridge | 145:64910690c574 | 98 | #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 99 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 100 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 101 | |
AnnaBridge | 145:64910690c574 | 102 | /** |
AnnaBridge | 145:64910690c574 | 103 | * @brief AF 4 selection |
AnnaBridge | 145:64910690c574 | 104 | */ |
AnnaBridge | 145:64910690c574 | 105 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 106 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 107 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 108 | |
AnnaBridge | 145:64910690c574 | 109 | /** |
AnnaBridge | 145:64910690c574 | 110 | * @brief AF 5 selection |
AnnaBridge | 145:64910690c574 | 111 | */ |
AnnaBridge | 145:64910690c574 | 112 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 113 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 114 | |
AnnaBridge | 145:64910690c574 | 115 | /** |
AnnaBridge | 145:64910690c574 | 116 | * @brief AF 6 selection |
AnnaBridge | 145:64910690c574 | 117 | */ |
AnnaBridge | 145:64910690c574 | 118 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 119 | #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 120 | |
AnnaBridge | 145:64910690c574 | 121 | /** |
AnnaBridge | 145:64910690c574 | 122 | * @brief AF 7 selection |
AnnaBridge | 145:64910690c574 | 123 | */ |
AnnaBridge | 145:64910690c574 | 124 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 125 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 126 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 127 | |
AnnaBridge | 145:64910690c574 | 128 | /** |
AnnaBridge | 145:64910690c574 | 129 | * @brief AF 8 selection |
AnnaBridge | 145:64910690c574 | 130 | */ |
AnnaBridge | 145:64910690c574 | 131 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 132 | |
AnnaBridge | 145:64910690c574 | 133 | /** |
AnnaBridge | 145:64910690c574 | 134 | * @brief AF 9 selection |
AnnaBridge | 145:64910690c574 | 135 | */ |
AnnaBridge | 145:64910690c574 | 136 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 137 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 138 | |
AnnaBridge | 145:64910690c574 | 139 | /** |
AnnaBridge | 145:64910690c574 | 140 | * @brief AF 10 selection |
AnnaBridge | 145:64910690c574 | 141 | */ |
AnnaBridge | 145:64910690c574 | 142 | #if defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) |
AnnaBridge | 145:64910690c574 | 143 | #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 144 | #endif /* STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ |
AnnaBridge | 145:64910690c574 | 145 | #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 146 | |
AnnaBridge | 145:64910690c574 | 147 | #if defined(STM32L433xx) || defined(STM32L443xx) |
AnnaBridge | 145:64910690c574 | 148 | /** |
AnnaBridge | 145:64910690c574 | 149 | * @brief AF 11 selection |
AnnaBridge | 145:64910690c574 | 150 | */ |
AnnaBridge | 145:64910690c574 | 151 | #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 152 | #endif /* STM32L433xx || STM32L443xx */ |
AnnaBridge | 145:64910690c574 | 153 | |
AnnaBridge | 145:64910690c574 | 154 | /** |
AnnaBridge | 145:64910690c574 | 155 | * @brief AF 12 selection |
AnnaBridge | 145:64910690c574 | 156 | */ |
AnnaBridge | 145:64910690c574 | 157 | #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 158 | #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 159 | #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 160 | #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 161 | |
AnnaBridge | 145:64910690c574 | 162 | /** |
AnnaBridge | 145:64910690c574 | 163 | * @brief AF 13 selection |
AnnaBridge | 145:64910690c574 | 164 | */ |
AnnaBridge | 145:64910690c574 | 165 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 166 | |
AnnaBridge | 145:64910690c574 | 167 | /** |
AnnaBridge | 145:64910690c574 | 168 | * @brief AF 14 selection |
AnnaBridge | 145:64910690c574 | 169 | */ |
AnnaBridge | 145:64910690c574 | 170 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 171 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 172 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 173 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 174 | |
AnnaBridge | 145:64910690c574 | 175 | /** |
AnnaBridge | 145:64910690c574 | 176 | * @brief AF 15 selection |
AnnaBridge | 145:64910690c574 | 177 | */ |
AnnaBridge | 145:64910690c574 | 178 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 179 | |
AnnaBridge | 145:64910690c574 | 180 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
AnnaBridge | 145:64910690c574 | 181 | |
AnnaBridge | 145:64910690c574 | 182 | #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ |
AnnaBridge | 145:64910690c574 | 183 | |
AnnaBridge | 145:64910690c574 | 184 | #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) |
AnnaBridge | 145:64910690c574 | 185 | /*--------------STM32L451xx/STM32L452xx/STM32L462xx---------------------------*/ |
AnnaBridge | 145:64910690c574 | 186 | /** |
AnnaBridge | 145:64910690c574 | 187 | * @brief AF 0 selection |
AnnaBridge | 145:64910690c574 | 188 | */ |
AnnaBridge | 145:64910690c574 | 189 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 190 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 191 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 192 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 193 | |
AnnaBridge | 145:64910690c574 | 194 | /** |
AnnaBridge | 145:64910690c574 | 195 | * @brief AF 1 selection |
AnnaBridge | 145:64910690c574 | 196 | */ |
AnnaBridge | 145:64910690c574 | 197 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 198 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 199 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 200 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 201 | |
AnnaBridge | 145:64910690c574 | 202 | /** |
AnnaBridge | 145:64910690c574 | 203 | * @brief AF 2 selection |
AnnaBridge | 145:64910690c574 | 204 | */ |
AnnaBridge | 145:64910690c574 | 205 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 206 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 207 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 208 | #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 209 | |
AnnaBridge | 145:64910690c574 | 210 | /** |
AnnaBridge | 145:64910690c574 | 211 | * @brief AF 3 selection |
AnnaBridge | 145:64910690c574 | 212 | */ |
AnnaBridge | 145:64910690c574 | 213 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 214 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 215 | #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 216 | #define GPIO_AF3_CAN1 ((uint8_t)0x03) /* CAN1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 217 | #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 218 | |
AnnaBridge | 145:64910690c574 | 219 | /** |
AnnaBridge | 145:64910690c574 | 220 | * @brief AF 4 selection |
AnnaBridge | 145:64910690c574 | 221 | */ |
AnnaBridge | 145:64910690c574 | 222 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 223 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 224 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 225 | #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 226 | |
AnnaBridge | 145:64910690c574 | 227 | /** |
AnnaBridge | 145:64910690c574 | 228 | * @brief AF 5 selection |
AnnaBridge | 145:64910690c574 | 229 | */ |
AnnaBridge | 145:64910690c574 | 230 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 231 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 232 | #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 233 | |
AnnaBridge | 145:64910690c574 | 234 | /** |
AnnaBridge | 145:64910690c574 | 235 | * @brief AF 6 selection |
AnnaBridge | 145:64910690c574 | 236 | */ |
AnnaBridge | 145:64910690c574 | 237 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 238 | #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 239 | #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 240 | |
AnnaBridge | 145:64910690c574 | 241 | /** |
AnnaBridge | 145:64910690c574 | 242 | * @brief AF 7 selection |
AnnaBridge | 145:64910690c574 | 243 | */ |
AnnaBridge | 145:64910690c574 | 244 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 245 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 246 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 247 | |
AnnaBridge | 145:64910690c574 | 248 | /** |
AnnaBridge | 145:64910690c574 | 249 | * @brief AF 8 selection |
AnnaBridge | 145:64910690c574 | 250 | */ |
AnnaBridge | 145:64910690c574 | 251 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 252 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 253 | #define GPIO_AF8_CAN1 ((uint8_t)0x08) /* CAN1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 254 | |
AnnaBridge | 145:64910690c574 | 255 | |
AnnaBridge | 145:64910690c574 | 256 | /** |
AnnaBridge | 145:64910690c574 | 257 | * @brief AF 9 selection |
AnnaBridge | 145:64910690c574 | 258 | */ |
AnnaBridge | 145:64910690c574 | 259 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 260 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 261 | |
AnnaBridge | 145:64910690c574 | 262 | /** |
AnnaBridge | 145:64910690c574 | 263 | * @brief AF 10 selection |
AnnaBridge | 145:64910690c574 | 264 | */ |
AnnaBridge | 145:64910690c574 | 265 | #if defined(STM32L452xx) || defined(STM32L462xx) |
AnnaBridge | 145:64910690c574 | 266 | #define GPIO_AF10_USB_FS ((uint8_t)0x0A) /* USB_FS Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 267 | #endif /* STM32L452xx || STM32L462xx */ |
AnnaBridge | 145:64910690c574 | 268 | #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 269 | #define GPIO_AF10_CAN1 ((uint8_t)0x0A) /* CAN1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 270 | |
AnnaBridge | 145:64910690c574 | 271 | /** |
AnnaBridge | 145:64910690c574 | 272 | * @brief AF 11 selection |
AnnaBridge | 145:64910690c574 | 273 | */ |
AnnaBridge | 145:64910690c574 | 274 | |
AnnaBridge | 145:64910690c574 | 275 | /** |
AnnaBridge | 145:64910690c574 | 276 | * @brief AF 12 selection |
AnnaBridge | 145:64910690c574 | 277 | */ |
AnnaBridge | 145:64910690c574 | 278 | #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 279 | #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 280 | #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 281 | |
AnnaBridge | 145:64910690c574 | 282 | /** |
AnnaBridge | 145:64910690c574 | 283 | * @brief AF 13 selection |
AnnaBridge | 145:64910690c574 | 284 | */ |
AnnaBridge | 145:64910690c574 | 285 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 286 | |
AnnaBridge | 145:64910690c574 | 287 | /** |
AnnaBridge | 145:64910690c574 | 288 | * @brief AF 14 selection |
AnnaBridge | 145:64910690c574 | 289 | */ |
AnnaBridge | 145:64910690c574 | 290 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 291 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 292 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 293 | #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 294 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 295 | |
AnnaBridge | 145:64910690c574 | 296 | /** |
AnnaBridge | 145:64910690c574 | 297 | * @brief AF 15 selection |
AnnaBridge | 145:64910690c574 | 298 | */ |
AnnaBridge | 145:64910690c574 | 299 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 300 | |
AnnaBridge | 145:64910690c574 | 301 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
AnnaBridge | 145:64910690c574 | 302 | |
AnnaBridge | 145:64910690c574 | 303 | #endif /* STM32L451xx || STM32L452xx || STM32L462xx */ |
AnnaBridge | 145:64910690c574 | 304 | |
Kojto | 122:f9eeca106725 | 305 | #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 306 | /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx---*/ |
Kojto | 122:f9eeca106725 | 307 | /** |
Kojto | 122:f9eeca106725 | 308 | * @brief AF 0 selection |
Kojto | 122:f9eeca106725 | 309 | */ |
Kojto | 122:f9eeca106725 | 310 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 311 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 312 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 313 | #if defined(STM32L476xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 314 | #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 315 | #endif /* STM32L476xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 316 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 317 | |
Kojto | 122:f9eeca106725 | 318 | /** |
Kojto | 122:f9eeca106725 | 319 | * @brief AF 1 selection |
Kojto | 122:f9eeca106725 | 320 | */ |
Kojto | 122:f9eeca106725 | 321 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 322 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 323 | #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 324 | #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 325 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 326 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 327 | |
Kojto | 122:f9eeca106725 | 328 | /** |
Kojto | 122:f9eeca106725 | 329 | * @brief AF 2 selection |
Kojto | 122:f9eeca106725 | 330 | */ |
Kojto | 122:f9eeca106725 | 331 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 332 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 333 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 334 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 335 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 336 | |
Kojto | 122:f9eeca106725 | 337 | /** |
Kojto | 122:f9eeca106725 | 338 | * @brief AF 3 selection |
Kojto | 122:f9eeca106725 | 339 | */ |
Kojto | 122:f9eeca106725 | 340 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 341 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 342 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 343 | |
Kojto | 122:f9eeca106725 | 344 | /** |
Kojto | 122:f9eeca106725 | 345 | * @brief AF 4 selection |
Kojto | 122:f9eeca106725 | 346 | */ |
Kojto | 122:f9eeca106725 | 347 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 348 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 349 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 350 | |
Kojto | 122:f9eeca106725 | 351 | /** |
Kojto | 122:f9eeca106725 | 352 | * @brief AF 5 selection |
Kojto | 122:f9eeca106725 | 353 | */ |
Kojto | 122:f9eeca106725 | 354 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 355 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 356 | |
Kojto | 122:f9eeca106725 | 357 | /** |
Kojto | 122:f9eeca106725 | 358 | * @brief AF 6 selection |
Kojto | 122:f9eeca106725 | 359 | */ |
Kojto | 122:f9eeca106725 | 360 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 361 | #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 362 | |
Kojto | 122:f9eeca106725 | 363 | /** |
Kojto | 122:f9eeca106725 | 364 | * @brief AF 7 selection |
Kojto | 122:f9eeca106725 | 365 | */ |
Kojto | 122:f9eeca106725 | 366 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 367 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 368 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 369 | |
Kojto | 122:f9eeca106725 | 370 | /** |
Kojto | 122:f9eeca106725 | 371 | * @brief AF 8 selection |
Kojto | 122:f9eeca106725 | 372 | */ |
Kojto | 122:f9eeca106725 | 373 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 374 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 375 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 376 | |
Kojto | 122:f9eeca106725 | 377 | |
Kojto | 122:f9eeca106725 | 378 | /** |
Kojto | 122:f9eeca106725 | 379 | * @brief AF 9 selection |
Kojto | 122:f9eeca106725 | 380 | */ |
Kojto | 122:f9eeca106725 | 381 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 382 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 383 | |
Kojto | 122:f9eeca106725 | 384 | /** |
Kojto | 122:f9eeca106725 | 385 | * @brief AF 10 selection |
Kojto | 122:f9eeca106725 | 386 | */ |
Kojto | 122:f9eeca106725 | 387 | #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
AnnaBridge | 145:64910690c574 | 388 | #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 389 | #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
AnnaBridge | 145:64910690c574 | 390 | #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 391 | |
Kojto | 122:f9eeca106725 | 392 | #if defined(STM32L476xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 393 | /** |
Kojto | 122:f9eeca106725 | 394 | * @brief AF 11 selection |
Kojto | 122:f9eeca106725 | 395 | */ |
AnnaBridge | 145:64910690c574 | 396 | #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 397 | #endif /* STM32L476xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 398 | |
Kojto | 122:f9eeca106725 | 399 | /** |
Kojto | 122:f9eeca106725 | 400 | * @brief AF 12 selection |
Kojto | 122:f9eeca106725 | 401 | */ |
AnnaBridge | 145:64910690c574 | 402 | #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 403 | #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 404 | #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 405 | #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 406 | #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 407 | |
Kojto | 122:f9eeca106725 | 408 | /** |
Kojto | 122:f9eeca106725 | 409 | * @brief AF 13 selection |
Kojto | 122:f9eeca106725 | 410 | */ |
AnnaBridge | 145:64910690c574 | 411 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 412 | #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 413 | #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 414 | #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 415 | |
Kojto | 122:f9eeca106725 | 416 | /** |
Kojto | 122:f9eeca106725 | 417 | * @brief AF 14 selection |
Kojto | 122:f9eeca106725 | 418 | */ |
AnnaBridge | 145:64910690c574 | 419 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 420 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 421 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 422 | #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 423 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 424 | #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 425 | |
Kojto | 122:f9eeca106725 | 426 | /** |
Kojto | 122:f9eeca106725 | 427 | * @brief AF 15 selection |
Kojto | 122:f9eeca106725 | 428 | */ |
AnnaBridge | 145:64910690c574 | 429 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 430 | |
Kojto | 122:f9eeca106725 | 431 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
Kojto | 122:f9eeca106725 | 432 | |
Kojto | 122:f9eeca106725 | 433 | #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 434 | |
AnnaBridge | 145:64910690c574 | 435 | #if defined(STM32L496xx) || defined(STM32L4A6xx) |
AnnaBridge | 145:64910690c574 | 436 | /*--------------------------------STM32L496xx/STM32L4A6xx---------------------*/ |
Kojto | 122:f9eeca106725 | 437 | /** |
Kojto | 122:f9eeca106725 | 438 | * @brief AF 0 selection |
Kojto | 122:f9eeca106725 | 439 | */ |
Kojto | 122:f9eeca106725 | 440 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 441 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 442 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 443 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 444 | |
Kojto | 122:f9eeca106725 | 445 | /** |
Kojto | 122:f9eeca106725 | 446 | * @brief AF 1 selection |
Kojto | 122:f9eeca106725 | 447 | */ |
Kojto | 122:f9eeca106725 | 448 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 449 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 450 | #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 451 | #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 452 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 453 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 454 | |
Kojto | 122:f9eeca106725 | 455 | /** |
Kojto | 122:f9eeca106725 | 456 | * @brief AF 2 selection |
Kojto | 122:f9eeca106725 | 457 | */ |
Kojto | 122:f9eeca106725 | 458 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 459 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 460 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 461 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 462 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 463 | #define GPIO_AF2_I2C4 ((uint8_t)0x02) /* I2C4 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 464 | |
Kojto | 122:f9eeca106725 | 465 | /** |
Kojto | 122:f9eeca106725 | 466 | * @brief AF 3 selection |
Kojto | 122:f9eeca106725 | 467 | */ |
AnnaBridge | 145:64910690c574 | 468 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 469 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 470 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 471 | #define GPIO_AF3_CAN2 ((uint8_t)0x03) /* CAN2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 472 | #define GPIO_AF3_I2C4 ((uint8_t)0x03) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 473 | #define GPIO_AF3_QUADSPI ((uint8_t)0x03) /* QUADSPI Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 474 | #define GPIO_AF3_SPI2 ((uint8_t)0x03) /* SPI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 475 | #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 476 | |
Kojto | 122:f9eeca106725 | 477 | /** |
Kojto | 122:f9eeca106725 | 478 | * @brief AF 4 selection |
Kojto | 122:f9eeca106725 | 479 | */ |
Kojto | 122:f9eeca106725 | 480 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 481 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 482 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 483 | #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 484 | #define GPIO_AF4_DCMI ((uint8_t)0x04) /* DCMI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 485 | |
Kojto | 122:f9eeca106725 | 486 | /** |
Kojto | 122:f9eeca106725 | 487 | * @brief AF 5 selection |
Kojto | 122:f9eeca106725 | 488 | */ |
Kojto | 122:f9eeca106725 | 489 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 490 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 491 | #define GPIO_AF5_DCMI ((uint8_t)0x05) /* DCMI Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 492 | #define GPIO_AF5_I2C4 ((uint8_t)0x05) /* I2C4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 493 | #define GPIO_AF5_QUADSPI ((uint8_t)0x05) /* QUADSPI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 494 | |
Kojto | 122:f9eeca106725 | 495 | /** |
Kojto | 122:f9eeca106725 | 496 | * @brief AF 6 selection |
Kojto | 122:f9eeca106725 | 497 | */ |
Kojto | 122:f9eeca106725 | 498 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 499 | #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 500 | #define GPIO_AF6_I2C3 ((uint8_t)0x06) /* I2C3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 501 | |
Kojto | 122:f9eeca106725 | 502 | /** |
Kojto | 122:f9eeca106725 | 503 | * @brief AF 7 selection |
Kojto | 122:f9eeca106725 | 504 | */ |
Kojto | 122:f9eeca106725 | 505 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 506 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 507 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 508 | |
Kojto | 122:f9eeca106725 | 509 | /** |
Kojto | 122:f9eeca106725 | 510 | * @brief AF 8 selection |
Kojto | 122:f9eeca106725 | 511 | */ |
AnnaBridge | 145:64910690c574 | 512 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 513 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 514 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 515 | #define GPIO_AF8_CAN2 ((uint8_t)0x08) /* CAN2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 516 | |
Kojto | 122:f9eeca106725 | 517 | /** |
Kojto | 122:f9eeca106725 | 518 | * @brief AF 9 selection |
Kojto | 122:f9eeca106725 | 519 | */ |
AnnaBridge | 145:64910690c574 | 520 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 521 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 522 | |
Kojto | 122:f9eeca106725 | 523 | /** |
Kojto | 122:f9eeca106725 | 524 | * @brief AF 10 selection |
Kojto | 122:f9eeca106725 | 525 | */ |
AnnaBridge | 145:64910690c574 | 526 | #define GPIO_AF10_OTG_FS ((uint8_t)0x0A) /* OTG_FS Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 527 | #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 528 | #define GPIO_AF10_CAN2 ((uint8_t)0x0A) /* CAN2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 529 | #define GPIO_AF10_DCMI ((uint8_t)0x0A) /* DCMI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 530 | |
Kojto | 122:f9eeca106725 | 531 | /** |
Kojto | 122:f9eeca106725 | 532 | * @brief AF 11 selection |
Kojto | 122:f9eeca106725 | 533 | */ |
AnnaBridge | 145:64910690c574 | 534 | #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 535 | |
Kojto | 122:f9eeca106725 | 536 | /** |
Kojto | 122:f9eeca106725 | 537 | * @brief AF 12 selection |
Kojto | 122:f9eeca106725 | 538 | */ |
AnnaBridge | 145:64910690c574 | 539 | #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 540 | #define GPIO_AF12_SWPMI1 ((uint8_t)0x0C) /* SWPMI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 541 | #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 542 | #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 543 | #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 544 | #define GPIO_AF12_TIM1_COMP2 ((uint8_t)0x0C) /* TIM1/COMP2 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 545 | #define GPIO_AF12_TIM1_COMP1 ((uint8_t)0x0C) /* TIM1/COMP1 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 546 | #define GPIO_AF12_TIM8_COMP2 ((uint8_t)0x0C) /* TIM8/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 547 | |
Kojto | 122:f9eeca106725 | 548 | /** |
Kojto | 122:f9eeca106725 | 549 | * @brief AF 13 selection |
Kojto | 122:f9eeca106725 | 550 | */ |
AnnaBridge | 145:64910690c574 | 551 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 552 | #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 553 | #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 554 | #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 555 | |
Kojto | 122:f9eeca106725 | 556 | /** |
Kojto | 122:f9eeca106725 | 557 | * @brief AF 14 selection |
Kojto | 122:f9eeca106725 | 558 | */ |
AnnaBridge | 145:64910690c574 | 559 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 560 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 561 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 562 | #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 563 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
AnnaBridge | 145:64910690c574 | 564 | #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 565 | |
Kojto | 122:f9eeca106725 | 566 | /** |
Kojto | 122:f9eeca106725 | 567 | * @brief AF 15 selection |
Kojto | 122:f9eeca106725 | 568 | */ |
AnnaBridge | 145:64910690c574 | 569 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 570 | |
Kojto | 122:f9eeca106725 | 571 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
Kojto | 122:f9eeca106725 | 572 | |
AnnaBridge | 145:64910690c574 | 573 | #endif /* STM32L496xx || STM32L4A6xx */ |
Kojto | 122:f9eeca106725 | 574 | |
Kojto | 122:f9eeca106725 | 575 | /** |
Kojto | 122:f9eeca106725 | 576 | * @} |
Kojto | 122:f9eeca106725 | 577 | */ |
Kojto | 122:f9eeca106725 | 578 | |
Kojto | 122:f9eeca106725 | 579 | /** |
Kojto | 122:f9eeca106725 | 580 | * @} |
Kojto | 122:f9eeca106725 | 581 | */ |
Kojto | 122:f9eeca106725 | 582 | |
Kojto | 122:f9eeca106725 | 583 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 584 | /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros |
Kojto | 122:f9eeca106725 | 585 | * @{ |
Kojto | 122:f9eeca106725 | 586 | */ |
Kojto | 122:f9eeca106725 | 587 | |
Kojto | 122:f9eeca106725 | 588 | /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index |
Kojto | 122:f9eeca106725 | 589 | * @{ |
Kojto | 122:f9eeca106725 | 590 | */ |
Kojto | 122:f9eeca106725 | 591 | #if defined(STM32L431xx) || defined(STM32L433xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 592 | |
Kojto | 122:f9eeca106725 | 593 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 594 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 595 | ((__GPIOx__) == (GPIOC))? 2U :\ |
Kojto | 122:f9eeca106725 | 596 | ((__GPIOx__) == (GPIOD))? 3U :\ |
Kojto | 122:f9eeca106725 | 597 | ((__GPIOx__) == (GPIOE))? 4U : 7U) |
Kojto | 122:f9eeca106725 | 598 | |
Kojto | 122:f9eeca106725 | 599 | #endif /* STM32L431xx || STM32L433xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 600 | |
Kojto | 122:f9eeca106725 | 601 | #if defined(STM32L432xx) || defined(STM32L442xx) |
Kojto | 122:f9eeca106725 | 602 | |
Kojto | 122:f9eeca106725 | 603 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 604 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 605 | ((__GPIOx__) == (GPIOC))? 2U : 7U) |
Kojto | 122:f9eeca106725 | 606 | |
Kojto | 122:f9eeca106725 | 607 | #endif /* STM32L432xx || STM32L442xx */ |
Kojto | 122:f9eeca106725 | 608 | |
AnnaBridge | 145:64910690c574 | 609 | #if defined(STM32L451xx) || defined(STM32L452xx) || defined(STM32L462xx) |
AnnaBridge | 145:64910690c574 | 610 | |
AnnaBridge | 145:64910690c574 | 611 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
AnnaBridge | 145:64910690c574 | 612 | ((__GPIOx__) == (GPIOB))? 1U :\ |
AnnaBridge | 145:64910690c574 | 613 | ((__GPIOx__) == (GPIOC))? 2U :\ |
AnnaBridge | 145:64910690c574 | 614 | ((__GPIOx__) == (GPIOD))? 3U :\ |
AnnaBridge | 145:64910690c574 | 615 | ((__GPIOx__) == (GPIOE))? 4U : 7U) |
AnnaBridge | 145:64910690c574 | 616 | |
AnnaBridge | 145:64910690c574 | 617 | #endif /* STM32L451xx || STM32L452xx || STM32L462xx */ |
AnnaBridge | 145:64910690c574 | 618 | |
Kojto | 122:f9eeca106725 | 619 | #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 620 | |
Kojto | 122:f9eeca106725 | 621 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 622 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 623 | ((__GPIOx__) == (GPIOC))? 2U :\ |
Kojto | 122:f9eeca106725 | 624 | ((__GPIOx__) == (GPIOD))? 3U :\ |
Kojto | 122:f9eeca106725 | 625 | ((__GPIOx__) == (GPIOE))? 4U :\ |
Kojto | 122:f9eeca106725 | 626 | ((__GPIOx__) == (GPIOF))? 5U :\ |
Kojto | 122:f9eeca106725 | 627 | ((__GPIOx__) == (GPIOG))? 6U : 7U) |
Kojto | 122:f9eeca106725 | 628 | |
Kojto | 122:f9eeca106725 | 629 | #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 630 | |
AnnaBridge | 145:64910690c574 | 631 | #if defined(STM32L496xx) || defined(STM32L4A6xx) |
AnnaBridge | 145:64910690c574 | 632 | |
AnnaBridge | 145:64910690c574 | 633 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
AnnaBridge | 145:64910690c574 | 634 | ((__GPIOx__) == (GPIOB))? 1U :\ |
AnnaBridge | 145:64910690c574 | 635 | ((__GPIOx__) == (GPIOC))? 2U :\ |
AnnaBridge | 145:64910690c574 | 636 | ((__GPIOx__) == (GPIOD))? 3U :\ |
AnnaBridge | 145:64910690c574 | 637 | ((__GPIOx__) == (GPIOE))? 4U :\ |
AnnaBridge | 145:64910690c574 | 638 | ((__GPIOx__) == (GPIOF))? 5U :\ |
AnnaBridge | 145:64910690c574 | 639 | ((__GPIOx__) == (GPIOG))? 6U :\ |
AnnaBridge | 145:64910690c574 | 640 | ((__GPIOx__) == (GPIOH))? 7U : 8U) |
AnnaBridge | 145:64910690c574 | 641 | |
AnnaBridge | 145:64910690c574 | 642 | #endif /* STM32L496xx || STM32L4A6xx */ |
AnnaBridge | 145:64910690c574 | 643 | |
AnnaBridge | 145:64910690c574 | 644 | |
Kojto | 122:f9eeca106725 | 645 | /** |
Kojto | 122:f9eeca106725 | 646 | * @} |
Kojto | 122:f9eeca106725 | 647 | */ |
Kojto | 122:f9eeca106725 | 648 | |
Kojto | 122:f9eeca106725 | 649 | /** |
Kojto | 122:f9eeca106725 | 650 | * @} |
Kojto | 122:f9eeca106725 | 651 | */ |
Kojto | 122:f9eeca106725 | 652 | |
Kojto | 122:f9eeca106725 | 653 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 654 | /** |
Kojto | 122:f9eeca106725 | 655 | * @} |
Kojto | 122:f9eeca106725 | 656 | */ |
Kojto | 122:f9eeca106725 | 657 | |
Kojto | 122:f9eeca106725 | 658 | /** |
Kojto | 122:f9eeca106725 | 659 | * @} |
Kojto | 122:f9eeca106725 | 660 | */ |
Kojto | 122:f9eeca106725 | 661 | |
Kojto | 122:f9eeca106725 | 662 | #ifdef __cplusplus |
Kojto | 122:f9eeca106725 | 663 | } |
Kojto | 122:f9eeca106725 | 664 | #endif |
Kojto | 122:f9eeca106725 | 665 | |
Kojto | 122:f9eeca106725 | 666 | #endif /* __STM32L4xx_HAL_GPIO_EX_H */ |
Kojto | 122:f9eeca106725 | 667 | |
Kojto | 122:f9eeca106725 | 668 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |