mbed SDK library sources
Fork of mbed-src by
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/stm32f10x_gpio.h@52:a51c77007319, 2013-12-02 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Dec 02 11:30:05 2013 +0000
- Revision:
- 52:a51c77007319
- Child:
- 70:c1fbde68b492
Synchronized with git revision 49df530ae72ce97ccc773d1f2c13b38e868e6abd
Full URL: https://github.com/mbedmicro/mbed/commit/49df530ae72ce97ccc773d1f2c13b38e868e6abd/
Add STMicroelectronics NUCLEO_F103RB target
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 52:a51c77007319 | 1 | /** |
mbed_official | 52:a51c77007319 | 2 | ****************************************************************************** |
mbed_official | 52:a51c77007319 | 3 | * @file stm32f10x_gpio.h |
mbed_official | 52:a51c77007319 | 4 | * @author MCD Application Team |
mbed_official | 52:a51c77007319 | 5 | * @version V3.5.0 |
mbed_official | 52:a51c77007319 | 6 | * @date 11-March-2011 |
mbed_official | 52:a51c77007319 | 7 | * @brief This file contains all the functions prototypes for the GPIO |
mbed_official | 52:a51c77007319 | 8 | * firmware library. |
mbed_official | 52:a51c77007319 | 9 | ****************************************************************************** |
mbed_official | 52:a51c77007319 | 10 | * @attention |
mbed_official | 52:a51c77007319 | 11 | * |
mbed_official | 52:a51c77007319 | 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
mbed_official | 52:a51c77007319 | 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE |
mbed_official | 52:a51c77007319 | 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY |
mbed_official | 52:a51c77007319 | 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING |
mbed_official | 52:a51c77007319 | 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE |
mbed_official | 52:a51c77007319 | 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
mbed_official | 52:a51c77007319 | 18 | * |
mbed_official | 52:a51c77007319 | 19 | * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> |
mbed_official | 52:a51c77007319 | 20 | ****************************************************************************** |
mbed_official | 52:a51c77007319 | 21 | */ |
mbed_official | 52:a51c77007319 | 22 | |
mbed_official | 52:a51c77007319 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 52:a51c77007319 | 24 | #ifndef __STM32F10x_GPIO_H |
mbed_official | 52:a51c77007319 | 25 | #define __STM32F10x_GPIO_H |
mbed_official | 52:a51c77007319 | 26 | |
mbed_official | 52:a51c77007319 | 27 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 28 | extern "C" { |
mbed_official | 52:a51c77007319 | 29 | #endif |
mbed_official | 52:a51c77007319 | 30 | |
mbed_official | 52:a51c77007319 | 31 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 52:a51c77007319 | 32 | #include "stm32f10x.h" |
mbed_official | 52:a51c77007319 | 33 | |
mbed_official | 52:a51c77007319 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver |
mbed_official | 52:a51c77007319 | 35 | * @{ |
mbed_official | 52:a51c77007319 | 36 | */ |
mbed_official | 52:a51c77007319 | 37 | |
mbed_official | 52:a51c77007319 | 38 | /** @addtogroup GPIO |
mbed_official | 52:a51c77007319 | 39 | * @{ |
mbed_official | 52:a51c77007319 | 40 | */ |
mbed_official | 52:a51c77007319 | 41 | |
mbed_official | 52:a51c77007319 | 42 | /** @defgroup GPIO_Exported_Types |
mbed_official | 52:a51c77007319 | 43 | * @{ |
mbed_official | 52:a51c77007319 | 44 | */ |
mbed_official | 52:a51c77007319 | 45 | |
mbed_official | 52:a51c77007319 | 46 | #define IS_GPIO_ALL_PERIPH(PERIPH) (((PERIPH) == GPIOA) || \ |
mbed_official | 52:a51c77007319 | 47 | ((PERIPH) == GPIOB) || \ |
mbed_official | 52:a51c77007319 | 48 | ((PERIPH) == GPIOC) || \ |
mbed_official | 52:a51c77007319 | 49 | ((PERIPH) == GPIOD) || \ |
mbed_official | 52:a51c77007319 | 50 | ((PERIPH) == GPIOE) || \ |
mbed_official | 52:a51c77007319 | 51 | ((PERIPH) == GPIOF) || \ |
mbed_official | 52:a51c77007319 | 52 | ((PERIPH) == GPIOG)) |
mbed_official | 52:a51c77007319 | 53 | |
mbed_official | 52:a51c77007319 | 54 | /** |
mbed_official | 52:a51c77007319 | 55 | * @brief Output Maximum frequency selection |
mbed_official | 52:a51c77007319 | 56 | */ |
mbed_official | 52:a51c77007319 | 57 | |
mbed_official | 52:a51c77007319 | 58 | typedef enum |
mbed_official | 52:a51c77007319 | 59 | { |
mbed_official | 52:a51c77007319 | 60 | GPIO_Speed_10MHz = 1, |
mbed_official | 52:a51c77007319 | 61 | GPIO_Speed_2MHz, |
mbed_official | 52:a51c77007319 | 62 | GPIO_Speed_50MHz |
mbed_official | 52:a51c77007319 | 63 | }GPIOSpeed_TypeDef; |
mbed_official | 52:a51c77007319 | 64 | #define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_Speed_10MHz) || ((SPEED) == GPIO_Speed_2MHz) || \ |
mbed_official | 52:a51c77007319 | 65 | ((SPEED) == GPIO_Speed_50MHz)) |
mbed_official | 52:a51c77007319 | 66 | |
mbed_official | 52:a51c77007319 | 67 | /** |
mbed_official | 52:a51c77007319 | 68 | * @brief Configuration Mode enumeration |
mbed_official | 52:a51c77007319 | 69 | */ |
mbed_official | 52:a51c77007319 | 70 | |
mbed_official | 52:a51c77007319 | 71 | typedef enum |
mbed_official | 52:a51c77007319 | 72 | { GPIO_Mode_AIN = 0x0, |
mbed_official | 52:a51c77007319 | 73 | GPIO_Mode_IN_FLOATING = 0x04, |
mbed_official | 52:a51c77007319 | 74 | GPIO_Mode_IPD = 0x28, |
mbed_official | 52:a51c77007319 | 75 | GPIO_Mode_IPU = 0x48, |
mbed_official | 52:a51c77007319 | 76 | GPIO_Mode_Out_OD = 0x14, |
mbed_official | 52:a51c77007319 | 77 | GPIO_Mode_Out_PP = 0x10, |
mbed_official | 52:a51c77007319 | 78 | GPIO_Mode_AF_OD = 0x1C, |
mbed_official | 52:a51c77007319 | 79 | GPIO_Mode_AF_PP = 0x18 |
mbed_official | 52:a51c77007319 | 80 | }GPIOMode_TypeDef; |
mbed_official | 52:a51c77007319 | 81 | |
mbed_official | 52:a51c77007319 | 82 | #define IS_GPIO_MODE(MODE) (((MODE) == GPIO_Mode_AIN) || ((MODE) == GPIO_Mode_IN_FLOATING) || \ |
mbed_official | 52:a51c77007319 | 83 | ((MODE) == GPIO_Mode_IPD) || ((MODE) == GPIO_Mode_IPU) || \ |
mbed_official | 52:a51c77007319 | 84 | ((MODE) == GPIO_Mode_Out_OD) || ((MODE) == GPIO_Mode_Out_PP) || \ |
mbed_official | 52:a51c77007319 | 85 | ((MODE) == GPIO_Mode_AF_OD) || ((MODE) == GPIO_Mode_AF_PP)) |
mbed_official | 52:a51c77007319 | 86 | |
mbed_official | 52:a51c77007319 | 87 | /** |
mbed_official | 52:a51c77007319 | 88 | * @brief GPIO Init structure definition |
mbed_official | 52:a51c77007319 | 89 | */ |
mbed_official | 52:a51c77007319 | 90 | |
mbed_official | 52:a51c77007319 | 91 | typedef struct |
mbed_official | 52:a51c77007319 | 92 | { |
mbed_official | 52:a51c77007319 | 93 | uint16_t GPIO_Pin; /*!< Specifies the GPIO pins to be configured. |
mbed_official | 52:a51c77007319 | 94 | This parameter can be any value of @ref GPIO_pins_define */ |
mbed_official | 52:a51c77007319 | 95 | |
mbed_official | 52:a51c77007319 | 96 | GPIOSpeed_TypeDef GPIO_Speed; /*!< Specifies the speed for the selected pins. |
mbed_official | 52:a51c77007319 | 97 | This parameter can be a value of @ref GPIOSpeed_TypeDef */ |
mbed_official | 52:a51c77007319 | 98 | |
mbed_official | 52:a51c77007319 | 99 | GPIOMode_TypeDef GPIO_Mode; /*!< Specifies the operating mode for the selected pins. |
mbed_official | 52:a51c77007319 | 100 | This parameter can be a value of @ref GPIOMode_TypeDef */ |
mbed_official | 52:a51c77007319 | 101 | }GPIO_InitTypeDef; |
mbed_official | 52:a51c77007319 | 102 | |
mbed_official | 52:a51c77007319 | 103 | |
mbed_official | 52:a51c77007319 | 104 | /** |
mbed_official | 52:a51c77007319 | 105 | * @brief Bit_SET and Bit_RESET enumeration |
mbed_official | 52:a51c77007319 | 106 | */ |
mbed_official | 52:a51c77007319 | 107 | |
mbed_official | 52:a51c77007319 | 108 | typedef enum |
mbed_official | 52:a51c77007319 | 109 | { Bit_RESET = 0, |
mbed_official | 52:a51c77007319 | 110 | Bit_SET |
mbed_official | 52:a51c77007319 | 111 | }BitAction; |
mbed_official | 52:a51c77007319 | 112 | |
mbed_official | 52:a51c77007319 | 113 | #define IS_GPIO_BIT_ACTION(ACTION) (((ACTION) == Bit_RESET) || ((ACTION) == Bit_SET)) |
mbed_official | 52:a51c77007319 | 114 | |
mbed_official | 52:a51c77007319 | 115 | /** |
mbed_official | 52:a51c77007319 | 116 | * @} |
mbed_official | 52:a51c77007319 | 117 | */ |
mbed_official | 52:a51c77007319 | 118 | |
mbed_official | 52:a51c77007319 | 119 | /** @defgroup GPIO_Exported_Constants |
mbed_official | 52:a51c77007319 | 120 | * @{ |
mbed_official | 52:a51c77007319 | 121 | */ |
mbed_official | 52:a51c77007319 | 122 | |
mbed_official | 52:a51c77007319 | 123 | /** @defgroup GPIO_pins_define |
mbed_official | 52:a51c77007319 | 124 | * @{ |
mbed_official | 52:a51c77007319 | 125 | */ |
mbed_official | 52:a51c77007319 | 126 | |
mbed_official | 52:a51c77007319 | 127 | #define GPIO_Pin_0 ((uint16_t)0x0001) /*!< Pin 0 selected */ |
mbed_official | 52:a51c77007319 | 128 | #define GPIO_Pin_1 ((uint16_t)0x0002) /*!< Pin 1 selected */ |
mbed_official | 52:a51c77007319 | 129 | #define GPIO_Pin_2 ((uint16_t)0x0004) /*!< Pin 2 selected */ |
mbed_official | 52:a51c77007319 | 130 | #define GPIO_Pin_3 ((uint16_t)0x0008) /*!< Pin 3 selected */ |
mbed_official | 52:a51c77007319 | 131 | #define GPIO_Pin_4 ((uint16_t)0x0010) /*!< Pin 4 selected */ |
mbed_official | 52:a51c77007319 | 132 | #define GPIO_Pin_5 ((uint16_t)0x0020) /*!< Pin 5 selected */ |
mbed_official | 52:a51c77007319 | 133 | #define GPIO_Pin_6 ((uint16_t)0x0040) /*!< Pin 6 selected */ |
mbed_official | 52:a51c77007319 | 134 | #define GPIO_Pin_7 ((uint16_t)0x0080) /*!< Pin 7 selected */ |
mbed_official | 52:a51c77007319 | 135 | #define GPIO_Pin_8 ((uint16_t)0x0100) /*!< Pin 8 selected */ |
mbed_official | 52:a51c77007319 | 136 | #define GPIO_Pin_9 ((uint16_t)0x0200) /*!< Pin 9 selected */ |
mbed_official | 52:a51c77007319 | 137 | #define GPIO_Pin_10 ((uint16_t)0x0400) /*!< Pin 10 selected */ |
mbed_official | 52:a51c77007319 | 138 | #define GPIO_Pin_11 ((uint16_t)0x0800) /*!< Pin 11 selected */ |
mbed_official | 52:a51c77007319 | 139 | #define GPIO_Pin_12 ((uint16_t)0x1000) /*!< Pin 12 selected */ |
mbed_official | 52:a51c77007319 | 140 | #define GPIO_Pin_13 ((uint16_t)0x2000) /*!< Pin 13 selected */ |
mbed_official | 52:a51c77007319 | 141 | #define GPIO_Pin_14 ((uint16_t)0x4000) /*!< Pin 14 selected */ |
mbed_official | 52:a51c77007319 | 142 | #define GPIO_Pin_15 ((uint16_t)0x8000) /*!< Pin 15 selected */ |
mbed_official | 52:a51c77007319 | 143 | #define GPIO_Pin_All ((uint16_t)0xFFFF) /*!< All pins selected */ |
mbed_official | 52:a51c77007319 | 144 | |
mbed_official | 52:a51c77007319 | 145 | #define IS_GPIO_PIN(PIN) ((((PIN) & (uint16_t)0x00) == 0x00) && ((PIN) != (uint16_t)0x00)) |
mbed_official | 52:a51c77007319 | 146 | |
mbed_official | 52:a51c77007319 | 147 | #define IS_GET_GPIO_PIN(PIN) (((PIN) == GPIO_Pin_0) || \ |
mbed_official | 52:a51c77007319 | 148 | ((PIN) == GPIO_Pin_1) || \ |
mbed_official | 52:a51c77007319 | 149 | ((PIN) == GPIO_Pin_2) || \ |
mbed_official | 52:a51c77007319 | 150 | ((PIN) == GPIO_Pin_3) || \ |
mbed_official | 52:a51c77007319 | 151 | ((PIN) == GPIO_Pin_4) || \ |
mbed_official | 52:a51c77007319 | 152 | ((PIN) == GPIO_Pin_5) || \ |
mbed_official | 52:a51c77007319 | 153 | ((PIN) == GPIO_Pin_6) || \ |
mbed_official | 52:a51c77007319 | 154 | ((PIN) == GPIO_Pin_7) || \ |
mbed_official | 52:a51c77007319 | 155 | ((PIN) == GPIO_Pin_8) || \ |
mbed_official | 52:a51c77007319 | 156 | ((PIN) == GPIO_Pin_9) || \ |
mbed_official | 52:a51c77007319 | 157 | ((PIN) == GPIO_Pin_10) || \ |
mbed_official | 52:a51c77007319 | 158 | ((PIN) == GPIO_Pin_11) || \ |
mbed_official | 52:a51c77007319 | 159 | ((PIN) == GPIO_Pin_12) || \ |
mbed_official | 52:a51c77007319 | 160 | ((PIN) == GPIO_Pin_13) || \ |
mbed_official | 52:a51c77007319 | 161 | ((PIN) == GPIO_Pin_14) || \ |
mbed_official | 52:a51c77007319 | 162 | ((PIN) == GPIO_Pin_15)) |
mbed_official | 52:a51c77007319 | 163 | |
mbed_official | 52:a51c77007319 | 164 | /** |
mbed_official | 52:a51c77007319 | 165 | * @} |
mbed_official | 52:a51c77007319 | 166 | */ |
mbed_official | 52:a51c77007319 | 167 | |
mbed_official | 52:a51c77007319 | 168 | /** @defgroup GPIO_Remap_define |
mbed_official | 52:a51c77007319 | 169 | * @{ |
mbed_official | 52:a51c77007319 | 170 | */ |
mbed_official | 52:a51c77007319 | 171 | |
mbed_official | 52:a51c77007319 | 172 | #define GPIO_Remap_SPI1 ((uint32_t)0x00000001) /*!< SPI1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 173 | #define GPIO_Remap_I2C1 ((uint32_t)0x00000002) /*!< I2C1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 174 | #define GPIO_Remap_USART1 ((uint32_t)0x00000004) /*!< USART1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 175 | #define GPIO_Remap_USART2 ((uint32_t)0x00000008) /*!< USART2 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 176 | #define GPIO_PartialRemap_USART3 ((uint32_t)0x00140010) /*!< USART3 Partial Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 177 | #define GPIO_FullRemap_USART3 ((uint32_t)0x00140030) /*!< USART3 Full Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 178 | #define GPIO_PartialRemap_TIM1 ((uint32_t)0x00160040) /*!< TIM1 Partial Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 179 | #define GPIO_FullRemap_TIM1 ((uint32_t)0x001600C0) /*!< TIM1 Full Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 180 | #define GPIO_PartialRemap1_TIM2 ((uint32_t)0x00180100) /*!< TIM2 Partial1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 181 | #define GPIO_PartialRemap2_TIM2 ((uint32_t)0x00180200) /*!< TIM2 Partial2 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 182 | #define GPIO_FullRemap_TIM2 ((uint32_t)0x00180300) /*!< TIM2 Full Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 183 | #define GPIO_PartialRemap_TIM3 ((uint32_t)0x001A0800) /*!< TIM3 Partial Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 184 | #define GPIO_FullRemap_TIM3 ((uint32_t)0x001A0C00) /*!< TIM3 Full Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 185 | #define GPIO_Remap_TIM4 ((uint32_t)0x00001000) /*!< TIM4 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 186 | #define GPIO_Remap1_CAN1 ((uint32_t)0x001D4000) /*!< CAN1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 187 | #define GPIO_Remap2_CAN1 ((uint32_t)0x001D6000) /*!< CAN1 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 188 | #define GPIO_Remap_PD01 ((uint32_t)0x00008000) /*!< PD01 Alternate Function mapping */ |
mbed_official | 52:a51c77007319 | 189 | #define GPIO_Remap_TIM5CH4_LSI ((uint32_t)0x00200001) /*!< LSI connected to TIM5 Channel4 input capture for calibration */ |
mbed_official | 52:a51c77007319 | 190 | #define GPIO_Remap_ADC1_ETRGINJ ((uint32_t)0x00200002) /*!< ADC1 External Trigger Injected Conversion remapping */ |
mbed_official | 52:a51c77007319 | 191 | #define GPIO_Remap_ADC1_ETRGREG ((uint32_t)0x00200004) /*!< ADC1 External Trigger Regular Conversion remapping */ |
mbed_official | 52:a51c77007319 | 192 | #define GPIO_Remap_ADC2_ETRGINJ ((uint32_t)0x00200008) /*!< ADC2 External Trigger Injected Conversion remapping */ |
mbed_official | 52:a51c77007319 | 193 | #define GPIO_Remap_ADC2_ETRGREG ((uint32_t)0x00200010) /*!< ADC2 External Trigger Regular Conversion remapping */ |
mbed_official | 52:a51c77007319 | 194 | #define GPIO_Remap_ETH ((uint32_t)0x00200020) /*!< Ethernet remapping (only for Connectivity line devices) */ |
mbed_official | 52:a51c77007319 | 195 | #define GPIO_Remap_CAN2 ((uint32_t)0x00200040) /*!< CAN2 remapping (only for Connectivity line devices) */ |
mbed_official | 52:a51c77007319 | 196 | #define GPIO_Remap_SWJ_NoJTRST ((uint32_t)0x00300100) /*!< Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST */ |
mbed_official | 52:a51c77007319 | 197 | #define GPIO_Remap_SWJ_JTAGDisable ((uint32_t)0x00300200) /*!< JTAG-DP Disabled and SW-DP Enabled */ |
mbed_official | 52:a51c77007319 | 198 | #define GPIO_Remap_SWJ_Disable ((uint32_t)0x00300400) /*!< Full SWJ Disabled (JTAG-DP + SW-DP) */ |
mbed_official | 52:a51c77007319 | 199 | #define GPIO_Remap_SPI3 ((uint32_t)0x00201100) /*!< SPI3/I2S3 Alternate Function mapping (only for Connectivity line devices) */ |
mbed_official | 52:a51c77007319 | 200 | #define GPIO_Remap_TIM2ITR1_PTP_SOF ((uint32_t)0x00202000) /*!< Ethernet PTP output or USB OTG SOF (Start of Frame) connected |
mbed_official | 52:a51c77007319 | 201 | to TIM2 Internal Trigger 1 for calibration |
mbed_official | 52:a51c77007319 | 202 | (only for Connectivity line devices) */ |
mbed_official | 52:a51c77007319 | 203 | #define GPIO_Remap_PTP_PPS ((uint32_t)0x00204000) /*!< Ethernet MAC PPS_PTS output on PB05 (only for Connectivity line devices) */ |
mbed_official | 52:a51c77007319 | 204 | |
mbed_official | 52:a51c77007319 | 205 | #define GPIO_Remap_TIM15 ((uint32_t)0x80000001) /*!< TIM15 Alternate Function mapping (only for Value line devices) */ |
mbed_official | 52:a51c77007319 | 206 | #define GPIO_Remap_TIM16 ((uint32_t)0x80000002) /*!< TIM16 Alternate Function mapping (only for Value line devices) */ |
mbed_official | 52:a51c77007319 | 207 | #define GPIO_Remap_TIM17 ((uint32_t)0x80000004) /*!< TIM17 Alternate Function mapping (only for Value line devices) */ |
mbed_official | 52:a51c77007319 | 208 | #define GPIO_Remap_CEC ((uint32_t)0x80000008) /*!< CEC Alternate Function mapping (only for Value line devices) */ |
mbed_official | 52:a51c77007319 | 209 | #define GPIO_Remap_TIM1_DMA ((uint32_t)0x80000010) /*!< TIM1 DMA requests mapping (only for Value line devices) */ |
mbed_official | 52:a51c77007319 | 210 | |
mbed_official | 52:a51c77007319 | 211 | #define GPIO_Remap_TIM9 ((uint32_t)0x80000020) /*!< TIM9 Alternate Function mapping (only for XL-density devices) */ |
mbed_official | 52:a51c77007319 | 212 | #define GPIO_Remap_TIM10 ((uint32_t)0x80000040) /*!< TIM10 Alternate Function mapping (only for XL-density devices) */ |
mbed_official | 52:a51c77007319 | 213 | #define GPIO_Remap_TIM11 ((uint32_t)0x80000080) /*!< TIM11 Alternate Function mapping (only for XL-density devices) */ |
mbed_official | 52:a51c77007319 | 214 | #define GPIO_Remap_TIM13 ((uint32_t)0x80000100) /*!< TIM13 Alternate Function mapping (only for High density Value line and XL-density devices) */ |
mbed_official | 52:a51c77007319 | 215 | #define GPIO_Remap_TIM14 ((uint32_t)0x80000200) /*!< TIM14 Alternate Function mapping (only for High density Value line and XL-density devices) */ |
mbed_official | 52:a51c77007319 | 216 | #define GPIO_Remap_FSMC_NADV ((uint32_t)0x80000400) /*!< FSMC_NADV Alternate Function mapping (only for High density Value line and XL-density devices) */ |
mbed_official | 52:a51c77007319 | 217 | |
mbed_official | 52:a51c77007319 | 218 | #define GPIO_Remap_TIM67_DAC_DMA ((uint32_t)0x80000800) /*!< TIM6/TIM7 and DAC DMA requests remapping (only for High density Value line devices) */ |
mbed_official | 52:a51c77007319 | 219 | #define GPIO_Remap_TIM12 ((uint32_t)0x80001000) /*!< TIM12 Alternate Function mapping (only for High density Value line devices) */ |
mbed_official | 52:a51c77007319 | 220 | #define GPIO_Remap_MISC ((uint32_t)0x80002000) /*!< Miscellaneous Remap (DMA2 Channel5 Position and DAC Trigger remapping, |
mbed_official | 52:a51c77007319 | 221 | only for High density Value line devices) */ |
mbed_official | 52:a51c77007319 | 222 | |
mbed_official | 52:a51c77007319 | 223 | #define IS_GPIO_REMAP(REMAP) (((REMAP) == GPIO_Remap_SPI1) || ((REMAP) == GPIO_Remap_I2C1) || \ |
mbed_official | 52:a51c77007319 | 224 | ((REMAP) == GPIO_Remap_USART1) || ((REMAP) == GPIO_Remap_USART2) || \ |
mbed_official | 52:a51c77007319 | 225 | ((REMAP) == GPIO_PartialRemap_USART3) || ((REMAP) == GPIO_FullRemap_USART3) || \ |
mbed_official | 52:a51c77007319 | 226 | ((REMAP) == GPIO_PartialRemap_TIM1) || ((REMAP) == GPIO_FullRemap_TIM1) || \ |
mbed_official | 52:a51c77007319 | 227 | ((REMAP) == GPIO_PartialRemap1_TIM2) || ((REMAP) == GPIO_PartialRemap2_TIM2) || \ |
mbed_official | 52:a51c77007319 | 228 | ((REMAP) == GPIO_FullRemap_TIM2) || ((REMAP) == GPIO_PartialRemap_TIM3) || \ |
mbed_official | 52:a51c77007319 | 229 | ((REMAP) == GPIO_FullRemap_TIM3) || ((REMAP) == GPIO_Remap_TIM4) || \ |
mbed_official | 52:a51c77007319 | 230 | ((REMAP) == GPIO_Remap1_CAN1) || ((REMAP) == GPIO_Remap2_CAN1) || \ |
mbed_official | 52:a51c77007319 | 231 | ((REMAP) == GPIO_Remap_PD01) || ((REMAP) == GPIO_Remap_TIM5CH4_LSI) || \ |
mbed_official | 52:a51c77007319 | 232 | ((REMAP) == GPIO_Remap_ADC1_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC1_ETRGREG) || \ |
mbed_official | 52:a51c77007319 | 233 | ((REMAP) == GPIO_Remap_ADC2_ETRGINJ) ||((REMAP) == GPIO_Remap_ADC2_ETRGREG) || \ |
mbed_official | 52:a51c77007319 | 234 | ((REMAP) == GPIO_Remap_ETH) ||((REMAP) == GPIO_Remap_CAN2) || \ |
mbed_official | 52:a51c77007319 | 235 | ((REMAP) == GPIO_Remap_SWJ_NoJTRST) || ((REMAP) == GPIO_Remap_SWJ_JTAGDisable) || \ |
mbed_official | 52:a51c77007319 | 236 | ((REMAP) == GPIO_Remap_SWJ_Disable)|| ((REMAP) == GPIO_Remap_SPI3) || \ |
mbed_official | 52:a51c77007319 | 237 | ((REMAP) == GPIO_Remap_TIM2ITR1_PTP_SOF) || ((REMAP) == GPIO_Remap_PTP_PPS) || \ |
mbed_official | 52:a51c77007319 | 238 | ((REMAP) == GPIO_Remap_TIM15) || ((REMAP) == GPIO_Remap_TIM16) || \ |
mbed_official | 52:a51c77007319 | 239 | ((REMAP) == GPIO_Remap_TIM17) || ((REMAP) == GPIO_Remap_CEC) || \ |
mbed_official | 52:a51c77007319 | 240 | ((REMAP) == GPIO_Remap_TIM1_DMA) || ((REMAP) == GPIO_Remap_TIM9) || \ |
mbed_official | 52:a51c77007319 | 241 | ((REMAP) == GPIO_Remap_TIM10) || ((REMAP) == GPIO_Remap_TIM11) || \ |
mbed_official | 52:a51c77007319 | 242 | ((REMAP) == GPIO_Remap_TIM13) || ((REMAP) == GPIO_Remap_TIM14) || \ |
mbed_official | 52:a51c77007319 | 243 | ((REMAP) == GPIO_Remap_FSMC_NADV) || ((REMAP) == GPIO_Remap_TIM67_DAC_DMA) || \ |
mbed_official | 52:a51c77007319 | 244 | ((REMAP) == GPIO_Remap_TIM12) || ((REMAP) == GPIO_Remap_MISC)) |
mbed_official | 52:a51c77007319 | 245 | |
mbed_official | 52:a51c77007319 | 246 | /** |
mbed_official | 52:a51c77007319 | 247 | * @} |
mbed_official | 52:a51c77007319 | 248 | */ |
mbed_official | 52:a51c77007319 | 249 | |
mbed_official | 52:a51c77007319 | 250 | /** @defgroup GPIO_Port_Sources |
mbed_official | 52:a51c77007319 | 251 | * @{ |
mbed_official | 52:a51c77007319 | 252 | */ |
mbed_official | 52:a51c77007319 | 253 | |
mbed_official | 52:a51c77007319 | 254 | #define GPIO_PortSourceGPIOA ((uint8_t)0x00) |
mbed_official | 52:a51c77007319 | 255 | #define GPIO_PortSourceGPIOB ((uint8_t)0x01) |
mbed_official | 52:a51c77007319 | 256 | #define GPIO_PortSourceGPIOC ((uint8_t)0x02) |
mbed_official | 52:a51c77007319 | 257 | #define GPIO_PortSourceGPIOD ((uint8_t)0x03) |
mbed_official | 52:a51c77007319 | 258 | #define GPIO_PortSourceGPIOE ((uint8_t)0x04) |
mbed_official | 52:a51c77007319 | 259 | #define GPIO_PortSourceGPIOF ((uint8_t)0x05) |
mbed_official | 52:a51c77007319 | 260 | #define GPIO_PortSourceGPIOG ((uint8_t)0x06) |
mbed_official | 52:a51c77007319 | 261 | #define IS_GPIO_EVENTOUT_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) || \ |
mbed_official | 52:a51c77007319 | 262 | ((PORTSOURCE) == GPIO_PortSourceGPIOB) || \ |
mbed_official | 52:a51c77007319 | 263 | ((PORTSOURCE) == GPIO_PortSourceGPIOC) || \ |
mbed_official | 52:a51c77007319 | 264 | ((PORTSOURCE) == GPIO_PortSourceGPIOD) || \ |
mbed_official | 52:a51c77007319 | 265 | ((PORTSOURCE) == GPIO_PortSourceGPIOE)) |
mbed_official | 52:a51c77007319 | 266 | |
mbed_official | 52:a51c77007319 | 267 | #define IS_GPIO_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == GPIO_PortSourceGPIOA) || \ |
mbed_official | 52:a51c77007319 | 268 | ((PORTSOURCE) == GPIO_PortSourceGPIOB) || \ |
mbed_official | 52:a51c77007319 | 269 | ((PORTSOURCE) == GPIO_PortSourceGPIOC) || \ |
mbed_official | 52:a51c77007319 | 270 | ((PORTSOURCE) == GPIO_PortSourceGPIOD) || \ |
mbed_official | 52:a51c77007319 | 271 | ((PORTSOURCE) == GPIO_PortSourceGPIOE) || \ |
mbed_official | 52:a51c77007319 | 272 | ((PORTSOURCE) == GPIO_PortSourceGPIOF) || \ |
mbed_official | 52:a51c77007319 | 273 | ((PORTSOURCE) == GPIO_PortSourceGPIOG)) |
mbed_official | 52:a51c77007319 | 274 | |
mbed_official | 52:a51c77007319 | 275 | /** |
mbed_official | 52:a51c77007319 | 276 | * @} |
mbed_official | 52:a51c77007319 | 277 | */ |
mbed_official | 52:a51c77007319 | 278 | |
mbed_official | 52:a51c77007319 | 279 | /** @defgroup GPIO_Pin_sources |
mbed_official | 52:a51c77007319 | 280 | * @{ |
mbed_official | 52:a51c77007319 | 281 | */ |
mbed_official | 52:a51c77007319 | 282 | |
mbed_official | 52:a51c77007319 | 283 | #define GPIO_PinSource0 ((uint8_t)0x00) |
mbed_official | 52:a51c77007319 | 284 | #define GPIO_PinSource1 ((uint8_t)0x01) |
mbed_official | 52:a51c77007319 | 285 | #define GPIO_PinSource2 ((uint8_t)0x02) |
mbed_official | 52:a51c77007319 | 286 | #define GPIO_PinSource3 ((uint8_t)0x03) |
mbed_official | 52:a51c77007319 | 287 | #define GPIO_PinSource4 ((uint8_t)0x04) |
mbed_official | 52:a51c77007319 | 288 | #define GPIO_PinSource5 ((uint8_t)0x05) |
mbed_official | 52:a51c77007319 | 289 | #define GPIO_PinSource6 ((uint8_t)0x06) |
mbed_official | 52:a51c77007319 | 290 | #define GPIO_PinSource7 ((uint8_t)0x07) |
mbed_official | 52:a51c77007319 | 291 | #define GPIO_PinSource8 ((uint8_t)0x08) |
mbed_official | 52:a51c77007319 | 292 | #define GPIO_PinSource9 ((uint8_t)0x09) |
mbed_official | 52:a51c77007319 | 293 | #define GPIO_PinSource10 ((uint8_t)0x0A) |
mbed_official | 52:a51c77007319 | 294 | #define GPIO_PinSource11 ((uint8_t)0x0B) |
mbed_official | 52:a51c77007319 | 295 | #define GPIO_PinSource12 ((uint8_t)0x0C) |
mbed_official | 52:a51c77007319 | 296 | #define GPIO_PinSource13 ((uint8_t)0x0D) |
mbed_official | 52:a51c77007319 | 297 | #define GPIO_PinSource14 ((uint8_t)0x0E) |
mbed_official | 52:a51c77007319 | 298 | #define GPIO_PinSource15 ((uint8_t)0x0F) |
mbed_official | 52:a51c77007319 | 299 | |
mbed_official | 52:a51c77007319 | 300 | #define IS_GPIO_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == GPIO_PinSource0) || \ |
mbed_official | 52:a51c77007319 | 301 | ((PINSOURCE) == GPIO_PinSource1) || \ |
mbed_official | 52:a51c77007319 | 302 | ((PINSOURCE) == GPIO_PinSource2) || \ |
mbed_official | 52:a51c77007319 | 303 | ((PINSOURCE) == GPIO_PinSource3) || \ |
mbed_official | 52:a51c77007319 | 304 | ((PINSOURCE) == GPIO_PinSource4) || \ |
mbed_official | 52:a51c77007319 | 305 | ((PINSOURCE) == GPIO_PinSource5) || \ |
mbed_official | 52:a51c77007319 | 306 | ((PINSOURCE) == GPIO_PinSource6) || \ |
mbed_official | 52:a51c77007319 | 307 | ((PINSOURCE) == GPIO_PinSource7) || \ |
mbed_official | 52:a51c77007319 | 308 | ((PINSOURCE) == GPIO_PinSource8) || \ |
mbed_official | 52:a51c77007319 | 309 | ((PINSOURCE) == GPIO_PinSource9) || \ |
mbed_official | 52:a51c77007319 | 310 | ((PINSOURCE) == GPIO_PinSource10) || \ |
mbed_official | 52:a51c77007319 | 311 | ((PINSOURCE) == GPIO_PinSource11) || \ |
mbed_official | 52:a51c77007319 | 312 | ((PINSOURCE) == GPIO_PinSource12) || \ |
mbed_official | 52:a51c77007319 | 313 | ((PINSOURCE) == GPIO_PinSource13) || \ |
mbed_official | 52:a51c77007319 | 314 | ((PINSOURCE) == GPIO_PinSource14) || \ |
mbed_official | 52:a51c77007319 | 315 | ((PINSOURCE) == GPIO_PinSource15)) |
mbed_official | 52:a51c77007319 | 316 | |
mbed_official | 52:a51c77007319 | 317 | /** |
mbed_official | 52:a51c77007319 | 318 | * @} |
mbed_official | 52:a51c77007319 | 319 | */ |
mbed_official | 52:a51c77007319 | 320 | |
mbed_official | 52:a51c77007319 | 321 | /** @defgroup Ethernet_Media_Interface |
mbed_official | 52:a51c77007319 | 322 | * @{ |
mbed_official | 52:a51c77007319 | 323 | */ |
mbed_official | 52:a51c77007319 | 324 | #define GPIO_ETH_MediaInterface_MII ((u32)0x00000000) |
mbed_official | 52:a51c77007319 | 325 | #define GPIO_ETH_MediaInterface_RMII ((u32)0x00000001) |
mbed_official | 52:a51c77007319 | 326 | |
mbed_official | 52:a51c77007319 | 327 | #define IS_GPIO_ETH_MEDIA_INTERFACE(INTERFACE) (((INTERFACE) == GPIO_ETH_MediaInterface_MII) || \ |
mbed_official | 52:a51c77007319 | 328 | ((INTERFACE) == GPIO_ETH_MediaInterface_RMII)) |
mbed_official | 52:a51c77007319 | 329 | |
mbed_official | 52:a51c77007319 | 330 | /** |
mbed_official | 52:a51c77007319 | 331 | * @} |
mbed_official | 52:a51c77007319 | 332 | */ |
mbed_official | 52:a51c77007319 | 333 | /** |
mbed_official | 52:a51c77007319 | 334 | * @} |
mbed_official | 52:a51c77007319 | 335 | */ |
mbed_official | 52:a51c77007319 | 336 | |
mbed_official | 52:a51c77007319 | 337 | /** @defgroup GPIO_Exported_Macros |
mbed_official | 52:a51c77007319 | 338 | * @{ |
mbed_official | 52:a51c77007319 | 339 | */ |
mbed_official | 52:a51c77007319 | 340 | |
mbed_official | 52:a51c77007319 | 341 | /** |
mbed_official | 52:a51c77007319 | 342 | * @} |
mbed_official | 52:a51c77007319 | 343 | */ |
mbed_official | 52:a51c77007319 | 344 | |
mbed_official | 52:a51c77007319 | 345 | /** @defgroup GPIO_Exported_Functions |
mbed_official | 52:a51c77007319 | 346 | * @{ |
mbed_official | 52:a51c77007319 | 347 | */ |
mbed_official | 52:a51c77007319 | 348 | |
mbed_official | 52:a51c77007319 | 349 | void GPIO_DeInit(GPIO_TypeDef* GPIOx); |
mbed_official | 52:a51c77007319 | 350 | void GPIO_AFIODeInit(void); |
mbed_official | 52:a51c77007319 | 351 | void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct); |
mbed_official | 52:a51c77007319 | 352 | void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct); |
mbed_official | 52:a51c77007319 | 353 | uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
mbed_official | 52:a51c77007319 | 354 | uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx); |
mbed_official | 52:a51c77007319 | 355 | uint8_t GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
mbed_official | 52:a51c77007319 | 356 | uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx); |
mbed_official | 52:a51c77007319 | 357 | void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
mbed_official | 52:a51c77007319 | 358 | void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
mbed_official | 52:a51c77007319 | 359 | void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal); |
mbed_official | 52:a51c77007319 | 360 | void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal); |
mbed_official | 52:a51c77007319 | 361 | void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); |
mbed_official | 52:a51c77007319 | 362 | void GPIO_EventOutputConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource); |
mbed_official | 52:a51c77007319 | 363 | void GPIO_EventOutputCmd(FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 364 | void GPIO_PinRemapConfig(uint32_t GPIO_Remap, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 365 | void GPIO_EXTILineConfig(uint8_t GPIO_PortSource, uint8_t GPIO_PinSource); |
mbed_official | 52:a51c77007319 | 366 | void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface); |
mbed_official | 52:a51c77007319 | 367 | |
mbed_official | 52:a51c77007319 | 368 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 369 | } |
mbed_official | 52:a51c77007319 | 370 | #endif |
mbed_official | 52:a51c77007319 | 371 | |
mbed_official | 52:a51c77007319 | 372 | #endif /* __STM32F10x_GPIO_H */ |
mbed_official | 52:a51c77007319 | 373 | /** |
mbed_official | 52:a51c77007319 | 374 | * @} |
mbed_official | 52:a51c77007319 | 375 | */ |
mbed_official | 52:a51c77007319 | 376 | |
mbed_official | 52:a51c77007319 | 377 | /** |
mbed_official | 52:a51c77007319 | 378 | * @} |
mbed_official | 52:a51c77007319 | 379 | */ |
mbed_official | 52:a51c77007319 | 380 | |
mbed_official | 52:a51c77007319 | 381 | /** |
mbed_official | 52:a51c77007319 | 382 | * @} |
mbed_official | 52:a51c77007319 | 383 | */ |
mbed_official | 52:a51c77007319 | 384 | |
mbed_official | 52:a51c77007319 | 385 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ |