meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 17 14:27:45 2015 +0000
Revision:
96:487b796308b0
Parent:
92:4fc01daae5a5
Release 96 of the mbed library

Changes:
- IAR support for ble boards, lpc, ethernet stack
- RTC - attach function to redirect time functions
- Nucleo F103RB - cube driver
- k20xx - fixes for teensy and k20 platforms in sleep/deepsleep and usb
- STM32L0, Nucleo/Disco L053 - refactoring

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 84:0b3ab51c8877 1 /**
bogdanm 84:0b3ab51c8877 2 ******************************************************************************
bogdanm 84:0b3ab51c8877 3 * @file stm32l0xx_hal_gpio_ex.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
Kojto 96:487b796308b0 5 * @version V1.2.0
Kojto 96:487b796308b0 6 * @date 06-February-2015
bogdanm 84:0b3ab51c8877 7 * @brief Header file of GPIO HAL Extension module.
bogdanm 84:0b3ab51c8877 8 ******************************************************************************
bogdanm 84:0b3ab51c8877 9 * @attention
bogdanm 84:0b3ab51c8877 10 *
Kojto 96:487b796308b0 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 12 *
bogdanm 84:0b3ab51c8877 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 14 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 16 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 19 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 21 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 22 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 23 *
bogdanm 84:0b3ab51c8877 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 34 *
bogdanm 84:0b3ab51c8877 35 ******************************************************************************
bogdanm 84:0b3ab51c8877 36 */
bogdanm 84:0b3ab51c8877 37
bogdanm 84:0b3ab51c8877 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 84:0b3ab51c8877 39 #ifndef __STM32L0xx_HAL_GPIO_EX_H
bogdanm 84:0b3ab51c8877 40 #define __STM32L0xx_HAL_GPIO_EX_H
bogdanm 84:0b3ab51c8877 41
bogdanm 84:0b3ab51c8877 42 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 43 extern "C" {
bogdanm 84:0b3ab51c8877 44 #endif
bogdanm 84:0b3ab51c8877 45
bogdanm 84:0b3ab51c8877 46 /* Includes ------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 47 #include "stm32l0xx_hal_def.h"
bogdanm 84:0b3ab51c8877 48
bogdanm 84:0b3ab51c8877 49 /** @addtogroup STM32L0xx_HAL_Driver
bogdanm 84:0b3ab51c8877 50 * @{
bogdanm 84:0b3ab51c8877 51 */
bogdanm 84:0b3ab51c8877 52
Kojto 96:487b796308b0 53 /** @defgroup GPIOEx GPIOx
bogdanm 84:0b3ab51c8877 54 * @{
Kojto 96:487b796308b0 55 */
bogdanm 84:0b3ab51c8877 56
bogdanm 84:0b3ab51c8877 57 /* Exported types ------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 58
bogdanm 84:0b3ab51c8877 59 /* Exported constants --------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 60
Kojto 96:487b796308b0 61 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
bogdanm 84:0b3ab51c8877 62 * @{
bogdanm 84:0b3ab51c8877 63 */
bogdanm 84:0b3ab51c8877 64
Kojto 96:487b796308b0 65
Kojto 96:487b796308b0 66 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 67 /*------------------------- STM32L083xx/STM32L073xx---------------------------*/
Kojto 96:487b796308b0 68 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 69
Kojto 96:487b796308b0 70 #if defined (STM32L083xx) || defined (STM32L073xx)
Kojto 96:487b796308b0 71
Kojto 96:487b796308b0 72 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 73 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 74 *
Kojto 96:487b796308b0 75 */
Kojto 96:487b796308b0 76
Kojto 96:487b796308b0 77 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 78 *______________________________________________________________________________
Kojto 96:487b796308b0 79 * PA0 | | |TIM2_C1 |TSC |USART2 |TIM2_TR |USART4 |COMP1 |
Kojto 96:487b796308b0 80 * PA1 |EVENTOUT|LCD |TIM2_C2 |TSC |USART2 |TIM21_TR|USART4 | |
Kojto 96:487b796308b0 81 * PA2 |TIM21_C1|LCD |TIM2_C3 |TSC |USART2 | |LPUART1 |COMP2 |
Kojto 96:487b796308b0 82 * PA3 |TIM21_C2|LCD |TIM2_C4 |TSC |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 83 * PA4 |SPI1 | | |TSC |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 84 * PA5 |SPI1 | |TIM2_TR |TSC | |TIM2_C1 | | |
Kojto 96:487b796308b0 85 * PA6 |SPI1 |LCD |TIM3_C1 |TSC |LPUART1 |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 86 * PA7 |SPI1 |LCD |TIM3_C2 |TSC | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 87 * PA8 |MCO |LCD |USB |EVENTOUT|USART1 | | |I2C3 |
Kojto 96:487b796308b0 88 * PA9 |MCO |LCD | |TSC |USART1 | |I2C1 |I2C3 |
Kojto 96:487b796308b0 89 * PA10| |LCD | |TSC |USART1 | |I2C1 | |
Kojto 96:487b796308b0 90 * PA11|SPI1 | |EVENTOUT|TSC |USART1 | |I2C2 |COMP1 |
Kojto 96:487b796308b0 91 * PA12|SPI1 | |EVENTOUT|TSC |USART1 | |I2C2 |COMP2 |
Kojto 96:487b796308b0 92 * PA13|SWDIO | |USB | | | |LPUART1 | |
Kojto 96:487b796308b0 93 * PA14|SWCLK | | | |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 94 * PA15|SPI1 |LCD |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 |USART4 | |
Kojto 96:487b796308b0 95 *______________________________________________________________________________
Kojto 96:487b796308b0 96 * PB0 |EVENTOUT|LCD |TIM3_C3 |TSC | | | | |
Kojto 96:487b796308b0 97 * PB1 | |LCD |TIM3_C4 |TSC |LPUART1 | | | |
Kojto 96:487b796308b0 98 * PB2 | | |LPTIM1_O|TSC | | | |I2C3 |
Kojto 96:487b796308b0 99 * PB3 |SPI1 |LCD |TIM2_C2 |TSC |EVENTOUT|USART1 |USART5 | |
Kojto 96:487b796308b0 100 * PB4 |SPI1 |LCD |TIM3_C1 |TSC |TIM22_C1|USART1 |USART5 |I2C3 |
Kojto 96:487b796308b0 101 * PB5 |SPI1 |LCD |LPTIM1_I|I2C1 |TIM3_C2 |USART1 |USART5 | |
Kojto 96:487b796308b0 102 * | | | | |TIM22_C2| | | |
Kojto 96:487b796308b0 103 * PB6 |USART1 |I2C1 |LPTIM1_T|TSC | | | | |
Kojto 96:487b796308b0 104 * PB7 |USART1 |I2C1 |LPTIM1_I|TSC | | |USART4 | |
Kojto 96:487b796308b0 105 * PB8 | |LCD | |TSC |I2C1 | | | |
Kojto 96:487b796308b0 106 * PB9 | |LCD |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 107 * PB10| |LCD |TIM2_C3 |TSC |LPUART1 |SPI2 |I2C2 |LPUART1 |
Kojto 96:487b796308b0 108 * PB11|EVENTOUT|LCD |TIM2_C4 |TSC |LPUART1 | |I2C2 |LPUART1 |
Kojto 96:487b796308b0 109 * PB12|SPI2 |LCD |LPUART1 |TSC | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 110 * PB13|SPI2 |LCD |MCO |TSC |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 111 * PB14|SPI2 |LCD |RTC |TSC |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 112 * PB15|SPI2 |LCD |RTC | | | | | |
Kojto 96:487b796308b0 113 *______________________________________________________________________________
Kojto 96:487b796308b0 114 * PC0 |LPTIM1_I|LCD |EVENTOUT|TSC | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 115 * PC1 |LPTIM1_O|LCD |EVENTOUT|TSC | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 116 * PC2 |LPTIM1_I|LCD |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 117 * PC3 |LPTIM1_T|LCD |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 118 * PC4 |EVENTOUT|LCD |LPUART1 | | | | | |
Kojto 96:487b796308b0 119 * PC5 | |LCD |LPUART1 |TSC | | | | |
Kojto 96:487b796308b0 120 * PC6 |TIM22_C1|LCD |TIM3_C1 |TSC | | | | |
Kojto 96:487b796308b0 121 * PC7 |TIM22_C2|LCD |TIM3_C2 |TSC | | | | |
Kojto 96:487b796308b0 122 * PC8 |TIM22_TR|LCD |TIM3_C3 |TSC | | | | |
Kojto 96:487b796308b0 123 * PC9 |TIM21_TR|LCD |USB |TSC | | | |I2C3 |
Kojto 96:487b796308b0 124 * | | |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 125 * PC10|LPUART1 |LCD | | | | |USART4 | |
Kojto 96:487b796308b0 126 * PC11|LPUART1 |LCD | | | | |USART4 | |
Kojto 96:487b796308b0 127 * PC12| |LCD |USART5 | | | |USART4 | |
Kojto 96:487b796308b0 128 * PC13| | | | | | | | |
Kojto 96:487b796308b0 129 * PC14| | | | | | | | |
Kojto 96:487b796308b0 130 * PC15| | | | | | | | |
Kojto 96:487b796308b0 131 *______________________________________________________________________________
Kojto 96:487b796308b0 132 * PD0 |TIM21_C1|SPI2 | | | | | | |
Kojto 96:487b796308b0 133 * PD1 | |SPI2 | | | | | | |
Kojto 96:487b796308b0 134 * PD2 |LPUART1 |LCD |TIM3_TR | | | |USART5 | |
Kojto 96:487b796308b0 135 * PD3 |USART2 |LCD |SPI2 | | | | | |
Kojto 96:487b796308b0 136 * PD4 |USART2 |SPI2 | | | | | | |
Kojto 96:487b796308b0 137 * PD5 |USART2 | | | | | | | |
Kojto 96:487b796308b0 138 * PD6 |USART2 | | | | | | | |
Kojto 96:487b796308b0 139 * PD7 |USART2 |TIM21_C2| | | | | | |
Kojto 96:487b796308b0 140 * PD8 |LPUART1 |LCD | | | | | | |
Kojto 96:487b796308b0 141 * PD9 |LPUART1 |LCD | | | | | | |
Kojto 96:487b796308b0 142 * PD10| |LCD | | | | | | |
Kojto 96:487b796308b0 143 * PD11|LPUART1 |LCD | | | | | | |
Kojto 96:487b796308b0 144 * PD12|LPUART1 |LCD | | | | | | |
Kojto 96:487b796308b0 145 * PD13| |LCD | | | | | | |
Kojto 96:487b796308b0 146 * PD14| |LCD | | | | | | |
Kojto 96:487b796308b0 147 * PD15|USB |LCD | | | | | | |
Kojto 96:487b796308b0 148 *______________________________________________________________________________
Kojto 96:487b796308b0 149 * PE0 | |LCD |EVENTOUT| | | | | |
Kojto 96:487b796308b0 150 * PE1 | |LCD |EVENTOUT| | | | | |
Kojto 96:487b796308b0 151 * PE2 | |LCD |TIM3_TR | | | | | |
Kojto 96:487b796308b0 152 * PE3 |TIM22_C1|LCD |TIM3_C1 | | | | | |
Kojto 96:487b796308b0 153 * PE4 |TIM22_C2| |TIM3_C2 | | | | | |
Kojto 96:487b796308b0 154 * PE5 |TIM21_C1| |TIM3_C3 | | | | | |
Kojto 96:487b796308b0 155 * PE6 |TIM21_C2| |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 156 * PE7 | |LCD | | | | |USART5 | |
Kojto 96:487b796308b0 157 * PE8 | |LCD | | | | |USART4 | |
Kojto 96:487b796308b0 158 * PE9 |TIM2_C1 |LCD |TIM2_TR | | | |USART4 | |
Kojto 96:487b796308b0 159 * PE10|TIM2_C2 |LCD | | | | |USART5 | |
Kojto 96:487b796308b0 160 * PE11|TIM2_C3 | | | | | |USART5 | |
Kojto 96:487b796308b0 161 * PE12|TIM2_C4 | |SPI1 | | | | | |
Kojto 96:487b796308b0 162 * PE13| |LCD |SPI1 | | | | | |
Kojto 96:487b796308b0 163 * PE14| |LCD |SPI1 | | | | | |
Kojto 96:487b796308b0 164 * PE15| |LCD |SPI1 | | | | | |
Kojto 96:487b796308b0 165 *______________________________________________________________________________
Kojto 96:487b796308b0 166 * PH0 |USB | | | | | | | |
Kojto 96:487b796308b0 167 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 168 * PH9 | | | | | | | | |
Kojto 96:487b796308b0 169 * PH10| | | | | | | | |
Kojto 96:487b796308b0 170 *
Kojto 96:487b796308b0 171 */
Kojto 96:487b796308b0 172
Kojto 96:487b796308b0 173 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 174 * @{
Kojto 96:487b796308b0 175 */
Kojto 96:487b796308b0 176
Kojto 96:487b796308b0 177 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 178 * @{
Kojto 96:487b796308b0 179 */
Kojto 96:487b796308b0 180 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 181 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 182 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 183 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 184 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 185 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 186 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 187 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 188 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 189 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 190 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 191 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 192 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 193 #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 194 /**
Kojto 96:487b796308b0 195 * @}
Kojto 96:487b796308b0 196 */
Kojto 96:487b796308b0 197
Kojto 96:487b796308b0 198 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 199 * @{
Kojto 96:487b796308b0 200 */
Kojto 96:487b796308b0 201 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 202 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 203 #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 204 #define GPIO_AF1_LCD ((uint8_t)0x01) /* LCD Alternate Function mapping */
Kojto 96:487b796308b0 205 /**
Kojto 96:487b796308b0 206 * @}
Kojto 96:487b796308b0 207 */
Kojto 96:487b796308b0 208
Kojto 96:487b796308b0 209 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 210 * @{
Kojto 96:487b796308b0 211 */
Kojto 96:487b796308b0 212 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 213 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 214 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 215 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 216 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 217 #define GPIO_AF2_MCO ((uint8_t)0x02) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 218 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 219 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 220 #define GPIO_AF2_USART5 ((uint8_t)0x02) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 221 #define GPIO_AF2_SPI1 ((uint8_t)0x02) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 222 #define GPIO_AF2_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 223 /**
Kojto 96:487b796308b0 224 * @}
Kojto 96:487b796308b0 225 */
Kojto 96:487b796308b0 226
Kojto 96:487b796308b0 227 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 228 * @{
Kojto 96:487b796308b0 229 */
Kojto 96:487b796308b0 230 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 231 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 232 #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */
Kojto 96:487b796308b0 233 /**
Kojto 96:487b796308b0 234 * @}
Kojto 96:487b796308b0 235 */
Kojto 96:487b796308b0 236
Kojto 96:487b796308b0 237 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 238 * @{
Kojto 96:487b796308b0 239 */
Kojto 96:487b796308b0 240 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 241 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 242 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 243 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping*/
Kojto 96:487b796308b0 244 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 245 #define GPIO_AF4_TIM3 ((uint8_t)0x04) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 246 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 247 /**
Kojto 96:487b796308b0 248 * @}
Kojto 96:487b796308b0 249 */
Kojto 96:487b796308b0 250
Kojto 96:487b796308b0 251 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 252 * @{
Kojto 96:487b796308b0 253 */
Kojto 96:487b796308b0 254 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 255 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 256 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 257 #define GPIO_AF5_USART1 ((uint8_t)0x05) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 258 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 259 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 260 /**
Kojto 96:487b796308b0 261 * @}
Kojto 96:487b796308b0 262 */
Kojto 96:487b796308b0 263
Kojto 96:487b796308b0 264 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 265 * @{
Kojto 96:487b796308b0 266 */
Kojto 96:487b796308b0 267
Kojto 96:487b796308b0 268 #define GPIO_AF6_USART4 ((uint8_t)0x06) /* USART4 Alternate Function mapping */
Kojto 96:487b796308b0 269 #define GPIO_AF6_LPUART1 ((uint8_t)0x06) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 270 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 271 #define GPIO_AF6_I2C1 ((uint8_t)0x06) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 272 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 273 #define GPIO_AF6_USART5 ((uint8_t)0x06) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 274 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 275 /**
Kojto 96:487b796308b0 276 * @}
Kojto 96:487b796308b0 277 */
Kojto 96:487b796308b0 278
Kojto 96:487b796308b0 279 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 280 * @{
Kojto 96:487b796308b0 281 */
Kojto 96:487b796308b0 282 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
Kojto 96:487b796308b0 283 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 284 #define GPIO_AF7_I2C3 ((uint8_t)0x07) /* I2C3 Alternate Function mapping */
Kojto 96:487b796308b0 285 #define GPIO_AF7_LPUART1 ((uint8_t)0x07) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 286 /**
Kojto 96:487b796308b0 287 * @}
Kojto 96:487b796308b0 288 */
Kojto 96:487b796308b0 289
Kojto 96:487b796308b0 290 /**
Kojto 96:487b796308b0 291 * @}
Kojto 96:487b796308b0 292 */
Kojto 96:487b796308b0 293
Kojto 96:487b796308b0 294 /**
Kojto 96:487b796308b0 295 * @brief IS_GPIO_AF macro definition
Kojto 96:487b796308b0 296 */
Kojto 96:487b796308b0 297 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 298 ((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 299 ((__AF__) == GPIO_AF0_TIM21) || ((__AF__) == GPIO_AF1_SPI2) || \
Kojto 96:487b796308b0 300 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF1_TIM21) || \
Kojto 96:487b796308b0 301 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 302 ((__AF__) == GPIO_AF0_SWCLK) || ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 303 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF2_USB) || \
Kojto 96:487b796308b0 304 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 305 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 306 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 307 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_MCO) || \
Kojto 96:487b796308b0 308 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_RTC) || \
Kojto 96:487b796308b0 309 ((__AF__) == GPIO_AF0_USB) || ((__AF__) == GPIO_AF2_SPI2) || \
Kojto 96:487b796308b0 310 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_USART5) || \
Kojto 96:487b796308b0 311 ((__AF__) == GPIO_AF3_TSC) || ((__AF__) == GPIO_AF2_SPI1) || \
Kojto 96:487b796308b0 312 ((__AF__) == GPIO_AF3_EVENTOUT) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 313 ((__AF__) == GPIO_AF3_I2C1) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 314 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 315 ((__AF__) == GPIO_AF5_TIM2) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 316 ((__AF__) == GPIO_AF5_USART1) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 317 ((__AF__) == GPIO_AF5_TIM22) || ((__AF__) == GPIO_AF4_TIM3) || \
Kojto 96:487b796308b0 318 ((__AF__) == GPIO_AF5_SPI2) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 319 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 320 ((__AF__) == GPIO_AF7_COMP2) || ((__AF__) == GPIO_AF6_LPUART1) || \
Kojto 96:487b796308b0 321 ((__AF__) == GPIO_AF7_COMP1) || ((__AF__) == GPIO_AF6_I2C1) || \
Kojto 96:487b796308b0 322 ((__AF__) == GPIO_AF7_I2C3) || ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 323 ((__AF__) == GPIO_AF7_LPUART1) || ((__AF__) == GPIO_AF6_I2C2) || \
Kojto 96:487b796308b0 324 ((__AF__) == GPIO_AF6_USART5) || ((__AF__) == GPIO_AF6_TIM21))
Kojto 96:487b796308b0 325
Kojto 96:487b796308b0 326
Kojto 96:487b796308b0 327 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 328 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 329 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 330 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 331 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 332 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 333 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 334 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 335 ((__AF__) == GPIO_AF7_I2C3))) || \
Kojto 96:487b796308b0 336 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 337 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 338 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 339 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 340 ((__AF__) == GPIO_AF4_TIM3) || \
Kojto 96:487b796308b0 341 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 342 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 343 ((__AF__) == GPIO_AF7_LPUART1))) || \
Kojto 96:487b796308b0 344 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_LPTIM1) || \
Kojto 96:487b796308b0 345 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 346 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 347 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 348 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 349 ((__AF__) == GPIO_AF7_I2C3))) || \
Kojto 96:487b796308b0 350 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_LPUART1) || \
Kojto 96:487b796308b0 351 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 352 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 353 ((__AF__) == GPIO_AF6_USART5))) || \
Kojto 96:487b796308b0 354 (((__INSTANCE__) == GPIOE) && (((__AF__) == GPIO_AF0_TIM22) || \
Kojto 96:487b796308b0 355 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 356 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 357 ((__AF__) == GPIO_AF6_USART4))) || \
Kojto 96:487b796308b0 358 (((__INSTANCE__) == GPIOH) && (((__AF__) == GPIO_AF0_USB))))
Kojto 96:487b796308b0 359
Kojto 96:487b796308b0 360 #endif /* (STM32L083xx) || (STM32L073xx) */
Kojto 96:487b796308b0 361
Kojto 96:487b796308b0 362 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 363 /*------------------------- STM32L082xx and STM32L072xx-----------------------*/
Kojto 96:487b796308b0 364 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 365 #if defined (STM32L082xx) || defined (STM32L072xx)
Kojto 96:487b796308b0 366
Kojto 96:487b796308b0 367 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 368 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 369 */
Kojto 96:487b796308b0 370
Kojto 96:487b796308b0 371
Kojto 96:487b796308b0 372 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 373 *______________________________________________________________________________
Kojto 96:487b796308b0 374 * PA0 | | |TIM2_C1 |TSC |USART2 |TIM2_TR |USART4 |COMP1 |
Kojto 96:487b796308b0 375 * PA1 |EVENTOUT| |TIM2_C2 |TSC |USART2 |TIM21_TR|USART4 | |
Kojto 96:487b796308b0 376 * PA2 |TIM21_C1| |TIM2_C3 |TSC |USART2 | |LPUART1 |COMP2 |
Kojto 96:487b796308b0 377 * PA3 |TIM21_C2| |TIM2_C4 |TSC |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 378 * PA4 |SPI1 | | |TSC |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 379 * PA5 |SPI1 | |TIM2_TR |TSC | |TIM2_C1 | | |
Kojto 96:487b796308b0 380 * PA6 |SPI1 | |TIM3_C1 |TSC |LPUART1 |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 381 * PA7 |SPI1 | |TIM3_C2 |TSC | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 382 * PA8 |MCO | |USB |EVENTOUT|USART1 | | |I2C3 |
Kojto 96:487b796308b0 383 * PA9 |MCO | | |TSC |USART1 | |I2C1 |I2C3 |
Kojto 96:487b796308b0 384 * PA10| | | |TSC |USART1 | |I2C1 | |
Kojto 96:487b796308b0 385 * PA11|SPI1 | |EVENTOUT|TSC |USART1 | |I2C2 |COMP1 |
Kojto 96:487b796308b0 386 * PA12|SPI1 | |EVENTOUT|TSC |USART1 | |I2C2 |COMP2 |
Kojto 96:487b796308b0 387 * PA13|SWDIO | |USB | | | |LPUART1 | |
Kojto 96:487b796308b0 388 * PA14|SWCLK | | | |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 389 * PA15|SPI1 | |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 |USART4 | |
Kojto 96:487b796308b0 390 *______________________________________________________________________________
Kojto 96:487b796308b0 391 * PB0 |EVENTOUT| |TIM3_C3 |TSC | | | | |
Kojto 96:487b796308b0 392 * PB1 | | |TIM3_C4 |TSC |LPUART1 | | | |
Kojto 96:487b796308b0 393 * PB2 | | |LPTIM1_O|TSC | | | |I2C3 |
Kojto 96:487b796308b0 394 * PB3 |SPI1 | |TIM2_C2 |TSC |EVENTOUT|USART1 |USART5 | |
Kojto 96:487b796308b0 395 * PB4 |SPI1 | |TIM3_C1 |TSC |TIM22_C1|USART1 |USART5 |I2C3 |
Kojto 96:487b796308b0 396 * PB5 |SPI1 | |LPTIM1_I|I2C1 |TIM3_C2 |USART1 |USART5 | |
Kojto 96:487b796308b0 397 * | | | | |TIM22_C2| | | |
Kojto 96:487b796308b0 398 * PB6 |USART1 |I2C1 |LPTIM1_T|TSC | | | | |
Kojto 96:487b796308b0 399 * PB7 |USART1 |I2C1 |LPTIM1_I|TSC | | |USART4 | |
Kojto 96:487b796308b0 400 * PB8 | | | |TSC |I2C1 | | | |
Kojto 96:487b796308b0 401 * PB9 | | |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 402 * PB10| | |TIM2_C3 |TSC |LPUART1 |SPI2 |I2C2 |LPUART1 |
Kojto 96:487b796308b0 403 * PB11|EVENTOUT| |TIM2_C4 |TSC |LPUART1 | |I2C2 |LPUART1 |
Kojto 96:487b796308b0 404 * PB12|SPI2 | |LPUART1 |TSC | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 405 * PB13|SPI2 | |MCO |TSC |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 406 * PB14|SPI2 | |RTC |TSC |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 407 * PB15|SPI2 | |RTC | | | | | |
Kojto 96:487b796308b0 408 *______________________________________________________________________________
Kojto 96:487b796308b0 409 * PC0 |LPTIM1_I| |EVENTOUT|TSC | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 410 * PC1 |LPTIM1_O| |EVENTOUT|TSC | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 411 * PC2 |LPTIM1_I| |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 412 * PC3 |LPTIM1_T| |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 413 * PC4 |EVENTOUT| |LPUART1 | | | | | |
Kojto 96:487b796308b0 414 * PC5 | | |LPUART1 |TSC | | | | |
Kojto 96:487b796308b0 415 * PC6 |TIM22_C1| |TIM3_C1 |TSC | | | | |
Kojto 96:487b796308b0 416 * PC7 |TIM22_C2| |TIM3_C2 |TSC | | | | |
Kojto 96:487b796308b0 417 * PC8 |TIM22_TR| |TIM3_C3 |TSC | | | | |
Kojto 96:487b796308b0 418 * PC9 |TIM21_TR| |USB |TSC | | | |I2C3 |
Kojto 96:487b796308b0 419 * | | |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 420 * PC10|LPUART1 | | | | | |USART4 | |
Kojto 96:487b796308b0 421 * PC11|LPUART1 | | | | | |USART4 | |
Kojto 96:487b796308b0 422 * PC12| | |USART5 | | | |USART4 | |
Kojto 96:487b796308b0 423 * PC13| | | | | | | | |
Kojto 96:487b796308b0 424 * PC14| | | | | | | | |
Kojto 96:487b796308b0 425 * PC15| | | | | | | | |
Kojto 96:487b796308b0 426 *______________________________________________________________________________
Kojto 96:487b796308b0 427 * PD0 |TIM21_C1|SPI2 | | | | | | |
Kojto 96:487b796308b0 428 * PD1 | |SPI2 | | | | | | |
Kojto 96:487b796308b0 429 * PD2 |LPUART1 | |TIM3_TR | | | |USART5 | |
Kojto 96:487b796308b0 430 * PD3 |USART2 | |SPI2 | | | | | |
Kojto 96:487b796308b0 431 * PD4 |USART2 |SPI2 | | | | | | |
Kojto 96:487b796308b0 432 * PD5 |USART2 | | | | | | | |
Kojto 96:487b796308b0 433 * PD6 |USART2 | | | | | | | |
Kojto 96:487b796308b0 434 * PD7 |USART2 |TIM21_C2| | | | | | |
Kojto 96:487b796308b0 435 * PD8 |LPUART1 | | | | | | | |
Kojto 96:487b796308b0 436 * PD9 |LPUART1 | | | | | | | |
Kojto 96:487b796308b0 437 * PD10| | | | | | | | |
Kojto 96:487b796308b0 438 * PD11|LPUART1 | | | | | | | |
Kojto 96:487b796308b0 439 * PD12|LPUART1 | | | | | | | |
Kojto 96:487b796308b0 440 * PD13| | | | | | | | |
Kojto 96:487b796308b0 441 * PD14| | | | | | | | |
Kojto 96:487b796308b0 442 * PD15|USB | | | | | | | |
Kojto 96:487b796308b0 443 *______________________________________________________________________________
Kojto 96:487b796308b0 444 * PE0 | | |EVENTOUT| | | | | |
Kojto 96:487b796308b0 445 * PE1 | | |EVENTOUT| | | | | |
Kojto 96:487b796308b0 446 * PE2 | | |TIM3_TR | | | | | |
Kojto 96:487b796308b0 447 * PE3 |TIM22_C1| |TIM3_C1 | | | | | |
Kojto 96:487b796308b0 448 * PE4 |TIM22_C2| |TIM3_C2 | | | | | |
Kojto 96:487b796308b0 449 * PE5 |TIM21_C1| |TIM3_C3 | | | | | |
Kojto 96:487b796308b0 450 * PE6 |TIM21_C2| |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 451 * PE7 | | | | | | |USART5 | |
Kojto 96:487b796308b0 452 * PE8 | | | | | | |USART4 | |
Kojto 96:487b796308b0 453 * PE9 |TIM2_C1 | |TIM2_TR | | | |USART4 | |
Kojto 96:487b796308b0 454 * PE10|TIM2_C2 | | | | | |USART5 | |
Kojto 96:487b796308b0 455 * PE11|TIM2_C3 | | | | | |USART5 | |
Kojto 96:487b796308b0 456 * PE12|TIM2_C4 | |SPI1 | | | | | |
Kojto 96:487b796308b0 457 * PE13| | |SPI1 | | | | | |
Kojto 96:487b796308b0 458 * PE14| | |SPI1 | | | | | |
Kojto 96:487b796308b0 459 * PE15| | |SPI1 | | | | | |
Kojto 96:487b796308b0 460 *______________________________________________________________________________
Kojto 96:487b796308b0 461 * PH0 |USB | | | | | | | |
Kojto 96:487b796308b0 462 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 463 * PH9 | | | | | | | | |
Kojto 96:487b796308b0 464 * PH10| | | | | | | | |
Kojto 96:487b796308b0 465 *
Kojto 96:487b796308b0 466 */
Kojto 96:487b796308b0 467
Kojto 96:487b796308b0 468 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 469 * @{
Kojto 96:487b796308b0 470 */
Kojto 96:487b796308b0 471
Kojto 96:487b796308b0 472 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 473 * @{
Kojto 96:487b796308b0 474 */
Kojto 96:487b796308b0 475 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 476 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 477 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 478 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 479 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 480 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 481 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 482 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 483 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 484 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 485 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 486 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 487 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 488 #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 489 /**
Kojto 96:487b796308b0 490 * @}
Kojto 96:487b796308b0 491 */
Kojto 96:487b796308b0 492
Kojto 96:487b796308b0 493 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 494 * @{
Kojto 96:487b796308b0 495 */
Kojto 96:487b796308b0 496 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 497 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 498 #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 499 /**
Kojto 96:487b796308b0 500 * @}
Kojto 96:487b796308b0 501 */
Kojto 96:487b796308b0 502
Kojto 96:487b796308b0 503 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 504 * @{
Kojto 96:487b796308b0 505 */
Kojto 96:487b796308b0 506 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 507 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 508 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 509 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 510 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 511 #define GPIO_AF2_MCO ((uint8_t)0x02) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 512 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 513 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 514 #define GPIO_AF2_USART5 ((uint8_t)0x02) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 515 #define GPIO_AF2_SPI1 ((uint8_t)0x02) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 516 #define GPIO_AF2_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 517 /**
Kojto 96:487b796308b0 518 * @}
Kojto 96:487b796308b0 519 */
Kojto 96:487b796308b0 520
Kojto 96:487b796308b0 521 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 522 * @{
Kojto 96:487b796308b0 523 */
Kojto 96:487b796308b0 524 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 525 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 526 #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */
Kojto 96:487b796308b0 527 /**
Kojto 96:487b796308b0 528 * @}
bogdanm 84:0b3ab51c8877 529 */
Kojto 96:487b796308b0 530
Kojto 96:487b796308b0 531 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 532 * @{
Kojto 96:487b796308b0 533 */
Kojto 96:487b796308b0 534 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 535 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 536 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 537 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 538 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 539 #define GPIO_AF4_TIM3 ((uint8_t)0x04) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 540 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 541 /**
Kojto 96:487b796308b0 542 * @}
Kojto 96:487b796308b0 543 */
Kojto 96:487b796308b0 544
Kojto 96:487b796308b0 545 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 546 * @{
Kojto 96:487b796308b0 547 */
Kojto 96:487b796308b0 548 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 549 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 550 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 551 #define GPIO_AF5_USART1 ((uint8_t)0x05) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 552 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 553 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 554 /**
Kojto 96:487b796308b0 555 * @}
Kojto 96:487b796308b0 556 */
Kojto 96:487b796308b0 557
Kojto 96:487b796308b0 558 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 559 * @{
Kojto 96:487b796308b0 560 */
Kojto 96:487b796308b0 561 #define GPIO_AF6_USART4 ((uint8_t)0x06) /* USART4 Alternate Function mapping */
Kojto 96:487b796308b0 562 #define GPIO_AF6_LPUART1 ((uint8_t)0x06) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 563 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 564 #define GPIO_AF6_I2C1 ((uint8_t)0x06) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 565 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 566 #define GPIO_AF6_USART5 ((uint8_t)0x06) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 567 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 568 /**
Kojto 96:487b796308b0 569 * @}
Kojto 96:487b796308b0 570 */
Kojto 96:487b796308b0 571
Kojto 96:487b796308b0 572 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 573 * @{
Kojto 96:487b796308b0 574 */
Kojto 96:487b796308b0 575 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
Kojto 96:487b796308b0 576 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 577 #define GPIO_AF7_I2C3 ((uint8_t)0x07) /* I2C3 Alternate Function mapping */
Kojto 96:487b796308b0 578 #define GPIO_AF7_LPUART1 ((uint8_t)0x07) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 579 /**
Kojto 96:487b796308b0 580 * @}
Kojto 96:487b796308b0 581 */
Kojto 96:487b796308b0 582
Kojto 96:487b796308b0 583 /**
Kojto 96:487b796308b0 584 * @}
Kojto 96:487b796308b0 585 */
Kojto 96:487b796308b0 586
Kojto 96:487b796308b0 587 /**
Kojto 96:487b796308b0 588 * IS_GPIO_AF macro definition
Kojto 96:487b796308b0 589 */
Kojto 96:487b796308b0 590 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF6_TIM21) || \
Kojto 96:487b796308b0 591 ((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 592 ((__AF__) == GPIO_AF0_TIM21) || ((__AF__) == GPIO_AF1_SPI2) || \
Kojto 96:487b796308b0 593 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF1_TIM21) || \
Kojto 96:487b796308b0 594 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 595 ((__AF__) == GPIO_AF0_SWCLK) || ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 596 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF2_USB) || \
Kojto 96:487b796308b0 597 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 598 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 599 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 600 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_MCO) || \
Kojto 96:487b796308b0 601 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_RTC) || \
Kojto 96:487b796308b0 602 ((__AF__) == GPIO_AF0_USB) || ((__AF__) == GPIO_AF2_SPI2) || \
Kojto 96:487b796308b0 603 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_USART5) || \
Kojto 96:487b796308b0 604 ((__AF__) == GPIO_AF3_TSC) || ((__AF__) == GPIO_AF2_SPI1) || \
Kojto 96:487b796308b0 605 ((__AF__) == GPIO_AF3_EVENTOUT) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 606 ((__AF__) == GPIO_AF3_I2C1) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 607 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 608 ((__AF__) == GPIO_AF5_TIM2) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 609 ((__AF__) == GPIO_AF5_USART1) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 610 ((__AF__) == GPIO_AF5_TIM22) || ((__AF__) == GPIO_AF4_TIM3) || \
Kojto 96:487b796308b0 611 ((__AF__) == GPIO_AF5_SPI2) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 612 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 613 ((__AF__) == GPIO_AF7_COMP2) || ((__AF__) == GPIO_AF6_LPUART1) || \
Kojto 96:487b796308b0 614 ((__AF__) == GPIO_AF7_COMP1) || ((__AF__) == GPIO_AF6_I2C1) || \
Kojto 96:487b796308b0 615 ((__AF__) == GPIO_AF7_I2C3) || ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 616 ((__AF__) == GPIO_AF7_LPUART1) || ((__AF__) == GPIO_AF6_I2C2) || \
Kojto 96:487b796308b0 617 ((__AF__) == GPIO_AF6_USART5))
Kojto 96:487b796308b0 618
Kojto 96:487b796308b0 619 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 620 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 621 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 622 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 623 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 624 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 625 ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 626 ((__AF__) == GPIO_AF7_COMP1))) || \
Kojto 96:487b796308b0 627 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 628 ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 629 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 630 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 631 ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 632 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 633 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 634 ((__AF__) == GPIO_AF7_LPUART1))) || \
Kojto 96:487b796308b0 635 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_TIM22) || \
Kojto 96:487b796308b0 636 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 637 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 638 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 639 ((__AF__) == GPIO_AF7_I2C3))) || \
Kojto 96:487b796308b0 640 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_TIM21) || \
Kojto 96:487b796308b0 641 ((__AF__) == GPIO_AF1_TIM21) || \
Kojto 96:487b796308b0 642 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 643 ((__AF__) == GPIO_AF6_USART5))) || \
Kojto 96:487b796308b0 644 (((__INSTANCE__) == GPIOE) && (((__AF__) == GPIO_AF0_TIM22) || \
Kojto 96:487b796308b0 645 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 646 ((__AF__) == GPIO_AF6_USART4))) || \
Kojto 96:487b796308b0 647 (((__INSTANCE__) == GPIOH) && (((__AF__) == GPIO_AF0_USB))))
Kojto 96:487b796308b0 648
Kojto 96:487b796308b0 649
Kojto 96:487b796308b0 650 #endif /* (STM32L082xx) || (STM32L072xx) */
Kojto 96:487b796308b0 651
Kojto 96:487b796308b0 652
Kojto 96:487b796308b0 653 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 654 /*------------------------- STM32L081xx and STM32L071xx-----------------------*/
Kojto 96:487b796308b0 655 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 656 #if defined (STM32L081xx) || defined (STM32L071xx)
Kojto 96:487b796308b0 657
Kojto 96:487b796308b0 658 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 659 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 660 *
Kojto 96:487b796308b0 661 */
Kojto 96:487b796308b0 662
Kojto 96:487b796308b0 663
Kojto 96:487b796308b0 664 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 665 *______________________________________________________________________________
Kojto 96:487b796308b0 666 * PA0 | | |TIM2_C1 | |USART2 |TIM2_TR |USART4 |COMP1 |
Kojto 96:487b796308b0 667 * PA1 |EVENTOUT| |TIM2_C2 | |USART2 |TIM21_TR|USART4 | |
Kojto 96:487b796308b0 668 * PA2 |TIM21_C1| |TIM2_C3 | |USART2 | |LPUART1 |COMP2 |
Kojto 96:487b796308b0 669 * PA3 |TIM21_C2| |TIM2_C4 | |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 670 * PA4 |SPI1 | | | |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 671 * PA5 |SPI1 | |TIM2_TR | | |TIM2_C1 | | |
Kojto 96:487b796308b0 672 * PA6 |SPI1 | |TIM3_C1 | |LPUART1 |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 673 * PA7 |SPI1 | |TIM3_C2 | | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 674 * PA8 |MCO | | |EVENTOUT|USART1 | | |I2C3 |
Kojto 96:487b796308b0 675 * PA9 |MCO | | | |USART1 | |I2C1 |I2C3 |
Kojto 96:487b796308b0 676 * PA10| | | | |USART1 | |I2C1 | |
Kojto 96:487b796308b0 677 * PA11|SPI1 | |EVENTOUT| |USART1 | |I2C2 |COMP1 |
Kojto 96:487b796308b0 678 * PA12|SPI1 | |EVENTOUT| |USART1 | |I2C2 |COMP2 |
Kojto 96:487b796308b0 679 * PA13|SWDIO | | | | | |LPUART1 | |
Kojto 96:487b796308b0 680 * PA14|SWCLK | | | |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 681 * PA15|SPI1 | |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 |USART4 | |
Kojto 96:487b796308b0 682 *______________________________________________________________________________
Kojto 96:487b796308b0 683 * PB0 |EVENTOUT| |TIM3_C3 | | | | | |
Kojto 96:487b796308b0 684 * PB1 | | |TIM3_C4 | |LPUART1 | | | |
Kojto 96:487b796308b0 685 * PB2 | | |LPTIM1_O| | | | |I2C3 |
Kojto 96:487b796308b0 686 * PB3 |SPI1 | |TIM2_C2 | |EVENTOUT|USART1 |USART5 | |
Kojto 96:487b796308b0 687 * PB4 |SPI1 | |TIM3_C1 | |TIM22_C1|USART1 |USART5 |I2C3 |
Kojto 96:487b796308b0 688 * PB5 |SPI1 | |LPTIM1_I|I2C1 |TIM3_C2 |USART1 |USART5 | |
Kojto 96:487b796308b0 689 * | | | | |TIM22_C2| | | |
Kojto 96:487b796308b0 690 * PB6 |USART1 |I2C1 |LPTIM1_T| | | | | |
Kojto 96:487b796308b0 691 * PB7 |USART1 |I2C1 |LPTIM1_I| | | |USART4 | |
Kojto 96:487b796308b0 692 * PB8 | | | | |I2C1 | | | |
Kojto 96:487b796308b0 693 * PB9 | | |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 694 * PB10| | |TIM2_C3 | |LPUART1 |SPI2 |I2C2 |LPUART1 |
Kojto 96:487b796308b0 695 * PB11|EVENTOUT| |TIM2_C4 | |LPUART1 | |I2C2 |LPUART1 |
Kojto 96:487b796308b0 696 * PB12|SPI2 | |LPUART1 | | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 697 * PB13|SPI2 | |MCO | |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 698 * PB14|SPI2 | |RTC | |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 699 * PB15|SPI2 | |RTC | | | | | |
Kojto 96:487b796308b0 700 *______________________________________________________________________________
Kojto 96:487b796308b0 701 * PC0 |LPTIM1_I| |EVENTOUT| | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 702 * PC1 |LPTIM1_O| |EVENTOUT| | | |LPUART1 |I2C3 |
Kojto 96:487b796308b0 703 * PC2 |LPTIM1_I| |SPI2 | | | | | |
Kojto 96:487b796308b0 704 * PC3 |LPTIM1_T| |SPI2 | | | | | |
Kojto 96:487b796308b0 705 * PC4 |EVENTOUT| |LPUART1 | | | | | |
Kojto 96:487b796308b0 706 * PC5 | | |LPUART1 | | | | | |
Kojto 96:487b796308b0 707 * PC6 |TIM22_C1| |TIM3_C1 | | | | | |
Kojto 96:487b796308b0 708 * PC7 |TIM22_C2| |TIM3_C2 | | | | | |
Kojto 96:487b796308b0 709 * PC8 |TIM22_TR| |TIM3_C3 | | | | | |
Kojto 96:487b796308b0 710 * PC9 |TIM21_TR| | | | | | |I2C3 |
Kojto 96:487b796308b0 711 * | | |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 712 * PC10|LPUART1 | | | | | |USART4 | |
Kojto 96:487b796308b0 713 * PC11|LPUART1 | | | | | |USART4 | |
Kojto 96:487b796308b0 714 * PC12| | |USART5 | | | |USART4 | |
Kojto 96:487b796308b0 715 * PC13| | | | | | | | |
Kojto 96:487b796308b0 716 * PC14| | | | | | | | |
Kojto 96:487b796308b0 717 * PC15| | | | | | | | |
Kojto 96:487b796308b0 718 *______________________________________________________________________________
Kojto 96:487b796308b0 719 * PD0 |TIM21_C1|SPI2 | | | | | | |
Kojto 96:487b796308b0 720 * PD1 | |SPI2 | | | | | | |
Kojto 96:487b796308b0 721 * PD2 |LPUART1 | |TIM3_TR | | | |USART5 | |
Kojto 96:487b796308b0 722 * PD3 |USART2 | |SPI2 | | | | | |
Kojto 96:487b796308b0 723 * PD4 |USART2 |SPI2 | | | | | | |
Kojto 96:487b796308b0 724 * PD5 |USART2 | | | | | | | |
Kojto 96:487b796308b0 725 * PD6 |USART2 | | | | | | | |
Kojto 96:487b796308b0 726 * PD7 |USART2 |TIM21_C2| | | | | | |
Kojto 96:487b796308b0 727 * PD8 |LPUART1 | | | | | | | |
Kojto 96:487b796308b0 728 * PD9 |LPUART1 | | | | | | | |
Kojto 96:487b796308b0 729 * PD10| | | | | | | | |
Kojto 96:487b796308b0 730 * PD11|LPUART1 | | | | | | | |
Kojto 96:487b796308b0 731 * PD12|LPUART1 | | | | | | | |
Kojto 96:487b796308b0 732 * PD13| | | | | | | | |
Kojto 96:487b796308b0 733 * PD14| | | | | | | | |
Kojto 96:487b796308b0 734 * PD15| | | | | | | | |
Kojto 96:487b796308b0 735 *______________________________________________________________________________
Kojto 96:487b796308b0 736 * PE0 | | |EVENTOUT| | | | | |
Kojto 96:487b796308b0 737 * PE1 | | |EVENTOUT| | | | | |
Kojto 96:487b796308b0 738 * PE2 | | |TIM3_TR | | | | | |
Kojto 96:487b796308b0 739 * PE3 |TIM22_C1| |TIM3_C1 | | | | | |
Kojto 96:487b796308b0 740 * PE4 |TIM22_C2| |TIM3_C2 | | | | | |
Kojto 96:487b796308b0 741 * PE5 |TIM21_C1| |TIM3_C3 | | | | | |
Kojto 96:487b796308b0 742 * PE6 |TIM21_C2| |TIM3_C4 | | | | | |
Kojto 96:487b796308b0 743 * PE7 | | | | | | |USART5 | |
Kojto 96:487b796308b0 744 * PE8 | | | | | | |USART4 | |
Kojto 96:487b796308b0 745 * PE9 |TIM2_C1 | |TIM2_TR | | | |USART4 | |
Kojto 96:487b796308b0 746 * PE10|TIM2_C2 | | | | | |USART5 | |
Kojto 96:487b796308b0 747 * PE11|TIM2_C3 | | | | | |USART5 | |
Kojto 96:487b796308b0 748 * PE12|TIM2_C4 | |SPI1 | | | | | |
Kojto 96:487b796308b0 749 * PE13| | |SPI1 | | | | | |
Kojto 96:487b796308b0 750 * PE14| | |SPI1 | | | | | |
Kojto 96:487b796308b0 751 * PE15| | |SPI1 | | | | | |
Kojto 96:487b796308b0 752 *______________________________________________________________________________
Kojto 96:487b796308b0 753 * PH0 | | | | | | | | |
Kojto 96:487b796308b0 754 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 755 * PH9 | | | | | | | | |
Kojto 96:487b796308b0 756 * PH10| | | | | | | | |
Kojto 96:487b796308b0 757 *
Kojto 96:487b796308b0 758 */
Kojto 96:487b796308b0 759
Kojto 96:487b796308b0 760 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 761 * @{
Kojto 96:487b796308b0 762 */
Kojto 96:487b796308b0 763
Kojto 96:487b796308b0 764 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 765 * @{
Kojto 96:487b796308b0 766 */
Kojto 96:487b796308b0 767 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 768 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 769 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 770 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 771 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 772 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 773 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 774 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 775 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 776 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 777 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 778 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 779 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 780 /**
Kojto 96:487b796308b0 781 * @}
Kojto 96:487b796308b0 782 */
Kojto 96:487b796308b0 783
Kojto 96:487b796308b0 784 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 785 * @{
Kojto 96:487b796308b0 786 */
Kojto 96:487b796308b0 787 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 788 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 789 #define GPIO_AF1_TIM21 ((uint8_t)0x01) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 790 /**
Kojto 96:487b796308b0 791 * @}
Kojto 96:487b796308b0 792 */
Kojto 96:487b796308b0 793
Kojto 96:487b796308b0 794 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 795 * @{
Kojto 96:487b796308b0 796 */
Kojto 96:487b796308b0 797 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 798 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 799 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 800 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 801 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 802 #define GPIO_AF2_MCO ((uint8_t)0x02) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 803 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 804 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 805 #define GPIO_AF2_USART5 ((uint8_t)0x02) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 806 #define GPIO_AF2_SPI1 ((uint8_t)0x02) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 807 /**
Kojto 96:487b796308b0 808 * @}
Kojto 96:487b796308b0 809 */
Kojto 96:487b796308b0 810
Kojto 96:487b796308b0 811 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 812 * @{
Kojto 96:487b796308b0 813 */
Kojto 96:487b796308b0 814 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 815 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 816 /**
Kojto 96:487b796308b0 817 * @}
Kojto 96:487b796308b0 818 */
Kojto 96:487b796308b0 819
Kojto 96:487b796308b0 820 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 821 * @{
Kojto 96:487b796308b0 822 */
Kojto 96:487b796308b0 823 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 824 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 825 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 826 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 827 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 828 #define GPIO_AF4_TIM3 ((uint8_t)0x04) /* TIM3 Alternate Function mapping */
Kojto 96:487b796308b0 829 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 830 /**
Kojto 96:487b796308b0 831 * @}
Kojto 96:487b796308b0 832 */
Kojto 96:487b796308b0 833
Kojto 96:487b796308b0 834 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 835 * @{
Kojto 96:487b796308b0 836 */
Kojto 96:487b796308b0 837 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 838 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 839 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 840 #define GPIO_AF5_USART1 ((uint8_t)0x05) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 841 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 842 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 843 /**
Kojto 96:487b796308b0 844 * @}
Kojto 96:487b796308b0 845 */
Kojto 96:487b796308b0 846
Kojto 96:487b796308b0 847 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 848 * @{
Kojto 96:487b796308b0 849 */
Kojto 96:487b796308b0 850 #define GPIO_AF6_USART4 ((uint8_t)0x06) /* USART4 Alternate Function mapping */
Kojto 96:487b796308b0 851 #define GPIO_AF6_LPUART1 ((uint8_t)0x06) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 852 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 853 #define GPIO_AF6_I2C1 ((uint8_t)0x06) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 854 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
Kojto 96:487b796308b0 855 #define GPIO_AF6_USART5 ((uint8_t)0x06) /* USART5 Alternate Function mapping */
Kojto 96:487b796308b0 856 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 857 /**
Kojto 96:487b796308b0 858 * @}
Kojto 96:487b796308b0 859 */
Kojto 96:487b796308b0 860
Kojto 96:487b796308b0 861 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 862 * @{
Kojto 96:487b796308b0 863 */
Kojto 96:487b796308b0 864 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
Kojto 96:487b796308b0 865 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 866 #define GPIO_AF7_I2C3 ((uint8_t)0x07) /* I2C3 Alternate Function mapping */
Kojto 96:487b796308b0 867 #define GPIO_AF7_LPUART1 ((uint8_t)0x07) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 868 /**
Kojto 96:487b796308b0 869 * @}
Kojto 96:487b796308b0 870 */
Kojto 96:487b796308b0 871
Kojto 96:487b796308b0 872 /**
Kojto 96:487b796308b0 873 * @}
Kojto 96:487b796308b0 874 */
Kojto 96:487b796308b0 875
Kojto 96:487b796308b0 876 /**
Kojto 96:487b796308b0 877 * IS_GPIO_AF macro definition
Kojto 96:487b796308b0 878 */
Kojto 96:487b796308b0 879 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF7_LPUART1) || \
Kojto 96:487b796308b0 880 ((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 881 ((__AF__) == GPIO_AF0_TIM21) || ((__AF__) == GPIO_AF1_SPI2) || \
Kojto 96:487b796308b0 882 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF1_TIM21) || \
Kojto 96:487b796308b0 883 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 884 ((__AF__) == GPIO_AF0_SWCLK) || ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 885 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF6_TIM21) || \
Kojto 96:487b796308b0 886 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 887 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 888 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 889 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_MCO) || \
Kojto 96:487b796308b0 890 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_RTC) || \
Kojto 96:487b796308b0 891 ((__AF__) == GPIO_AF2_SPI2) || ((__AF__) == GPIO_AF6_USART5) || \
Kojto 96:487b796308b0 892 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF2_USART5) || \
Kojto 96:487b796308b0 893 ((__AF__) == GPIO_AF2_SPI1) || ((__AF__) == GPIO_AF6_I2C2) || \
Kojto 96:487b796308b0 894 ((__AF__) == GPIO_AF3_EVENTOUT) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 895 ((__AF__) == GPIO_AF3_I2C1) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 896 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 897 ((__AF__) == GPIO_AF5_TIM2) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 898 ((__AF__) == GPIO_AF5_USART1) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 899 ((__AF__) == GPIO_AF5_TIM22) || ((__AF__) == GPIO_AF4_TIM3) || \
Kojto 96:487b796308b0 900 ((__AF__) == GPIO_AF5_SPI2) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 901 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 902 ((__AF__) == GPIO_AF7_COMP2) || ((__AF__) == GPIO_AF6_LPUART1) || \
Kojto 96:487b796308b0 903 ((__AF__) == GPIO_AF7_COMP1) || ((__AF__) == GPIO_AF6_I2C1) || \
Kojto 96:487b796308b0 904 ((__AF__) == GPIO_AF7_I2C3) || ((__AF__) == GPIO_AF6_EVENTOUT))
Kojto 96:487b796308b0 905
Kojto 96:487b796308b0 906
Kojto 96:487b796308b0 907 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 908 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 909 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 910 ((__AF__) == GPIO_AF3_EVENTOUT) || \
Kojto 96:487b796308b0 911 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 912 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 913 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 914 ((__AF__) == GPIO_AF7_COMP1))) || \
Kojto 96:487b796308b0 915 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 916 ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 917 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 918 ((__AF__) == GPIO_AF3_I2C1) || \
Kojto 96:487b796308b0 919 ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 920 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 921 ((__AF__) == GPIO_AF6_USART4) || \
Kojto 96:487b796308b0 922 ((__AF__) == GPIO_AF7_LPUART1))) || \
Kojto 96:487b796308b0 923 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 924 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 925 ((__AF__) == GPIO_AF6_LPUART1) || \
Kojto 96:487b796308b0 926 ((__AF__) == GPIO_AF7_I2C3))) || \
Kojto 96:487b796308b0 927 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_LPUART1) || \
Kojto 96:487b796308b0 928 ((__AF__) == GPIO_AF1_SPI2) || \
Kojto 96:487b796308b0 929 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 930 ((__AF__) == GPIO_AF6_USART5))) || \
Kojto 96:487b796308b0 931 (((__INSTANCE__) == GPIOE) && (((__AF__) == GPIO_AF0_TIM22) || \
Kojto 96:487b796308b0 932 ((__AF__) == GPIO_AF2_TIM3) || \
Kojto 96:487b796308b0 933 ((__AF__) == GPIO_AF6_USART4))))
Kojto 96:487b796308b0 934
Kojto 96:487b796308b0 935
Kojto 96:487b796308b0 936 #endif /* (STM32L081xx) || (STM32L071xx) */
Kojto 96:487b796308b0 937
Kojto 96:487b796308b0 938 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 939 /*------------------------- STM32L053xx/STM32L063xx---------------------------*/
Kojto 96:487b796308b0 940 /*----------------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 941 #if defined (STM32L053xx) || defined (STM32L063xx)
Kojto 96:487b796308b0 942
Kojto 96:487b796308b0 943 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 944 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 945 *
Kojto 96:487b796308b0 946 */
Kojto 96:487b796308b0 947 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 948 *______________________________________________________________________________
Kojto 96:487b796308b0 949 * PA0 | | |TIM2_C1 |TSC |USART2 |TIM2_TR | |COMP1 |
Kojto 96:487b796308b0 950 * PA1 |EVENTOUT|LCD |TIM2_C2 |TSC |USART2 |TIM21_TR| | |
Kojto 96:487b796308b0 951 * PA2 |TIM21_C1|LCD |TIM2_C3 |TSC |USART2 | | |COMP2 |
Kojto 96:487b796308b0 952 * PA3 |TIM21_C2|LCD |TIM2_C4 |TSC |USART2 | | | |
Kojto 96:487b796308b0 953 * PA4 |SPI1 | | |TSC |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 954 * PA5 |SPI1 | |TIM2_TR |TSC | |TIM2_C1 | | |
Kojto 96:487b796308b0 955 * PA6 |SPI1 |LCD | |TSC |LPUART |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 956 * PA7 |SPI1 |LCD | |TSC | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 957 * PA8 |MCO |LCD |USB |EVENTOUT|USART1 | | | |
Kojto 96:487b796308b0 958 * PA9 |MCO |LCD | |TSC |USART1 | | | |
Kojto 96:487b796308b0 959 * PA10| |LCD | |TSC |USART1 | | | |
Kojto 96:487b796308b0 960 * PA11|SPI1 | |EVENTOUT|TSC |USART1 | | |COMP1 |
Kojto 96:487b796308b0 961 * PA12|SPI1 | |EVENTOUT|TSC |USART1 | | |COMP2 |
Kojto 96:487b796308b0 962 * PA13|SWDIO | |USB | | | | | |
Kojto 96:487b796308b0 963 * PA14|SWCLK | | | |USART2 | | | |
Kojto 96:487b796308b0 964 * PA15|SPI1 |LCD |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 | | |
Kojto 96:487b796308b0 965 *______________________________________________________________________________
Kojto 96:487b796308b0 966 * PB0 |EVENTOUT|LCD | |TSC | | | | |
Kojto 96:487b796308b0 967 * PB1 | |LCD | |TSC |LPUART1 | | | |
Kojto 96:487b796308b0 968 * PB2 | | |LPTIM1_O|TSC | | | | |
Kojto 96:487b796308b0 969 * PB3 |SPI1 |LCD |TIM2_C2 |TSC |EVENTOUT| | | |
Kojto 96:487b796308b0 970 * PB4 |SPI1 |LCD |EVENTOUT|TSC |TIM22_C1| | | |
Kojto 96:487b796308b0 971 * PB5 |SPI1 |LCD |LPTIM1_I|I2C1 |TIM22_C2| | | |
Kojto 96:487b796308b0 972 * PB6 |USART1 |I2C1 |LPTIM1_T|TSC | | | | |
Kojto 96:487b796308b0 973 * PB7 |USART1 |I2C1 |LPTIM1_I|TSC | | | | |
Kojto 96:487b796308b0 974 * PB8 | |LCD | |TSC |I2C1 | | | |
Kojto 96:487b796308b0 975 * PB9 | |LCD |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 976 * PB10| |LCD |TIM2_C3 |TSC |LPUART1 |SPI2 |I2C2 | |
Kojto 96:487b796308b0 977 * PB11|EVENTOUT|LCD |TIM2_C4 |TSC |LPUART1 | |I2C2 | |
Kojto 96:487b796308b0 978 * PB12|SPI2 |LCD |LPUART1 |TSC | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 979 * PB13|SPI2 |LCD | |TSC |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 980 * PB14|SPI2 |LCD |RTC |TSC |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 981 * PB15|SPI2 |LCD |RTC | | | | | |
Kojto 96:487b796308b0 982 *______________________________________________________________________________
Kojto 96:487b796308b0 983 * PC0 |LPTIM1_I|LCD |EVENTOUT|TSC | | | | |
Kojto 96:487b796308b0 984 * PC1 |LPTIM1_O|LCD |EVENTOUT|TSC | | | | |
Kojto 96:487b796308b0 985 * PC2 |LPTIM1_I|LCD |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 986 * PC3 |LPTIM1_T|LCD |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 987 * PC4 |EVENTOUT|LCD |LPUART | | | | | |
Kojto 96:487b796308b0 988 * PC5 | |LCD |LPUART |TSC | | | | |
Kojto 96:487b796308b0 989 * PC6 |TIM22_C1|LCD | |TSC | | | | |
Kojto 96:487b796308b0 990 * PC7 |TIM22_C2|LCD | |TSC | | | | |
Kojto 96:487b796308b0 991 * PC8 |TIM22_TR|LCD | |TSC | | | | |
Kojto 96:487b796308b0 992 * PC9 |TIM21_TR|LCD |USB |TSC | | | | |
Kojto 96:487b796308b0 993 * PC10|LPUART |LCD | | | | | | |
Kojto 96:487b796308b0 994 * PC11|LPUART |LCD | | | | | | |
Kojto 96:487b796308b0 995 * PC12| |LCD | | | | | | |
Kojto 96:487b796308b0 996 * PC13| | | | | | | | |
Kojto 96:487b796308b0 997 * PC14| | | | | | | | |
Kojto 96:487b796308b0 998 * PC15| | | | | | | | |
Kojto 96:487b796308b0 999 *______________________________________________________________________________
Kojto 96:487b796308b0 1000 * PD2 |LPUART |LCD | | | | | | |
Kojto 96:487b796308b0 1001 *______________________________________________________________________________
Kojto 96:487b796308b0 1002 * PH0 |USB | | | | | | | |
Kojto 96:487b796308b0 1003 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 1004 * *
Kojto 96:487b796308b0 1005 */
Kojto 96:487b796308b0 1006
Kojto 96:487b796308b0 1007 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 1008 * @{
Kojto 96:487b796308b0 1009 */
Kojto 96:487b796308b0 1010
Kojto 96:487b796308b0 1011 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 1012 * @{
Kojto 96:487b796308b0 1013 */
bogdanm 84:0b3ab51c8877 1014 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1015 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1016 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1017 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1018 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1019 #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 1020 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1021 #define GPIO_AF0_TSC ((uint8_t)0x00) /* TSC Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1022 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1023 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1024 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1025 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1026 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1027 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1028 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 1029 /**
Kojto 96:487b796308b0 1030 * @}
Kojto 96:487b796308b0 1031 */
bogdanm 84:0b3ab51c8877 1032
Kojto 96:487b796308b0 1033 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 1034 * @{
Kojto 96:487b796308b0 1035 */
bogdanm 84:0b3ab51c8877 1036 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1037 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1038 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1039 #define GPIO_AF1_LCD ((uint8_t)0x01) /* LCD Alternate Function mapping */
Kojto 96:487b796308b0 1040 /**
Kojto 96:487b796308b0 1041 * @}
Kojto 96:487b796308b0 1042 */
Kojto 96:487b796308b0 1043
Kojto 96:487b796308b0 1044 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 1045 * @{
Kojto 96:487b796308b0 1046 */
bogdanm 84:0b3ab51c8877 1047 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1048 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1049 #define GPIO_AF2_USB ((uint8_t)0x02) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 1050 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1051 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1052 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1053 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 1054 /**
Kojto 96:487b796308b0 1055 * @}
Kojto 96:487b796308b0 1056 */
bogdanm 84:0b3ab51c8877 1057
Kojto 96:487b796308b0 1058 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 1059 * @{
Kojto 96:487b796308b0 1060 */
bogdanm 84:0b3ab51c8877 1061 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1062 #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1063 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1064 /**
Kojto 96:487b796308b0 1065 * @}
Kojto 96:487b796308b0 1066 */
bogdanm 84:0b3ab51c8877 1067
Kojto 96:487b796308b0 1068 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 1069 * @{
Kojto 96:487b796308b0 1070 */
bogdanm 84:0b3ab51c8877 1071 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1072 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1073 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1074 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1075 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1076 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1077 /**
Kojto 96:487b796308b0 1078 * @}
Kojto 96:487b796308b0 1079 */
bogdanm 84:0b3ab51c8877 1080
Kojto 96:487b796308b0 1081 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 1082 * @{
Kojto 96:487b796308b0 1083 */
bogdanm 84:0b3ab51c8877 1084 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1085 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1086 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1087 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1088 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1089 /**
Kojto 96:487b796308b0 1090 * @}
Kojto 96:487b796308b0 1091 */
bogdanm 84:0b3ab51c8877 1092
Kojto 96:487b796308b0 1093 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 1094 * @{
Kojto 96:487b796308b0 1095 */
bogdanm 84:0b3ab51c8877 1096 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1097 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1098 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1099 /**
Kojto 96:487b796308b0 1100 * @}
Kojto 96:487b796308b0 1101 */
bogdanm 84:0b3ab51c8877 1102
Kojto 96:487b796308b0 1103 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 1104 * @{
Kojto 96:487b796308b0 1105 */
bogdanm 84:0b3ab51c8877 1106 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1107 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 1108 /**
Kojto 96:487b796308b0 1109 * @}
Kojto 96:487b796308b0 1110 */
Kojto 96:487b796308b0 1111
Kojto 96:487b796308b0 1112 /**
Kojto 96:487b796308b0 1113 * @}
Kojto 96:487b796308b0 1114 */
Kojto 96:487b796308b0 1115
bogdanm 84:0b3ab51c8877 1116
bogdanm 84:0b3ab51c8877 1117
Kojto 96:487b796308b0 1118 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF2_SPI2) || \
Kojto 96:487b796308b0 1119 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 1120 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF2_USB) || \
Kojto 96:487b796308b0 1121 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 1122 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1123 ((__AF__) == GPIO_AF0_USB) || ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1124 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 1125 ((__AF__) == GPIO_AF0_TSC) || ((__AF__) == GPIO_AF2_RTC) || \
Kojto 96:487b796308b0 1126 ((__AF__) == GPIO_AF3_I2C1) || ((__AF__) == GPIO_AF7_COMP2) || \
Kojto 96:487b796308b0 1127 ((__AF__) == GPIO_AF0_TIM22) || ((__AF__) == GPIO_AF3_EVENTOUT) || \
Kojto 96:487b796308b0 1128 ((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 1129 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 1130 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF0_SWCLK) || \
Kojto 96:487b796308b0 1131 ((__AF__) == GPIO_AF1_SPI1) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1132 ((__AF__) == GPIO_AF1_SPI2) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 1133 ((__AF__) == GPIO_AF7_COMP2) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 1134 ((__AF__) == GPIO_AF1_I2C1) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 1135 ((__AF__) == GPIO_AF1_LCD) || ((__AF__) == GPIO_AF5_SPI2) || \
Kojto 96:487b796308b0 1136 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF5_TIM2) || \
Kojto 96:487b796308b0 1137 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1138 ((__AF__) == GPIO_AF6_I2C2) || ((__AF__) == GPIO_AF6_TIM21) || \
Kojto 96:487b796308b0 1139 ((__AF__) == GPIO_AF6_EVENTOUT) || ((__AF__) == GPIO_AF7_COMP1))
Kojto 96:487b796308b0 1140
Kojto 96:487b796308b0 1141
Kojto 96:487b796308b0 1142
Kojto 96:487b796308b0 1143 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 1144 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1145 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 1146 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1147 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1148 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1149 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1150 ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 1151 ((__AF__) == GPIO_AF7_COMP1))) || \
Kojto 96:487b796308b0 1152 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1153 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 1154 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1155 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1156 ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 1157 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 1158 ((__AF__) == GPIO_AF6_TIM21))) || \
Kojto 96:487b796308b0 1159 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1160 ((__AF__) == GPIO_AF1_LCD) || \
Kojto 96:487b796308b0 1161 ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 1162 ((__AF__) == GPIO_AF3_TSC))) || \
Kojto 96:487b796308b0 1163 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_LPUART1) || \
Kojto 96:487b796308b0 1164 ((__AF__) == GPIO_AF1_LCD))) || \
Kojto 96:487b796308b0 1165 (((__INSTANCE__) == GPIOH) && (((__AF__) == GPIO_AF0_USB))))
Kojto 96:487b796308b0 1166
bogdanm 84:0b3ab51c8877 1167
bogdanm 84:0b3ab51c8877 1168 #endif /* STM32L053xx || STM32L063xx */
bogdanm 84:0b3ab51c8877 1169 /*------------------------------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 1170
Kojto 96:487b796308b0 1171 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1172 /*------------------------- STM32L052xx/STM32L062xx---------------------------*/
Kojto 96:487b796308b0 1173 /*----------------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 1174 #if defined (STM32L052xx) || defined (STM32L062xx)
bogdanm 84:0b3ab51c8877 1175
Kojto 96:487b796308b0 1176 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 1177 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 1178 *
Kojto 96:487b796308b0 1179 */
Kojto 96:487b796308b0 1180 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 1181 *______________________________________________________________________________
Kojto 96:487b796308b0 1182 * PA0 | | |TIM2_C1 |TSC |USART2 |TIM2_TR | |COMP1 |
Kojto 96:487b796308b0 1183 * PA1 |EVENTOUT| |TIM2_C2 |TSC |USART2 |TIM21_TR| | |
Kojto 96:487b796308b0 1184 * PA2 |TIM21_C1| |TIM2_C3 |TSC |USART2 | | |COMP2 |
Kojto 96:487b796308b0 1185 * PA3 |TIM21_C2| |TIM2_C4 |TSC |USART2 | | | |
Kojto 96:487b796308b0 1186 * PA4 |SPI1 | | |TSC |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 1187 * PA5 |SPI1 | |TIM2_TR |TSC | |TIM2_C1 | | |
Kojto 96:487b796308b0 1188 * PA6 |SPI1 | | |TSC |LPUART |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 1189 * PA7 |SPI1 | | |TSC | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 1190 * PA8 |MCO | |USB |EVENTOUT|USART1 | | | |
Kojto 96:487b796308b0 1191 * PA9 |MCO | | |TSC |USART1 | | | |
Kojto 96:487b796308b0 1192 * PA10| | | |TSC |USART1 | | | |
Kojto 96:487b796308b0 1193 * PA11|SPI1 | |EVENTOUT|TSC |USART1 | | |COMP1 |
Kojto 96:487b796308b0 1194 * PA12|SPI1 | |EVENTOUT|TSC |USART1 | | |COMP2 |
Kojto 96:487b796308b0 1195 * PA13|SWDIO | |USB | | | | | |
Kojto 96:487b796308b0 1196 * PA14|SWCLK | | | |USART2 | | | |
Kojto 96:487b796308b0 1197 * PA15|SPI1 | |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 | | |
Kojto 96:487b796308b0 1198 *______________________________________________________________________________
Kojto 96:487b796308b0 1199 * PB0 |EVENTOUT| | |TSC | | | | |
Kojto 96:487b796308b0 1200 * PB1 | | | |TSC |LPUART1 | | | |
Kojto 96:487b796308b0 1201 * PB2 | | |LPTIM1_O|TSC | | | | |
Kojto 96:487b796308b0 1202 * PB3 |SPI1 | |TIM2_C2 |TSC |EVENTOUT| | | |
Kojto 96:487b796308b0 1203 * PB4 |SPI1 | |EVENTOUT|TSC |TIM22_C1| | | |
Kojto 96:487b796308b0 1204 * PB5 |SPI1 | |LPTIM1_I|I2C1 |TIM22_C2| | | |
Kojto 96:487b796308b0 1205 * PB6 |USART1 |I2C1 |LPTIM1_T|TSC | | | | |
Kojto 96:487b796308b0 1206 * PB7 |USART1 |I2C1 |LPTIM1_I|TSC | | | | |
Kojto 96:487b796308b0 1207 * PB8 | | | |TSC |I2C1 | | | |
Kojto 96:487b796308b0 1208 * PB9 | | |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 1209 * PB10| | |TIM2_C3 |TSC |LPUART1 |SPI2 |I2C2 | |
Kojto 96:487b796308b0 1210 * PB11|EVENTOUT| |TIM2_C4 |TSC |LPUART1 | |I2C2 | |
Kojto 96:487b796308b0 1211 * PB12|SPI2 | |LPUART1 |TSC | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 1212 * PB13|SPI2 | | |TSC |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 1213 * PB14|SPI2 | |RTC |TSC |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 1214 * PB15|SPI2 | |RTC | | | | | |
Kojto 96:487b796308b0 1215 *______________________________________________________________________________
Kojto 96:487b796308b0 1216 * PC0 |LPTIM1_I| |EVENTOUT|TSC | | | | |
Kojto 96:487b796308b0 1217 * PC1 |LPTIM1_O| |EVENTOUT|TSC | | | | |
Kojto 96:487b796308b0 1218 * PC2 |LPTIM1_I| |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 1219 * PC3 |LPTIM1_T| |SPI2 |TSC | | | | |
Kojto 96:487b796308b0 1220 * PC4 |EVENTOUT| |LPUART | | | | | |
Kojto 96:487b796308b0 1221 * PC5 | | |LPUART |TSC | | | | |
Kojto 96:487b796308b0 1222 * PC6 |TIM22_C1| | |TSC | | | | |
Kojto 96:487b796308b0 1223 * PC7 |TIM22_C2| | |TSC | | | | |
Kojto 96:487b796308b0 1224 * PC8 |TIM22_TR| | |TSC | | | | |
Kojto 96:487b796308b0 1225 * PC9 |TIM21_TR| |USB |TSC | | | | |
Kojto 96:487b796308b0 1226 * PC10|LPUART | | | | | | | |
Kojto 96:487b796308b0 1227 * PC11|LPUART | | | | | | | |
Kojto 96:487b796308b0 1228 * PC12| | | | | | | | |
Kojto 96:487b796308b0 1229 * PC13| | | | | | | | |
Kojto 96:487b796308b0 1230 * PC14| | | | | | | | |
Kojto 96:487b796308b0 1231 * PC15| | | | | | | | |
Kojto 96:487b796308b0 1232 *______________________________________________________________________________
Kojto 96:487b796308b0 1233 * PD2 |LPUART | | | | | | | |
Kojto 96:487b796308b0 1234 *______________________________________________________________________________
Kojto 96:487b796308b0 1235 * PH0 |USB | | | | | | | |
Kojto 96:487b796308b0 1236 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 1237 * *
Kojto 96:487b796308b0 1238 */
bogdanm 84:0b3ab51c8877 1239
Kojto 96:487b796308b0 1240 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 1241 * @{
Kojto 96:487b796308b0 1242 */
Kojto 96:487b796308b0 1243
Kojto 96:487b796308b0 1244 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 1245 * @{
Kojto 96:487b796308b0 1246 */
Kojto 96:487b796308b0 1247 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1248 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1249 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 1250 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 1251 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1252 #define GPIO_AF0_USB ((uint8_t)0x00) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 1253 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1254 #define GPIO_AF0_TSC ((uint8_t)0x00) /* TSC Alternate Function mapping */
Kojto 96:487b796308b0 1255 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1256 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 1257 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1258 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1259 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 1260 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 1261 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 1262 /**
Kojto 96:487b796308b0 1263 * @}
Kojto 96:487b796308b0 1264 */
Kojto 96:487b796308b0 1265
Kojto 96:487b796308b0 1266 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 1267 * @{
Kojto 96:487b796308b0 1268 */
Kojto 96:487b796308b0 1269 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1270 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1271 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 1272 /**
Kojto 96:487b796308b0 1273 * @}
Kojto 96:487b796308b0 1274 */
Kojto 96:487b796308b0 1275
Kojto 96:487b796308b0 1276 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 1277 * @{
Kojto 96:487b796308b0 1278 */
Kojto 96:487b796308b0 1279 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1280 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1281 #define GPIO_AF2_USB ((uint8_t)0x02) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 1282 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1283 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1284 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1285 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 1286 /**
Kojto 96:487b796308b0 1287 * @}
Kojto 96:487b796308b0 1288 */
Kojto 96:487b796308b0 1289
Kojto 96:487b796308b0 1290 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 1291 * @{
Kojto 96:487b796308b0 1292 */
bogdanm 84:0b3ab51c8877 1293 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1294 #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1295 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1296 /**
Kojto 96:487b796308b0 1297 * @}
Kojto 96:487b796308b0 1298 */
bogdanm 84:0b3ab51c8877 1299
Kojto 96:487b796308b0 1300 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 1301 * @{
Kojto 96:487b796308b0 1302 */
bogdanm 84:0b3ab51c8877 1303 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1304 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1305 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1306 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1307 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1308 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1309 /**
Kojto 96:487b796308b0 1310 * @}
Kojto 96:487b796308b0 1311 */
bogdanm 84:0b3ab51c8877 1312
Kojto 96:487b796308b0 1313 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 1314 * @{
Kojto 96:487b796308b0 1315 */
bogdanm 84:0b3ab51c8877 1316 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1317 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1318 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1319 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1320 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1321 /**
Kojto 96:487b796308b0 1322 * @}
Kojto 96:487b796308b0 1323 */
bogdanm 84:0b3ab51c8877 1324
Kojto 96:487b796308b0 1325 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 1326 * @{
Kojto 96:487b796308b0 1327 */
bogdanm 84:0b3ab51c8877 1328 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1329 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1330 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1331 /**
Kojto 96:487b796308b0 1332 * @}
Kojto 96:487b796308b0 1333 */
bogdanm 84:0b3ab51c8877 1334
Kojto 96:487b796308b0 1335 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 1336 * @{
Kojto 96:487b796308b0 1337 */
bogdanm 84:0b3ab51c8877 1338 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1339 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 1340 /**
Kojto 96:487b796308b0 1341 * @}
Kojto 96:487b796308b0 1342 */
Kojto 96:487b796308b0 1343
Kojto 96:487b796308b0 1344 /**
Kojto 96:487b796308b0 1345 * @}
Kojto 96:487b796308b0 1346 */
bogdanm 84:0b3ab51c8877 1347
bogdanm 84:0b3ab51c8877 1348
Kojto 96:487b796308b0 1349 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF2_SPI2) || \
Kojto 96:487b796308b0 1350 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 1351 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF2_USB) || \
Kojto 96:487b796308b0 1352 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 1353 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1354 ((__AF__) == GPIO_AF0_USB) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 1355 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 1356 ((__AF__) == GPIO_AF0_TSC) || ((__AF__) == GPIO_AF2_RTC) || \
Kojto 96:487b796308b0 1357 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF3_I2C1) || \
Kojto 96:487b796308b0 1358 ((__AF__) == GPIO_AF0_TIM21) || ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1359 ((__AF__) == GPIO_AF0_TIM22) || ((__AF__) == GPIO_AF3_EVENTOUT) || \
Kojto 96:487b796308b0 1360 ((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 1361 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 1362 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF0_SWCLK) || \
Kojto 96:487b796308b0 1363 ((__AF__) == GPIO_AF1_SPI1) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1364 ((__AF__) == GPIO_AF1_SPI2) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 1365 ((__AF__) == GPIO_AF1_I2C1) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 1366 ((__AF__) == GPIO_AF6_EVENTOUT) || ((__AF__) == GPIO_AF5_SPI2) || \
Kojto 96:487b796308b0 1367 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF5_TIM2) || \
Kojto 96:487b796308b0 1368 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1369 ((__AF__) == GPIO_AF6_I2C2) || ((__AF__) == GPIO_AF6_TIM21) || \
Kojto 96:487b796308b0 1370 ((__AF__) == GPIO_AF7_COMP2) || ((__AF__) == GPIO_AF7_COMP1))
Kojto 96:487b796308b0 1371
Kojto 96:487b796308b0 1372
Kojto 96:487b796308b0 1373 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 1374 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1375 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1376 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1377 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1378 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1379 ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 1380 ((__AF__) == GPIO_AF7_COMP1))) || \
Kojto 96:487b796308b0 1381 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1382 ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 1383 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1384 ((__AF__) == GPIO_AF3_TSC) || \
Kojto 96:487b796308b0 1385 ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 1386 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 1387 ((__AF__) == GPIO_AF6_EVENTOUT))) || \
Kojto 96:487b796308b0 1388 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1389 ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 1390 ((__AF__) == GPIO_AF3_TSC))) || \
Kojto 96:487b796308b0 1391 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_LPUART1))) || \
Kojto 96:487b796308b0 1392 (((__INSTANCE__) == GPIOH) && (((__AF__) == GPIO_AF0_USB))))
Kojto 96:487b796308b0 1393
bogdanm 84:0b3ab51c8877 1394
bogdanm 84:0b3ab51c8877 1395 #endif /* STM32L052xx || STM32L062xx */
bogdanm 84:0b3ab51c8877 1396 /*------------------------------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 1397
Kojto 96:487b796308b0 1398 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1399 /*------------------------- STM32L051xx/STM32L061xx---------------------------*/
Kojto 96:487b796308b0 1400 /*----------------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 1401 #if defined (STM32L051xx)|| defined (STM32L061xx)
Kojto 96:487b796308b0 1402 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 1403 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 1404 *
Kojto 96:487b796308b0 1405 */
Kojto 96:487b796308b0 1406 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 1407 *______________________________________________________________________________
Kojto 96:487b796308b0 1408 * PA0 | | |TIM2_C1 | |USART2 |TIM2_TR | |COMP1 |
Kojto 96:487b796308b0 1409 * PA1 |EVENTOUT| |TIM2_C2 | |USART2 |TIM21_TR| | |
Kojto 96:487b796308b0 1410 * PA2 |TIM21_C1| |TIM2_C3 | |USART2 | | |COMP2 |
Kojto 96:487b796308b0 1411 * PA3 |TIM21_C2| |TIM2_C4 | |USART2 | | | |
Kojto 96:487b796308b0 1412 * PA4 |SPI1 | | | |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 1413 * PA5 |SPI1 | |TIM2_TR | | |TIM2_C1 | | |
Kojto 96:487b796308b0 1414 * PA6 |SPI1 | | | |LPUART |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 1415 * PA7 |SPI1 | | | | |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 1416 * PA8 |MCO | | |EVENTOUT|USART1 | | | |
Kojto 96:487b796308b0 1417 * PA9 |MCO | | | |USART1 | | | |
Kojto 96:487b796308b0 1418 * PA10| | | | |USART1 | | | |
Kojto 96:487b796308b0 1419 * PA11|SPI1 | |EVENTOUT| |USART1 | | |COMP1 |
Kojto 96:487b796308b0 1420 * PA12|SPI1 | |EVENTOUT| |USART1 | | |COMP2 |
Kojto 96:487b796308b0 1421 * PA13|SWDIO | | | | | | | |
Kojto 96:487b796308b0 1422 * PA14|SWCLK | | | |USART2 | | | |
Kojto 96:487b796308b0 1423 * PA15|SPI1 | |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 | | |
Kojto 96:487b796308b0 1424 *______________________________________________________________________________
Kojto 96:487b796308b0 1425 * PB0 |EVENTOUT| | | | | | | |
Kojto 96:487b796308b0 1426 * PB1 | | | | |LPUART1 | | | |
Kojto 96:487b796308b0 1427 * PB2 | | |LPTIM1_O| | | | | |
Kojto 96:487b796308b0 1428 * PB3 |SPI1 | |TIM2_C2 | |EVENTOUT| | | |
Kojto 96:487b796308b0 1429 * PB4 |SPI1 | |EVENTOUT| |TIM22_C1| | | |
Kojto 96:487b796308b0 1430 * PB5 |SPI1 | |LPTIM1_I|I2C1 |TIM22_C2| | | |
Kojto 96:487b796308b0 1431 * PB6 |USART1 |I2C1 |LPTIM1_T| | | | | |
Kojto 96:487b796308b0 1432 * PB7 |USART1 |I2C1 |LPTIM1_I| | | | | |
Kojto 96:487b796308b0 1433 * PB8 | | | | |I2C1 | | | |
Kojto 96:487b796308b0 1434 * PB9 | | |EVENTOUT| |I2C1 |SPI2 | | |
Kojto 96:487b796308b0 1435 * PB10| | |TIM2_C3 | |LPUART1 |SPI2 |I2C2 | |
Kojto 96:487b796308b0 1436 * PB11|EVENTOUT| |TIM2_C4 | |LPUART1 | |I2C2 | |
Kojto 96:487b796308b0 1437 * PB12|SPI2 | |LPUART1 | | |I2C2 |EVENTOUT| |
Kojto 96:487b796308b0 1438 * PB13|SPI2 | | | |LPUART1 |I2C2 |TIM21_C1| |
Kojto 96:487b796308b0 1439 * PB14|SPI2 | |RTC | |LPUART1 |I2C2 |TIM21_C2| |
Kojto 96:487b796308b0 1440 * PB15|SPI2 | |RTC | | | | | |
Kojto 96:487b796308b0 1441 *______________________________________________________________________________
Kojto 96:487b796308b0 1442 * PC0 |LPTIM1_I| |EVENTOUT| | | | | |
Kojto 96:487b796308b0 1443 * PC1 |LPTIM1_O| |EVENTOUT| | | | | |
Kojto 96:487b796308b0 1444 * PC2 |LPTIM1_I| |SPI2 | | | | | |
Kojto 96:487b796308b0 1445 * PC3 |LPTIM1_T| |SPI2 | | | | | |
Kojto 96:487b796308b0 1446 * PC4 |EVENTOUT| |LPUART | | | | | |
Kojto 96:487b796308b0 1447 * PC5 | | |LPUART | | | | | |
Kojto 96:487b796308b0 1448 * PC6 |TIM22_C1| | | | | | | |
Kojto 96:487b796308b0 1449 * PC7 |TIM22_C2| | | | | | | |
Kojto 96:487b796308b0 1450 * PC8 |TIM22_TR| | | | | | | |
Kojto 96:487b796308b0 1451 * PC9 |TIM21_TR| | | | | | | |
Kojto 96:487b796308b0 1452 * PC10|LPUART | | | | | | | |
Kojto 96:487b796308b0 1453 * PC11|LPUART | | | | | | | |
Kojto 96:487b796308b0 1454 * PC12| | | | | | | | |
Kojto 96:487b796308b0 1455 * PC13| | | | | | | | |
Kojto 96:487b796308b0 1456 * PC14| | | | | | | | |
Kojto 96:487b796308b0 1457 * PC15| | | | | | | | |
Kojto 96:487b796308b0 1458 *______________________________________________________________________________
Kojto 96:487b796308b0 1459 * PD2 |LPUART | | | | | | | |
Kojto 96:487b796308b0 1460 *______________________________________________________________________________
Kojto 96:487b796308b0 1461 * PH0 | | | | | | | | |
Kojto 96:487b796308b0 1462 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 1463 * *
Kojto 96:487b796308b0 1464 */
bogdanm 84:0b3ab51c8877 1465
Kojto 96:487b796308b0 1466 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 1467 * @{
Kojto 96:487b796308b0 1468 */
Kojto 96:487b796308b0 1469
Kojto 96:487b796308b0 1470 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 1471 * @{
Kojto 96:487b796308b0 1472 */
Kojto 96:487b796308b0 1473 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1474 #define GPIO_AF0_SPI2 ((uint8_t)0x00) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1475 #define GPIO_AF0_USART1 ((uint8_t)0x00) /* USART1 Alternate Function mapping */
Kojto 96:487b796308b0 1476 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 1477 #define GPIO_AF0_LPUART1 ((uint8_t)0x00) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1478 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1479 #define GPIO_AF0_TIM2 ((uint8_t)0x00) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1480 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 1481 #define GPIO_AF0_TIM22 ((uint8_t)0x00) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1482 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1483 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 1484 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 1485 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 1486 /**
Kojto 96:487b796308b0 1487 * @}
Kojto 96:487b796308b0 1488 */
bogdanm 84:0b3ab51c8877 1489
Kojto 96:487b796308b0 1490 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 1491 * @{
Kojto 96:487b796308b0 1492 */
Kojto 96:487b796308b0 1493 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1494 #define GPIO_AF1_SPI2 ((uint8_t)0x01) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1495 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 1496 /**
Kojto 96:487b796308b0 1497 * @}
Kojto 96:487b796308b0 1498 */
Kojto 96:487b796308b0 1499
Kojto 96:487b796308b0 1500 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 1501 * @{
Kojto 96:487b796308b0 1502 */
Kojto 96:487b796308b0 1503 #define GPIO_AF2_SPI2 ((uint8_t)0x02) /* SPI2 Alternate Function mapping */
Kojto 96:487b796308b0 1504 #define GPIO_AF2_LPUART1 ((uint8_t)0x02) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1505 #define GPIO_AF2_USB ((uint8_t)0x02) /* USB Alternate Function mapping */
Kojto 96:487b796308b0 1506 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1507 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1508 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1509 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 1510 /**
Kojto 96:487b796308b0 1511 * @}
Kojto 96:487b796308b0 1512 */
Kojto 96:487b796308b0 1513
Kojto 96:487b796308b0 1514 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 1515 * @{
Kojto 96:487b796308b0 1516 */
bogdanm 84:0b3ab51c8877 1517 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1518 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1519 /**
Kojto 96:487b796308b0 1520 * @}
Kojto 96:487b796308b0 1521 */
bogdanm 84:0b3ab51c8877 1522
Kojto 96:487b796308b0 1523 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 1524 * @{
Kojto 96:487b796308b0 1525 */
bogdanm 84:0b3ab51c8877 1526 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1527 #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1528 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1529 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1530 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1531 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1532 /**
Kojto 96:487b796308b0 1533 * @}
Kojto 96:487b796308b0 1534 */
bogdanm 84:0b3ab51c8877 1535
Kojto 96:487b796308b0 1536 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 1537 * @{
Kojto 96:487b796308b0 1538 */
bogdanm 84:0b3ab51c8877 1539 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1540 #define GPIO_AF5_I2C2 ((uint8_t)0x05) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1541 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1542 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1543 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1544 /**
Kojto 96:487b796308b0 1545 * @}
Kojto 96:487b796308b0 1546 */
bogdanm 84:0b3ab51c8877 1547
Kojto 96:487b796308b0 1548 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 1549 * @{
Kojto 96:487b796308b0 1550 */
bogdanm 84:0b3ab51c8877 1551 #define GPIO_AF6_I2C2 ((uint8_t)0x06) /* I2C2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1552 #define GPIO_AF6_TIM21 ((uint8_t)0x06) /* TIM21 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1553 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1554 /**
Kojto 96:487b796308b0 1555 * @}
Kojto 96:487b796308b0 1556 */
bogdanm 84:0b3ab51c8877 1557
Kojto 96:487b796308b0 1558 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 1559 * @{
Kojto 96:487b796308b0 1560 */
bogdanm 84:0b3ab51c8877 1561 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1562 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
bogdanm 84:0b3ab51c8877 1563 /**
bogdanm 84:0b3ab51c8877 1564 * @}
Kojto 96:487b796308b0 1565 */
bogdanm 84:0b3ab51c8877 1566
bogdanm 84:0b3ab51c8877 1567 /**
bogdanm 84:0b3ab51c8877 1568 * @}
bogdanm 84:0b3ab51c8877 1569 */
bogdanm 84:0b3ab51c8877 1570
Kojto 96:487b796308b0 1571
Kojto 96:487b796308b0 1572 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_SPI1) || ((__AF__) == GPIO_AF2_SPI2) || \
Kojto 96:487b796308b0 1573 ((__AF__) == GPIO_AF0_SPI2) || ((__AF__) == GPIO_AF2_LPUART1) || \
Kojto 96:487b796308b0 1574 ((__AF__) == GPIO_AF0_USART1) || ((__AF__) == GPIO_AF7_COMP1) || \
Kojto 96:487b796308b0 1575 ((__AF__) == GPIO_AF0_USART2) || ((__AF__) == GPIO_AF2_LPTIM1) || \
Kojto 96:487b796308b0 1576 ((__AF__) == GPIO_AF0_LPUART1) || ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1577 ((__AF__) == GPIO_AF0_LPTIM1) || ((__AF__) == GPIO_AF2_EVENTOUT) || \
Kojto 96:487b796308b0 1578 ((__AF__) == GPIO_AF2_RTC) || ((__AF__) == GPIO_AF4_TIM22) || \
Kojto 96:487b796308b0 1579 ((__AF__) == GPIO_AF0_TIM2) || ((__AF__) == GPIO_AF3_I2C1) || \
Kojto 96:487b796308b0 1580 ((__AF__) == GPIO_AF0_TIM21) || ((__AF__) == GPIO_AF7_COMP2) || \
Kojto 96:487b796308b0 1581 ((__AF__) == GPIO_AF0_TIM22) || ((__AF__) == GPIO_AF3_EVENTOUT) || \
Kojto 96:487b796308b0 1582 ((__AF__) == GPIO_AF0_EVENTOUT) || ((__AF__) == GPIO_AF4_I2C1) || \
Kojto 96:487b796308b0 1583 ((__AF__) == GPIO_AF0_MCO) || ((__AF__) == GPIO_AF4_USART1) || \
Kojto 96:487b796308b0 1584 ((__AF__) == GPIO_AF0_SWDIO) || ((__AF__) == GPIO_AF0_SWCLK) || \
Kojto 96:487b796308b0 1585 ((__AF__) == GPIO_AF1_SPI1) || ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1586 ((__AF__) == GPIO_AF1_SPI2) || ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 1587 ((__AF__) == GPIO_AF1_I2C1) || ((__AF__) == GPIO_AF4_EVENTOUT) || \
Kojto 96:487b796308b0 1588 ((__AF__) == GPIO_AF6_EVENTOUT) || ((__AF__) == GPIO_AF5_SPI2) || \
Kojto 96:487b796308b0 1589 ((__AF__) == GPIO_AF5_I2C2) || ((__AF__) == GPIO_AF5_TIM2) || \
Kojto 96:487b796308b0 1590 ((__AF__) == GPIO_AF5_TIM21) || ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1591 ((__AF__) == GPIO_AF6_I2C2) || ((__AF__) == GPIO_AF6_TIM21))
Kojto 96:487b796308b0 1592
Kojto 96:487b796308b0 1593
Kojto 96:487b796308b0 1594
Kojto 96:487b796308b0 1595 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 1596 ((((__INSTANCE__) == GPIOA) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1597 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1598 ((__AF__) == GPIO_AF3_EVENTOUT) || \
Kojto 96:487b796308b0 1599 ((__AF__) == GPIO_AF4_USART2) || \
Kojto 96:487b796308b0 1600 ((__AF__) == GPIO_AF5_TIM22) || \
Kojto 96:487b796308b0 1601 ((__AF__) == GPIO_AF6_EVENTOUT) || \
Kojto 96:487b796308b0 1602 ((__AF__) == GPIO_AF7_COMP2))) || \
Kojto 96:487b796308b0 1603 (((__INSTANCE__) == GPIOB) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1604 ((__AF__) == GPIO_AF1_I2C1) || \
Kojto 96:487b796308b0 1605 ((__AF__) == GPIO_AF2_TIM2) || \
Kojto 96:487b796308b0 1606 ((__AF__) == GPIO_AF3_I2C1) || \
Kojto 96:487b796308b0 1607 ((__AF__) == GPIO_AF4_LPUART1) || \
Kojto 96:487b796308b0 1608 ((__AF__) == GPIO_AF5_I2C2) || \
Kojto 96:487b796308b0 1609 ((__AF__) == GPIO_AF6_TIM21))) || \
Kojto 96:487b796308b0 1610 (((__INSTANCE__) == GPIOC) && (((__AF__) == GPIO_AF0_EVENTOUT) || \
Kojto 96:487b796308b0 1611 ((__AF__) == GPIO_AF2_LPUART1))) || \
Kojto 96:487b796308b0 1612 (((__INSTANCE__) == GPIOD) && (((__AF__) == GPIO_AF0_LPUART1))))
Kojto 96:487b796308b0 1613
Kojto 96:487b796308b0 1614
Kojto 96:487b796308b0 1615 #endif /* STM32L051xx/STM32L061xx*/
Kojto 96:487b796308b0 1616 /*------------------------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1617
Kojto 96:487b796308b0 1618 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1619 /*------------------------- STM32L031xx/STM32L041xx---------------------------*/
Kojto 96:487b796308b0 1620 /*----------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1621 #if defined (STM32L031xx)|| defined (STM32L041xx)
Kojto 96:487b796308b0 1622 /* The table below gives an overview of the different alternate functions per port.
Kojto 96:487b796308b0 1623 * For more details refer yourself to the product data sheet.
Kojto 96:487b796308b0 1624 *
Kojto 96:487b796308b0 1625 */
Kojto 96:487b796308b0 1626 /* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 |
Kojto 96:487b796308b0 1627 *______________________________________________________________________________
Kojto 96:487b796308b0 1628 * PA0 | |LPTIM1 |TIM2_C1 | |USART2 |TIM2_TR | |COMP1 |
Kojto 96:487b796308b0 1629 * PA1 |EVENTOUT|LPTIM1 |TIM2_C2 |I2C1 |USART2 |TIM21_TR| | |
Kojto 96:487b796308b0 1630 * PA2 |TIM21_C1| |TIM2_C3 | |USART2 | |LPUART1 |COMP2 |
Kojto 96:487b796308b0 1631 * PA3 |TIM21_C2| |TIM2_C4 | |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 1632 * PA4 |SPI1 |LPTIM1 | | |USART2 |TIM22_TR| | |
Kojto 96:487b796308b0 1633 * PA5 |SPI1 |LPTIM1 |TIM2_TR | | |TIM2_C1 | | |
Kojto 96:487b796308b0 1634 * PA6 |SPI1 |LPTIM1 | | |LPUART |TIM22_C1|EVENTOUT|COMP1 |
Kojto 96:487b796308b0 1635 * PA7 |SPI1 |LPTIM1 | | |USART2 |TIM22_C2|EVENTOUT|COMP2 |
Kojto 96:487b796308b0 1636 * PA8 |MCO | |LPTIM1 |EVENTOUT|USART2 | | | |
Kojto 96:487b796308b0 1637 * PA9 |MCO |I2C1 | | |USART2 |TIM22_C1| | |
Kojto 96:487b796308b0 1638 * PA10| |I2C1 | | |USART2 |TIM22_C2| | |
Kojto 96:487b796308b0 1639 * PA11|SPI1 | |EVENTOUT| |USART2 | | |COMP1 |
Kojto 96:487b796308b0 1640 * PA12|SPI1 | |EVENTOUT| |USART2 | | |COMP2 |
Kojto 96:487b796308b0 1641 * PA13|SWDIO |LPTIM1 | | | | |LPUART1 | |
Kojto 96:487b796308b0 1642 * PA14|SWCLK |LPTIM1 | |I2C1 |USART2 | |LPUART1 | |
Kojto 96:487b796308b0 1643 * PA15|SPI1 | |TIM2_TR |EVENTOUT|USART2 |TIM2_C1 | | |
Kojto 96:487b796308b0 1644 *_____________________________________________________________________________|
Kojto 96:487b796308b0 1645 * PB0 |EVENTOUT|SPI1 | | |USART2 |TIM2_C3 | | |
Kojto 96:487b796308b0 1646 * PB1 |USART2 |SPI1 | | |LPUART1 |TIM2_C4 | | |
Kojto 96:487b796308b0 1647 * PB2 | | |LPTIM1_O| | | | | |
Kojto 96:487b796308b0 1648 * PB3 |SPI1 | |TIM2_C2 | |EVENTOUT| | | |
Kojto 96:487b796308b0 1649 * PB4 |SPI1 | |EVENTOUT| |TIM22_C1| | | |
Kojto 96:487b796308b0 1650 * PB5 |SPI1 | |LPTIM1_I|I2C1 |TIM22_C2| | | |
Kojto 96:487b796308b0 1651 * PB6 |USART2 |I2C1 |LPTIM1_T| | | | | |
Kojto 96:487b796308b0 1652 * PB7 |USART2 |I2C1 |LPTIM1_I| | | | | |
Kojto 96:487b796308b0 1653 * PB8 | | | | |I2C1 | | | |
Kojto 96:487b796308b0 1654 * PB9 | | |EVENTOUT| |I2C1 | | | |
Kojto 96:487b796308b0 1655 * PB10| | |TIM2_C3 | | | |LPUART1 | |
Kojto 96:487b796308b0 1656 * PB11|EVENTOUT| |TIM2_C4 | | | |LPUART1 | |
Kojto 96:487b796308b0 1657 * PB12|SPI2 | | | | | |EVENTOUT| |
Kojto 96:487b796308b0 1658 * PB13|SPI2 | |MCO | | |TIM21_C1|LPUART1 | |
Kojto 96:487b796308b0 1659 * PB14|SPI2 | |RTC | | |TIM21_C2|LPUART1 | |
Kojto 96:487b796308b0 1660 * PB15|SPI2 | |RTC | | | | | |
Kojto 96:487b796308b0 1661 *_____________________________________________________________________________|
Kojto 96:487b796308b0 1662 * PC0 |LPTIM1_I| |EVENTOUT| | | |LPUART1 | |
Kojto 96:487b796308b0 1663 * PC1 | | | | | | | | |
Kojto 96:487b796308b0 1664 * PC13| | | | | | | | |
Kojto 96:487b796308b0 1665 * PC14| | | | | | | | |
Kojto 96:487b796308b0 1666 * PC15| | | | | | | | |
Kojto 96:487b796308b0 1667 *_____________________________________________________________________________|
Kojto 96:487b796308b0 1668 * PH0 | | | | | | | | |
Kojto 96:487b796308b0 1669 * PH1 | | | | | | | | |
Kojto 96:487b796308b0 1670 *_____________________________________________________________________________|
Kojto 96:487b796308b0 1671 */
Kojto 96:487b796308b0 1672
Kojto 96:487b796308b0 1673 /** @defgroup GPIOEx_Alternate_function_selection Alternate function selection
Kojto 96:487b796308b0 1674 * @{
Kojto 96:487b796308b0 1675 */
Kojto 96:487b796308b0 1676
Kojto 96:487b796308b0 1677 /** @defgroup GPIOEx_Alternate_function_AF0 Alternate function AF0
Kojto 96:487b796308b0 1678 * @{
Kojto 96:487b796308b0 1679 */
Kojto 96:487b796308b0 1680 #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1681 #define GPIO_AF0_TIM21 ((uint8_t)0x00) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 1682 #define GPIO_AF0_SPI1 ((uint8_t)0x00) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1683 #define GPIO_AF0_USART2 ((uint8_t)0x00) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 1684 #define GPIO_AF0_LPTIM1 ((uint8_t)0x00) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1685 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 96:487b796308b0 1686 #define GPIO_AF0_SWDIO ((uint8_t)0x00) /* SWDIO Alternate Function mapping */
Kojto 96:487b796308b0 1687 #define GPIO_AF0_SWCLK ((uint8_t)0x00) /* SWCLK Alternate Function mapping */
Kojto 96:487b796308b0 1688 /**
Kojto 96:487b796308b0 1689 * @}
Kojto 96:487b796308b0 1690 */
Kojto 96:487b796308b0 1691
Kojto 96:487b796308b0 1692 /** @defgroup GPIOEx_Alternate_function_AF1 Alternate function AF1
Kojto 96:487b796308b0 1693 * @{
Kojto 96:487b796308b0 1694 */
Kojto 96:487b796308b0 1695 #define GPIO_AF1_SPI1 ((uint8_t)0x01) /* SPI1 Alternate Function mapping */
Kojto 96:487b796308b0 1696 #define GPIO_AF1_I2C1 ((uint8_t)0x01) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 1697 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1698 /**
Kojto 96:487b796308b0 1699 * @}
Kojto 96:487b796308b0 1700 */
Kojto 96:487b796308b0 1701
Kojto 96:487b796308b0 1702 /** @defgroup GPIOEx_Alternate_function_AF2 Alternate function AF2
Kojto 96:487b796308b0 1703 * @{
Kojto 96:487b796308b0 1704 */
Kojto 96:487b796308b0 1705 #define GPIO_AF2_LPTIM1 ((uint8_t)0x02) /* LPTIM1 Alternate Function mapping */
Kojto 96:487b796308b0 1706 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1707 #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1708 #define GPIO_AF2_RTC ((uint8_t)0x02) /* RTC_OUT Alternate Function mapping */
Kojto 96:487b796308b0 1709 /**
Kojto 96:487b796308b0 1710 * @}
Kojto 96:487b796308b0 1711 */
Kojto 96:487b796308b0 1712
Kojto 96:487b796308b0 1713 /** @defgroup GPIOEx_Alternate_function_AF3 Alternate function AF3
Kojto 96:487b796308b0 1714 * @{
Kojto 96:487b796308b0 1715 */
Kojto 96:487b796308b0 1716 #define GPIO_AF3_I2C1 ((uint8_t)0x03) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 1717 #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1718 /**
Kojto 96:487b796308b0 1719 * @}
Kojto 96:487b796308b0 1720 */
Kojto 96:487b796308b0 1721
Kojto 96:487b796308b0 1722 /** @defgroup GPIOEx_Alternate_function_AF4 Alternate function AF4
Kojto 96:487b796308b0 1723 * @{
Kojto 96:487b796308b0 1724 */
Kojto 96:487b796308b0 1725 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 96:487b796308b0 1726 #define GPIO_AF4_USART2 ((uint8_t)0x04) /* USART2 Alternate Function mapping */
Kojto 96:487b796308b0 1727 #define GPIO_AF4_LPUART1 ((uint8_t)0x04) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1728 #define GPIO_AF4_TIM22 ((uint8_t)0x04) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1729 #define GPIO_AF4_EVENTOUT ((uint8_t)0x04) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1730 /**
Kojto 96:487b796308b0 1731 * @}
Kojto 96:487b796308b0 1732 */
Kojto 96:487b796308b0 1733
Kojto 96:487b796308b0 1734 /** @defgroup GPIOEx_Alternate_function_AF5 Alternate function AF5
Kojto 96:487b796308b0 1735 * @{
Kojto 96:487b796308b0 1736 */
Kojto 96:487b796308b0 1737 #define GPIO_AF5_TIM2 ((uint8_t)0x05) /* TIM2 Alternate Function mapping */
Kojto 96:487b796308b0 1738 #define GPIO_AF5_TIM21 ((uint8_t)0x05) /* TIM21 Alternate Function mapping */
Kojto 96:487b796308b0 1739 #define GPIO_AF5_TIM22 ((uint8_t)0x05) /* TIM22 Alternate Function mapping */
Kojto 96:487b796308b0 1740 /**
Kojto 96:487b796308b0 1741 * @}
Kojto 96:487b796308b0 1742 */
Kojto 96:487b796308b0 1743
Kojto 96:487b796308b0 1744 /** @defgroup GPIOEx_Alternate_function_AF6 Alternate function AF6
Kojto 96:487b796308b0 1745 * @{
Kojto 96:487b796308b0 1746 */
Kojto 96:487b796308b0 1747 #define GPIO_AF6_LPUART1 ((uint8_t)0x06) /* LPUART1 Alternate Function mapping */
Kojto 96:487b796308b0 1748 #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /* EVENTOUT Alternate Function mapping */
Kojto 96:487b796308b0 1749 /**
Kojto 96:487b796308b0 1750 * @}
Kojto 96:487b796308b0 1751 */
Kojto 96:487b796308b0 1752
Kojto 96:487b796308b0 1753 /** @defgroup GPIOEx_Alternate_function_AF7 Alternate function AF7
Kojto 96:487b796308b0 1754 * @{
Kojto 96:487b796308b0 1755 */
Kojto 96:487b796308b0 1756 #define GPIO_AF7_COMP1 ((uint8_t)0x07) /* COMP1 Alternate Function mapping */
Kojto 96:487b796308b0 1757 #define GPIO_AF7_COMP2 ((uint8_t)0x07) /* COMP2 Alternate Function mapping */
Kojto 96:487b796308b0 1758 /**
Kojto 96:487b796308b0 1759 * @}
Kojto 96:487b796308b0 1760 */
Kojto 96:487b796308b0 1761
Kojto 96:487b796308b0 1762 /**
Kojto 96:487b796308b0 1763 * @}
Kojto 96:487b796308b0 1764 */
Kojto 96:487b796308b0 1765
Kojto 96:487b796308b0 1766 #define IS_GPIO_AF(__AF__) (((__AF__) == GPIO_AF0_EVENTOUT ) || \
Kojto 96:487b796308b0 1767 ((__AF__) == GPIO_AF0_TIM21 ) || \
Kojto 96:487b796308b0 1768 ((__AF__) == GPIO_AF0_SPI1 ) || \
Kojto 96:487b796308b0 1769 ((__AF__) == GPIO_AF0_USART2 ) || \
Kojto 96:487b796308b0 1770 ((__AF__) == GPIO_AF0_LPTIM1 ) || \
Kojto 96:487b796308b0 1771 ((__AF__) == GPIO_AF0_MCO ) || \
Kojto 96:487b796308b0 1772 ((__AF__) == GPIO_AF0_SWDIO ) || \
Kojto 96:487b796308b0 1773 ((__AF__) == GPIO_AF0_SWCLK ) || \
Kojto 96:487b796308b0 1774 ((__AF__) == GPIO_AF1_SPI1 ) || \
Kojto 96:487b796308b0 1775 ((__AF__) == GPIO_AF1_I2C1 ) || \
Kojto 96:487b796308b0 1776 ((__AF__) == GPIO_AF1_LPTIM1 ) || \
Kojto 96:487b796308b0 1777 ((__AF__) == GPIO_AF2_LPTIM1 ) || \
Kojto 96:487b796308b0 1778 ((__AF__) == GPIO_AF2_TIM2 ) || \
Kojto 96:487b796308b0 1779 ((__AF__) == GPIO_AF2_EVENTOUT ) || \
Kojto 96:487b796308b0 1780 ((__AF__) == GPIO_AF2_RTC ) || \
Kojto 96:487b796308b0 1781 ((__AF__) == GPIO_AF3_I2C1 ) || \
Kojto 96:487b796308b0 1782 ((__AF__) == GPIO_AF3_EVENTOUT ) || \
Kojto 96:487b796308b0 1783 ((__AF__) == GPIO_AF4_I2C1 ) || \
Kojto 96:487b796308b0 1784 ((__AF__) == GPIO_AF4_USART2 ) || \
Kojto 96:487b796308b0 1785 ((__AF__) == GPIO_AF4_LPUART1 ) || \
Kojto 96:487b796308b0 1786 ((__AF__) == GPIO_AF4_TIM22 ) || \
Kojto 96:487b796308b0 1787 ((__AF__) == GPIO_AF4_EVENTOUT ) || \
Kojto 96:487b796308b0 1788 ((__AF__) == GPIO_AF5_TIM2 ) || \
Kojto 96:487b796308b0 1789 ((__AF__) == GPIO_AF5_TIM21 ) || \
Kojto 96:487b796308b0 1790 ((__AF__) == GPIO_AF5_TIM22 ) || \
Kojto 96:487b796308b0 1791 ((__AF__) == GPIO_AF6_LPUART1 ) || \
Kojto 96:487b796308b0 1792 ((__AF__) == GPIO_AF6_EVENTOUT ) || \
Kojto 96:487b796308b0 1793 ((__AF__) == GPIO_AF7_COMP1 ) || \
Kojto 96:487b796308b0 1794 ((__AF__) == GPIO_AF7_COMP2 ))
Kojto 96:487b796308b0 1795
Kojto 96:487b796308b0 1796
Kojto 96:487b796308b0 1797
Kojto 96:487b796308b0 1798 #define IS_GPIO_AF_AVAILABLE(__INSTANCE__,__AF__) \
Kojto 96:487b796308b0 1799 (1)
Kojto 96:487b796308b0 1800
Kojto 96:487b796308b0 1801
Kojto 96:487b796308b0 1802 #endif /* STM32L031xx/STM32L041xx*/
Kojto 96:487b796308b0 1803 /*------------------------------------------------------------------------------------------*/
Kojto 96:487b796308b0 1804
Kojto 96:487b796308b0 1805
Kojto 96:487b796308b0 1806
Kojto 96:487b796308b0 1807 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 96:487b796308b0 1808 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
Kojto 96:487b796308b0 1809
Kojto 96:487b796308b0 1810 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 96:487b796308b0 1811 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 96:487b796308b0 1812 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 96:487b796308b0 1813 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 96:487b796308b0 1814 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 96:487b796308b0 1815 ((__GPIOx__) == (GPIOH))? 5U : 6U)
Kojto 96:487b796308b0 1816
Kojto 96:487b796308b0 1817 /** @defgroup GPIOEx_Pin_Available Pin available
Kojto 96:487b796308b0 1818 * @{
Kojto 96:487b796308b0 1819 */
Kojto 96:487b796308b0 1820 #define GPIOA_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1821 #define GPIOB_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1822 #define GPIOC_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1823 #define GPIOD_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1824 #define GPIOE_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1825 #define GPIOH_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_9 | GPIO_PIN_10)
Kojto 96:487b796308b0 1826 /**
Kojto 96:487b796308b0 1827 * @}
Kojto 96:487b796308b0 1828 */
Kojto 96:487b796308b0 1829
Kojto 96:487b796308b0 1830 #define IS_GPIO_PIN_AVAILABLE(__INSTANCE__,__PIN__) \
Kojto 96:487b796308b0 1831 ((((__INSTANCE__) == GPIOA) && (((__PIN__) & (GPIOA_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOA_PIN_AVAILABLE)) == (GPIOA_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1832 (((__INSTANCE__) == GPIOB) && (((__PIN__) & (GPIOB_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOB_PIN_AVAILABLE)) == (GPIOB_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1833 (((__INSTANCE__) == GPIOC) && (((__PIN__) & (GPIOC_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOC_PIN_AVAILABLE)) == (GPIOC_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1834 (((__INSTANCE__) == GPIOD) && (((__PIN__) & (GPIOD_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOD_PIN_AVAILABLE)) == (GPIOD_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1835 (((__INSTANCE__) == GPIOE) && (((__PIN__) & (GPIOE_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOE_PIN_AVAILABLE)) == (GPIOE_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1836 (((__INSTANCE__) == GPIOH) && (((__PIN__) & (GPIOH_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOH_PIN_AVAILABLE)) == (GPIOH_PIN_AVAILABLE))))
Kojto 96:487b796308b0 1837
Kojto 96:487b796308b0 1838 #elif defined (STM32L031xx) || defined (STM32L041xx)
Kojto 96:487b796308b0 1839
Kojto 96:487b796308b0 1840 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 96:487b796308b0 1841 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 96:487b796308b0 1842 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 96:487b796308b0 1843 ((__GPIOx__) == (GPIOH))? 5U : 6U)
Kojto 96:487b796308b0 1844
Kojto 96:487b796308b0 1845 /** @defgroup GPIOEx_Pin_Available Pin available
Kojto 96:487b796308b0 1846 * @{
Kojto 96:487b796308b0 1847 */
Kojto 96:487b796308b0 1848 #define GPIOA_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1849 #define GPIOB_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1850 #define GPIOC_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15)
Kojto 96:487b796308b0 1851 #define GPIOH_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1)
Kojto 96:487b796308b0 1852 /**
Kojto 96:487b796308b0 1853 * @}
Kojto 96:487b796308b0 1854 */
Kojto 96:487b796308b0 1855
Kojto 96:487b796308b0 1856 #define IS_GPIO_PIN_AVAILABLE(__INSTANCE__,__PIN__) \
Kojto 96:487b796308b0 1857 ((((__INSTANCE__) == GPIOA) && (((__PIN__) & (GPIOA_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOA_PIN_AVAILABLE)) == (GPIOA_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1858 (((__INSTANCE__) == GPIOB) && (((__PIN__) & (GPIOB_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOB_PIN_AVAILABLE)) == (GPIOB_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1859 (((__INSTANCE__) == GPIOC) && (((__PIN__) & (GPIOC_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOC_PIN_AVAILABLE)) == (GPIOC_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1860 (((__INSTANCE__) == GPIOH) && (((__PIN__) & (GPIOH_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOH_PIN_AVAILABLE)) == (GPIOH_PIN_AVAILABLE))))
Kojto 96:487b796308b0 1861
Kojto 96:487b796308b0 1862 #elif defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 96:487b796308b0 1863 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx)
Kojto 96:487b796308b0 1864
Kojto 96:487b796308b0 1865 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 96:487b796308b0 1866 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 96:487b796308b0 1867 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 96:487b796308b0 1868 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 96:487b796308b0 1869 ((__GPIOx__) == (GPIOH))? 5U : 6U)
Kojto 96:487b796308b0 1870
Kojto 96:487b796308b0 1871 /** @defgroup GPIOEx_Pin_Available Pin available
Kojto 96:487b796308b0 1872 * @{
Kojto 96:487b796308b0 1873 */
Kojto 96:487b796308b0 1874 #define GPIOA_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1875 #define GPIOB_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1876 #define GPIOC_PIN_AVAILABLE GPIO_PIN_All
Kojto 96:487b796308b0 1877 #define GPIOD_PIN_AVAILABLE GPIO_PIN_2
Kojto 96:487b796308b0 1878 #define GPIOH_PIN_AVAILABLE GPIO_PIN_0 | GPIO_PIN_1
Kojto 96:487b796308b0 1879 /**
Kojto 96:487b796308b0 1880 * @}
Kojto 96:487b796308b0 1881 */
Kojto 96:487b796308b0 1882
Kojto 96:487b796308b0 1883 #define IS_GPIO_PIN_AVAILABLE(__INSTANCE__,__PIN__) \
Kojto 96:487b796308b0 1884 ((((__INSTANCE__) == GPIOA) && (((__PIN__) & (GPIOA_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOA_PIN_AVAILABLE)) == (GPIOA_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1885 (((__INSTANCE__) == GPIOB) && (((__PIN__) & (GPIOB_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOB_PIN_AVAILABLE)) == (GPIOB_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1886 (((__INSTANCE__) == GPIOC) && (((__PIN__) & (GPIOC_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOC_PIN_AVAILABLE)) == (GPIOC_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1887 (((__INSTANCE__) == GPIOD) && (((__PIN__) & (GPIOD_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOD_PIN_AVAILABLE)) == (GPIOD_PIN_AVAILABLE))) || \
Kojto 96:487b796308b0 1888 (((__INSTANCE__) == GPIOH) && (((__PIN__) & (GPIOH_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOH_PIN_AVAILABLE)) == (GPIOH_PIN_AVAILABLE))))
Kojto 96:487b796308b0 1889
Kojto 96:487b796308b0 1890
Kojto 96:487b796308b0 1891 #endif /* STM32L083xx || STM32L082xx || STM32L081xx || STM32L073xx || STM32L072xx || STM32L071xx*/
bogdanm 84:0b3ab51c8877 1892
bogdanm 84:0b3ab51c8877 1893
bogdanm 84:0b3ab51c8877 1894 /**
bogdanm 84:0b3ab51c8877 1895 * @}
bogdanm 84:0b3ab51c8877 1896 */
bogdanm 84:0b3ab51c8877 1897
bogdanm 84:0b3ab51c8877 1898 /**
Kojto 96:487b796308b0 1899 * @}
Kojto 96:487b796308b0 1900 */
Kojto 96:487b796308b0 1901
Kojto 96:487b796308b0 1902 /**
Kojto 96:487b796308b0 1903 * @}
Kojto 96:487b796308b0 1904 */
bogdanm 84:0b3ab51c8877 1905 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 1906 }
bogdanm 84:0b3ab51c8877 1907 #endif
bogdanm 84:0b3ab51c8877 1908
bogdanm 84:0b3ab51c8877 1909 #endif /* __STM32L0xx_HAL_GPIO_EX_H */
bogdanm 84:0b3ab51c8877 1910
bogdanm 84:0b3ab51c8877 1911 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 96:487b796308b0 1912