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