MBED-DEV only fro Nucleo STM32F303K8T6
Fork of mbed-dev by
targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_gpio_ex.h@151:acf04f8e7d03, 2016-11-19 (annotated)
- Committer:
- pravinautosys
- Date:
- Sat Nov 19 10:38:54 2016 +0000
- Revision:
- 151:acf04f8e7d03
- Parent:
- 149:156823d33999
MyMBED-DEVWithSTM32F303K8T6;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /** |
<> | 144:ef7eb2e8f9f7 | 2 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 3 | * @file stm32f3xx_hal_gpio_ex.h |
<> | 144:ef7eb2e8f9f7 | 4 | * @author MCD Application Team |
<> | 144:ef7eb2e8f9f7 | 5 | * @version V1.3.0 |
<> | 144:ef7eb2e8f9f7 | 6 | * @date 01-July-2016 |
<> | 144:ef7eb2e8f9f7 | 7 | * @brief Header file of GPIO HAL Extended module. |
<> | 144:ef7eb2e8f9f7 | 8 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 9 | * @attention |
<> | 144:ef7eb2e8f9f7 | 10 | * |
<> | 144:ef7eb2e8f9f7 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
<> | 144:ef7eb2e8f9f7 | 12 | * |
<> | 144:ef7eb2e8f9f7 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
<> | 144:ef7eb2e8f9f7 | 14 | * are permitted provided that the following conditions are met: |
<> | 144:ef7eb2e8f9f7 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
<> | 144:ef7eb2e8f9f7 | 16 | * this list of conditions and the following disclaimer. |
<> | 144:ef7eb2e8f9f7 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
<> | 144:ef7eb2e8f9f7 | 18 | * this list of conditions and the following disclaimer in the documentation |
<> | 144:ef7eb2e8f9f7 | 19 | * and/or other materials provided with the distribution. |
<> | 144:ef7eb2e8f9f7 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
<> | 144:ef7eb2e8f9f7 | 21 | * may be used to endorse or promote products derived from this software |
<> | 144:ef7eb2e8f9f7 | 22 | * without specific prior written permission. |
<> | 144:ef7eb2e8f9f7 | 23 | * |
<> | 144:ef7eb2e8f9f7 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
<> | 144:ef7eb2e8f9f7 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
<> | 144:ef7eb2e8f9f7 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
<> | 144:ef7eb2e8f9f7 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
<> | 144:ef7eb2e8f9f7 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
<> | 144:ef7eb2e8f9f7 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
<> | 144:ef7eb2e8f9f7 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
<> | 144:ef7eb2e8f9f7 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
<> | 144:ef7eb2e8f9f7 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
<> | 144:ef7eb2e8f9f7 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
<> | 144:ef7eb2e8f9f7 | 34 | * |
<> | 144:ef7eb2e8f9f7 | 35 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 36 | */ |
<> | 144:ef7eb2e8f9f7 | 37 | |
<> | 144:ef7eb2e8f9f7 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 39 | #ifndef __STM32F3xx_HAL_GPIO_EX_H |
<> | 144:ef7eb2e8f9f7 | 40 | #define __STM32F3xx_HAL_GPIO_EX_H |
<> | 144:ef7eb2e8f9f7 | 41 | |
<> | 144:ef7eb2e8f9f7 | 42 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 43 | extern "C" { |
<> | 144:ef7eb2e8f9f7 | 44 | #endif |
<> | 144:ef7eb2e8f9f7 | 45 | |
<> | 144:ef7eb2e8f9f7 | 46 | /* Includes ------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 47 | #include "stm32f3xx_hal_def.h" |
<> | 144:ef7eb2e8f9f7 | 48 | |
<> | 144:ef7eb2e8f9f7 | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
<> | 144:ef7eb2e8f9f7 | 50 | * @{ |
<> | 144:ef7eb2e8f9f7 | 51 | */ |
<> | 144:ef7eb2e8f9f7 | 52 | |
<> | 144:ef7eb2e8f9f7 | 53 | /** @defgroup GPIOEx GPIOEx |
<> | 144:ef7eb2e8f9f7 | 54 | * @brief GPIO Extended HAL module driver |
<> | 144:ef7eb2e8f9f7 | 55 | * @{ |
<> | 144:ef7eb2e8f9f7 | 56 | */ |
<> | 144:ef7eb2e8f9f7 | 57 | |
<> | 144:ef7eb2e8f9f7 | 58 | /* Exported types ------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 59 | /* Exported constants --------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 60 | /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants |
<> | 144:ef7eb2e8f9f7 | 61 | * @{ |
<> | 144:ef7eb2e8f9f7 | 62 | */ |
<> | 144:ef7eb2e8f9f7 | 63 | |
<> | 144:ef7eb2e8f9f7 | 64 | /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection |
<> | 144:ef7eb2e8f9f7 | 65 | * @{ |
<> | 144:ef7eb2e8f9f7 | 66 | */ |
<> | 144:ef7eb2e8f9f7 | 67 | |
<> | 144:ef7eb2e8f9f7 | 68 | #if defined (STM32F302xC) |
<> | 144:ef7eb2e8f9f7 | 69 | /*---------------------------------- STM32F302xC ------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 70 | /** |
<> | 144:ef7eb2e8f9f7 | 71 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 72 | */ |
<> | 144:ef7eb2e8f9f7 | 73 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 74 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 75 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 76 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 77 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 78 | |
<> | 144:ef7eb2e8f9f7 | 79 | /** |
<> | 144:ef7eb2e8f9f7 | 80 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 81 | */ |
<> | 144:ef7eb2e8f9f7 | 82 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 83 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 84 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 85 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 86 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 87 | /** |
<> | 144:ef7eb2e8f9f7 | 88 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 89 | */ |
<> | 144:ef7eb2e8f9f7 | 90 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 91 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 92 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 93 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 94 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 95 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 96 | /** |
<> | 144:ef7eb2e8f9f7 | 97 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 98 | */ |
<> | 144:ef7eb2e8f9f7 | 99 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 100 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 101 | |
<> | 144:ef7eb2e8f9f7 | 102 | /** |
<> | 144:ef7eb2e8f9f7 | 103 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 104 | */ |
<> | 144:ef7eb2e8f9f7 | 105 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 106 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 107 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 108 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 109 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 110 | |
<> | 144:ef7eb2e8f9f7 | 111 | /** |
<> | 144:ef7eb2e8f9f7 | 112 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 113 | */ |
<> | 144:ef7eb2e8f9f7 | 114 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 115 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 116 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 117 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 118 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 119 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 120 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 121 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 122 | /** |
<> | 144:ef7eb2e8f9f7 | 123 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 124 | */ |
<> | 144:ef7eb2e8f9f7 | 125 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 126 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 127 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 128 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 129 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 130 | |
<> | 144:ef7eb2e8f9f7 | 131 | /** |
<> | 144:ef7eb2e8f9f7 | 132 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 133 | */ |
<> | 144:ef7eb2e8f9f7 | 134 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 135 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 136 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 137 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 138 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 139 | |
<> | 144:ef7eb2e8f9f7 | 140 | /** |
<> | 144:ef7eb2e8f9f7 | 141 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 142 | */ |
<> | 144:ef7eb2e8f9f7 | 143 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 144 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 145 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 146 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 147 | |
<> | 144:ef7eb2e8f9f7 | 148 | /** |
<> | 144:ef7eb2e8f9f7 | 149 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 150 | */ |
<> | 144:ef7eb2e8f9f7 | 151 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 152 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 153 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 154 | |
<> | 144:ef7eb2e8f9f7 | 155 | /** |
<> | 144:ef7eb2e8f9f7 | 156 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 157 | */ |
<> | 144:ef7eb2e8f9f7 | 158 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 159 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 160 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 161 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 162 | /** |
<> | 144:ef7eb2e8f9f7 | 163 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 164 | */ |
<> | 144:ef7eb2e8f9f7 | 165 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 166 | |
<> | 144:ef7eb2e8f9f7 | 167 | /** |
<> | 144:ef7eb2e8f9f7 | 168 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 169 | */ |
<> | 144:ef7eb2e8f9f7 | 170 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 171 | |
<> | 144:ef7eb2e8f9f7 | 172 | /** |
<> | 144:ef7eb2e8f9f7 | 173 | * @brief AF 14 selection |
<> | 144:ef7eb2e8f9f7 | 174 | */ |
<> | 144:ef7eb2e8f9f7 | 175 | |
<> | 144:ef7eb2e8f9f7 | 176 | #define GPIO_AF14_USB ((uint8_t)0x0E) /* USB Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 177 | /** |
<> | 144:ef7eb2e8f9f7 | 178 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 179 | */ |
<> | 144:ef7eb2e8f9f7 | 180 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 181 | |
<> | 144:ef7eb2e8f9f7 | 182 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0E) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 183 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 184 | #endif /* STM32F302xC */ |
<> | 144:ef7eb2e8f9f7 | 185 | |
<> | 144:ef7eb2e8f9f7 | 186 | #if defined (STM32F303xC) |
<> | 144:ef7eb2e8f9f7 | 187 | /*---------------------------------- STM32F303xC ------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 188 | /** |
<> | 144:ef7eb2e8f9f7 | 189 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 190 | */ |
<> | 144:ef7eb2e8f9f7 | 191 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 192 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 193 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 194 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 195 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 196 | |
<> | 144:ef7eb2e8f9f7 | 197 | /** |
<> | 144:ef7eb2e8f9f7 | 198 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 199 | */ |
<> | 144:ef7eb2e8f9f7 | 200 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 201 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 202 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 203 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 204 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 205 | /** |
<> | 144:ef7eb2e8f9f7 | 206 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 207 | */ |
<> | 144:ef7eb2e8f9f7 | 208 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 209 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 210 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 211 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 212 | #define GPIO_AF2_TIM8 ((uint8_t)0x02) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 213 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 214 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 215 | /** |
<> | 144:ef7eb2e8f9f7 | 216 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 217 | */ |
<> | 144:ef7eb2e8f9f7 | 218 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 219 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 220 | #define GPIO_AF3_COMP7 ((uint8_t)0x03) /* COMP7 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 221 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 222 | |
<> | 144:ef7eb2e8f9f7 | 223 | /** |
<> | 144:ef7eb2e8f9f7 | 224 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 225 | */ |
<> | 144:ef7eb2e8f9f7 | 226 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 227 | #define GPIO_AF4_TIM8 ((uint8_t)0x04) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 228 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 229 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 230 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 231 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 232 | |
<> | 144:ef7eb2e8f9f7 | 233 | /** |
<> | 144:ef7eb2e8f9f7 | 234 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 235 | */ |
<> | 144:ef7eb2e8f9f7 | 236 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 237 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 238 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 239 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 240 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 241 | #define GPIO_AF5_TIM8 ((uint8_t)0x05) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 242 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 243 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 244 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 245 | /** |
<> | 144:ef7eb2e8f9f7 | 246 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 247 | */ |
<> | 144:ef7eb2e8f9f7 | 248 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 249 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 250 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 251 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 252 | #define GPIO_AF6_TIM8 ((uint8_t)0x06) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 253 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 254 | |
<> | 144:ef7eb2e8f9f7 | 255 | /** |
<> | 144:ef7eb2e8f9f7 | 256 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 257 | */ |
<> | 144:ef7eb2e8f9f7 | 258 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 259 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 260 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 261 | #define GPIO_AF7_COMP3 ((uint8_t)0x07) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 262 | #define GPIO_AF7_COMP5 ((uint8_t)0x07) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 263 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 264 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 265 | |
<> | 144:ef7eb2e8f9f7 | 266 | /** |
<> | 144:ef7eb2e8f9f7 | 267 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 268 | */ |
<> | 144:ef7eb2e8f9f7 | 269 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 270 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 271 | #define GPIO_AF8_COMP3 ((uint8_t)0x08) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 272 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 273 | #define GPIO_AF8_COMP5 ((uint8_t)0x08) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 274 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 275 | |
<> | 144:ef7eb2e8f9f7 | 276 | /** |
<> | 144:ef7eb2e8f9f7 | 277 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 278 | */ |
<> | 144:ef7eb2e8f9f7 | 279 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 280 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 281 | #define GPIO_AF9_TIM8 ((uint8_t)0x09) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 282 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 283 | |
<> | 144:ef7eb2e8f9f7 | 284 | /** |
<> | 144:ef7eb2e8f9f7 | 285 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 286 | */ |
<> | 144:ef7eb2e8f9f7 | 287 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 288 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 289 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 290 | #define GPIO_AF10_TIM8 ((uint8_t)0xA) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 291 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 292 | /** |
<> | 144:ef7eb2e8f9f7 | 293 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 294 | */ |
<> | 144:ef7eb2e8f9f7 | 295 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 296 | #define GPIO_AF11_TIM8 ((uint8_t)0x0B) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 297 | |
<> | 144:ef7eb2e8f9f7 | 298 | /** |
<> | 144:ef7eb2e8f9f7 | 299 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 300 | */ |
<> | 144:ef7eb2e8f9f7 | 301 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 302 | |
<> | 144:ef7eb2e8f9f7 | 303 | /** |
<> | 144:ef7eb2e8f9f7 | 304 | * @brief AF 14 selection |
<> | 144:ef7eb2e8f9f7 | 305 | */ |
<> | 144:ef7eb2e8f9f7 | 306 | |
<> | 144:ef7eb2e8f9f7 | 307 | #define GPIO_AF14_USB ((uint8_t)0x0E) /* USB Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 308 | /** |
<> | 144:ef7eb2e8f9f7 | 309 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 310 | */ |
<> | 144:ef7eb2e8f9f7 | 311 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 312 | |
<> | 144:ef7eb2e8f9f7 | 313 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0E) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 314 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 315 | #endif /* STM32F303xC */ |
<> | 144:ef7eb2e8f9f7 | 316 | |
<> | 144:ef7eb2e8f9f7 | 317 | #if defined (STM32F303xE) |
<> | 144:ef7eb2e8f9f7 | 318 | /*---------------------------------- STM32F303xE ------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 319 | /** |
<> | 144:ef7eb2e8f9f7 | 320 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 321 | */ |
<> | 144:ef7eb2e8f9f7 | 322 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 323 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 324 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 325 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 326 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 327 | |
<> | 144:ef7eb2e8f9f7 | 328 | /** |
<> | 144:ef7eb2e8f9f7 | 329 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 330 | */ |
<> | 144:ef7eb2e8f9f7 | 331 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 332 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 333 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 334 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 335 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 336 | |
<> | 144:ef7eb2e8f9f7 | 337 | /** |
<> | 144:ef7eb2e8f9f7 | 338 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 339 | */ |
<> | 144:ef7eb2e8f9f7 | 340 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 341 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 342 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 343 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 344 | #define GPIO_AF2_TIM8 ((uint8_t)0x02) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 345 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 346 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 347 | #define GPIO_AF2_I2C3 ((uint8_t)0x02) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 348 | #define GPIO_AF2_TIM20 ((uint8_t)0x02) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 349 | |
<> | 144:ef7eb2e8f9f7 | 350 | /** |
<> | 144:ef7eb2e8f9f7 | 351 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 352 | */ |
<> | 144:ef7eb2e8f9f7 | 353 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 354 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 355 | #define GPIO_AF3_COMP7 ((uint8_t)0x03) /* COMP7 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 356 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 357 | #define GPIO_AF3_I2C3 ((uint8_t)0x03) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 358 | #define GPIO_AF3_TIM20 ((uint8_t)0x03) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 359 | |
<> | 144:ef7eb2e8f9f7 | 360 | /** |
<> | 144:ef7eb2e8f9f7 | 361 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 362 | */ |
<> | 144:ef7eb2e8f9f7 | 363 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 364 | #define GPIO_AF4_TIM8 ((uint8_t)0x04) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 365 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 366 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 367 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 368 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 369 | |
<> | 144:ef7eb2e8f9f7 | 370 | /** |
<> | 144:ef7eb2e8f9f7 | 371 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 372 | */ |
<> | 144:ef7eb2e8f9f7 | 373 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 374 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 375 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 376 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 377 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 378 | #define GPIO_AF5_TIM8 ((uint8_t)0x05) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 379 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 380 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 381 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 382 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 383 | |
<> | 144:ef7eb2e8f9f7 | 384 | /** |
<> | 144:ef7eb2e8f9f7 | 385 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 386 | */ |
<> | 144:ef7eb2e8f9f7 | 387 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 388 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 389 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 390 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 391 | #define GPIO_AF6_TIM8 ((uint8_t)0x06) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 392 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 393 | #define GPIO_AF6_TIM20 ((uint8_t)0x06) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 394 | |
<> | 144:ef7eb2e8f9f7 | 395 | /** |
<> | 144:ef7eb2e8f9f7 | 396 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 397 | */ |
<> | 144:ef7eb2e8f9f7 | 398 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 399 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 400 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 401 | #define GPIO_AF7_COMP3 ((uint8_t)0x07) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 402 | #define GPIO_AF7_COMP5 ((uint8_t)0x07) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 403 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 404 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 405 | |
<> | 144:ef7eb2e8f9f7 | 406 | /** |
<> | 144:ef7eb2e8f9f7 | 407 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 408 | */ |
<> | 144:ef7eb2e8f9f7 | 409 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 410 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 411 | #define GPIO_AF8_COMP3 ((uint8_t)0x08) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 412 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 413 | #define GPIO_AF8_COMP5 ((uint8_t)0x08) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 414 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 415 | #define GPIO_AF8_I2C3 ((uint8_t)0x08) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 416 | |
<> | 144:ef7eb2e8f9f7 | 417 | /** |
<> | 144:ef7eb2e8f9f7 | 418 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 419 | */ |
<> | 144:ef7eb2e8f9f7 | 420 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 421 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 422 | #define GPIO_AF9_TIM8 ((uint8_t)0x09) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 423 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 424 | |
<> | 144:ef7eb2e8f9f7 | 425 | /** |
<> | 144:ef7eb2e8f9f7 | 426 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 427 | */ |
<> | 144:ef7eb2e8f9f7 | 428 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 429 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 430 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 431 | #define GPIO_AF10_TIM8 ((uint8_t)0xA) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 432 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 433 | /** |
<> | 144:ef7eb2e8f9f7 | 434 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 435 | */ |
<> | 144:ef7eb2e8f9f7 | 436 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 437 | #define GPIO_AF11_TIM8 ((uint8_t)0x0B) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 438 | |
<> | 144:ef7eb2e8f9f7 | 439 | /** |
<> | 144:ef7eb2e8f9f7 | 440 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 441 | */ |
<> | 144:ef7eb2e8f9f7 | 442 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 443 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 444 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 445 | |
<> | 144:ef7eb2e8f9f7 | 446 | /** |
<> | 144:ef7eb2e8f9f7 | 447 | * @brief AF 14 selection |
<> | 144:ef7eb2e8f9f7 | 448 | */ |
<> | 144:ef7eb2e8f9f7 | 449 | #define GPIO_AF14_USB ((uint8_t)0x0E) /* USB Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 450 | |
<> | 144:ef7eb2e8f9f7 | 451 | /** |
<> | 144:ef7eb2e8f9f7 | 452 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 453 | */ |
<> | 144:ef7eb2e8f9f7 | 454 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 455 | |
<> | 144:ef7eb2e8f9f7 | 456 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0E) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 457 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 458 | #endif /* STM32F303xE */ |
<> | 144:ef7eb2e8f9f7 | 459 | |
<> | 144:ef7eb2e8f9f7 | 460 | #if defined (STM32F302xE) |
<> | 144:ef7eb2e8f9f7 | 461 | /*---------------------------------- STM32F302xE ------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 462 | /** |
<> | 144:ef7eb2e8f9f7 | 463 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 464 | */ |
<> | 144:ef7eb2e8f9f7 | 465 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 466 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 467 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 468 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 469 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 470 | |
<> | 144:ef7eb2e8f9f7 | 471 | /** |
<> | 144:ef7eb2e8f9f7 | 472 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 473 | */ |
<> | 144:ef7eb2e8f9f7 | 474 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 475 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 476 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 477 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 478 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 479 | |
<> | 144:ef7eb2e8f9f7 | 480 | /** |
<> | 144:ef7eb2e8f9f7 | 481 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 482 | */ |
<> | 144:ef7eb2e8f9f7 | 483 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 484 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 485 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 486 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 487 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 488 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 489 | #define GPIO_AF2_I2C3 ((uint8_t)0x02) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 490 | |
<> | 144:ef7eb2e8f9f7 | 491 | /** |
<> | 144:ef7eb2e8f9f7 | 492 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 493 | */ |
<> | 144:ef7eb2e8f9f7 | 494 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 495 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 496 | #define GPIO_AF3_I2C3 ((uint8_t)0x03) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 497 | |
<> | 144:ef7eb2e8f9f7 | 498 | /** |
<> | 144:ef7eb2e8f9f7 | 499 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 500 | */ |
<> | 144:ef7eb2e8f9f7 | 501 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 502 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 503 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 504 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 505 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 506 | |
<> | 144:ef7eb2e8f9f7 | 507 | /** |
<> | 144:ef7eb2e8f9f7 | 508 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 509 | */ |
<> | 144:ef7eb2e8f9f7 | 510 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 511 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 512 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 513 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 514 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 515 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 516 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 517 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 518 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 519 | |
<> | 144:ef7eb2e8f9f7 | 520 | /** |
<> | 144:ef7eb2e8f9f7 | 521 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 522 | */ |
<> | 144:ef7eb2e8f9f7 | 523 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 524 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 525 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 526 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 527 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 528 | |
<> | 144:ef7eb2e8f9f7 | 529 | /** |
<> | 144:ef7eb2e8f9f7 | 530 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 531 | */ |
<> | 144:ef7eb2e8f9f7 | 532 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 533 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 534 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 535 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 536 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 537 | |
<> | 144:ef7eb2e8f9f7 | 538 | /** |
<> | 144:ef7eb2e8f9f7 | 539 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 540 | */ |
<> | 144:ef7eb2e8f9f7 | 541 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 542 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 543 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 544 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 545 | #define GPIO_AF8_I2C3 ((uint8_t)0x08) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 546 | |
<> | 144:ef7eb2e8f9f7 | 547 | /** |
<> | 144:ef7eb2e8f9f7 | 548 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 549 | */ |
<> | 144:ef7eb2e8f9f7 | 550 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 551 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 552 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 553 | |
<> | 144:ef7eb2e8f9f7 | 554 | /** |
<> | 144:ef7eb2e8f9f7 | 555 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 556 | */ |
<> | 144:ef7eb2e8f9f7 | 557 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 558 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 559 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 560 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 561 | /** |
<> | 144:ef7eb2e8f9f7 | 562 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 563 | */ |
<> | 144:ef7eb2e8f9f7 | 564 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 565 | |
<> | 144:ef7eb2e8f9f7 | 566 | /** |
<> | 144:ef7eb2e8f9f7 | 567 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 568 | */ |
<> | 144:ef7eb2e8f9f7 | 569 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 570 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 571 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 572 | |
<> | 144:ef7eb2e8f9f7 | 573 | /** |
<> | 144:ef7eb2e8f9f7 | 574 | * @brief AF 14 selection |
<> | 144:ef7eb2e8f9f7 | 575 | */ |
<> | 144:ef7eb2e8f9f7 | 576 | #define GPIO_AF14_USB ((uint8_t)0x0E) /* USB Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 577 | |
<> | 144:ef7eb2e8f9f7 | 578 | /** |
<> | 144:ef7eb2e8f9f7 | 579 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 580 | */ |
<> | 144:ef7eb2e8f9f7 | 581 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 582 | |
<> | 144:ef7eb2e8f9f7 | 583 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0E) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 584 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 585 | #endif /* STM32F302xE */ |
<> | 144:ef7eb2e8f9f7 | 586 | |
<> | 144:ef7eb2e8f9f7 | 587 | #if defined (STM32F398xx) |
<> | 144:ef7eb2e8f9f7 | 588 | /*---------------------------------- STM32F398xx ------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 589 | /** |
<> | 144:ef7eb2e8f9f7 | 590 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 591 | */ |
<> | 144:ef7eb2e8f9f7 | 592 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 593 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 594 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 595 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 596 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 597 | |
<> | 144:ef7eb2e8f9f7 | 598 | /** |
<> | 144:ef7eb2e8f9f7 | 599 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 600 | */ |
<> | 144:ef7eb2e8f9f7 | 601 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 602 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 603 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 604 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 605 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 606 | |
<> | 144:ef7eb2e8f9f7 | 607 | /** |
<> | 144:ef7eb2e8f9f7 | 608 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 609 | */ |
<> | 144:ef7eb2e8f9f7 | 610 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 611 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 612 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 613 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 614 | #define GPIO_AF2_TIM8 ((uint8_t)0x02) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 615 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 616 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 617 | #define GPIO_AF2_I2C3 ((uint8_t)0x02) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 618 | #define GPIO_AF2_TIM20 ((uint8_t)0x02) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 619 | |
<> | 144:ef7eb2e8f9f7 | 620 | /** |
<> | 144:ef7eb2e8f9f7 | 621 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 622 | */ |
<> | 144:ef7eb2e8f9f7 | 623 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 624 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 625 | #define GPIO_AF3_COMP7 ((uint8_t)0x03) /* COMP7 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 626 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 627 | #define GPIO_AF3_I2C3 ((uint8_t)0x03) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 628 | #define GPIO_AF3_TIM20 ((uint8_t)0x03) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 629 | |
<> | 144:ef7eb2e8f9f7 | 630 | /** |
<> | 144:ef7eb2e8f9f7 | 631 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 632 | */ |
<> | 144:ef7eb2e8f9f7 | 633 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 634 | #define GPIO_AF4_TIM8 ((uint8_t)0x04) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 635 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 636 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 637 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 638 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 639 | |
<> | 144:ef7eb2e8f9f7 | 640 | /** |
<> | 144:ef7eb2e8f9f7 | 641 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 642 | */ |
<> | 144:ef7eb2e8f9f7 | 643 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 644 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 645 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 646 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 647 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 648 | #define GPIO_AF5_TIM8 ((uint8_t)0x05) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 649 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 650 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 651 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 652 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 653 | |
<> | 144:ef7eb2e8f9f7 | 654 | /** |
<> | 144:ef7eb2e8f9f7 | 655 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 656 | */ |
<> | 144:ef7eb2e8f9f7 | 657 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 658 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 659 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 660 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 661 | #define GPIO_AF6_TIM8 ((uint8_t)0x06) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 662 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 663 | #define GPIO_AF6_TIM20 ((uint8_t)0x06) /* TIM20 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 664 | |
<> | 144:ef7eb2e8f9f7 | 665 | /** |
<> | 144:ef7eb2e8f9f7 | 666 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 667 | */ |
<> | 144:ef7eb2e8f9f7 | 668 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 669 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 670 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 671 | #define GPIO_AF7_COMP3 ((uint8_t)0x07) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 672 | #define GPIO_AF7_COMP5 ((uint8_t)0x07) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 673 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 674 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 675 | |
<> | 144:ef7eb2e8f9f7 | 676 | /** |
<> | 144:ef7eb2e8f9f7 | 677 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 678 | */ |
<> | 144:ef7eb2e8f9f7 | 679 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 680 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 681 | #define GPIO_AF8_COMP3 ((uint8_t)0x08) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 682 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 683 | #define GPIO_AF8_COMP5 ((uint8_t)0x08) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 684 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 685 | #define GPIO_AF8_I2C3 ((uint8_t)0x08) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 686 | |
<> | 144:ef7eb2e8f9f7 | 687 | /** |
<> | 144:ef7eb2e8f9f7 | 688 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 689 | */ |
<> | 144:ef7eb2e8f9f7 | 690 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 691 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 692 | #define GPIO_AF9_TIM8 ((uint8_t)0x09) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 693 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 694 | |
<> | 144:ef7eb2e8f9f7 | 695 | /** |
<> | 144:ef7eb2e8f9f7 | 696 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 697 | */ |
<> | 144:ef7eb2e8f9f7 | 698 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 699 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 700 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 701 | #define GPIO_AF10_TIM8 ((uint8_t)0xA) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 702 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 703 | /** |
<> | 144:ef7eb2e8f9f7 | 704 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 705 | */ |
<> | 144:ef7eb2e8f9f7 | 706 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 707 | #define GPIO_AF11_TIM8 ((uint8_t)0x0B) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 708 | |
<> | 144:ef7eb2e8f9f7 | 709 | /** |
<> | 144:ef7eb2e8f9f7 | 710 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 711 | */ |
<> | 144:ef7eb2e8f9f7 | 712 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 713 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 714 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 715 | |
<> | 144:ef7eb2e8f9f7 | 716 | /** |
<> | 144:ef7eb2e8f9f7 | 717 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 718 | */ |
<> | 144:ef7eb2e8f9f7 | 719 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 720 | |
<> | 144:ef7eb2e8f9f7 | 721 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 722 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 723 | #endif /* STM32F398xx */ |
<> | 144:ef7eb2e8f9f7 | 724 | |
<> | 144:ef7eb2e8f9f7 | 725 | #if defined (STM32F358xx) |
<> | 144:ef7eb2e8f9f7 | 726 | /*---------------------------------- STM32F358xx -------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 727 | /** |
<> | 144:ef7eb2e8f9f7 | 728 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 729 | */ |
<> | 144:ef7eb2e8f9f7 | 730 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 731 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 732 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 733 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 734 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 735 | |
<> | 144:ef7eb2e8f9f7 | 736 | /** |
<> | 144:ef7eb2e8f9f7 | 737 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 738 | */ |
<> | 144:ef7eb2e8f9f7 | 739 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 740 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 741 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 742 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 743 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 744 | /** |
<> | 144:ef7eb2e8f9f7 | 745 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 746 | */ |
<> | 144:ef7eb2e8f9f7 | 747 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 748 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 749 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 750 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 751 | #define GPIO_AF2_TIM8 ((uint8_t)0x02) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 752 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 753 | #define GPIO_AF2_COMP1 ((uint8_t)0x02) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 754 | /** |
<> | 144:ef7eb2e8f9f7 | 755 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 756 | */ |
<> | 144:ef7eb2e8f9f7 | 757 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 758 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 759 | #define GPIO_AF3_COMP7 ((uint8_t)0x03) /* COMP7 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 760 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 761 | |
<> | 144:ef7eb2e8f9f7 | 762 | /** |
<> | 144:ef7eb2e8f9f7 | 763 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 764 | */ |
<> | 144:ef7eb2e8f9f7 | 765 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 766 | #define GPIO_AF4_TIM8 ((uint8_t)0x04) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 767 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 768 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 769 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 770 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 771 | |
<> | 144:ef7eb2e8f9f7 | 772 | /** |
<> | 144:ef7eb2e8f9f7 | 773 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 774 | */ |
<> | 144:ef7eb2e8f9f7 | 775 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 776 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 777 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 778 | #define GPIO_AF5_I2S ((uint8_t)0x05) /* I2S Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 779 | #define GPIO_AF5_I2S2ext ((uint8_t)0x05) /* I2S2ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 780 | #define GPIO_AF5_TIM8 ((uint8_t)0x05) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 781 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 782 | #define GPIO_AF5_UART4 ((uint8_t)0x05) /* UART4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 783 | #define GPIO_AF5_UART5 ((uint8_t)0x05) /* UART5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 784 | /** |
<> | 144:ef7eb2e8f9f7 | 785 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 786 | */ |
<> | 144:ef7eb2e8f9f7 | 787 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 788 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 789 | #define GPIO_AF6_I2S3ext ((uint8_t)0x06) /* I2S3ext Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 790 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 791 | #define GPIO_AF6_TIM8 ((uint8_t)0x06) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 792 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 793 | |
<> | 144:ef7eb2e8f9f7 | 794 | /** |
<> | 144:ef7eb2e8f9f7 | 795 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 796 | */ |
<> | 144:ef7eb2e8f9f7 | 797 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 798 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 799 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 800 | #define GPIO_AF7_COMP3 ((uint8_t)0x07) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 801 | #define GPIO_AF7_COMP5 ((uint8_t)0x07) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 802 | #define GPIO_AF7_COMP6 ((uint8_t)0x07) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 803 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 804 | |
<> | 144:ef7eb2e8f9f7 | 805 | /** |
<> | 144:ef7eb2e8f9f7 | 806 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 807 | */ |
<> | 144:ef7eb2e8f9f7 | 808 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 809 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 810 | #define GPIO_AF8_COMP3 ((uint8_t)0x08) /* COMP3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 811 | #define GPIO_AF8_COMP4 ((uint8_t)0x08) /* COMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 812 | #define GPIO_AF8_COMP5 ((uint8_t)0x08) /* COMP5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 813 | #define GPIO_AF8_COMP6 ((uint8_t)0x08) /* COMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 814 | |
<> | 144:ef7eb2e8f9f7 | 815 | /** |
<> | 144:ef7eb2e8f9f7 | 816 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 817 | */ |
<> | 144:ef7eb2e8f9f7 | 818 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 819 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 820 | #define GPIO_AF9_TIM8 ((uint8_t)0x09) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 821 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 822 | |
<> | 144:ef7eb2e8f9f7 | 823 | /** |
<> | 144:ef7eb2e8f9f7 | 824 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 825 | */ |
<> | 144:ef7eb2e8f9f7 | 826 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 827 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 828 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 829 | #define GPIO_AF10_TIM8 ((uint8_t)0xA) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 830 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 831 | /** |
<> | 144:ef7eb2e8f9f7 | 832 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 833 | */ |
<> | 144:ef7eb2e8f9f7 | 834 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 835 | #define GPIO_AF11_TIM8 ((uint8_t)0x0B) /* TIM8 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 836 | |
<> | 144:ef7eb2e8f9f7 | 837 | /** |
<> | 144:ef7eb2e8f9f7 | 838 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 839 | */ |
<> | 144:ef7eb2e8f9f7 | 840 | #define GPIO_AF12_TIM1 ((uint8_t)0xC) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 841 | |
<> | 144:ef7eb2e8f9f7 | 842 | /** |
<> | 144:ef7eb2e8f9f7 | 843 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 844 | */ |
<> | 144:ef7eb2e8f9f7 | 845 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 846 | |
<> | 144:ef7eb2e8f9f7 | 847 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 848 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 849 | #endif /* STM32F358xx */ |
<> | 144:ef7eb2e8f9f7 | 850 | |
<> | 144:ef7eb2e8f9f7 | 851 | #if defined (STM32F373xC) |
<> | 144:ef7eb2e8f9f7 | 852 | /*---------------------------------- STM32F373xC--------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 853 | /** |
<> | 144:ef7eb2e8f9f7 | 854 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 855 | */ |
<> | 144:ef7eb2e8f9f7 | 856 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 857 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 858 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 859 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 860 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 861 | |
<> | 144:ef7eb2e8f9f7 | 862 | /** |
<> | 144:ef7eb2e8f9f7 | 863 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 864 | */ |
<> | 144:ef7eb2e8f9f7 | 865 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 866 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 867 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 868 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 869 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 870 | /** |
<> | 144:ef7eb2e8f9f7 | 871 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 872 | */ |
<> | 144:ef7eb2e8f9f7 | 873 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 874 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 875 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 876 | #define GPIO_AF2_TIM13 ((uint8_t)0x02) /* TIM13 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 877 | #define GPIO_AF2_TIM14 ((uint8_t)0x02) /* TIM14 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 878 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 879 | #define GPIO_AF2_TIM19 ((uint8_t)0x02) /* TIM19 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 880 | |
<> | 144:ef7eb2e8f9f7 | 881 | /** |
<> | 144:ef7eb2e8f9f7 | 882 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 883 | */ |
<> | 144:ef7eb2e8f9f7 | 884 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 885 | /** |
<> | 144:ef7eb2e8f9f7 | 886 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 887 | */ |
<> | 144:ef7eb2e8f9f7 | 888 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 889 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 890 | |
<> | 144:ef7eb2e8f9f7 | 891 | /** |
<> | 144:ef7eb2e8f9f7 | 892 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 893 | */ |
<> | 144:ef7eb2e8f9f7 | 894 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 895 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 896 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 897 | /** |
<> | 144:ef7eb2e8f9f7 | 898 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 899 | */ |
<> | 144:ef7eb2e8f9f7 | 900 | #define GPIO_AF6_SPI1 ((uint8_t)0x06) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 901 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 902 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 903 | #define GPIO_AF6_CEC ((uint8_t)0x06) /* CEC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 904 | /** |
<> | 144:ef7eb2e8f9f7 | 905 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 906 | */ |
<> | 144:ef7eb2e8f9f7 | 907 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 908 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 909 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 910 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 911 | #define GPIO_AF7_CEC ((uint8_t)0x07) /* CEC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 912 | |
<> | 144:ef7eb2e8f9f7 | 913 | /** |
<> | 144:ef7eb2e8f9f7 | 914 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 915 | */ |
<> | 144:ef7eb2e8f9f7 | 916 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 917 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 918 | |
<> | 144:ef7eb2e8f9f7 | 919 | /** |
<> | 144:ef7eb2e8f9f7 | 920 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 921 | */ |
<> | 144:ef7eb2e8f9f7 | 922 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 923 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 924 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 925 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 926 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 927 | /** |
<> | 144:ef7eb2e8f9f7 | 928 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 929 | */ |
<> | 144:ef7eb2e8f9f7 | 930 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 931 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 932 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 933 | #define GPIO_AF10_TIM12 ((uint8_t)0xA) /* TIM12 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 934 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 935 | /** |
<> | 144:ef7eb2e8f9f7 | 936 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 937 | */ |
<> | 144:ef7eb2e8f9f7 | 938 | #define GPIO_AF11_TIM19 ((uint8_t)0x0B) /* TIM19 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 939 | |
<> | 144:ef7eb2e8f9f7 | 940 | |
<> | 144:ef7eb2e8f9f7 | 941 | /** |
<> | 144:ef7eb2e8f9f7 | 942 | * @brief AF 14 selection |
<> | 144:ef7eb2e8f9f7 | 943 | */ |
<> | 144:ef7eb2e8f9f7 | 944 | #define GPIO_AF14_USB ((uint8_t)0x0E) /* USB Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 945 | |
<> | 144:ef7eb2e8f9f7 | 946 | /** |
<> | 144:ef7eb2e8f9f7 | 947 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 948 | */ |
<> | 144:ef7eb2e8f9f7 | 949 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 950 | |
<> | 144:ef7eb2e8f9f7 | 951 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0B) || ((AF) == (uint8_t)0x0E) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 952 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 953 | #endif /* STM32F373xC */ |
<> | 144:ef7eb2e8f9f7 | 954 | |
<> | 144:ef7eb2e8f9f7 | 955 | |
<> | 144:ef7eb2e8f9f7 | 956 | #if defined (STM32F378xx) |
<> | 144:ef7eb2e8f9f7 | 957 | /*---------------------------------------- STM32F378xx--------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 958 | /** |
<> | 144:ef7eb2e8f9f7 | 959 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 960 | */ |
<> | 144:ef7eb2e8f9f7 | 961 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 962 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 963 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 964 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 965 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 966 | |
<> | 144:ef7eb2e8f9f7 | 967 | /** |
<> | 144:ef7eb2e8f9f7 | 968 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 969 | */ |
<> | 144:ef7eb2e8f9f7 | 970 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 971 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 972 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 973 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 974 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 975 | /** |
<> | 144:ef7eb2e8f9f7 | 976 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 977 | */ |
<> | 144:ef7eb2e8f9f7 | 978 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 979 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 980 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 981 | #define GPIO_AF2_TIM13 ((uint8_t)0x02) /* TIM13 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 982 | #define GPIO_AF2_TIM14 ((uint8_t)0x02) /* TIM14 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 983 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 984 | #define GPIO_AF2_TIM19 ((uint8_t)0x02) /* TIM19 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 985 | |
<> | 144:ef7eb2e8f9f7 | 986 | /** |
<> | 144:ef7eb2e8f9f7 | 987 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 988 | */ |
<> | 144:ef7eb2e8f9f7 | 989 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 990 | /** |
<> | 144:ef7eb2e8f9f7 | 991 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 992 | */ |
<> | 144:ef7eb2e8f9f7 | 993 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 994 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 995 | |
<> | 144:ef7eb2e8f9f7 | 996 | /** |
<> | 144:ef7eb2e8f9f7 | 997 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 998 | */ |
<> | 144:ef7eb2e8f9f7 | 999 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1000 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1001 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1002 | |
<> | 144:ef7eb2e8f9f7 | 1003 | /** |
<> | 144:ef7eb2e8f9f7 | 1004 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 1005 | */ |
<> | 144:ef7eb2e8f9f7 | 1006 | #define GPIO_AF6_SPI1 ((uint8_t)0x06) /* SPI1/I2S1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1007 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1008 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1009 | #define GPIO_AF6_CEC ((uint8_t)0x06) /* CEC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1010 | |
<> | 144:ef7eb2e8f9f7 | 1011 | /** |
<> | 144:ef7eb2e8f9f7 | 1012 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 1013 | */ |
<> | 144:ef7eb2e8f9f7 | 1014 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1015 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1016 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1017 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1018 | #define GPIO_AF7_CEC ((uint8_t)0x07) /* CEC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1019 | |
<> | 144:ef7eb2e8f9f7 | 1020 | /** |
<> | 144:ef7eb2e8f9f7 | 1021 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 1022 | */ |
<> | 144:ef7eb2e8f9f7 | 1023 | #define GPIO_AF8_COMP1 ((uint8_t)0x08) /* COMP1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1024 | #define GPIO_AF8_COMP2 ((uint8_t)0x08) /* COMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1025 | |
<> | 144:ef7eb2e8f9f7 | 1026 | /** |
<> | 144:ef7eb2e8f9f7 | 1027 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 1028 | */ |
<> | 144:ef7eb2e8f9f7 | 1029 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1030 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1031 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1032 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1033 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1034 | |
<> | 144:ef7eb2e8f9f7 | 1035 | /** |
<> | 144:ef7eb2e8f9f7 | 1036 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 1037 | */ |
<> | 144:ef7eb2e8f9f7 | 1038 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1039 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1040 | #define GPIO_AF10_TIM4 ((uint8_t)0xA) /* TIM4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1041 | #define GPIO_AF10_TIM12 ((uint8_t)0xA) /* TIM12 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1042 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1043 | |
<> | 144:ef7eb2e8f9f7 | 1044 | /** |
<> | 144:ef7eb2e8f9f7 | 1045 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 1046 | */ |
<> | 144:ef7eb2e8f9f7 | 1047 | #define GPIO_AF11_TIM19 ((uint8_t)0x0B) /* TIM19 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1048 | |
<> | 144:ef7eb2e8f9f7 | 1049 | /** |
<> | 144:ef7eb2e8f9f7 | 1050 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 1051 | */ |
<> | 144:ef7eb2e8f9f7 | 1052 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1053 | |
<> | 144:ef7eb2e8f9f7 | 1054 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0B) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 1055 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1056 | #endif /* STM32F378xx */ |
<> | 144:ef7eb2e8f9f7 | 1057 | |
<> | 144:ef7eb2e8f9f7 | 1058 | #if defined (STM32F303x8) |
<> | 144:ef7eb2e8f9f7 | 1059 | /*---------------------------------- STM32F303x8--------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1060 | /** |
<> | 144:ef7eb2e8f9f7 | 1061 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 1062 | */ |
<> | 144:ef7eb2e8f9f7 | 1063 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1064 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1065 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1066 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1067 | |
<> | 144:ef7eb2e8f9f7 | 1068 | /** |
<> | 144:ef7eb2e8f9f7 | 1069 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 1070 | */ |
<> | 144:ef7eb2e8f9f7 | 1071 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1072 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1073 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1074 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1075 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1076 | /** |
<> | 144:ef7eb2e8f9f7 | 1077 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 1078 | */ |
<> | 144:ef7eb2e8f9f7 | 1079 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1080 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1081 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1082 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1083 | |
<> | 144:ef7eb2e8f9f7 | 1084 | /** |
<> | 144:ef7eb2e8f9f7 | 1085 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 1086 | */ |
<> | 144:ef7eb2e8f9f7 | 1087 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1088 | |
<> | 144:ef7eb2e8f9f7 | 1089 | /** |
<> | 144:ef7eb2e8f9f7 | 1090 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 1091 | */ |
<> | 144:ef7eb2e8f9f7 | 1092 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1093 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1094 | |
<> | 144:ef7eb2e8f9f7 | 1095 | /** |
<> | 144:ef7eb2e8f9f7 | 1096 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 1097 | */ |
<> | 144:ef7eb2e8f9f7 | 1098 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1099 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1100 | /** |
<> | 144:ef7eb2e8f9f7 | 1101 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 1102 | */ |
<> | 144:ef7eb2e8f9f7 | 1103 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1104 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1105 | |
<> | 144:ef7eb2e8f9f7 | 1106 | /** |
<> | 144:ef7eb2e8f9f7 | 1107 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 1108 | */ |
<> | 144:ef7eb2e8f9f7 | 1109 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1110 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1111 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1112 | #define GPIO_AF7_GPCOMP6 ((uint8_t)0x07) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1113 | |
<> | 144:ef7eb2e8f9f7 | 1114 | /** |
<> | 144:ef7eb2e8f9f7 | 1115 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 1116 | */ |
<> | 144:ef7eb2e8f9f7 | 1117 | #define GPIO_AF8_GPCOMP2 ((uint8_t)0x08) /* GPCOMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1118 | #define GPIO_AF8_GPCOMP4 ((uint8_t)0x08) /* GPCOMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1119 | #define GPIO_AF8_GPCOMP6 ((uint8_t)0x08) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1120 | |
<> | 144:ef7eb2e8f9f7 | 1121 | /** |
<> | 144:ef7eb2e8f9f7 | 1122 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 1123 | */ |
<> | 144:ef7eb2e8f9f7 | 1124 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1125 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1126 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1127 | /** |
<> | 144:ef7eb2e8f9f7 | 1128 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 1129 | */ |
<> | 144:ef7eb2e8f9f7 | 1130 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1131 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1132 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1133 | |
<> | 144:ef7eb2e8f9f7 | 1134 | /** |
<> | 144:ef7eb2e8f9f7 | 1135 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 1136 | */ |
<> | 144:ef7eb2e8f9f7 | 1137 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1138 | |
<> | 144:ef7eb2e8f9f7 | 1139 | /** |
<> | 144:ef7eb2e8f9f7 | 1140 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 1141 | */ |
<> | 144:ef7eb2e8f9f7 | 1142 | #define GPIO_AF12_TIM1 ((uint8_t)0x0C) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1143 | |
<> | 144:ef7eb2e8f9f7 | 1144 | /** |
<> | 144:ef7eb2e8f9f7 | 1145 | * @brief AF 13 selection |
<> | 144:ef7eb2e8f9f7 | 1146 | */ |
<> | 144:ef7eb2e8f9f7 | 1147 | #define GPIO_AF13_OPAMP2 ((uint8_t)0x0D) /* OPAMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1148 | |
<> | 144:ef7eb2e8f9f7 | 1149 | /** |
<> | 144:ef7eb2e8f9f7 | 1150 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 1151 | */ |
<> | 144:ef7eb2e8f9f7 | 1152 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1153 | |
<> | 144:ef7eb2e8f9f7 | 1154 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0D) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 1155 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1156 | #endif /* STM32F303x8 */ |
<> | 144:ef7eb2e8f9f7 | 1157 | |
<> | 144:ef7eb2e8f9f7 | 1158 | #if defined (STM32F334x8) || defined (STM32F328xx) |
<> | 144:ef7eb2e8f9f7 | 1159 | /*---------------------------------- STM32F334x8/STM32F328xx -------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1160 | /** |
<> | 144:ef7eb2e8f9f7 | 1161 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 1162 | */ |
<> | 144:ef7eb2e8f9f7 | 1163 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1164 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1165 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1166 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1167 | |
<> | 144:ef7eb2e8f9f7 | 1168 | /** |
<> | 144:ef7eb2e8f9f7 | 1169 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 1170 | */ |
<> | 144:ef7eb2e8f9f7 | 1171 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1172 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1173 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1174 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1175 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1176 | /** |
<> | 144:ef7eb2e8f9f7 | 1177 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 1178 | */ |
<> | 144:ef7eb2e8f9f7 | 1179 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1180 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1181 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1182 | #define GPIO_AF2_TIM16 ((uint8_t)0x02) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1183 | |
<> | 144:ef7eb2e8f9f7 | 1184 | /** |
<> | 144:ef7eb2e8f9f7 | 1185 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 1186 | */ |
<> | 144:ef7eb2e8f9f7 | 1187 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1188 | #define GPIO_AF3_HRTIM1 ((uint8_t)0x03) /* HRTIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1189 | |
<> | 144:ef7eb2e8f9f7 | 1190 | /** |
<> | 144:ef7eb2e8f9f7 | 1191 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 1192 | */ |
<> | 144:ef7eb2e8f9f7 | 1193 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1194 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1195 | |
<> | 144:ef7eb2e8f9f7 | 1196 | /** |
<> | 144:ef7eb2e8f9f7 | 1197 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 1198 | */ |
<> | 144:ef7eb2e8f9f7 | 1199 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1200 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1201 | /** |
<> | 144:ef7eb2e8f9f7 | 1202 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 1203 | */ |
<> | 144:ef7eb2e8f9f7 | 1204 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1205 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1206 | |
<> | 144:ef7eb2e8f9f7 | 1207 | /** |
<> | 144:ef7eb2e8f9f7 | 1208 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 1209 | */ |
<> | 144:ef7eb2e8f9f7 | 1210 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1211 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1212 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1213 | #define GPIO_AF7_GPCOMP6 ((uint8_t)0x07) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1214 | |
<> | 144:ef7eb2e8f9f7 | 1215 | /** |
<> | 144:ef7eb2e8f9f7 | 1216 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 1217 | */ |
<> | 144:ef7eb2e8f9f7 | 1218 | #define GPIO_AF8_GPCOMP2 ((uint8_t)0x08) /* GPCOMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1219 | #define GPIO_AF8_GPCOMP4 ((uint8_t)0x08) /* GPCOMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1220 | #define GPIO_AF8_GPCOMP6 ((uint8_t)0x08) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1221 | |
<> | 144:ef7eb2e8f9f7 | 1222 | /** |
<> | 144:ef7eb2e8f9f7 | 1223 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 1224 | */ |
<> | 144:ef7eb2e8f9f7 | 1225 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1226 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1227 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1228 | /** |
<> | 144:ef7eb2e8f9f7 | 1229 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 1230 | */ |
<> | 144:ef7eb2e8f9f7 | 1231 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1232 | #define GPIO_AF10_TIM3 ((uint8_t)0xA) /* TIM3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1233 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1234 | |
<> | 144:ef7eb2e8f9f7 | 1235 | /** |
<> | 144:ef7eb2e8f9f7 | 1236 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 1237 | */ |
<> | 144:ef7eb2e8f9f7 | 1238 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1239 | |
<> | 144:ef7eb2e8f9f7 | 1240 | /** |
<> | 144:ef7eb2e8f9f7 | 1241 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 1242 | */ |
<> | 144:ef7eb2e8f9f7 | 1243 | #define GPIO_AF12_TIM1 ((uint8_t)0x0C) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1244 | #define GPIO_AF12_HRTIM1 ((uint8_t)0x0C) /* HRTIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1245 | |
<> | 144:ef7eb2e8f9f7 | 1246 | /** |
<> | 144:ef7eb2e8f9f7 | 1247 | * @brief AF 13 selection |
<> | 144:ef7eb2e8f9f7 | 1248 | */ |
<> | 144:ef7eb2e8f9f7 | 1249 | #define GPIO_AF13_OPAMP2 ((uint8_t)0x0D) /* OPAMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1250 | #define GPIO_AF13_HRTIM1 ((uint8_t)0x0D) /* HRTIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1251 | |
<> | 144:ef7eb2e8f9f7 | 1252 | /** |
<> | 144:ef7eb2e8f9f7 | 1253 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 1254 | */ |
<> | 144:ef7eb2e8f9f7 | 1255 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1256 | |
<> | 144:ef7eb2e8f9f7 | 1257 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0D) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 1258 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1259 | #endif /* STM32F334x8 || STM32F328xx */ |
<> | 144:ef7eb2e8f9f7 | 1260 | |
<> | 144:ef7eb2e8f9f7 | 1261 | #if defined (STM32F301x8) || defined (STM32F318xx) |
<> | 144:ef7eb2e8f9f7 | 1262 | /*---------------------------------- STM32F301x8 / STM32F318xx ------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1263 | /** |
<> | 144:ef7eb2e8f9f7 | 1264 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 1265 | */ |
<> | 144:ef7eb2e8f9f7 | 1266 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1267 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1268 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1269 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1270 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1271 | |
<> | 144:ef7eb2e8f9f7 | 1272 | /** |
<> | 144:ef7eb2e8f9f7 | 1273 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 1274 | */ |
<> | 144:ef7eb2e8f9f7 | 1275 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1276 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1277 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1278 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1279 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1280 | /** |
<> | 144:ef7eb2e8f9f7 | 1281 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 1282 | */ |
<> | 144:ef7eb2e8f9f7 | 1283 | #define GPIO_AF2_I2C3 ((uint8_t)0x02) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1284 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1285 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1286 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1287 | |
<> | 144:ef7eb2e8f9f7 | 1288 | /** |
<> | 144:ef7eb2e8f9f7 | 1289 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 1290 | */ |
<> | 144:ef7eb2e8f9f7 | 1291 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1292 | #define GPIO_AF3_I2C3 ((uint8_t)0x03) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1293 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1294 | |
<> | 144:ef7eb2e8f9f7 | 1295 | /** |
<> | 144:ef7eb2e8f9f7 | 1296 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 1297 | */ |
<> | 144:ef7eb2e8f9f7 | 1298 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1299 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1300 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1301 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1302 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1303 | |
<> | 144:ef7eb2e8f9f7 | 1304 | /** |
<> | 144:ef7eb2e8f9f7 | 1305 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 1306 | */ |
<> | 144:ef7eb2e8f9f7 | 1307 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1308 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1309 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1310 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1311 | /** |
<> | 144:ef7eb2e8f9f7 | 1312 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 1313 | */ |
<> | 144:ef7eb2e8f9f7 | 1314 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1315 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1316 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1317 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1318 | |
<> | 144:ef7eb2e8f9f7 | 1319 | /** |
<> | 144:ef7eb2e8f9f7 | 1320 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 1321 | */ |
<> | 144:ef7eb2e8f9f7 | 1322 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1323 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1324 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1325 | #define GPIO_AF7_GPCOMP6 ((uint8_t)0x07) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1326 | |
<> | 144:ef7eb2e8f9f7 | 1327 | /** |
<> | 144:ef7eb2e8f9f7 | 1328 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 1329 | */ |
<> | 144:ef7eb2e8f9f7 | 1330 | #define GPIO_AF8_I2C3 ((uint8_t)0x08) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1331 | #define GPIO_AF8_GPCOMP2 ((uint8_t)0x08) /* GPCOMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1332 | #define GPIO_AF8_GPCOMP4 ((uint8_t)0x08) /* GPCOMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1333 | #define GPIO_AF8_GPCOMP6 ((uint8_t)0x08) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1334 | |
<> | 144:ef7eb2e8f9f7 | 1335 | /** |
<> | 144:ef7eb2e8f9f7 | 1336 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 1337 | */ |
<> | 144:ef7eb2e8f9f7 | 1338 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1339 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1340 | |
<> | 144:ef7eb2e8f9f7 | 1341 | /** |
<> | 144:ef7eb2e8f9f7 | 1342 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 1343 | */ |
<> | 144:ef7eb2e8f9f7 | 1344 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1345 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1346 | |
<> | 144:ef7eb2e8f9f7 | 1347 | /** |
<> | 144:ef7eb2e8f9f7 | 1348 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 1349 | */ |
<> | 144:ef7eb2e8f9f7 | 1350 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1351 | |
<> | 144:ef7eb2e8f9f7 | 1352 | /** |
<> | 144:ef7eb2e8f9f7 | 1353 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 1354 | */ |
<> | 144:ef7eb2e8f9f7 | 1355 | #define GPIO_AF12_TIM1 ((uint8_t)0x0C) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1356 | |
<> | 144:ef7eb2e8f9f7 | 1357 | /** |
<> | 144:ef7eb2e8f9f7 | 1358 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 1359 | */ |
<> | 144:ef7eb2e8f9f7 | 1360 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1361 | |
<> | 144:ef7eb2e8f9f7 | 1362 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 1363 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1364 | #endif /* STM32F301x8 || STM32F318xx */ |
<> | 144:ef7eb2e8f9f7 | 1365 | |
<> | 144:ef7eb2e8f9f7 | 1366 | #if defined (STM32F302x8) |
<> | 144:ef7eb2e8f9f7 | 1367 | /*---------------------------------- STM32F302x8------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1368 | /** |
<> | 144:ef7eb2e8f9f7 | 1369 | * @brief AF 0 selection |
<> | 144:ef7eb2e8f9f7 | 1370 | */ |
<> | 144:ef7eb2e8f9f7 | 1371 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1372 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1373 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1374 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1375 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1376 | |
<> | 144:ef7eb2e8f9f7 | 1377 | /** |
<> | 144:ef7eb2e8f9f7 | 1378 | * @brief AF 1 selection |
<> | 144:ef7eb2e8f9f7 | 1379 | */ |
<> | 144:ef7eb2e8f9f7 | 1380 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1381 | #define GPIO_AF1_TIM15 ((uint8_t)0x01) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1382 | #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1383 | #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1384 | #define GPIO_AF1_EVENTOUT ((uint8_t)0x01) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1385 | /** |
<> | 144:ef7eb2e8f9f7 | 1386 | * @brief AF 2 selection |
<> | 144:ef7eb2e8f9f7 | 1387 | */ |
<> | 144:ef7eb2e8f9f7 | 1388 | #define GPIO_AF2_I2C3 ((uint8_t)0x02) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1389 | #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1390 | #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1391 | #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1392 | |
<> | 144:ef7eb2e8f9f7 | 1393 | /** |
<> | 144:ef7eb2e8f9f7 | 1394 | * @brief AF 3 selection |
<> | 144:ef7eb2e8f9f7 | 1395 | */ |
<> | 144:ef7eb2e8f9f7 | 1396 | #define GPIO_AF3_TSC ((uint8_t)0x03) /* TSC Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1397 | #define GPIO_AF3_I2C3 ((uint8_t)0x03) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1398 | #define GPIO_AF3_TIM15 ((uint8_t)0x03) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1399 | |
<> | 144:ef7eb2e8f9f7 | 1400 | /** |
<> | 144:ef7eb2e8f9f7 | 1401 | * @brief AF 4 selection |
<> | 144:ef7eb2e8f9f7 | 1402 | */ |
<> | 144:ef7eb2e8f9f7 | 1403 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1404 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1405 | #define GPIO_AF4_TIM1 ((uint8_t)0x04) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1406 | #define GPIO_AF4_TIM16 ((uint8_t)0x04) /* TIM16 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1407 | #define GPIO_AF4_TIM17 ((uint8_t)0x04) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1408 | |
<> | 144:ef7eb2e8f9f7 | 1409 | /** |
<> | 144:ef7eb2e8f9f7 | 1410 | * @brief AF 5 selection |
<> | 144:ef7eb2e8f9f7 | 1411 | */ |
<> | 144:ef7eb2e8f9f7 | 1412 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1413 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1414 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1415 | #define GPIO_AF5_IR ((uint8_t)0x05) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1416 | /** |
<> | 144:ef7eb2e8f9f7 | 1417 | * @brief AF 6 selection |
<> | 144:ef7eb2e8f9f7 | 1418 | */ |
<> | 144:ef7eb2e8f9f7 | 1419 | #define GPIO_AF6_TIM1 ((uint8_t)0x06) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1420 | #define GPIO_AF6_IR ((uint8_t)0x06) /* IR Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1421 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2/I2S2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1422 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1423 | |
<> | 144:ef7eb2e8f9f7 | 1424 | /** |
<> | 144:ef7eb2e8f9f7 | 1425 | * @brief AF 7 selection |
<> | 144:ef7eb2e8f9f7 | 1426 | */ |
<> | 144:ef7eb2e8f9f7 | 1427 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1428 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1429 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1430 | #define GPIO_AF7_GPCOMP6 ((uint8_t)0x07) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1431 | #define GPIO_AF7_CAN ((uint8_t)0x07) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1432 | |
<> | 144:ef7eb2e8f9f7 | 1433 | /** |
<> | 144:ef7eb2e8f9f7 | 1434 | * @brief AF 8 selection |
<> | 144:ef7eb2e8f9f7 | 1435 | */ |
<> | 144:ef7eb2e8f9f7 | 1436 | #define GPIO_AF8_I2C3 ((uint8_t)0x08) /* I2C3 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1437 | #define GPIO_AF8_GPCOMP2 ((uint8_t)0x08) /* GPCOMP2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1438 | #define GPIO_AF8_GPCOMP4 ((uint8_t)0x08) /* GPCOMP4 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1439 | #define GPIO_AF8_GPCOMP6 ((uint8_t)0x08) /* GPCOMP6 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1440 | |
<> | 144:ef7eb2e8f9f7 | 1441 | /** |
<> | 144:ef7eb2e8f9f7 | 1442 | * @brief AF 9 selection |
<> | 144:ef7eb2e8f9f7 | 1443 | */ |
<> | 144:ef7eb2e8f9f7 | 1444 | #define GPIO_AF9_TIM1 ((uint8_t)0x09) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1445 | #define GPIO_AF9_TIM15 ((uint8_t)0x09) /* TIM15 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1446 | #define GPIO_AF9_CAN ((uint8_t)0x09) /* CAN Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1447 | |
<> | 144:ef7eb2e8f9f7 | 1448 | /** |
<> | 144:ef7eb2e8f9f7 | 1449 | * @brief AF 10 selection |
<> | 144:ef7eb2e8f9f7 | 1450 | */ |
<> | 144:ef7eb2e8f9f7 | 1451 | #define GPIO_AF10_TIM2 ((uint8_t)0xA) /* TIM2 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1452 | #define GPIO_AF10_TIM17 ((uint8_t)0xA) /* TIM17 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1453 | |
<> | 144:ef7eb2e8f9f7 | 1454 | /** |
<> | 144:ef7eb2e8f9f7 | 1455 | * @brief AF 11 selection |
<> | 144:ef7eb2e8f9f7 | 1456 | */ |
<> | 144:ef7eb2e8f9f7 | 1457 | #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1458 | |
<> | 144:ef7eb2e8f9f7 | 1459 | /** |
<> | 144:ef7eb2e8f9f7 | 1460 | * @brief AF 12 selection |
<> | 144:ef7eb2e8f9f7 | 1461 | */ |
<> | 144:ef7eb2e8f9f7 | 1462 | #define GPIO_AF12_TIM1 ((uint8_t)0x0C) /* TIM1 Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1463 | |
<> | 144:ef7eb2e8f9f7 | 1464 | /** |
<> | 144:ef7eb2e8f9f7 | 1465 | * @brief AF 15 selection |
<> | 144:ef7eb2e8f9f7 | 1466 | */ |
<> | 144:ef7eb2e8f9f7 | 1467 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
<> | 144:ef7eb2e8f9f7 | 1468 | |
<> | 144:ef7eb2e8f9f7 | 1469 | #define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0C) || ((AF) == (uint8_t)0x0F)) |
<> | 144:ef7eb2e8f9f7 | 1470 | /*------------------------------------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1471 | #endif /* STM32F302x8 */ |
<> | 144:ef7eb2e8f9f7 | 1472 | /** |
<> | 144:ef7eb2e8f9f7 | 1473 | * @} |
<> | 144:ef7eb2e8f9f7 | 1474 | */ |
<> | 144:ef7eb2e8f9f7 | 1475 | |
<> | 144:ef7eb2e8f9f7 | 1476 | /** |
<> | 144:ef7eb2e8f9f7 | 1477 | * @} |
<> | 144:ef7eb2e8f9f7 | 1478 | */ |
<> | 144:ef7eb2e8f9f7 | 1479 | |
<> | 144:ef7eb2e8f9f7 | 1480 | /* Exported macro ------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1481 | /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros |
<> | 144:ef7eb2e8f9f7 | 1482 | * @{ |
<> | 144:ef7eb2e8f9f7 | 1483 | */ |
<> | 144:ef7eb2e8f9f7 | 1484 | |
<> | 144:ef7eb2e8f9f7 | 1485 | /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index |
<> | 144:ef7eb2e8f9f7 | 1486 | * @{ |
<> | 144:ef7eb2e8f9f7 | 1487 | */ |
<> | 144:ef7eb2e8f9f7 | 1488 | #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ |
<> | 144:ef7eb2e8f9f7 | 1489 | defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) |
<> | 144:ef7eb2e8f9f7 | 1490 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
<> | 144:ef7eb2e8f9f7 | 1491 | ((__GPIOx__) == (GPIOB))? 1U :\ |
<> | 144:ef7eb2e8f9f7 | 1492 | ((__GPIOx__) == (GPIOC))? 2U :\ |
<> | 144:ef7eb2e8f9f7 | 1493 | ((__GPIOx__) == (GPIOD))? 3U : 5U) |
<> | 144:ef7eb2e8f9f7 | 1494 | #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ |
<> | 144:ef7eb2e8f9f7 | 1495 | /* STM32F301x8 || STM32F302x8 || STM32F318xx */ |
<> | 144:ef7eb2e8f9f7 | 1496 | |
<> | 144:ef7eb2e8f9f7 | 1497 | #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ |
<> | 144:ef7eb2e8f9f7 | 1498 | defined(STM32F373xC) || defined(STM32F378xx) |
<> | 144:ef7eb2e8f9f7 | 1499 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
<> | 144:ef7eb2e8f9f7 | 1500 | ((__GPIOx__) == (GPIOB))? 1U :\ |
<> | 144:ef7eb2e8f9f7 | 1501 | ((__GPIOx__) == (GPIOC))? 2U :\ |
<> | 144:ef7eb2e8f9f7 | 1502 | ((__GPIOx__) == (GPIOD))? 3U :\ |
<> | 144:ef7eb2e8f9f7 | 1503 | ((__GPIOx__) == (GPIOE))? 4U : 5U) |
<> | 144:ef7eb2e8f9f7 | 1504 | #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
<> | 144:ef7eb2e8f9f7 | 1505 | /* STM32F373xC || STM32F378xx */ |
<> | 144:ef7eb2e8f9f7 | 1506 | |
<> | 144:ef7eb2e8f9f7 | 1507 | #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) |
<> | 144:ef7eb2e8f9f7 | 1508 | #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ |
<> | 144:ef7eb2e8f9f7 | 1509 | ((__GPIOx__) == (GPIOB))? 1U :\ |
<> | 144:ef7eb2e8f9f7 | 1510 | ((__GPIOx__) == (GPIOC))? 2U :\ |
<> | 144:ef7eb2e8f9f7 | 1511 | ((__GPIOx__) == (GPIOD))? 3U :\ |
<> | 144:ef7eb2e8f9f7 | 1512 | ((__GPIOx__) == (GPIOE))? 4U :\ |
<> | 144:ef7eb2e8f9f7 | 1513 | ((__GPIOx__) == (GPIOF))? 5U :\ |
<> | 144:ef7eb2e8f9f7 | 1514 | ((__GPIOx__) == (GPIOG))? 6U : 7U) |
<> | 144:ef7eb2e8f9f7 | 1515 | #endif /* STM32F302xE || STM32F303xE || STM32F398xx */ |
<> | 144:ef7eb2e8f9f7 | 1516 | |
<> | 144:ef7eb2e8f9f7 | 1517 | /** |
<> | 144:ef7eb2e8f9f7 | 1518 | * @} |
<> | 144:ef7eb2e8f9f7 | 1519 | */ |
<> | 144:ef7eb2e8f9f7 | 1520 | |
<> | 144:ef7eb2e8f9f7 | 1521 | /** |
<> | 144:ef7eb2e8f9f7 | 1522 | * @} |
<> | 144:ef7eb2e8f9f7 | 1523 | */ |
<> | 144:ef7eb2e8f9f7 | 1524 | |
<> | 144:ef7eb2e8f9f7 | 1525 | /* Exported functions --------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 1526 | /** |
<> | 144:ef7eb2e8f9f7 | 1527 | * @} |
<> | 144:ef7eb2e8f9f7 | 1528 | */ |
<> | 144:ef7eb2e8f9f7 | 1529 | |
<> | 144:ef7eb2e8f9f7 | 1530 | /** |
<> | 144:ef7eb2e8f9f7 | 1531 | * @} |
<> | 144:ef7eb2e8f9f7 | 1532 | */ |
<> | 144:ef7eb2e8f9f7 | 1533 | |
<> | 144:ef7eb2e8f9f7 | 1534 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 1535 | } |
<> | 144:ef7eb2e8f9f7 | 1536 | #endif |
<> | 144:ef7eb2e8f9f7 | 1537 | |
<> | 144:ef7eb2e8f9f7 | 1538 | #endif /* __STM32F3xx_HAL_GPIO_EX_H */ |
<> | 144:ef7eb2e8f9f7 | 1539 | |
<> | 144:ef7eb2e8f9f7 | 1540 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |