mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F411RE/stm32f4xx_hal_gpio_ex.h@235:685d5f11838f, 2014-06-23 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jun 23 14:00:09 2014 +0100
- Revision:
- 235:685d5f11838f
Synchronized with git revision 9728c76667962b289ee9c4c687ef9f115db48cd3
Full URL: https://github.com/mbedmicro/mbed/commit/9728c76667962b289ee9c4c687ef9f115db48cd3/
[NUCLEO_F411RE] Add all target files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 235:685d5f11838f | 1 | /** |
mbed_official | 235:685d5f11838f | 2 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 3 | * @file stm32f4xx_hal_gpio_ex.h |
mbed_official | 235:685d5f11838f | 4 | * @author MCD Application Team |
mbed_official | 235:685d5f11838f | 5 | * @version V1.1.0 |
mbed_official | 235:685d5f11838f | 6 | * @date 19-June-2014 |
mbed_official | 235:685d5f11838f | 7 | * @brief Header file of GPIO HAL Extension module. |
mbed_official | 235:685d5f11838f | 8 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 9 | * @attention |
mbed_official | 235:685d5f11838f | 10 | * |
mbed_official | 235:685d5f11838f | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 235:685d5f11838f | 12 | * |
mbed_official | 235:685d5f11838f | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 235:685d5f11838f | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 235:685d5f11838f | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 235:685d5f11838f | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 235:685d5f11838f | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 235:685d5f11838f | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 235:685d5f11838f | 19 | * and/or other materials provided with the distribution. |
mbed_official | 235:685d5f11838f | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 235:685d5f11838f | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 235:685d5f11838f | 22 | * without specific prior written permission. |
mbed_official | 235:685d5f11838f | 23 | * |
mbed_official | 235:685d5f11838f | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 235:685d5f11838f | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 235:685d5f11838f | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 235:685d5f11838f | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 235:685d5f11838f | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 235:685d5f11838f | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 235:685d5f11838f | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 235:685d5f11838f | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 235:685d5f11838f | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 235:685d5f11838f | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 235:685d5f11838f | 34 | * |
mbed_official | 235:685d5f11838f | 35 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 36 | */ |
mbed_official | 235:685d5f11838f | 37 | |
mbed_official | 235:685d5f11838f | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 235:685d5f11838f | 39 | #ifndef __STM32F4xx_HAL_GPIO_EX_H |
mbed_official | 235:685d5f11838f | 40 | #define __STM32F4xx_HAL_GPIO_EX_H |
mbed_official | 235:685d5f11838f | 41 | |
mbed_official | 235:685d5f11838f | 42 | #ifdef __cplusplus |
mbed_official | 235:685d5f11838f | 43 | extern "C" { |
mbed_official | 235:685d5f11838f | 44 | #endif |
mbed_official | 235:685d5f11838f | 45 | |
mbed_official | 235:685d5f11838f | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 47 | #include "stm32f4xx_hal_def.h" |
mbed_official | 235:685d5f11838f | 48 | |
mbed_official | 235:685d5f11838f | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
mbed_official | 235:685d5f11838f | 50 | * @{ |
mbed_official | 235:685d5f11838f | 51 | */ |
mbed_official | 235:685d5f11838f | 52 | |
mbed_official | 235:685d5f11838f | 53 | /** @addtogroup GPIO |
mbed_official | 235:685d5f11838f | 54 | * @{ |
mbed_official | 235:685d5f11838f | 55 | */ |
mbed_official | 235:685d5f11838f | 56 | |
mbed_official | 235:685d5f11838f | 57 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 58 | |
mbed_official | 235:685d5f11838f | 59 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 60 | |
mbed_official | 235:685d5f11838f | 61 | /** @defgroup GPIO_Exported_Constants |
mbed_official | 235:685d5f11838f | 62 | * @{ |
mbed_official | 235:685d5f11838f | 63 | */ |
mbed_official | 235:685d5f11838f | 64 | |
mbed_official | 235:685d5f11838f | 65 | /** @defgroup GPIO_Alternat_function_selection |
mbed_official | 235:685d5f11838f | 66 | * @{ |
mbed_official | 235:685d5f11838f | 67 | */ |
mbed_official | 235:685d5f11838f | 68 | |
mbed_official | 235:685d5f11838f | 69 | /*------------------------- STM32F429xx/STM32F439xx---------------------------*/ |
mbed_official | 235:685d5f11838f | 70 | #if defined (STM32F429xx) || defined (STM32F439xx) |
mbed_official | 235:685d5f11838f | 71 | /** |
mbed_official | 235:685d5f11838f | 72 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 73 | */ |
mbed_official | 235:685d5f11838f | 74 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 75 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 76 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 77 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 78 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 79 | |
mbed_official | 235:685d5f11838f | 80 | /** |
mbed_official | 235:685d5f11838f | 81 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 82 | */ |
mbed_official | 235:685d5f11838f | 83 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 84 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 85 | |
mbed_official | 235:685d5f11838f | 86 | /** |
mbed_official | 235:685d5f11838f | 87 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 88 | */ |
mbed_official | 235:685d5f11838f | 89 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 90 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 91 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 92 | |
mbed_official | 235:685d5f11838f | 93 | /** |
mbed_official | 235:685d5f11838f | 94 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 95 | */ |
mbed_official | 235:685d5f11838f | 96 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 97 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 98 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 99 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 100 | |
mbed_official | 235:685d5f11838f | 101 | /** |
mbed_official | 235:685d5f11838f | 102 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 103 | */ |
mbed_official | 235:685d5f11838f | 104 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 105 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 106 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 107 | |
mbed_official | 235:685d5f11838f | 108 | /** |
mbed_official | 235:685d5f11838f | 109 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 110 | */ |
mbed_official | 235:685d5f11838f | 111 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 112 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 113 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 114 | #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 115 | #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 116 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 117 | |
mbed_official | 235:685d5f11838f | 118 | /** |
mbed_official | 235:685d5f11838f | 119 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 120 | */ |
mbed_official | 235:685d5f11838f | 121 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 122 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 123 | #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 124 | |
mbed_official | 235:685d5f11838f | 125 | /** |
mbed_official | 235:685d5f11838f | 126 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 127 | */ |
mbed_official | 235:685d5f11838f | 128 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 129 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 130 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 131 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 132 | |
mbed_official | 235:685d5f11838f | 133 | /** |
mbed_official | 235:685d5f11838f | 134 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 135 | */ |
mbed_official | 235:685d5f11838f | 136 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 137 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 138 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 139 | #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 140 | #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 141 | |
mbed_official | 235:685d5f11838f | 142 | /** |
mbed_official | 235:685d5f11838f | 143 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 144 | */ |
mbed_official | 235:685d5f11838f | 145 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 146 | #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 147 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 148 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 149 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 150 | #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LCD-TFT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 151 | |
mbed_official | 235:685d5f11838f | 152 | /** |
mbed_official | 235:685d5f11838f | 153 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 154 | */ |
mbed_official | 235:685d5f11838f | 155 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 156 | #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 157 | |
mbed_official | 235:685d5f11838f | 158 | /** |
mbed_official | 235:685d5f11838f | 159 | * @brief AF 11 selection |
mbed_official | 235:685d5f11838f | 160 | */ |
mbed_official | 235:685d5f11838f | 161 | #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 162 | |
mbed_official | 235:685d5f11838f | 163 | /** |
mbed_official | 235:685d5f11838f | 164 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 165 | */ |
mbed_official | 235:685d5f11838f | 166 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 167 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 168 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 169 | |
mbed_official | 235:685d5f11838f | 170 | /** |
mbed_official | 235:685d5f11838f | 171 | * @brief AF 13 selection |
mbed_official | 235:685d5f11838f | 172 | */ |
mbed_official | 235:685d5f11838f | 173 | #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 174 | |
mbed_official | 235:685d5f11838f | 175 | /** |
mbed_official | 235:685d5f11838f | 176 | * @brief AF 14 selection |
mbed_official | 235:685d5f11838f | 177 | */ |
mbed_official | 235:685d5f11838f | 178 | #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LCD-TFT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 179 | |
mbed_official | 235:685d5f11838f | 180 | /** |
mbed_official | 235:685d5f11838f | 181 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 182 | */ |
mbed_official | 235:685d5f11838f | 183 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 184 | |
mbed_official | 235:685d5f11838f | 185 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 186 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 187 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 188 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 189 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 190 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
mbed_official | 235:685d5f11838f | 191 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
mbed_official | 235:685d5f11838f | 192 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
mbed_official | 235:685d5f11838f | 193 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
mbed_official | 235:685d5f11838f | 194 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
mbed_official | 235:685d5f11838f | 195 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 196 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
mbed_official | 235:685d5f11838f | 197 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
mbed_official | 235:685d5f11838f | 198 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
mbed_official | 235:685d5f11838f | 199 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
mbed_official | 235:685d5f11838f | 200 | ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ |
mbed_official | 235:685d5f11838f | 201 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ |
mbed_official | 235:685d5f11838f | 202 | ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ |
mbed_official | 235:685d5f11838f | 203 | ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ |
mbed_official | 235:685d5f11838f | 204 | ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ |
mbed_official | 235:685d5f11838f | 205 | ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1) || \ |
mbed_official | 235:685d5f11838f | 206 | ((AF) == GPIO_AF14_LTDC)) |
mbed_official | 235:685d5f11838f | 207 | |
mbed_official | 235:685d5f11838f | 208 | #endif /* STM32F429xx || STM32F439xx */ |
mbed_official | 235:685d5f11838f | 209 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 210 | |
mbed_official | 235:685d5f11838f | 211 | /*---------------------------------- STM32F427xx/STM32F437xx--------------------------------*/ |
mbed_official | 235:685d5f11838f | 212 | #if defined (STM32F427xx) || defined (STM32F437xx) |
mbed_official | 235:685d5f11838f | 213 | /** |
mbed_official | 235:685d5f11838f | 214 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 215 | */ |
mbed_official | 235:685d5f11838f | 216 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 217 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 218 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 219 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 220 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 221 | |
mbed_official | 235:685d5f11838f | 222 | /** |
mbed_official | 235:685d5f11838f | 223 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 224 | */ |
mbed_official | 235:685d5f11838f | 225 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 226 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 227 | |
mbed_official | 235:685d5f11838f | 228 | /** |
mbed_official | 235:685d5f11838f | 229 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 230 | */ |
mbed_official | 235:685d5f11838f | 231 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 232 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 233 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 234 | |
mbed_official | 235:685d5f11838f | 235 | /** |
mbed_official | 235:685d5f11838f | 236 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 237 | */ |
mbed_official | 235:685d5f11838f | 238 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 239 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 240 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 241 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 242 | |
mbed_official | 235:685d5f11838f | 243 | /** |
mbed_official | 235:685d5f11838f | 244 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 245 | */ |
mbed_official | 235:685d5f11838f | 246 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 247 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 248 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 249 | |
mbed_official | 235:685d5f11838f | 250 | /** |
mbed_official | 235:685d5f11838f | 251 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 252 | */ |
mbed_official | 235:685d5f11838f | 253 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 254 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 255 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 256 | #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 257 | #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 258 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 259 | |
mbed_official | 235:685d5f11838f | 260 | /** |
mbed_official | 235:685d5f11838f | 261 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 262 | */ |
mbed_official | 235:685d5f11838f | 263 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 264 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 265 | #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 266 | |
mbed_official | 235:685d5f11838f | 267 | /** |
mbed_official | 235:685d5f11838f | 268 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 269 | */ |
mbed_official | 235:685d5f11838f | 270 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 271 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 272 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 273 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 274 | |
mbed_official | 235:685d5f11838f | 275 | /** |
mbed_official | 235:685d5f11838f | 276 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 277 | */ |
mbed_official | 235:685d5f11838f | 278 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 279 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 280 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 281 | #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 282 | #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 283 | |
mbed_official | 235:685d5f11838f | 284 | /** |
mbed_official | 235:685d5f11838f | 285 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 286 | */ |
mbed_official | 235:685d5f11838f | 287 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 288 | #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 289 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 290 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 291 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 292 | |
mbed_official | 235:685d5f11838f | 293 | /** |
mbed_official | 235:685d5f11838f | 294 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 295 | */ |
mbed_official | 235:685d5f11838f | 296 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 297 | #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 298 | |
mbed_official | 235:685d5f11838f | 299 | /** |
mbed_official | 235:685d5f11838f | 300 | * @brief AF 11 selection |
mbed_official | 235:685d5f11838f | 301 | */ |
mbed_official | 235:685d5f11838f | 302 | #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 303 | |
mbed_official | 235:685d5f11838f | 304 | /** |
mbed_official | 235:685d5f11838f | 305 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 306 | */ |
mbed_official | 235:685d5f11838f | 307 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 308 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 309 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 310 | |
mbed_official | 235:685d5f11838f | 311 | /** |
mbed_official | 235:685d5f11838f | 312 | * @brief AF 13 selection |
mbed_official | 235:685d5f11838f | 313 | */ |
mbed_official | 235:685d5f11838f | 314 | #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 315 | |
mbed_official | 235:685d5f11838f | 316 | /** |
mbed_official | 235:685d5f11838f | 317 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 318 | */ |
mbed_official | 235:685d5f11838f | 319 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 320 | |
mbed_official | 235:685d5f11838f | 321 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 322 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 323 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 324 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 325 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 326 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
mbed_official | 235:685d5f11838f | 327 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
mbed_official | 235:685d5f11838f | 328 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
mbed_official | 235:685d5f11838f | 329 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
mbed_official | 235:685d5f11838f | 330 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
mbed_official | 235:685d5f11838f | 331 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 332 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
mbed_official | 235:685d5f11838f | 333 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
mbed_official | 235:685d5f11838f | 334 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
mbed_official | 235:685d5f11838f | 335 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
mbed_official | 235:685d5f11838f | 336 | ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ |
mbed_official | 235:685d5f11838f | 337 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ |
mbed_official | 235:685d5f11838f | 338 | ((AF) == GPIO_AF15_EVENTOUT) || ((AF) == GPIO_AF5_SPI4) || \ |
mbed_official | 235:685d5f11838f | 339 | ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ |
mbed_official | 235:685d5f11838f | 340 | ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ |
mbed_official | 235:685d5f11838f | 341 | ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF6_SAI1)) |
mbed_official | 235:685d5f11838f | 342 | |
mbed_official | 235:685d5f11838f | 343 | #endif /* STM32F427xx || STM32F437xx */ |
mbed_official | 235:685d5f11838f | 344 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 345 | |
mbed_official | 235:685d5f11838f | 346 | /*---------------------------------- STM32F407xx/STM32F417xx--------------------------------*/ |
mbed_official | 235:685d5f11838f | 347 | #if defined (STM32F407xx) || defined (STM32F417xx) |
mbed_official | 235:685d5f11838f | 348 | /** |
mbed_official | 235:685d5f11838f | 349 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 350 | */ |
mbed_official | 235:685d5f11838f | 351 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 352 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 353 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 354 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 355 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 356 | |
mbed_official | 235:685d5f11838f | 357 | /** |
mbed_official | 235:685d5f11838f | 358 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 359 | */ |
mbed_official | 235:685d5f11838f | 360 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 361 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 362 | |
mbed_official | 235:685d5f11838f | 363 | /** |
mbed_official | 235:685d5f11838f | 364 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 365 | */ |
mbed_official | 235:685d5f11838f | 366 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 367 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 368 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 369 | |
mbed_official | 235:685d5f11838f | 370 | /** |
mbed_official | 235:685d5f11838f | 371 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 372 | */ |
mbed_official | 235:685d5f11838f | 373 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 374 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 375 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 376 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 377 | |
mbed_official | 235:685d5f11838f | 378 | /** |
mbed_official | 235:685d5f11838f | 379 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 380 | */ |
mbed_official | 235:685d5f11838f | 381 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 382 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 383 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 384 | |
mbed_official | 235:685d5f11838f | 385 | /** |
mbed_official | 235:685d5f11838f | 386 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 387 | */ |
mbed_official | 235:685d5f11838f | 388 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 389 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 390 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 391 | |
mbed_official | 235:685d5f11838f | 392 | /** |
mbed_official | 235:685d5f11838f | 393 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 394 | */ |
mbed_official | 235:685d5f11838f | 395 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 396 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 397 | |
mbed_official | 235:685d5f11838f | 398 | /** |
mbed_official | 235:685d5f11838f | 399 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 400 | */ |
mbed_official | 235:685d5f11838f | 401 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 402 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 403 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 404 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 405 | |
mbed_official | 235:685d5f11838f | 406 | /** |
mbed_official | 235:685d5f11838f | 407 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 408 | */ |
mbed_official | 235:685d5f11838f | 409 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 410 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 411 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 412 | |
mbed_official | 235:685d5f11838f | 413 | /** |
mbed_official | 235:685d5f11838f | 414 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 415 | */ |
mbed_official | 235:685d5f11838f | 416 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 417 | #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 418 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 419 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 420 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 421 | |
mbed_official | 235:685d5f11838f | 422 | /** |
mbed_official | 235:685d5f11838f | 423 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 424 | */ |
mbed_official | 235:685d5f11838f | 425 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 426 | #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 427 | |
mbed_official | 235:685d5f11838f | 428 | /** |
mbed_official | 235:685d5f11838f | 429 | * @brief AF 11 selection |
mbed_official | 235:685d5f11838f | 430 | */ |
mbed_official | 235:685d5f11838f | 431 | #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 432 | |
mbed_official | 235:685d5f11838f | 433 | /** |
mbed_official | 235:685d5f11838f | 434 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 435 | */ |
mbed_official | 235:685d5f11838f | 436 | #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 437 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 438 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 439 | |
mbed_official | 235:685d5f11838f | 440 | /** |
mbed_official | 235:685d5f11838f | 441 | * @brief AF 13 selection |
mbed_official | 235:685d5f11838f | 442 | */ |
mbed_official | 235:685d5f11838f | 443 | #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 444 | |
mbed_official | 235:685d5f11838f | 445 | /** |
mbed_official | 235:685d5f11838f | 446 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 447 | */ |
mbed_official | 235:685d5f11838f | 448 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 449 | |
mbed_official | 235:685d5f11838f | 450 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 451 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 452 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 453 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 454 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 455 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
mbed_official | 235:685d5f11838f | 456 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
mbed_official | 235:685d5f11838f | 457 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
mbed_official | 235:685d5f11838f | 458 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
mbed_official | 235:685d5f11838f | 459 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
mbed_official | 235:685d5f11838f | 460 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 461 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
mbed_official | 235:685d5f11838f | 462 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
mbed_official | 235:685d5f11838f | 463 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
mbed_official | 235:685d5f11838f | 464 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
mbed_official | 235:685d5f11838f | 465 | ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ |
mbed_official | 235:685d5f11838f | 466 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ |
mbed_official | 235:685d5f11838f | 467 | ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) |
mbed_official | 235:685d5f11838f | 468 | |
mbed_official | 235:685d5f11838f | 469 | #endif /* STM32F407xx || STM32F417xx */ |
mbed_official | 235:685d5f11838f | 470 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 471 | |
mbed_official | 235:685d5f11838f | 472 | /*---------------------------------- STM32F405xx/STM32F415xx--------------------------------*/ |
mbed_official | 235:685d5f11838f | 473 | #if defined (STM32F405xx) || defined (STM32F415xx) |
mbed_official | 235:685d5f11838f | 474 | /** |
mbed_official | 235:685d5f11838f | 475 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 476 | */ |
mbed_official | 235:685d5f11838f | 477 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 478 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 479 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 480 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 481 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 482 | |
mbed_official | 235:685d5f11838f | 483 | /** |
mbed_official | 235:685d5f11838f | 484 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 485 | */ |
mbed_official | 235:685d5f11838f | 486 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 487 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 488 | |
mbed_official | 235:685d5f11838f | 489 | /** |
mbed_official | 235:685d5f11838f | 490 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 491 | */ |
mbed_official | 235:685d5f11838f | 492 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 493 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 494 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 495 | |
mbed_official | 235:685d5f11838f | 496 | /** |
mbed_official | 235:685d5f11838f | 497 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 498 | */ |
mbed_official | 235:685d5f11838f | 499 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 500 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 501 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 502 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 503 | |
mbed_official | 235:685d5f11838f | 504 | /** |
mbed_official | 235:685d5f11838f | 505 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 506 | */ |
mbed_official | 235:685d5f11838f | 507 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 508 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 509 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 510 | |
mbed_official | 235:685d5f11838f | 511 | /** |
mbed_official | 235:685d5f11838f | 512 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 513 | */ |
mbed_official | 235:685d5f11838f | 514 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 515 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 516 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 517 | |
mbed_official | 235:685d5f11838f | 518 | /** |
mbed_official | 235:685d5f11838f | 519 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 520 | */ |
mbed_official | 235:685d5f11838f | 521 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 522 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 523 | |
mbed_official | 235:685d5f11838f | 524 | /** |
mbed_official | 235:685d5f11838f | 525 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 526 | */ |
mbed_official | 235:685d5f11838f | 527 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 528 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 529 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 530 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 531 | |
mbed_official | 235:685d5f11838f | 532 | /** |
mbed_official | 235:685d5f11838f | 533 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 534 | */ |
mbed_official | 235:685d5f11838f | 535 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 536 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 537 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 538 | |
mbed_official | 235:685d5f11838f | 539 | /** |
mbed_official | 235:685d5f11838f | 540 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 541 | */ |
mbed_official | 235:685d5f11838f | 542 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 543 | #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 544 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 545 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 546 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 547 | |
mbed_official | 235:685d5f11838f | 548 | /** |
mbed_official | 235:685d5f11838f | 549 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 550 | */ |
mbed_official | 235:685d5f11838f | 551 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 552 | #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 553 | |
mbed_official | 235:685d5f11838f | 554 | /** |
mbed_official | 235:685d5f11838f | 555 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 556 | */ |
mbed_official | 235:685d5f11838f | 557 | #define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 558 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 559 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 560 | |
mbed_official | 235:685d5f11838f | 561 | /** |
mbed_official | 235:685d5f11838f | 562 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 563 | */ |
mbed_official | 235:685d5f11838f | 564 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 565 | |
mbed_official | 235:685d5f11838f | 566 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 567 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 568 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 569 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 570 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 571 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
mbed_official | 235:685d5f11838f | 572 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
mbed_official | 235:685d5f11838f | 573 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
mbed_official | 235:685d5f11838f | 574 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
mbed_official | 235:685d5f11838f | 575 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
mbed_official | 235:685d5f11838f | 576 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 577 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
mbed_official | 235:685d5f11838f | 578 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
mbed_official | 235:685d5f11838f | 579 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
mbed_official | 235:685d5f11838f | 580 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
mbed_official | 235:685d5f11838f | 581 | ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \ |
mbed_official | 235:685d5f11838f | 582 | ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) |
mbed_official | 235:685d5f11838f | 583 | |
mbed_official | 235:685d5f11838f | 584 | #endif /* STM32F405xx || STM32F415xx */ |
mbed_official | 235:685d5f11838f | 585 | |
mbed_official | 235:685d5f11838f | 586 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 587 | |
mbed_official | 235:685d5f11838f | 588 | /*---------------------------------------- STM32F401xx--------------------------------------*/ |
mbed_official | 235:685d5f11838f | 589 | #if defined(STM32F401xC) || defined(STM32F401xE) |
mbed_official | 235:685d5f11838f | 590 | /** |
mbed_official | 235:685d5f11838f | 591 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 592 | */ |
mbed_official | 235:685d5f11838f | 593 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 594 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 595 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 596 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 597 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 598 | |
mbed_official | 235:685d5f11838f | 599 | /** |
mbed_official | 235:685d5f11838f | 600 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 601 | */ |
mbed_official | 235:685d5f11838f | 602 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 603 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 604 | |
mbed_official | 235:685d5f11838f | 605 | /** |
mbed_official | 235:685d5f11838f | 606 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 607 | */ |
mbed_official | 235:685d5f11838f | 608 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 609 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 610 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 611 | |
mbed_official | 235:685d5f11838f | 612 | /** |
mbed_official | 235:685d5f11838f | 613 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 614 | */ |
mbed_official | 235:685d5f11838f | 615 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 616 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 617 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 618 | |
mbed_official | 235:685d5f11838f | 619 | /** |
mbed_official | 235:685d5f11838f | 620 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 621 | */ |
mbed_official | 235:685d5f11838f | 622 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 623 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 624 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 625 | |
mbed_official | 235:685d5f11838f | 626 | /** |
mbed_official | 235:685d5f11838f | 627 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 628 | */ |
mbed_official | 235:685d5f11838f | 629 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 630 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 631 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 632 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 633 | |
mbed_official | 235:685d5f11838f | 634 | /** |
mbed_official | 235:685d5f11838f | 635 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 636 | */ |
mbed_official | 235:685d5f11838f | 637 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 638 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 639 | |
mbed_official | 235:685d5f11838f | 640 | /** |
mbed_official | 235:685d5f11838f | 641 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 642 | */ |
mbed_official | 235:685d5f11838f | 643 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 644 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 645 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 646 | |
mbed_official | 235:685d5f11838f | 647 | /** |
mbed_official | 235:685d5f11838f | 648 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 649 | */ |
mbed_official | 235:685d5f11838f | 650 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 651 | |
mbed_official | 235:685d5f11838f | 652 | /** |
mbed_official | 235:685d5f11838f | 653 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 654 | */ |
mbed_official | 235:685d5f11838f | 655 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 656 | #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 657 | #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 658 | |
mbed_official | 235:685d5f11838f | 659 | |
mbed_official | 235:685d5f11838f | 660 | /** |
mbed_official | 235:685d5f11838f | 661 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 662 | */ |
mbed_official | 235:685d5f11838f | 663 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 664 | |
mbed_official | 235:685d5f11838f | 665 | /** |
mbed_official | 235:685d5f11838f | 666 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 667 | */ |
mbed_official | 235:685d5f11838f | 668 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 669 | |
mbed_official | 235:685d5f11838f | 670 | /** |
mbed_official | 235:685d5f11838f | 671 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 672 | */ |
mbed_official | 235:685d5f11838f | 673 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 674 | |
mbed_official | 235:685d5f11838f | 675 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 676 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 677 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 678 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 679 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 680 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \ |
mbed_official | 235:685d5f11838f | 681 | ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \ |
mbed_official | 235:685d5f11838f | 682 | ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ |
mbed_official | 235:685d5f11838f | 683 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ |
mbed_official | 235:685d5f11838f | 684 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 685 | ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \ |
mbed_official | 235:685d5f11838f | 686 | ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \ |
mbed_official | 235:685d5f11838f | 687 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT)) |
mbed_official | 235:685d5f11838f | 688 | |
mbed_official | 235:685d5f11838f | 689 | #endif /* STM32F401xC || STM32F401xE */ |
mbed_official | 235:685d5f11838f | 690 | /*------------------------------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 691 | |
mbed_official | 235:685d5f11838f | 692 | /*---------------------------------------- STM32F411xx--------------------------------------*/ |
mbed_official | 235:685d5f11838f | 693 | #if defined(STM32F411xE) |
mbed_official | 235:685d5f11838f | 694 | /** |
mbed_official | 235:685d5f11838f | 695 | * @brief AF 0 selection |
mbed_official | 235:685d5f11838f | 696 | */ |
mbed_official | 235:685d5f11838f | 697 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 698 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 699 | #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 700 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 701 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 702 | |
mbed_official | 235:685d5f11838f | 703 | /** |
mbed_official | 235:685d5f11838f | 704 | * @brief AF 1 selection |
mbed_official | 235:685d5f11838f | 705 | */ |
mbed_official | 235:685d5f11838f | 706 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 707 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 708 | |
mbed_official | 235:685d5f11838f | 709 | /** |
mbed_official | 235:685d5f11838f | 710 | * @brief AF 2 selection |
mbed_official | 235:685d5f11838f | 711 | */ |
mbed_official | 235:685d5f11838f | 712 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 713 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 714 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 715 | |
mbed_official | 235:685d5f11838f | 716 | /** |
mbed_official | 235:685d5f11838f | 717 | * @brief AF 3 selection |
mbed_official | 235:685d5f11838f | 718 | */ |
mbed_official | 235:685d5f11838f | 719 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 720 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 721 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 722 | |
mbed_official | 235:685d5f11838f | 723 | /** |
mbed_official | 235:685d5f11838f | 724 | * @brief AF 4 selection |
mbed_official | 235:685d5f11838f | 725 | */ |
mbed_official | 235:685d5f11838f | 726 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 727 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 728 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 729 | |
mbed_official | 235:685d5f11838f | 730 | /** |
mbed_official | 235:685d5f11838f | 731 | * @brief AF 5 selection |
mbed_official | 235:685d5f11838f | 732 | */ |
mbed_official | 235:685d5f11838f | 733 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 734 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 735 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 736 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 737 | #define GPIO_AF5_I2S3ext ((uint8_t)0x05) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 738 | |
mbed_official | 235:685d5f11838f | 739 | /** |
mbed_official | 235:685d5f11838f | 740 | * @brief AF 6 selection |
mbed_official | 235:685d5f11838f | 741 | */ |
mbed_official | 235:685d5f11838f | 742 | #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* I2S2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 743 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 744 | #define GPIO_AF6_SPI4 ((uint8_t)0x06) /* SPI4/I2S4 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 745 | #define GPIO_AF6_SPI5 ((uint8_t)0x06) /* SPI5/I2S5 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 746 | #define GPIO_AF6_I2S2ext ((uint8_t)0x06) /* I2S2ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 747 | /** |
mbed_official | 235:685d5f11838f | 748 | * @brief AF 7 selection |
mbed_official | 235:685d5f11838f | 749 | */ |
mbed_official | 235:685d5f11838f | 750 | #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3/I2S3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 751 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 752 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 753 | #define GPIO_AF7_I2S3ext ((uint8_t)0x07) /* I2S3ext_SD Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 754 | |
mbed_official | 235:685d5f11838f | 755 | /** |
mbed_official | 235:685d5f11838f | 756 | * @brief AF 8 selection |
mbed_official | 235:685d5f11838f | 757 | */ |
mbed_official | 235:685d5f11838f | 758 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 759 | |
mbed_official | 235:685d5f11838f | 760 | /** |
mbed_official | 235:685d5f11838f | 761 | * @brief AF 9 selection |
mbed_official | 235:685d5f11838f | 762 | */ |
mbed_official | 235:685d5f11838f | 763 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 764 | #define GPIO_AF9_I2C2 ((uint8_t)0x09) /* I2C2 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 765 | #define GPIO_AF9_I2C3 ((uint8_t)0x09) /* I2C3 Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 766 | |
mbed_official | 235:685d5f11838f | 767 | |
mbed_official | 235:685d5f11838f | 768 | /** |
mbed_official | 235:685d5f11838f | 769 | * @brief AF 10 selection |
mbed_official | 235:685d5f11838f | 770 | */ |
mbed_official | 235:685d5f11838f | 771 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 772 | |
mbed_official | 235:685d5f11838f | 773 | /** |
mbed_official | 235:685d5f11838f | 774 | * @brief AF 12 selection |
mbed_official | 235:685d5f11838f | 775 | */ |
mbed_official | 235:685d5f11838f | 776 | #define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 777 | |
mbed_official | 235:685d5f11838f | 778 | /** |
mbed_official | 235:685d5f11838f | 779 | * @brief AF 15 selection |
mbed_official | 235:685d5f11838f | 780 | */ |
mbed_official | 235:685d5f11838f | 781 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
mbed_official | 235:685d5f11838f | 782 | |
mbed_official | 235:685d5f11838f | 783 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
mbed_official | 235:685d5f11838f | 784 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
mbed_official | 235:685d5f11838f | 785 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
mbed_official | 235:685d5f11838f | 786 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
mbed_official | 235:685d5f11838f | 787 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
mbed_official | 235:685d5f11838f | 788 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF4_I2C1) || \ |
mbed_official | 235:685d5f11838f | 789 | ((AF) == GPIO_AF4_I2C2) || ((AF) == GPIO_AF4_I2C3) || \ |
mbed_official | 235:685d5f11838f | 790 | ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ |
mbed_official | 235:685d5f11838f | 791 | ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF6_SPI4) || \ |
mbed_official | 235:685d5f11838f | 792 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ |
mbed_official | 235:685d5f11838f | 793 | ((AF) == GPIO_AF6_SPI5) || ((AF) == GPIO_AF7_SPI3) || \ |
mbed_official | 235:685d5f11838f | 794 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
mbed_official | 235:685d5f11838f | 795 | ((AF) == GPIO_AF8_USART6) || ((AF) == GPIO_AF10_OTG_FS) || \ |
mbed_official | 235:685d5f11838f | 796 | ((AF) == GPIO_AF9_I2C2) || ((AF) == GPIO_AF9_I2C3) || \ |
mbed_official | 235:685d5f11838f | 797 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF15_EVENTOUT)) |
mbed_official | 235:685d5f11838f | 798 | |
mbed_official | 235:685d5f11838f | 799 | #endif /* STM32F411xE */ |
mbed_official | 235:685d5f11838f | 800 | /** |
mbed_official | 235:685d5f11838f | 801 | * @} |
mbed_official | 235:685d5f11838f | 802 | */ |
mbed_official | 235:685d5f11838f | 803 | |
mbed_official | 235:685d5f11838f | 804 | /** |
mbed_official | 235:685d5f11838f | 805 | * @} |
mbed_official | 235:685d5f11838f | 806 | */ |
mbed_official | 235:685d5f11838f | 807 | |
mbed_official | 235:685d5f11838f | 808 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 809 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 810 | |
mbed_official | 235:685d5f11838f | 811 | |
mbed_official | 235:685d5f11838f | 812 | /** |
mbed_official | 235:685d5f11838f | 813 | * @} |
mbed_official | 235:685d5f11838f | 814 | */ |
mbed_official | 235:685d5f11838f | 815 | |
mbed_official | 235:685d5f11838f | 816 | /** |
mbed_official | 235:685d5f11838f | 817 | * @} |
mbed_official | 235:685d5f11838f | 818 | */ |
mbed_official | 235:685d5f11838f | 819 | |
mbed_official | 235:685d5f11838f | 820 | #ifdef __cplusplus |
mbed_official | 235:685d5f11838f | 821 | } |
mbed_official | 235:685d5f11838f | 822 | #endif |
mbed_official | 235:685d5f11838f | 823 | |
mbed_official | 235:685d5f11838f | 824 | #endif /* __STM32F4xx_HAL_GPIO_EX_H */ |
mbed_official | 235:685d5f11838f | 825 | |
mbed_official | 235:685d5f11838f | 826 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |