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