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