Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_F031K6/stm32f0xx_hal_gpio_ex.h@109:9296ab0bfc11, 2015-10-29 (annotated)
- Committer:
- Kojto
- Date:
- Thu Oct 29 08:40:18 2015 +0000
- Revision:
- 109:9296ab0bfc11
Release 109 of the mbed library
Changes:
- new platforms - NUCLEO_F042K6, WIZNWIKI_W7500ECO
- MTS targets - bootloaders update to 0.1.1
- STM F7 - RTC enable fixes
- STM F4 - i2c pending stop before start fix
- STM all targets - analogout normalization fix
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kojto | 109:9296ab0bfc11 | 1 | /** |
| Kojto | 109:9296ab0bfc11 | 2 | ****************************************************************************** |
| Kojto | 109:9296ab0bfc11 | 3 | * @file stm32f0xx_hal_gpio_ex.h |
| Kojto | 109:9296ab0bfc11 | 4 | * @author MCD Application Team |
| Kojto | 109:9296ab0bfc11 | 5 | * @version V1.3.0 |
| Kojto | 109:9296ab0bfc11 | 6 | * @date 26-June-2015 |
| Kojto | 109:9296ab0bfc11 | 7 | * @brief Header file of GPIO HAL Extension module. |
| Kojto | 109:9296ab0bfc11 | 8 | ****************************************************************************** |
| Kojto | 109:9296ab0bfc11 | 9 | * @attention |
| Kojto | 109:9296ab0bfc11 | 10 | * |
| Kojto | 109:9296ab0bfc11 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
| Kojto | 109:9296ab0bfc11 | 12 | * |
| Kojto | 109:9296ab0bfc11 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
| Kojto | 109:9296ab0bfc11 | 14 | * are permitted provided that the following conditions are met: |
| Kojto | 109:9296ab0bfc11 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
| Kojto | 109:9296ab0bfc11 | 16 | * this list of conditions and the following disclaimer. |
| Kojto | 109:9296ab0bfc11 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| Kojto | 109:9296ab0bfc11 | 18 | * this list of conditions and the following disclaimer in the documentation |
| Kojto | 109:9296ab0bfc11 | 19 | * and/or other materials provided with the distribution. |
| Kojto | 109:9296ab0bfc11 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| Kojto | 109:9296ab0bfc11 | 21 | * may be used to endorse or promote products derived from this software |
| Kojto | 109:9296ab0bfc11 | 22 | * without specific prior written permission. |
| Kojto | 109:9296ab0bfc11 | 23 | * |
| Kojto | 109:9296ab0bfc11 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| Kojto | 109:9296ab0bfc11 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| Kojto | 109:9296ab0bfc11 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| Kojto | 109:9296ab0bfc11 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| Kojto | 109:9296ab0bfc11 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| Kojto | 109:9296ab0bfc11 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| Kojto | 109:9296ab0bfc11 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| Kojto | 109:9296ab0bfc11 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| Kojto | 109:9296ab0bfc11 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| Kojto | 109:9296ab0bfc11 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Kojto | 109:9296ab0bfc11 | 34 | * |
| Kojto | 109:9296ab0bfc11 | 35 | ****************************************************************************** |
| Kojto | 109:9296ab0bfc11 | 36 | */ |
| Kojto | 109:9296ab0bfc11 | 37 | |
| Kojto | 109:9296ab0bfc11 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 39 | #ifndef __STM32F0xx_HAL_GPIO_EX_H |
| Kojto | 109:9296ab0bfc11 | 40 | #define __STM32F0xx_HAL_GPIO_EX_H |
| Kojto | 109:9296ab0bfc11 | 41 | |
| Kojto | 109:9296ab0bfc11 | 42 | #ifdef __cplusplus |
| Kojto | 109:9296ab0bfc11 | 43 | extern "C" { |
| Kojto | 109:9296ab0bfc11 | 44 | #endif |
| Kojto | 109:9296ab0bfc11 | 45 | |
| Kojto | 109:9296ab0bfc11 | 46 | /* Includes ------------------------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 47 | #include "stm32f0xx_hal_def.h" |
| Kojto | 109:9296ab0bfc11 | 48 | |
| Kojto | 109:9296ab0bfc11 | 49 | /** @addtogroup STM32F0xx_HAL_Driver |
| Kojto | 109:9296ab0bfc11 | 50 | * @{ |
| Kojto | 109:9296ab0bfc11 | 51 | */ |
| Kojto | 109:9296ab0bfc11 | 52 | |
| Kojto | 109:9296ab0bfc11 | 53 | /** @defgroup GPIOEx GPIOEx |
| Kojto | 109:9296ab0bfc11 | 54 | * @{ |
| Kojto | 109:9296ab0bfc11 | 55 | */ |
| Kojto | 109:9296ab0bfc11 | 56 | |
| Kojto | 109:9296ab0bfc11 | 57 | /* Exported types ------------------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 58 | /* Exported constants --------------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 59 | /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants |
| Kojto | 109:9296ab0bfc11 | 60 | * @{ |
| Kojto | 109:9296ab0bfc11 | 61 | */ |
| Kojto | 109:9296ab0bfc11 | 62 | |
| Kojto | 109:9296ab0bfc11 | 63 | /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection |
| Kojto | 109:9296ab0bfc11 | 64 | * @{ |
| Kojto | 109:9296ab0bfc11 | 65 | */ |
| Kojto | 109:9296ab0bfc11 | 66 | |
| Kojto | 109:9296ab0bfc11 | 67 | #if defined (STM32F030x6) |
| Kojto | 109:9296ab0bfc11 | 68 | /*------------------------- STM32F030x6---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 69 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 70 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 71 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 72 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 73 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 74 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 75 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 76 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 77 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 78 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 79 | |
| Kojto | 109:9296ab0bfc11 | 80 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 81 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 82 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 83 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 84 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 85 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 86 | |
| Kojto | 109:9296ab0bfc11 | 87 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 88 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 89 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 90 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 91 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 92 | |
| Kojto | 109:9296ab0bfc11 | 93 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 94 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 95 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 96 | |
| Kojto | 109:9296ab0bfc11 | 97 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 98 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 99 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 100 | |
| Kojto | 109:9296ab0bfc11 | 101 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 102 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 103 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 104 | |
| Kojto | 109:9296ab0bfc11 | 105 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 106 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 107 | |
| Kojto | 109:9296ab0bfc11 | 108 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 109 | |
| Kojto | 109:9296ab0bfc11 | 110 | #endif /* STM32F030x6 */ |
| Kojto | 109:9296ab0bfc11 | 111 | |
| Kojto | 109:9296ab0bfc11 | 112 | /*---------------------------------- STM32F030x8 -------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 113 | #if defined (STM32F030x8) |
| Kojto | 109:9296ab0bfc11 | 114 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 115 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 116 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 117 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 118 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 119 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 120 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 121 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 122 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 123 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 124 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 125 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 126 | |
| Kojto | 109:9296ab0bfc11 | 127 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 128 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 129 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 130 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 131 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 132 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 133 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 134 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 135 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 136 | |
| Kojto | 109:9296ab0bfc11 | 137 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 138 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 139 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 140 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 141 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 142 | |
| Kojto | 109:9296ab0bfc11 | 143 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 144 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 145 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 146 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 147 | |
| Kojto | 109:9296ab0bfc11 | 148 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 149 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 150 | |
| Kojto | 109:9296ab0bfc11 | 151 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 152 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 153 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 154 | |
| Kojto | 109:9296ab0bfc11 | 155 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 156 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 157 | |
| Kojto | 109:9296ab0bfc11 | 158 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 159 | |
| Kojto | 109:9296ab0bfc11 | 160 | #endif /* STM32F030x8 */ |
| Kojto | 109:9296ab0bfc11 | 161 | |
| Kojto | 109:9296ab0bfc11 | 162 | #if defined (STM32F031x6) || defined (STM32F038xx) |
| Kojto | 109:9296ab0bfc11 | 163 | /*--------------------------- STM32F031x6/STM32F038xx ---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 164 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 165 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 166 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 167 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 168 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 169 | #define GPIO_AF0_SWDAT ((uint8_t)0x00) /*!< AF0: SWDAT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 170 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 171 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 172 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 173 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 174 | |
| Kojto | 109:9296ab0bfc11 | 175 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 176 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 177 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 178 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 179 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 180 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 181 | |
| Kojto | 109:9296ab0bfc11 | 182 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 183 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 184 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 185 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 186 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 187 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 188 | |
| Kojto | 109:9296ab0bfc11 | 189 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 190 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 191 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 192 | |
| Kojto | 109:9296ab0bfc11 | 193 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 194 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 195 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 196 | |
| Kojto | 109:9296ab0bfc11 | 197 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 198 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 199 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 200 | |
| Kojto | 109:9296ab0bfc11 | 201 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 202 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 203 | |
| Kojto | 109:9296ab0bfc11 | 204 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 205 | |
| Kojto | 109:9296ab0bfc11 | 206 | #endif /* STM32F031x6 || STM32F038xx */ |
| Kojto | 109:9296ab0bfc11 | 207 | |
| Kojto | 109:9296ab0bfc11 | 208 | #if defined (STM32F051x8) || defined (STM32F058xx) |
| Kojto | 109:9296ab0bfc11 | 209 | /*--------------------------- STM32F051x8/STM32F058xx---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 210 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 211 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 212 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 213 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 214 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 215 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 216 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 217 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 218 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 219 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 220 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 221 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 222 | #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 223 | |
| Kojto | 109:9296ab0bfc11 | 224 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 225 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 226 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 227 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 228 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 229 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 230 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 231 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 232 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 233 | #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 234 | |
| Kojto | 109:9296ab0bfc11 | 235 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 236 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 237 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 238 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 239 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 240 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 241 | |
| Kojto | 109:9296ab0bfc11 | 242 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 243 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 244 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 245 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 246 | #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 247 | |
| Kojto | 109:9296ab0bfc11 | 248 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 249 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 250 | |
| Kojto | 109:9296ab0bfc11 | 251 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 252 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 253 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 254 | |
| Kojto | 109:9296ab0bfc11 | 255 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 256 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 257 | |
| Kojto | 109:9296ab0bfc11 | 258 | /* AF 7 */ |
| Kojto | 109:9296ab0bfc11 | 259 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 260 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 261 | |
| Kojto | 109:9296ab0bfc11 | 262 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07) |
| Kojto | 109:9296ab0bfc11 | 263 | |
| Kojto | 109:9296ab0bfc11 | 264 | #endif /* STM32F051x8/STM32F058xx */ |
| Kojto | 109:9296ab0bfc11 | 265 | |
| Kojto | 109:9296ab0bfc11 | 266 | #if defined (STM32F071xB) |
| Kojto | 109:9296ab0bfc11 | 267 | /*--------------------------- STM32F071xB ---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 268 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 269 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: AEVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 270 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 271 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 272 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 273 | #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 274 | #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 275 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 276 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 277 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 278 | #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 279 | #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 280 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 281 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 282 | #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 283 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 284 | #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 285 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 286 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 287 | #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 288 | #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 289 | |
| Kojto | 109:9296ab0bfc11 | 290 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 291 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 292 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 293 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 294 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 295 | #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 296 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 297 | #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 298 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 299 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 300 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 301 | #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 302 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 303 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 304 | |
| Kojto | 109:9296ab0bfc11 | 305 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 306 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 307 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 308 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 309 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 310 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 311 | |
| Kojto | 109:9296ab0bfc11 | 312 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 313 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 314 | #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 315 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 316 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 317 | |
| Kojto | 109:9296ab0bfc11 | 318 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 319 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 320 | #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 321 | #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 322 | #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 323 | |
| Kojto | 109:9296ab0bfc11 | 324 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 325 | #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 326 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 327 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 328 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 329 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 330 | |
| Kojto | 109:9296ab0bfc11 | 331 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 332 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 333 | |
| Kojto | 109:9296ab0bfc11 | 334 | /* AF 7 */ |
| Kojto | 109:9296ab0bfc11 | 335 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 336 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 337 | |
| Kojto | 109:9296ab0bfc11 | 338 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07) |
| Kojto | 109:9296ab0bfc11 | 339 | |
| Kojto | 109:9296ab0bfc11 | 340 | #endif /* STM32F071xB */ |
| Kojto | 109:9296ab0bfc11 | 341 | |
| Kojto | 109:9296ab0bfc11 | 342 | |
| Kojto | 109:9296ab0bfc11 | 343 | #if defined(STM32F091xC) || defined(STM32F098xx) |
| Kojto | 109:9296ab0bfc11 | 344 | /*--------------------------- STM32F091xC || STM32F098xx ------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 345 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 346 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 347 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 348 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 349 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 350 | #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 351 | #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 352 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 353 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 354 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 355 | #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 356 | #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 357 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 358 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 359 | #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 360 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 361 | #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 362 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 363 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 364 | #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 365 | #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 366 | #define GPIO_AF0_USART8 ((uint8_t)0x00) /*!< AF0: USART8 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 367 | #define GPIO_AF0_CAN ((uint8_t)0x00) /*!< AF0: CAN Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 368 | |
| Kojto | 109:9296ab0bfc11 | 369 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 370 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 371 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 372 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 373 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 374 | #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 375 | #define GPIO_AF1_USART4 ((uint8_t)0x01) /*!< AF1: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 376 | #define GPIO_AF1_USART5 ((uint8_t)0x01) /*!< AF1: USART5 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 377 | #define GPIO_AF1_USART6 ((uint8_t)0x01) /*!< AF1: USART6 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 378 | #define GPIO_AF1_USART7 ((uint8_t)0x01) /*!< AF1: USART7 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 379 | #define GPIO_AF1_USART8 ((uint8_t)0x01) /*!< AF1: USART8 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 380 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 381 | #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 382 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 383 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 384 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 385 | #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 386 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 387 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 388 | |
| Kojto | 109:9296ab0bfc11 | 389 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 390 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 391 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 392 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 393 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 394 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 395 | #define GPIO_AF2_USART5 ((uint8_t)0x02) /*!< AF2: USART5 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 396 | #define GPIO_AF2_USART6 ((uint8_t)0x02) /*!< AF2: USART6 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 397 | #define GPIO_AF2_USART7 ((uint8_t)0x02) /*!< AF2: USART7 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 398 | #define GPIO_AF2_USART8 ((uint8_t)0x02) /*!< AF2: USART8 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 399 | |
| Kojto | 109:9296ab0bfc11 | 400 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 401 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 402 | #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 403 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 404 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 405 | |
| Kojto | 109:9296ab0bfc11 | 406 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 407 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 408 | #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 409 | #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 410 | #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 411 | #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 412 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 413 | #define GPIO_AF4_USART5 ((uint8_t)0x04) /*!< AF4: USART5 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 414 | |
| Kojto | 109:9296ab0bfc11 | 415 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 416 | #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 417 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 418 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 419 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 420 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 421 | #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 422 | #define GPIO_AF5_USART6 ((uint8_t)0x05) /*!< AF5: USART6 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 423 | |
| Kojto | 109:9296ab0bfc11 | 424 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 425 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 426 | |
| Kojto | 109:9296ab0bfc11 | 427 | /* AF 7 */ |
| Kojto | 109:9296ab0bfc11 | 428 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 429 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 430 | |
| Kojto | 109:9296ab0bfc11 | 431 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07) |
| Kojto | 109:9296ab0bfc11 | 432 | |
| Kojto | 109:9296ab0bfc11 | 433 | #endif /* STM32F091xC || STM32F098xx */ |
| Kojto | 109:9296ab0bfc11 | 434 | |
| Kojto | 109:9296ab0bfc11 | 435 | #if defined(STM32F030xC) |
| Kojto | 109:9296ab0bfc11 | 436 | /*--------------------------- STM32F030xC ----------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 437 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 438 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 439 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 440 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 441 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 442 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 443 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 444 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 445 | #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 446 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 447 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 448 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 449 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 450 | #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 451 | |
| Kojto | 109:9296ab0bfc11 | 452 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 453 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 454 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 455 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 456 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 457 | #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 458 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 459 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 460 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 461 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 462 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 463 | |
| Kojto | 109:9296ab0bfc11 | 464 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 465 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 466 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 467 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 468 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 469 | #define GPIO_AF2_USART5 ((uint8_t)0x02) /*!< AF2: USART5 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 470 | #define GPIO_AF2_USART6 ((uint8_t)0x02) /*!< AF2: USART6 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 471 | |
| Kojto | 109:9296ab0bfc11 | 472 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 473 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 474 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 475 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 476 | |
| Kojto | 109:9296ab0bfc11 | 477 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 478 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 479 | #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 480 | #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 481 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 482 | #define GPIO_AF4_USART5 ((uint8_t)0x04) /*!< AF4: USART5 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 483 | |
| Kojto | 109:9296ab0bfc11 | 484 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 485 | #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 486 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 487 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 488 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 489 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 490 | #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 491 | #define GPIO_AF5_USART6 ((uint8_t)0x05) /*!< AF5: USART6 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 492 | |
| Kojto | 109:9296ab0bfc11 | 493 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 494 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 495 | |
| Kojto | 109:9296ab0bfc11 | 496 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 497 | |
| Kojto | 109:9296ab0bfc11 | 498 | #endif /* STM32F030xC */ |
| Kojto | 109:9296ab0bfc11 | 499 | |
| Kojto | 109:9296ab0bfc11 | 500 | #if defined (STM32F072xB) || defined (STM32F078xx) |
| Kojto | 109:9296ab0bfc11 | 501 | /*--------------------------- STM32F072xB/STM32F078xx ---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 502 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 503 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 504 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 505 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 506 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 507 | #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 508 | #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 509 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 510 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 511 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 512 | #define GPIO_AF0_TIM1 ((uint8_t)0x00) /*!< AF0: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 513 | #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 514 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 515 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 516 | #define GPIO_AF0_TIM16 ((uint8_t)0x00) /*!< AF0: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 517 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 518 | #define GPIO_AF0_TSC ((uint8_t)0x00) /*!< AF0: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 519 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 520 | #define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 521 | #define GPIO_AF0_USART3 ((uint8_t)0x00) /*!< AF0: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 522 | #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 523 | #define GPIO_AF0_CAN ((uint8_t)0x00) /*!< AF0: CAN Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 524 | |
| Kojto | 109:9296ab0bfc11 | 525 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 526 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 527 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 528 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 529 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 530 | #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 531 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 532 | #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 533 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 534 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 535 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 536 | #define GPIO_AF1_TSC ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 537 | #define GPIO_AF1_SPI1 ((uint8_t)0x01) /*!< AF1: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 538 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 539 | |
| Kojto | 109:9296ab0bfc11 | 540 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 541 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 542 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 543 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 544 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 545 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 546 | #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 547 | |
| Kojto | 109:9296ab0bfc11 | 548 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 549 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 550 | #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 551 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 552 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 553 | |
| Kojto | 109:9296ab0bfc11 | 554 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 555 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 556 | #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 557 | #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 558 | #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 559 | #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 560 | |
| Kojto | 109:9296ab0bfc11 | 561 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 562 | #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 563 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 564 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 565 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 566 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 567 | |
| Kojto | 109:9296ab0bfc11 | 568 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 569 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 570 | |
| Kojto | 109:9296ab0bfc11 | 571 | /* AF 7 */ |
| Kojto | 109:9296ab0bfc11 | 572 | #define GPIO_AF7_COMP1 ((uint8_t)0x07) /*!< AF7: COMP1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 573 | #define GPIO_AF7_COMP2 ((uint8_t)0x07) /*!< AF7: COMP2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 574 | |
| Kojto | 109:9296ab0bfc11 | 575 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x07) |
| Kojto | 109:9296ab0bfc11 | 576 | |
| Kojto | 109:9296ab0bfc11 | 577 | #endif /* STM32F072xB || STM32F078xx */ |
| Kojto | 109:9296ab0bfc11 | 578 | |
| Kojto | 109:9296ab0bfc11 | 579 | #if defined (STM32F070xB) |
| Kojto | 109:9296ab0bfc11 | 580 | /*---------------------------------- STM32F070xB ---------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 581 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 582 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 583 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 584 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 585 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 586 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 587 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 588 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 589 | #define GPIO_AF0_TIM3 ((uint8_t)0x00) /*!< AF0: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 590 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 591 | #define GPIO_AF0_TIM15 ((uint8_t)0x00) /*!< AF0: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 592 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 593 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 594 | #define GPIO_AF0_USART4 ((uint8_t)0x00) /*!< AF0: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 595 | |
| Kojto | 109:9296ab0bfc11 | 596 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 597 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 598 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /*!< AF1: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 599 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 600 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 601 | #define GPIO_AF1_USART3 ((uint8_t)0x01) /*!< AF1: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 602 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 603 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 604 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 605 | #define GPIO_AF1_I2C2 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 606 | #define GPIO_AF1_SPI2 ((uint8_t)0x01) /*!< AF1: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 607 | |
| Kojto | 109:9296ab0bfc11 | 608 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 609 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 610 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 611 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 612 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 613 | #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 614 | |
| Kojto | 109:9296ab0bfc11 | 615 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 616 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 617 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 618 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /*!< AF3: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 619 | |
| Kojto | 109:9296ab0bfc11 | 620 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 621 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 622 | #define GPIO_AF4_USART4 ((uint8_t)0x04) /*!< AF4: USART4 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 623 | #define GPIO_AF4_USART3 ((uint8_t)0x04) /*!< AF4: USART3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 624 | |
| Kojto | 109:9296ab0bfc11 | 625 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 626 | #define GPIO_AF5_TIM15 ((uint8_t)0x05) /*!< AF5: TIM15 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 627 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 628 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 629 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 630 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 631 | |
| Kojto | 109:9296ab0bfc11 | 632 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 633 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 634 | |
| Kojto | 109:9296ab0bfc11 | 635 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 636 | |
| Kojto | 109:9296ab0bfc11 | 637 | #endif /* STM32F070xB */ |
| Kojto | 109:9296ab0bfc11 | 638 | |
| Kojto | 109:9296ab0bfc11 | 639 | #if defined (STM32F042x6) || defined (STM32F048xx) |
| Kojto | 109:9296ab0bfc11 | 640 | /*--------------------------- STM32F042x6/STM32F048xx ---------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 641 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 642 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 643 | #define GPIO_AF0_CEC ((uint8_t)0x00) /*!< AF0: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 644 | #define GPIO_AF0_CRS ((uint8_t)0x00) /*!< AF0: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 645 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 646 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 647 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1/I2S1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 648 | #define GPIO_AF0_SPI2 ((uint8_t)0x00) /*!< AF0: SPI2/I2S2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 649 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 650 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 651 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 652 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 653 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 654 | |
| Kojto | 109:9296ab0bfc11 | 655 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 656 | #define GPIO_AF1_CEC ((uint8_t)0x01) /*!< AF1: CEC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 657 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 658 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 659 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 660 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 661 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 662 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 663 | |
| Kojto | 109:9296ab0bfc11 | 664 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 665 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 666 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 667 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< AF2: TIM2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 668 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 669 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 670 | #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 671 | |
| Kojto | 109:9296ab0bfc11 | 672 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 673 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 674 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 675 | #define GPIO_AF3_TSC ((uint8_t)0x03) /*!< AF3: TSC Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 676 | |
| Kojto | 109:9296ab0bfc11 | 677 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 678 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 679 | #define GPIO_AF4_CAN ((uint8_t)0x04) /*!< AF4: CAN Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 680 | #define GPIO_AF4_CRS ((uint8_t)0x04) /*!< AF4: CRS Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 681 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 682 | |
| Kojto | 109:9296ab0bfc11 | 683 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 684 | #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 685 | #define GPIO_AF5_I2C1 ((uint8_t)0x05) /*!< AF5: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 686 | #define GPIO_AF5_I2C2 ((uint8_t)0x05) /*!< AF5: I2C2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 687 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< AF5: SPI2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 688 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 689 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 690 | #define GPIO_AF5_USB ((uint8_t)0x05) /*!< AF5: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 691 | |
| Kojto | 109:9296ab0bfc11 | 692 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 693 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 694 | |
| Kojto | 109:9296ab0bfc11 | 695 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 696 | |
| Kojto | 109:9296ab0bfc11 | 697 | #endif /* STM32F042x6 || STM32F048xx */ |
| Kojto | 109:9296ab0bfc11 | 698 | |
| Kojto | 109:9296ab0bfc11 | 699 | #if defined (STM32F070x6) |
| Kojto | 109:9296ab0bfc11 | 700 | /*--------------------------------------- STM32F070x6 ----------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 701 | /* AF 0 */ |
| Kojto | 109:9296ab0bfc11 | 702 | #define GPIO_AF0_EVENTOUT ((uint8_t)0x00) /*!< AF0: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 703 | #define GPIO_AF0_IR ((uint8_t)0x00) /*!< AF0: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 704 | #define GPIO_AF0_MCO ((uint8_t)0x00) /*!< AF0: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 705 | #define GPIO_AF0_SPI1 ((uint8_t)0x00) /*!< AF0: SPI1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 706 | #define GPIO_AF0_SWDIO ((uint8_t)0x00) /*!< AF0: SWDIO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 707 | #define GPIO_AF0_SWCLK ((uint8_t)0x00) /*!< AF0: SWCLK Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 708 | #define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< AF0: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 709 | #define GPIO_AF0_TIM17 ((uint8_t)0x00) /*!< AF0: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 710 | #define GPIO_AF0_USART1 ((uint8_t)0x00) /*!< AF0: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 711 | |
| Kojto | 109:9296ab0bfc11 | 712 | /* AF 1 */ |
| Kojto | 109:9296ab0bfc11 | 713 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /*!< AF1: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 714 | #define GPIO_AF1_I2C1 ((uint8_t)0x01) /*!< AF1: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 715 | #define GPIO_AF1_IR ((uint8_t)0x01) /*!< AF1: IR Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 716 | #define GPIO_AF1_USART1 ((uint8_t)0x01) /*!< AF1: USART1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 717 | #define GPIO_AF1_USART2 ((uint8_t)0x01) /*!< AF1: USART2 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 718 | #define GPIO_AF1_TIM3 ((uint8_t)0x01) /*!< AF1: TIM3 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 719 | |
| Kojto | 109:9296ab0bfc11 | 720 | /* AF 2 */ |
| Kojto | 109:9296ab0bfc11 | 721 | #define GPIO_AF2_EVENTOUT ((uint8_t)0x02) /*!< AF2: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 722 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< AF2: TIM1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 723 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /*!< AF2: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 724 | #define GPIO_AF2_TIM17 ((uint8_t)0x02) /*!< AF2: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 725 | #define GPIO_AF2_USB ((uint8_t)0x02) /*!< AF2: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 726 | |
| Kojto | 109:9296ab0bfc11 | 727 | /* AF 3 */ |
| Kojto | 109:9296ab0bfc11 | 728 | #define GPIO_AF3_EVENTOUT ((uint8_t)0x03) /*!< AF3: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 729 | #define GPIO_AF3_I2C1 ((uint8_t)0x03) /*!< AF3: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 730 | |
| Kojto | 109:9296ab0bfc11 | 731 | /* AF 4 */ |
| Kojto | 109:9296ab0bfc11 | 732 | #define GPIO_AF4_TIM14 ((uint8_t)0x04) /*!< AF4: TIM14 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 733 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< AF4: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 734 | |
| Kojto | 109:9296ab0bfc11 | 735 | /* AF 5 */ |
| Kojto | 109:9296ab0bfc11 | 736 | #define GPIO_AF5_MCO ((uint8_t)0x05) /*!< AF5: MCO Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 737 | #define GPIO_AF5_I2C1 ((uint8_t)0x05) /*!< AF5: I2C1 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 738 | #define GPIO_AF5_TIM16 ((uint8_t)0x05) /*!< AF5: TIM16 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 739 | #define GPIO_AF5_TIM17 ((uint8_t)0x05) /*!< AF5: TIM17 Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 740 | #define GPIO_AF5_USB ((uint8_t)0x05) /*!< AF5: USB Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 741 | |
| Kojto | 109:9296ab0bfc11 | 742 | /* AF 6 */ |
| Kojto | 109:9296ab0bfc11 | 743 | #define GPIO_AF6_EVENTOUT ((uint8_t)0x06) /*!< AF6: EVENTOUT Alternate Function mapping */ |
| Kojto | 109:9296ab0bfc11 | 744 | |
| Kojto | 109:9296ab0bfc11 | 745 | #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x06) |
| Kojto | 109:9296ab0bfc11 | 746 | |
| Kojto | 109:9296ab0bfc11 | 747 | #endif /* STM32F070x6 */ |
| Kojto | 109:9296ab0bfc11 | 748 | /** |
| Kojto | 109:9296ab0bfc11 | 749 | * @} |
| Kojto | 109:9296ab0bfc11 | 750 | */ |
| Kojto | 109:9296ab0bfc11 | 751 | |
| Kojto | 109:9296ab0bfc11 | 752 | /** |
| Kojto | 109:9296ab0bfc11 | 753 | * @} |
| Kojto | 109:9296ab0bfc11 | 754 | */ |
| Kojto | 109:9296ab0bfc11 | 755 | |
| Kojto | 109:9296ab0bfc11 | 756 | /* Exported macro ------------------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 757 | /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros |
| Kojto | 109:9296ab0bfc11 | 758 | * @{ |
| Kojto | 109:9296ab0bfc11 | 759 | */ |
| Kojto | 109:9296ab0bfc11 | 760 | |
| Kojto | 109:9296ab0bfc11 | 761 | /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index |
| Kojto | 109:9296ab0bfc11 | 762 | * @{ |
| Kojto | 109:9296ab0bfc11 | 763 | */ |
| Kojto | 109:9296ab0bfc11 | 764 | #if defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \ |
| Kojto | 109:9296ab0bfc11 | 765 | defined (STM32F091xC) || defined (STM32F098xx) |
| Kojto | 109:9296ab0bfc11 | 766 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
| Kojto | 109:9296ab0bfc11 | 767 | ((__GPIOx__) == (GPIOB))? 1U :\ |
| Kojto | 109:9296ab0bfc11 | 768 | ((__GPIOx__) == (GPIOC))? 2U :\ |
| Kojto | 109:9296ab0bfc11 | 769 | ((__GPIOx__) == (GPIOD))? 3U :\ |
| Kojto | 109:9296ab0bfc11 | 770 | ((__GPIOx__) == (GPIOE))? 4U : 5U) |
| Kojto | 109:9296ab0bfc11 | 771 | #endif |
| Kojto | 109:9296ab0bfc11 | 772 | |
| Kojto | 109:9296ab0bfc11 | 773 | #if defined (STM32F030x6) || defined (STM32F030x8) || defined (STM32F070xB) || defined (STM32F030xC) || \ |
| Kojto | 109:9296ab0bfc11 | 774 | defined (STM32F051x8) || defined (STM32F058xx) |
| Kojto | 109:9296ab0bfc11 | 775 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
| Kojto | 109:9296ab0bfc11 | 776 | ((__GPIOx__) == (GPIOB))? 1U :\ |
| Kojto | 109:9296ab0bfc11 | 777 | ((__GPIOx__) == (GPIOC))? 2U :\ |
| Kojto | 109:9296ab0bfc11 | 778 | ((__GPIOx__) == (GPIOD))? 3U : 5U) |
| Kojto | 109:9296ab0bfc11 | 779 | #endif |
| Kojto | 109:9296ab0bfc11 | 780 | |
| Kojto | 109:9296ab0bfc11 | 781 | #if defined (STM32F031x6) || defined (STM32F038xx) || \ |
| Kojto | 109:9296ab0bfc11 | 782 | defined (STM32F042x6) || defined (STM32F048xx) || defined (STM32F070x6) |
| Kojto | 109:9296ab0bfc11 | 783 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
| Kojto | 109:9296ab0bfc11 | 784 | ((__GPIOx__) == (GPIOB))? 1U :\ |
| Kojto | 109:9296ab0bfc11 | 785 | ((__GPIOx__) == (GPIOC))? 2U : 5U) |
| Kojto | 109:9296ab0bfc11 | 786 | #endif |
| Kojto | 109:9296ab0bfc11 | 787 | |
| Kojto | 109:9296ab0bfc11 | 788 | /** |
| Kojto | 109:9296ab0bfc11 | 789 | * @} |
| Kojto | 109:9296ab0bfc11 | 790 | */ |
| Kojto | 109:9296ab0bfc11 | 791 | |
| Kojto | 109:9296ab0bfc11 | 792 | /** |
| Kojto | 109:9296ab0bfc11 | 793 | * @} |
| Kojto | 109:9296ab0bfc11 | 794 | */ |
| Kojto | 109:9296ab0bfc11 | 795 | |
| Kojto | 109:9296ab0bfc11 | 796 | /* Exported functions --------------------------------------------------------*/ |
| Kojto | 109:9296ab0bfc11 | 797 | /** |
| Kojto | 109:9296ab0bfc11 | 798 | * @} |
| Kojto | 109:9296ab0bfc11 | 799 | */ |
| Kojto | 109:9296ab0bfc11 | 800 | |
| Kojto | 109:9296ab0bfc11 | 801 | /** |
| Kojto | 109:9296ab0bfc11 | 802 | * @} |
| Kojto | 109:9296ab0bfc11 | 803 | */ |
| Kojto | 109:9296ab0bfc11 | 804 | |
| Kojto | 109:9296ab0bfc11 | 805 | #ifdef __cplusplus |
| Kojto | 109:9296ab0bfc11 | 806 | } |
| Kojto | 109:9296ab0bfc11 | 807 | #endif |
| Kojto | 109:9296ab0bfc11 | 808 | |
| Kojto | 109:9296ab0bfc11 | 809 | #endif /* __STM32F0xx_HAL_GPIO_EX_H */ |
| Kojto | 109:9296ab0bfc11 | 810 | |
| Kojto | 109:9296ab0bfc11 | 811 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| Kojto | 109:9296ab0bfc11 | 812 |
