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