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@140:97feb9bacc10, 2017-04-12 (annotated)
- Committer:
- <>
- Date:
- Wed Apr 12 16:07:08 2017 +0100
- Revision:
- 140:97feb9bacc10
- Parent:
- 128:9bcdf88f62b0
- Child:
- 145:64910690c574
Release 140 of the mbed library
Ports for Upcoming Targets
3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992
Fixes and Changes
3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982
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 |
Kojto | 122:f9eeca106725 | 5 | * @version V1.5.1 |
Kojto | 122:f9eeca106725 | 6 | * @date 31-May-2016 |
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 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 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 | |
Kojto | 122:f9eeca106725 | 68 | #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 69 | /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx---*/ |
Kojto | 122:f9eeca106725 | 70 | /** |
Kojto | 122:f9eeca106725 | 71 | * @brief AF 0 selection |
Kojto | 122:f9eeca106725 | 72 | */ |
Kojto | 122:f9eeca106725 | 73 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 74 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 75 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 76 | #if defined(STM32L476xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 77 | #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 78 | #endif /* STM32L476xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 79 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 80 | |
Kojto | 122:f9eeca106725 | 81 | /** |
Kojto | 122:f9eeca106725 | 82 | * @brief AF 1 selection |
Kojto | 122:f9eeca106725 | 83 | */ |
Kojto | 122:f9eeca106725 | 84 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 85 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 86 | #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 87 | #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 88 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 89 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 90 | |
Kojto | 122:f9eeca106725 | 91 | /** |
Kojto | 122:f9eeca106725 | 92 | * @brief AF 2 selection |
Kojto | 122:f9eeca106725 | 93 | */ |
Kojto | 122:f9eeca106725 | 94 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 95 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 96 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 97 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 98 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 99 | |
Kojto | 122:f9eeca106725 | 100 | /** |
Kojto | 122:f9eeca106725 | 101 | * @brief AF 3 selection |
Kojto | 122:f9eeca106725 | 102 | */ |
Kojto | 122:f9eeca106725 | 103 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 104 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 105 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 106 | |
Kojto | 122:f9eeca106725 | 107 | /** |
Kojto | 122:f9eeca106725 | 108 | * @brief AF 4 selection |
Kojto | 122:f9eeca106725 | 109 | */ |
Kojto | 122:f9eeca106725 | 110 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 111 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 112 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 113 | |
Kojto | 122:f9eeca106725 | 114 | /** |
Kojto | 122:f9eeca106725 | 115 | * @brief AF 5 selection |
Kojto | 122:f9eeca106725 | 116 | */ |
Kojto | 122:f9eeca106725 | 117 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 118 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 119 | |
Kojto | 122:f9eeca106725 | 120 | /** |
Kojto | 122:f9eeca106725 | 121 | * @brief AF 6 selection |
Kojto | 122:f9eeca106725 | 122 | */ |
Kojto | 122:f9eeca106725 | 123 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 124 | #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 125 | |
Kojto | 122:f9eeca106725 | 126 | /** |
Kojto | 122:f9eeca106725 | 127 | * @brief AF 7 selection |
Kojto | 122:f9eeca106725 | 128 | */ |
Kojto | 122:f9eeca106725 | 129 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 130 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 131 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 132 | |
Kojto | 122:f9eeca106725 | 133 | /** |
Kojto | 122:f9eeca106725 | 134 | * @brief AF 8 selection |
Kojto | 122:f9eeca106725 | 135 | */ |
Kojto | 122:f9eeca106725 | 136 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 137 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 138 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 139 | |
Kojto | 122:f9eeca106725 | 140 | |
Kojto | 122:f9eeca106725 | 141 | /** |
Kojto | 122:f9eeca106725 | 142 | * @brief AF 9 selection |
Kojto | 122:f9eeca106725 | 143 | */ |
Kojto | 122:f9eeca106725 | 144 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 145 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 146 | |
Kojto | 122:f9eeca106725 | 147 | /** |
Kojto | 122:f9eeca106725 | 148 | * @brief AF 10 selection |
Kojto | 122:f9eeca106725 | 149 | */ |
Kojto | 122:f9eeca106725 | 150 | #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 151 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 152 | #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 153 | #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 154 | |
Kojto | 122:f9eeca106725 | 155 | #if defined(STM32L476xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 156 | /** |
Kojto | 122:f9eeca106725 | 157 | * @brief AF 11 selection |
Kojto | 122:f9eeca106725 | 158 | */ |
Kojto | 122:f9eeca106725 | 159 | #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 160 | #endif /* STM32L476xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 161 | |
Kojto | 122:f9eeca106725 | 162 | /** |
Kojto | 122:f9eeca106725 | 163 | * @brief AF 12 selection |
Kojto | 122:f9eeca106725 | 164 | */ |
Kojto | 122:f9eeca106725 | 165 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 166 | #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 167 | #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 168 | #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 169 | #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 170 | |
Kojto | 122:f9eeca106725 | 171 | /** |
Kojto | 122:f9eeca106725 | 172 | * @brief AF 13 selection |
Kojto | 122:f9eeca106725 | 173 | */ |
Kojto | 122:f9eeca106725 | 174 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 175 | #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 176 | #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 177 | #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 178 | |
Kojto | 122:f9eeca106725 | 179 | /** |
Kojto | 122:f9eeca106725 | 180 | * @brief AF 14 selection |
Kojto | 122:f9eeca106725 | 181 | */ |
Kojto | 122:f9eeca106725 | 182 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 183 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 184 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 185 | #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 186 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 187 | #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 188 | |
Kojto | 122:f9eeca106725 | 189 | /** |
Kojto | 122:f9eeca106725 | 190 | * @brief AF 15 selection |
Kojto | 122:f9eeca106725 | 191 | */ |
Kojto | 122:f9eeca106725 | 192 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 193 | |
Kojto | 122:f9eeca106725 | 194 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
Kojto | 122:f9eeca106725 | 195 | |
Kojto | 122:f9eeca106725 | 196 | #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 197 | |
Kojto | 122:f9eeca106725 | 198 | #if defined(STM32L431xx) || defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 199 | /*--------------STM32L431xx/STM32L432xx/STM32L433xx/STM32L442xx/STM32L443xx---*/ |
Kojto | 122:f9eeca106725 | 200 | /** |
Kojto | 122:f9eeca106725 | 201 | * @brief AF 0 selection |
Kojto | 122:f9eeca106725 | 202 | */ |
Kojto | 122:f9eeca106725 | 203 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 204 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 205 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 206 | #if defined(STM32L433xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 207 | #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 208 | #endif /* STM32L433xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 209 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 210 | |
Kojto | 122:f9eeca106725 | 211 | /** |
Kojto | 122:f9eeca106725 | 212 | * @brief AF 1 selection |
Kojto | 122:f9eeca106725 | 213 | */ |
Kojto | 122:f9eeca106725 | 214 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 215 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 216 | #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 217 | #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 218 | |
Kojto | 122:f9eeca106725 | 219 | /** |
Kojto | 122:f9eeca106725 | 220 | * @brief AF 2 selection |
Kojto | 122:f9eeca106725 | 221 | */ |
Kojto | 122:f9eeca106725 | 222 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 223 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 224 | |
Kojto | 122:f9eeca106725 | 225 | /** |
Kojto | 122:f9eeca106725 | 226 | * @brief AF 3 selection |
Kojto | 122:f9eeca106725 | 227 | */ |
Kojto | 122:f9eeca106725 | 228 | #define GPIO_AF3_USART2 ((uint8_t)0x03) /* USART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 229 | #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 230 | #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 231 | |
Kojto | 122:f9eeca106725 | 232 | /** |
Kojto | 122:f9eeca106725 | 233 | * @brief AF 4 selection |
Kojto | 122:f9eeca106725 | 234 | */ |
Kojto | 122:f9eeca106725 | 235 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 236 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 237 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 238 | |
Kojto | 122:f9eeca106725 | 239 | /** |
Kojto | 122:f9eeca106725 | 240 | * @brief AF 5 selection |
Kojto | 122:f9eeca106725 | 241 | */ |
Kojto | 122:f9eeca106725 | 242 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 243 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 244 | |
Kojto | 122:f9eeca106725 | 245 | /** |
Kojto | 122:f9eeca106725 | 246 | * @brief AF 6 selection |
Kojto | 122:f9eeca106725 | 247 | */ |
Kojto | 122:f9eeca106725 | 248 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 249 | #define GPIO_AF6_COMP1 ((uint8_t)0x06) /* COMP1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 250 | |
Kojto | 122:f9eeca106725 | 251 | /** |
Kojto | 122:f9eeca106725 | 252 | * @brief AF 7 selection |
Kojto | 122:f9eeca106725 | 253 | */ |
Kojto | 122:f9eeca106725 | 254 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 255 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 256 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 257 | |
Kojto | 122:f9eeca106725 | 258 | /** |
Kojto | 122:f9eeca106725 | 259 | * @brief AF 8 selection |
Kojto | 122:f9eeca106725 | 260 | */ |
Kojto | 122:f9eeca106725 | 261 | #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 262 | |
Kojto | 122:f9eeca106725 | 263 | /** |
Kojto | 122:f9eeca106725 | 264 | * @brief AF 9 selection |
Kojto | 122:f9eeca106725 | 265 | */ |
Kojto | 122:f9eeca106725 | 266 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 267 | #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 268 | |
Kojto | 122:f9eeca106725 | 269 | /** |
Kojto | 122:f9eeca106725 | 270 | * @brief AF 10 selection |
Kojto | 122:f9eeca106725 | 271 | */ |
Kojto | 122:f9eeca106725 | 272 | #if defined(STM32L432xx) || defined(STM32L433xx) || defined(STM32L442xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 273 | #define GPIO_AF10_USB_FS ((uint8_t)0xA) /* USB_FS Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 274 | #endif /* STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 275 | #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 276 | |
Kojto | 122:f9eeca106725 | 277 | #if defined(STM32L433xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 278 | /** |
Kojto | 122:f9eeca106725 | 279 | * @brief AF 11 selection |
Kojto | 122:f9eeca106725 | 280 | */ |
Kojto | 122:f9eeca106725 | 281 | #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 282 | #endif /* STM32L433xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 283 | |
Kojto | 122:f9eeca106725 | 284 | /** |
Kojto | 122:f9eeca106725 | 285 | * @brief AF 12 selection |
Kojto | 122:f9eeca106725 | 286 | */ |
Kojto | 122:f9eeca106725 | 287 | #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 288 | #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 289 | #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 290 | #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 291 | |
Kojto | 122:f9eeca106725 | 292 | /** |
Kojto | 122:f9eeca106725 | 293 | * @brief AF 13 selection |
Kojto | 122:f9eeca106725 | 294 | */ |
Kojto | 122:f9eeca106725 | 295 | #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 296 | |
Kojto | 122:f9eeca106725 | 297 | /** |
Kojto | 122:f9eeca106725 | 298 | * @brief AF 14 selection |
Kojto | 122:f9eeca106725 | 299 | */ |
Kojto | 122:f9eeca106725 | 300 | #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 301 | #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 302 | #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 303 | #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 304 | |
Kojto | 122:f9eeca106725 | 305 | /** |
Kojto | 122:f9eeca106725 | 306 | * @brief AF 15 selection |
Kojto | 122:f9eeca106725 | 307 | */ |
Kojto | 122:f9eeca106725 | 308 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
Kojto | 122:f9eeca106725 | 309 | |
Kojto | 122:f9eeca106725 | 310 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) |
Kojto | 122:f9eeca106725 | 311 | |
Kojto | 122:f9eeca106725 | 312 | #endif /* STM32L431xx || STM32L432xx || STM32L433xx || STM32L442xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 313 | |
Kojto | 122:f9eeca106725 | 314 | /** |
Kojto | 122:f9eeca106725 | 315 | * @} |
Kojto | 122:f9eeca106725 | 316 | */ |
Kojto | 122:f9eeca106725 | 317 | |
Kojto | 122:f9eeca106725 | 318 | /** |
Kojto | 122:f9eeca106725 | 319 | * @} |
Kojto | 122:f9eeca106725 | 320 | */ |
Kojto | 122:f9eeca106725 | 321 | |
Kojto | 122:f9eeca106725 | 322 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 323 | /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros |
Kojto | 122:f9eeca106725 | 324 | * @{ |
Kojto | 122:f9eeca106725 | 325 | */ |
Kojto | 122:f9eeca106725 | 326 | |
Kojto | 122:f9eeca106725 | 327 | /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index |
Kojto | 122:f9eeca106725 | 328 | * @{ |
Kojto | 122:f9eeca106725 | 329 | */ |
Kojto | 122:f9eeca106725 | 330 | #if defined(STM32L431xx) || defined(STM32L433xx) || defined(STM32L443xx) |
Kojto | 122:f9eeca106725 | 331 | |
Kojto | 122:f9eeca106725 | 332 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 333 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 334 | ((__GPIOx__) == (GPIOC))? 2U :\ |
Kojto | 122:f9eeca106725 | 335 | ((__GPIOx__) == (GPIOD))? 3U :\ |
Kojto | 122:f9eeca106725 | 336 | ((__GPIOx__) == (GPIOE))? 4U : 7U) |
Kojto | 122:f9eeca106725 | 337 | |
Kojto | 122:f9eeca106725 | 338 | #endif /* STM32L431xx || STM32L433xx || STM32L443xx */ |
Kojto | 122:f9eeca106725 | 339 | |
Kojto | 122:f9eeca106725 | 340 | #if defined(STM32L432xx) || defined(STM32L442xx) |
Kojto | 122:f9eeca106725 | 341 | |
Kojto | 122:f9eeca106725 | 342 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 343 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 344 | ((__GPIOx__) == (GPIOC))? 2U : 7U) |
Kojto | 122:f9eeca106725 | 345 | |
Kojto | 122:f9eeca106725 | 346 | #endif /* STM32L432xx || STM32L442xx */ |
Kojto | 122:f9eeca106725 | 347 | |
Kojto | 122:f9eeca106725 | 348 | #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) |
Kojto | 122:f9eeca106725 | 349 | |
Kojto | 122:f9eeca106725 | 350 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
Kojto | 122:f9eeca106725 | 351 | ((__GPIOx__) == (GPIOB))? 1U :\ |
Kojto | 122:f9eeca106725 | 352 | ((__GPIOx__) == (GPIOC))? 2U :\ |
Kojto | 122:f9eeca106725 | 353 | ((__GPIOx__) == (GPIOD))? 3U :\ |
Kojto | 122:f9eeca106725 | 354 | ((__GPIOx__) == (GPIOE))? 4U :\ |
Kojto | 122:f9eeca106725 | 355 | ((__GPIOx__) == (GPIOF))? 5U :\ |
Kojto | 122:f9eeca106725 | 356 | ((__GPIOx__) == (GPIOG))? 6U : 7U) |
Kojto | 122:f9eeca106725 | 357 | |
Kojto | 122:f9eeca106725 | 358 | #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ |
Kojto | 122:f9eeca106725 | 359 | |
Kojto | 122:f9eeca106725 | 360 | /** |
Kojto | 122:f9eeca106725 | 361 | * @} |
Kojto | 122:f9eeca106725 | 362 | */ |
Kojto | 122:f9eeca106725 | 363 | |
Kojto | 122:f9eeca106725 | 364 | /** |
Kojto | 122:f9eeca106725 | 365 | * @} |
Kojto | 122:f9eeca106725 | 366 | */ |
Kojto | 122:f9eeca106725 | 367 | |
Kojto | 122:f9eeca106725 | 368 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 369 | /** |
Kojto | 122:f9eeca106725 | 370 | * @} |
Kojto | 122:f9eeca106725 | 371 | */ |
Kojto | 122:f9eeca106725 | 372 | |
Kojto | 122:f9eeca106725 | 373 | /** |
Kojto | 122:f9eeca106725 | 374 | * @} |
Kojto | 122:f9eeca106725 | 375 | */ |
Kojto | 122:f9eeca106725 | 376 | |
Kojto | 122:f9eeca106725 | 377 | #ifdef __cplusplus |
Kojto | 122:f9eeca106725 | 378 | } |
Kojto | 122:f9eeca106725 | 379 | #endif |
Kojto | 122:f9eeca106725 | 380 | |
Kojto | 122:f9eeca106725 | 381 | #endif /* __STM32L4xx_HAL_GPIO_EX_H */ |
Kojto | 122:f9eeca106725 | 382 | |
Kojto | 122:f9eeca106725 | 383 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |