mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_gpio_ex.h@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 181:a4cbdfbbd2f4
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 181:a4cbdfbbd2f4 | 1 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 2 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 3 | * @file stm32l0xx_hal_gpio_ex.h |
mbed_official | 181:a4cbdfbbd2f4 | 4 | * @author MCD Application Team |
mbed_official | 181:a4cbdfbbd2f4 | 5 | * @version V1.0.0 |
mbed_official | 181:a4cbdfbbd2f4 | 6 | * @date 22-April-2014 |
mbed_official | 181:a4cbdfbbd2f4 | 7 | * @brief Header file of GPIO HAL Extension module. |
mbed_official | 181:a4cbdfbbd2f4 | 8 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 9 | * @attention |
mbed_official | 181:a4cbdfbbd2f4 | 10 | * |
mbed_official | 181:a4cbdfbbd2f4 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 181:a4cbdfbbd2f4 | 12 | * |
mbed_official | 181:a4cbdfbbd2f4 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 181:a4cbdfbbd2f4 | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 181:a4cbdfbbd2f4 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 181:a4cbdfbbd2f4 | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 181:a4cbdfbbd2f4 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 181:a4cbdfbbd2f4 | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 181:a4cbdfbbd2f4 | 19 | * and/or other materials provided with the distribution. |
mbed_official | 181:a4cbdfbbd2f4 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 181:a4cbdfbbd2f4 | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 181:a4cbdfbbd2f4 | 22 | * without specific prior written permission. |
mbed_official | 181:a4cbdfbbd2f4 | 23 | * |
mbed_official | 181:a4cbdfbbd2f4 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 181:a4cbdfbbd2f4 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 181:a4cbdfbbd2f4 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 181:a4cbdfbbd2f4 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 181:a4cbdfbbd2f4 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 181:a4cbdfbbd2f4 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 181:a4cbdfbbd2f4 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 181:a4cbdfbbd2f4 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 181:a4cbdfbbd2f4 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 181:a4cbdfbbd2f4 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 181:a4cbdfbbd2f4 | 34 | * |
mbed_official | 181:a4cbdfbbd2f4 | 35 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 36 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 37 | |
mbed_official | 181:a4cbdfbbd2f4 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 39 | #ifndef __STM32L0xx_HAL_GPIO_EX_H |
mbed_official | 181:a4cbdfbbd2f4 | 40 | #define __STM32L0xx_HAL_GPIO_EX_H |
mbed_official | 181:a4cbdfbbd2f4 | 41 | |
mbed_official | 181:a4cbdfbbd2f4 | 42 | #ifdef __cplusplus |
mbed_official | 181:a4cbdfbbd2f4 | 43 | extern "C" { |
mbed_official | 181:a4cbdfbbd2f4 | 44 | #endif |
mbed_official | 181:a4cbdfbbd2f4 | 45 | |
mbed_official | 181:a4cbdfbbd2f4 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 47 | #include "stm32l0xx_hal_def.h" |
mbed_official | 181:a4cbdfbbd2f4 | 48 | |
mbed_official | 181:a4cbdfbbd2f4 | 49 | /** @addtogroup STM32L0xx_HAL_Driver |
mbed_official | 181:a4cbdfbbd2f4 | 50 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 51 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 52 | |
mbed_official | 181:a4cbdfbbd2f4 | 53 | /** @addtogroup GPIOEx |
mbed_official | 181:a4cbdfbbd2f4 | 54 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 55 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 56 | |
mbed_official | 181:a4cbdfbbd2f4 | 57 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 58 | |
mbed_official | 181:a4cbdfbbd2f4 | 59 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 60 | |
mbed_official | 181:a4cbdfbbd2f4 | 61 | /** @defgroup GPIOEx_Exported_Constants |
mbed_official | 181:a4cbdfbbd2f4 | 62 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 63 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 64 | |
mbed_official | 181:a4cbdfbbd2f4 | 65 | /** @defgroup GPIOEx_Alternate_function_selection |
mbed_official | 181:a4cbdfbbd2f4 | 66 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 67 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 68 | |
mbed_official | 181:a4cbdfbbd2f4 | 69 | /*------------------------- STM32L053xx/STM32L063xx---------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 70 | #if defined (STM32L053xx) || defined (STM32L063xx) |
mbed_official | 181:a4cbdfbbd2f4 | 71 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 72 | * @brief AF 0 selection |
mbed_official | 181:a4cbdfbbd2f4 | 73 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 74 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 75 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 76 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 77 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 78 | #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 79 | #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 80 | #define GPIO_AF0_LPTIM ((uint8_t)0x00) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 81 | #define GPIO_AF0_TSC ((uint8_t)0x00) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 82 | #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 83 | #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 84 | #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 85 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 86 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 87 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 88 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 89 | |
mbed_official | 181:a4cbdfbbd2f4 | 90 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 91 | * @brief AF 1 selection |
mbed_official | 181:a4cbdfbbd2f4 | 92 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 93 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 94 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 95 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 96 | #define GPIO_AF1_LCD ((uint8_t)0x01) /* LCD Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 97 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 98 | #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 99 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 100 | * @brief AF 2 selection |
mbed_official | 181:a4cbdfbbd2f4 | 101 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 102 | #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 103 | #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 104 | #define GPIO_AF2_USB ((uint8_t)0x02) /* USB Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 105 | #define GPIO_AF2_LPTIM ((uint8_t)0x02) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 106 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 107 | #define GPIO_AF2_TIM22 ((uint8_t)0x02) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 108 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 109 | #define GPIO_AF2_RTC_50Hz ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 110 | |
mbed_official | 181:a4cbdfbbd2f4 | 111 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 112 | * @brief AF 3 selection |
mbed_official | 181:a4cbdfbbd2f4 | 113 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 114 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 115 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 116 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 117 | |
mbed_official | 181:a4cbdfbbd2f4 | 118 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 119 | * @brief AF 4 selection |
mbed_official | 181:a4cbdfbbd2f4 | 120 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 121 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 122 | #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 123 | #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 124 | #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 125 | #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 126 | #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 127 | |
mbed_official | 181:a4cbdfbbd2f4 | 128 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 129 | * @brief AF 5 selection |
mbed_official | 181:a4cbdfbbd2f4 | 130 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 131 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 132 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 133 | #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 134 | #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 135 | #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 136 | |
mbed_official | 181:a4cbdfbbd2f4 | 137 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 138 | * @brief AF 6 selection |
mbed_official | 181:a4cbdfbbd2f4 | 139 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 140 | #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 141 | #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 142 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 143 | |
mbed_official | 181:a4cbdfbbd2f4 | 144 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 145 | * @brief AF 7 selection |
mbed_official | 181:a4cbdfbbd2f4 | 146 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 147 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 148 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 149 | |
mbed_official | 181:a4cbdfbbd2f4 | 150 | |
mbed_official | 181:a4cbdfbbd2f4 | 151 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_SPI1) || ((AF) == GPIO_AF2_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 152 | ((AF) == GPIO_AF0_SPI2) || ((AF) == GPIO_AF2_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 153 | ((AF) == GPIO_AF0_USART1) || ((AF) == GPIO_AF2_USB) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 154 | ((AF) == GPIO_AF0_USART2) || ((AF) == GPIO_AF2_LPTIM) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 155 | ((AF) == GPIO_AF0_LPUART1) || ((AF) == GPIO_AF2_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 156 | ((AF) == GPIO_AF0_USB) || ((AF) == GPIO_AF2_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 157 | ((AF) == GPIO_AF0_LPTIM) || ((AF) == GPIO_AF2_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 158 | ((AF) == GPIO_AF0_TSC) || ((AF) == GPIO_AF2_RTC_50Hz) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 159 | ((AF) == GPIO_AF0_TIM2) || ((AF) == GPIO_AF3_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 160 | ((AF) == GPIO_AF0_TIM21) || ((AF) == GPIO_AF3_TSC) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 161 | ((AF) == GPIO_AF0_TIM22) || ((AF) == GPIO_AF3_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 162 | ((AF) == GPIO_AF0_EVENTOUT) || ((AF) == GPIO_AF4_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 163 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF4_USART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 164 | ((AF) == GPIO_AF0_SWDIO) || ((AF) == GPIO_AF0_SWCLK) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 165 | ((AF) == GPIO_AF1_SPI1) || ((AF) == GPIO_AF4_USART2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 166 | ((AF) == GPIO_AF1_SPI2) || ((AF) == GPIO_AF4_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 167 | ((AF) == GPIO_AF1_TIM2) || ((AF) == GPIO_AF4_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 168 | ((AF) == GPIO_AF1_I2C1) || ((AF) == GPIO_AF4_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 169 | ((AF) == GPIO_AF1_LCD) || ((AF) == GPIO_AF5_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 170 | ((AF) == GPIO_AF5_I2C2) || ((AF) == GPIO_AF5_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 171 | ((AF) == GPIO_AF5_TIM21) || ((AF) == GPIO_AF5_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 172 | ((AF) == GPIO_AF6_I2C2) || ((AF) == GPIO_AF6_TIM21) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 173 | ((AF) == GPIO_AF6_EVENTOUT) || ((AF) == GPIO_AF7_COMP1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 174 | ((AF) == GPIO_AF7_COMP2) || ((AF) == GPIO_AF1_TIM21)) |
mbed_official | 181:a4cbdfbbd2f4 | 175 | |
mbed_official | 181:a4cbdfbbd2f4 | 176 | #endif /* STM32L053xx || STM32L063xx */ |
mbed_official | 181:a4cbdfbbd2f4 | 177 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 178 | |
mbed_official | 181:a4cbdfbbd2f4 | 179 | /*------------------------- STM32L052xx/STM32L062xx---------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 180 | #if defined (STM32L052xx) || defined (STM32L062xx) |
mbed_official | 181:a4cbdfbbd2f4 | 181 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 182 | * @brief AF 0 selection |
mbed_official | 181:a4cbdfbbd2f4 | 183 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 184 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 185 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 186 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 187 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 188 | #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 189 | #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 190 | #define GPIO_AF0_LPTIM ((uint8_t)0x00) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 191 | #define GPIO_AF0_TSC ((uint8_t)0x00) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 192 | #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 193 | #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 194 | #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 195 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 196 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 197 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 198 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 199 | |
mbed_official | 181:a4cbdfbbd2f4 | 200 | |
mbed_official | 181:a4cbdfbbd2f4 | 201 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 202 | * @brief AF 1 selection |
mbed_official | 181:a4cbdfbbd2f4 | 203 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 204 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 205 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 206 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 207 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 208 | #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 209 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 210 | * @brief AF 2 selection |
mbed_official | 181:a4cbdfbbd2f4 | 211 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 212 | #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 213 | #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 214 | #define GPIO_AF2_USB ((uint8_t)0x02) /* USB Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 215 | #define GPIO_AF2_LPTIM ((uint8_t)0x02) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 216 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 217 | #define GPIO_AF2_TIM22 ((uint8_t)0x02) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 218 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 219 | #define GPIO_AF2_RTC_50Hz ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 220 | |
mbed_official | 181:a4cbdfbbd2f4 | 221 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 222 | * @brief AF 3 selection |
mbed_official | 181:a4cbdfbbd2f4 | 223 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 224 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 225 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 226 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 227 | |
mbed_official | 181:a4cbdfbbd2f4 | 228 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 229 | * @brief AF 4 selection |
mbed_official | 181:a4cbdfbbd2f4 | 230 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 231 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 232 | #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 233 | #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 234 | #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 235 | #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 236 | #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 237 | |
mbed_official | 181:a4cbdfbbd2f4 | 238 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 239 | * @brief AF 5 selection |
mbed_official | 181:a4cbdfbbd2f4 | 240 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 241 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 242 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 243 | #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 244 | #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 245 | #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 246 | |
mbed_official | 181:a4cbdfbbd2f4 | 247 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 248 | * @brief AF 6 selection |
mbed_official | 181:a4cbdfbbd2f4 | 249 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 250 | #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 251 | #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 252 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 253 | |
mbed_official | 181:a4cbdfbbd2f4 | 254 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 255 | * @brief AF 7 selection |
mbed_official | 181:a4cbdfbbd2f4 | 256 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 257 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 258 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 259 | |
mbed_official | 181:a4cbdfbbd2f4 | 260 | |
mbed_official | 181:a4cbdfbbd2f4 | 261 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_SPI1) || ((AF) == GPIO_AF2_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 262 | ((AF) == GPIO_AF0_SPI2) || ((AF) == GPIO_AF2_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 263 | ((AF) == GPIO_AF0_USART1) || ((AF) == GPIO_AF2_USB) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 264 | ((AF) == GPIO_AF0_USART2) || ((AF) == GPIO_AF2_LPTIM) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 265 | ((AF) == GPIO_AF0_LPUART1) || ((AF) == GPIO_AF2_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 266 | ((AF) == GPIO_AF0_USB) || ((AF) == GPIO_AF2_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 267 | ((AF) == GPIO_AF0_LPTIM) || ((AF) == GPIO_AF2_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 268 | ((AF) == GPIO_AF0_TSC) || ((AF) == GPIO_AF2_RTC_50Hz) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 269 | ((AF) == GPIO_AF0_TIM2) || ((AF) == GPIO_AF3_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 270 | ((AF) == GPIO_AF0_TIM21) || ((AF) == GPIO_AF3_TSC) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 271 | ((AF) == GPIO_AF0_TIM22) || ((AF) == GPIO_AF3_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 272 | ((AF) == GPIO_AF0_EVENTOUT) || ((AF) == GPIO_AF4_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 273 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF4_USART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 274 | ((AF) == GPIO_AF0_SWDIO) || ((AF) == GPIO_AF0_SWCLK) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 275 | ((AF) == GPIO_AF1_SPI1) || ((AF) == GPIO_AF4_USART2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 276 | ((AF) == GPIO_AF1_SPI2) || ((AF) == GPIO_AF4_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 277 | ((AF) == GPIO_AF1_TIM2) || ((AF) == GPIO_AF4_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 278 | ((AF) == GPIO_AF1_I2C1) || ((AF) == GPIO_AF4_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 279 | ((AF) == GPIO_AF6_EVENTOUT) || ((AF) == GPIO_AF5_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 280 | ((AF) == GPIO_AF5_I2C2) || ((AF) == GPIO_AF5_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 281 | ((AF) == GPIO_AF5_TIM21) || ((AF) == GPIO_AF5_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 282 | ((AF) == GPIO_AF6_I2C2) || ((AF) == GPIO_AF6_TIM21) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 283 | ((AF) == GPIO_AF7_COMP2) || ((AF) == GPIO_AF7_COMP1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 284 | ((AF) == GPIO_AF1_TIM21)) |
mbed_official | 181:a4cbdfbbd2f4 | 285 | |
mbed_official | 181:a4cbdfbbd2f4 | 286 | #endif /* STM32L052xx || STM32L062xx */ |
mbed_official | 181:a4cbdfbbd2f4 | 287 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 288 | |
mbed_official | 181:a4cbdfbbd2f4 | 289 | /*------------------------- STM32L051xx/STM32L061xx---------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 290 | #if defined (STM32L051xx)|| defined (STM32L061xx) |
mbed_official | 181:a4cbdfbbd2f4 | 291 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 292 | * @brief AF 0 selection |
mbed_official | 181:a4cbdfbbd2f4 | 293 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 294 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 295 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 296 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 297 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 298 | #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 299 | #define GPIO_AF0_LPTIM ((uint8_t)0x00) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 300 | #define GPIO_AF0_TSC ((uint8_t)0x00) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 301 | #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 302 | #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 303 | #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 304 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 305 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 306 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 307 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 308 | |
mbed_official | 181:a4cbdfbbd2f4 | 309 | |
mbed_official | 181:a4cbdfbbd2f4 | 310 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 311 | * @brief AF 1 selection |
mbed_official | 181:a4cbdfbbd2f4 | 312 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 313 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 314 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 315 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 316 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 317 | #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 318 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 319 | * @brief AF 2 selection |
mbed_official | 181:a4cbdfbbd2f4 | 320 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 321 | #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 322 | #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 323 | #define GPIO_AF2_LPTIM ((uint8_t)0x02) /* LPTIM Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 324 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 325 | #define GPIO_AF2_TIM22 ((uint8_t)0x02) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 326 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 327 | #define GPIO_AF2_RTC_50Hz ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 328 | |
mbed_official | 181:a4cbdfbbd2f4 | 329 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 330 | * @brief AF 3 selection |
mbed_official | 181:a4cbdfbbd2f4 | 331 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 332 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 333 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 334 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 335 | |
mbed_official | 181:a4cbdfbbd2f4 | 336 | |
mbed_official | 181:a4cbdfbbd2f4 | 337 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 338 | * @brief AF 4 selection |
mbed_official | 181:a4cbdfbbd2f4 | 339 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 340 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 341 | #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 342 | #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 343 | #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 344 | #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 345 | #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 346 | |
mbed_official | 181:a4cbdfbbd2f4 | 347 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 348 | * @brief AF 5 selection |
mbed_official | 181:a4cbdfbbd2f4 | 349 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 350 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 351 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 352 | #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 353 | #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 354 | #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 355 | |
mbed_official | 181:a4cbdfbbd2f4 | 356 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 357 | * @brief AF 6 selection |
mbed_official | 181:a4cbdfbbd2f4 | 358 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 359 | #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 360 | #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 361 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 362 | |
mbed_official | 181:a4cbdfbbd2f4 | 363 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 364 | * @brief AF 7 selection |
mbed_official | 181:a4cbdfbbd2f4 | 365 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 366 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 367 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */ |
mbed_official | 181:a4cbdfbbd2f4 | 368 | |
mbed_official | 181:a4cbdfbbd2f4 | 369 | |
mbed_official | 181:a4cbdfbbd2f4 | 370 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_SPI1) || ((AF) == GPIO_AF2_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 371 | ((AF) == GPIO_AF0_SPI2) || ((AF) == GPIO_AF2_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 372 | ((AF) == GPIO_AF0_USART1) || ((AF) == GPIO_AF2_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 373 | ((AF) == GPIO_AF0_USART2) || ((AF) == GPIO_AF2_LPTIM) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 374 | ((AF) == GPIO_AF0_LPUART1) || ((AF) == GPIO_AF2_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 375 | ((AF) == GPIO_AF0_LPTIM) || ((AF) == GPIO_AF2_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 376 | ((AF) == GPIO_AF1_TIM21) || ((AF) == GPIO_AF2_RTC_50Hz) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 377 | ((AF) == GPIO_AF0_TIM2) || ((AF) == GPIO_AF3_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 378 | ((AF) == GPIO_AF0_TIM21) || ((AF) == GPIO_AF3_TSC) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 379 | ((AF) == GPIO_AF0_TIM22) || ((AF) == GPIO_AF3_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 380 | ((AF) == GPIO_AF0_EVENTOUT) || ((AF) == GPIO_AF4_I2C1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 381 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF4_USART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 382 | ((AF) == GPIO_AF0_SWDIO) || ((AF) == GPIO_AF0_SWCLK) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 383 | ((AF) == GPIO_AF1_SPI1) || ((AF) == GPIO_AF4_USART2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 384 | ((AF) == GPIO_AF1_SPI2) || ((AF) == GPIO_AF4_LPUART1) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 385 | ((AF) == GPIO_AF1_TIM2) || ((AF) == GPIO_AF4_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 386 | ((AF) == GPIO_AF1_I2C1) || ((AF) == GPIO_AF4_EVENTOUT) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 387 | ((AF) == GPIO_AF6_EVENTOUT) || ((AF) == GPIO_AF5_SPI2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 388 | ((AF) == GPIO_AF5_I2C2) || ((AF) == GPIO_AF5_TIM2) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 389 | ((AF) == GPIO_AF5_TIM21) || ((AF) == GPIO_AF5_TIM22) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 390 | ((AF) == GPIO_AF6_I2C2) || ((AF) == GPIO_AF6_TIM21) || \ |
mbed_official | 181:a4cbdfbbd2f4 | 391 | ((AF) == GPIO_AF7_COMP2) || ((AF) == GPIO_AF7_COMP1)) |
mbed_official | 181:a4cbdfbbd2f4 | 392 | |
mbed_official | 181:a4cbdfbbd2f4 | 393 | |
mbed_official | 181:a4cbdfbbd2f4 | 394 | #endif /* STM32L051xx/STM32L061xx*/ |
mbed_official | 181:a4cbdfbbd2f4 | 395 | |
mbed_official | 181:a4cbdfbbd2f4 | 396 | /* Aliases define maintained for legacy */ |
mbed_official | 181:a4cbdfbbd2f4 | 397 | #define GPIO_AF0_EVENOUT GPIO_AF0_EVENTOUT |
mbed_official | 181:a4cbdfbbd2f4 | 398 | #define GPIO_AF2_EVENOUT GPIO_AF2_EVENTOUT |
mbed_official | 181:a4cbdfbbd2f4 | 399 | #define GPIO_AF3_EVENOUT GPIO_AF3_EVENTOUT |
mbed_official | 181:a4cbdfbbd2f4 | 400 | #define GPIO_AF6_EVENOUT GPIO_AF6_EVENTOUT |
mbed_official | 181:a4cbdfbbd2f4 | 401 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 402 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 403 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 404 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 405 | |
mbed_official | 181:a4cbdfbbd2f4 | 406 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 407 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 408 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 409 | |
mbed_official | 181:a4cbdfbbd2f4 | 410 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 411 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 412 | |
mbed_official | 181:a4cbdfbbd2f4 | 413 | |
mbed_official | 181:a4cbdfbbd2f4 | 414 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 415 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 416 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 417 | |
mbed_official | 181:a4cbdfbbd2f4 | 418 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 419 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 420 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 421 | |
mbed_official | 181:a4cbdfbbd2f4 | 422 | #ifdef __cplusplus |
mbed_official | 181:a4cbdfbbd2f4 | 423 | } |
mbed_official | 181:a4cbdfbbd2f4 | 424 | #endif |
mbed_official | 181:a4cbdfbbd2f4 | 425 | |
mbed_official | 181:a4cbdfbbd2f4 | 426 | #endif /* __STM32L0xx_HAL_GPIO_EX_H */ |
mbed_official | 181:a4cbdfbbd2f4 | 427 | |
mbed_official | 181:a4cbdfbbd2f4 | 428 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |