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.
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/PinNames.h@52:a51c77007319, 2013-12-02 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Dec 02 11:30:05 2013 +0000
- Revision:
- 52:a51c77007319
- Child:
- 56:99eb381a3269
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 Microcontroller Library |
| mbed_official | 52:a51c77007319 | 2 | * Copyright (c) 2006-2013 ARM Limited |
| mbed_official | 52:a51c77007319 | 3 | * |
| mbed_official | 52:a51c77007319 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| mbed_official | 52:a51c77007319 | 5 | * you may not use this file except in compliance with the License. |
| mbed_official | 52:a51c77007319 | 6 | * You may obtain a copy of the License at |
| mbed_official | 52:a51c77007319 | 7 | * |
| mbed_official | 52:a51c77007319 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| mbed_official | 52:a51c77007319 | 9 | * |
| mbed_official | 52:a51c77007319 | 10 | * Unless required by applicable law or agreed to in writing, software |
| mbed_official | 52:a51c77007319 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| mbed_official | 52:a51c77007319 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| mbed_official | 52:a51c77007319 | 13 | * See the License for the specific language governing permissions and |
| mbed_official | 52:a51c77007319 | 14 | * limitations under the License. |
| mbed_official | 52:a51c77007319 | 15 | */ |
| mbed_official | 52:a51c77007319 | 16 | #ifndef MBED_PINNAMES_H |
| mbed_official | 52:a51c77007319 | 17 | #define MBED_PINNAMES_H |
| mbed_official | 52:a51c77007319 | 18 | |
| mbed_official | 52:a51c77007319 | 19 | #include "cmsis.h" |
| mbed_official | 52:a51c77007319 | 20 | |
| mbed_official | 52:a51c77007319 | 21 | #ifdef __cplusplus |
| mbed_official | 52:a51c77007319 | 22 | extern "C" { |
| mbed_official | 52:a51c77007319 | 23 | #endif |
| mbed_official | 52:a51c77007319 | 24 | |
| mbed_official | 52:a51c77007319 | 25 | // MODE (see GPIOMode_TypeDef structure) |
| mbed_official | 52:a51c77007319 | 26 | // AFNUM (see AF_mapping constant table) |
| mbed_official | 52:a51c77007319 | 27 | #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM)) |
| mbed_official | 52:a51c77007319 | 28 | #define STM_PIN_MODE(X) ((X) >> 8) |
| mbed_official | 52:a51c77007319 | 29 | #define STM_PIN_AFNUM(X) ((X) & 0xFF) |
| mbed_official | 52:a51c77007319 | 30 | |
| mbed_official | 52:a51c77007319 | 31 | typedef enum { |
| mbed_official | 52:a51c77007319 | 32 | PIN_INPUT, |
| mbed_official | 52:a51c77007319 | 33 | PIN_OUTPUT |
| mbed_official | 52:a51c77007319 | 34 | } PinDirection; |
| mbed_official | 52:a51c77007319 | 35 | |
| mbed_official | 52:a51c77007319 | 36 | typedef enum { |
| mbed_official | 52:a51c77007319 | 37 | |
| mbed_official | 52:a51c77007319 | 38 | // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F) |
| mbed_official | 52:a51c77007319 | 39 | // low nibble = pin number |
| mbed_official | 52:a51c77007319 | 40 | PA_0 = 0x00, |
| mbed_official | 52:a51c77007319 | 41 | PA_1 = 0x01, |
| mbed_official | 52:a51c77007319 | 42 | PA_2 = 0x02, |
| mbed_official | 52:a51c77007319 | 43 | PA_3 = 0x03, |
| mbed_official | 52:a51c77007319 | 44 | PA_4 = 0x04, |
| mbed_official | 52:a51c77007319 | 45 | PA_5 = 0x05, |
| mbed_official | 52:a51c77007319 | 46 | PA_6 = 0x06, |
| mbed_official | 52:a51c77007319 | 47 | PA_7 = 0x07, |
| mbed_official | 52:a51c77007319 | 48 | PA_8 = 0x08, |
| mbed_official | 52:a51c77007319 | 49 | PA_9 = 0x09, |
| mbed_official | 52:a51c77007319 | 50 | PA_10 = 0x0A, |
| mbed_official | 52:a51c77007319 | 51 | PA_11 = 0x0B, |
| mbed_official | 52:a51c77007319 | 52 | PA_12 = 0x0C, |
| mbed_official | 52:a51c77007319 | 53 | PA_13 = 0x0D, |
| mbed_official | 52:a51c77007319 | 54 | PA_14 = 0x0E, |
| mbed_official | 52:a51c77007319 | 55 | PA_15 = 0x0F, |
| mbed_official | 52:a51c77007319 | 56 | |
| mbed_official | 52:a51c77007319 | 57 | PB_0 = 0x10, |
| mbed_official | 52:a51c77007319 | 58 | PB_1 = 0x11, |
| mbed_official | 52:a51c77007319 | 59 | PB_2 = 0x12, |
| mbed_official | 52:a51c77007319 | 60 | PB_3 = 0x13, |
| mbed_official | 52:a51c77007319 | 61 | PB_4 = 0x14, |
| mbed_official | 52:a51c77007319 | 62 | PB_5 = 0x15, |
| mbed_official | 52:a51c77007319 | 63 | PB_6 = 0x16, |
| mbed_official | 52:a51c77007319 | 64 | PB_7 = 0x17, |
| mbed_official | 52:a51c77007319 | 65 | PB_8 = 0x18, |
| mbed_official | 52:a51c77007319 | 66 | PB_9 = 0x19, |
| mbed_official | 52:a51c77007319 | 67 | PB_10 = 0x1A, |
| mbed_official | 52:a51c77007319 | 68 | PB_11 = 0x1B, |
| mbed_official | 52:a51c77007319 | 69 | PB_12 = 0x1C, |
| mbed_official | 52:a51c77007319 | 70 | PB_13 = 0x1D, |
| mbed_official | 52:a51c77007319 | 71 | PB_14 = 0x1E, |
| mbed_official | 52:a51c77007319 | 72 | PB_15 = 0x1F, |
| mbed_official | 52:a51c77007319 | 73 | |
| mbed_official | 52:a51c77007319 | 74 | PC_0 = 0x20, |
| mbed_official | 52:a51c77007319 | 75 | PC_1 = 0x21, |
| mbed_official | 52:a51c77007319 | 76 | PC_2 = 0x22, |
| mbed_official | 52:a51c77007319 | 77 | PC_3 = 0x23, |
| mbed_official | 52:a51c77007319 | 78 | PC_4 = 0x24, |
| mbed_official | 52:a51c77007319 | 79 | PC_5 = 0x25, |
| mbed_official | 52:a51c77007319 | 80 | PC_6 = 0x26, |
| mbed_official | 52:a51c77007319 | 81 | PC_7 = 0x27, |
| mbed_official | 52:a51c77007319 | 82 | PC_8 = 0x28, |
| mbed_official | 52:a51c77007319 | 83 | PC_9 = 0x29, |
| mbed_official | 52:a51c77007319 | 84 | PC_10 = 0x2A, |
| mbed_official | 52:a51c77007319 | 85 | PC_11 = 0x2B, |
| mbed_official | 52:a51c77007319 | 86 | PC_12 = 0x2C, |
| mbed_official | 52:a51c77007319 | 87 | PC_13 = 0x2D, |
| mbed_official | 52:a51c77007319 | 88 | PC_14 = 0x2E, |
| mbed_official | 52:a51c77007319 | 89 | PC_15 = 0x2F, |
| mbed_official | 52:a51c77007319 | 90 | |
| mbed_official | 52:a51c77007319 | 91 | PD_0 = 0x30, |
| mbed_official | 52:a51c77007319 | 92 | PD_1 = 0x31, |
| mbed_official | 52:a51c77007319 | 93 | PD_2 = 0x32, |
| mbed_official | 52:a51c77007319 | 94 | PD_3 = 0x33, |
| mbed_official | 52:a51c77007319 | 95 | PD_4 = 0x34, |
| mbed_official | 52:a51c77007319 | 96 | PD_5 = 0x35, |
| mbed_official | 52:a51c77007319 | 97 | PD_6 = 0x36, |
| mbed_official | 52:a51c77007319 | 98 | PD_7 = 0x37, |
| mbed_official | 52:a51c77007319 | 99 | PD_8 = 0x38, |
| mbed_official | 52:a51c77007319 | 100 | PD_9 = 0x39, |
| mbed_official | 52:a51c77007319 | 101 | PD_10 = 0x3A, |
| mbed_official | 52:a51c77007319 | 102 | PD_11 = 0x3B, |
| mbed_official | 52:a51c77007319 | 103 | PD_12 = 0x3C, |
| mbed_official | 52:a51c77007319 | 104 | PD_13 = 0x3D, |
| mbed_official | 52:a51c77007319 | 105 | PD_14 = 0x3E, |
| mbed_official | 52:a51c77007319 | 106 | PD_15 = 0x3F, |
| mbed_official | 52:a51c77007319 | 107 | |
| mbed_official | 52:a51c77007319 | 108 | PE_0 = 0x40, |
| mbed_official | 52:a51c77007319 | 109 | PE_1 = 0x41, |
| mbed_official | 52:a51c77007319 | 110 | PE_2 = 0x42, |
| mbed_official | 52:a51c77007319 | 111 | PE_3 = 0x43, |
| mbed_official | 52:a51c77007319 | 112 | PE_4 = 0x44, |
| mbed_official | 52:a51c77007319 | 113 | PE_5 = 0x45, |
| mbed_official | 52:a51c77007319 | 114 | PE_6 = 0x46, |
| mbed_official | 52:a51c77007319 | 115 | PE_7 = 0x47, |
| mbed_official | 52:a51c77007319 | 116 | PE_8 = 0x48, |
| mbed_official | 52:a51c77007319 | 117 | PE_9 = 0x49, |
| mbed_official | 52:a51c77007319 | 118 | PE_10 = 0x4A, |
| mbed_official | 52:a51c77007319 | 119 | PE_11 = 0x4B, |
| mbed_official | 52:a51c77007319 | 120 | PE_12 = 0x4C, |
| mbed_official | 52:a51c77007319 | 121 | PE_13 = 0x4D, |
| mbed_official | 52:a51c77007319 | 122 | PE_14 = 0x4E, |
| mbed_official | 52:a51c77007319 | 123 | PE_15 = 0x4F, |
| mbed_official | 52:a51c77007319 | 124 | |
| mbed_official | 52:a51c77007319 | 125 | //-------------------- |
| mbed_official | 52:a51c77007319 | 126 | // NUCLEO_F103RB board |
| mbed_official | 52:a51c77007319 | 127 | //-------------------- |
| mbed_official | 52:a51c77007319 | 128 | |
| mbed_official | 52:a51c77007319 | 129 | // Arduino connectors |
| mbed_official | 52:a51c77007319 | 130 | A0 = PA_0, |
| mbed_official | 52:a51c77007319 | 131 | A1 = PA_1, |
| mbed_official | 52:a51c77007319 | 132 | A2 = PA_4, |
| mbed_official | 52:a51c77007319 | 133 | A3 = PB_0, |
| mbed_official | 52:a51c77007319 | 134 | A4 = PC_1, |
| mbed_official | 52:a51c77007319 | 135 | A5 = PC_0, |
| mbed_official | 52:a51c77007319 | 136 | D0 = PA_3, |
| mbed_official | 52:a51c77007319 | 137 | D1 = PA_2, |
| mbed_official | 52:a51c77007319 | 138 | D2 = PA_10, |
| mbed_official | 52:a51c77007319 | 139 | D3 = PB_3, |
| mbed_official | 52:a51c77007319 | 140 | D4 = PB_5, |
| mbed_official | 52:a51c77007319 | 141 | D5 = PB_4, |
| mbed_official | 52:a51c77007319 | 142 | D6 = PB_10, |
| mbed_official | 52:a51c77007319 | 143 | D7 = PA_8, |
| mbed_official | 52:a51c77007319 | 144 | D8 = PA_9, |
| mbed_official | 52:a51c77007319 | 145 | D9 = PC_7, |
| mbed_official | 52:a51c77007319 | 146 | D10 = PB_6, |
| mbed_official | 52:a51c77007319 | 147 | D11 = PA_7, |
| mbed_official | 52:a51c77007319 | 148 | D12 = PA_6, |
| mbed_official | 52:a51c77007319 | 149 | D13 = PA_5, |
| mbed_official | 52:a51c77007319 | 150 | D14 = PB_9, |
| mbed_official | 52:a51c77007319 | 151 | D15 = PB_8, |
| mbed_official | 52:a51c77007319 | 152 | |
| mbed_official | 52:a51c77007319 | 153 | USER_BUTTON = PC_13, |
| mbed_official | 52:a51c77007319 | 154 | UART_TX = PA_2, |
| mbed_official | 52:a51c77007319 | 155 | UART_RX = PA_3, |
| mbed_official | 52:a51c77007319 | 156 | |
| mbed_official | 52:a51c77007319 | 157 | // mbed mandatory namings |
| mbed_official | 52:a51c77007319 | 158 | LED1 = PA_5, |
| mbed_official | 52:a51c77007319 | 159 | LED2 = PA_5, |
| mbed_official | 52:a51c77007319 | 160 | LED3 = PA_5, |
| mbed_official | 52:a51c77007319 | 161 | LED4 = PA_5, |
| mbed_official | 52:a51c77007319 | 162 | |
| mbed_official | 52:a51c77007319 | 163 | // Not connected |
| mbed_official | 52:a51c77007319 | 164 | NC = (int)0xFFFFFFFF |
| mbed_official | 52:a51c77007319 | 165 | } PinName; |
| mbed_official | 52:a51c77007319 | 166 | |
| mbed_official | 52:a51c77007319 | 167 | typedef enum { |
| mbed_official | 52:a51c77007319 | 168 | PullNone = 0, |
| mbed_official | 52:a51c77007319 | 169 | PullUp = 1, |
| mbed_official | 52:a51c77007319 | 170 | PullDown = 2, |
| mbed_official | 52:a51c77007319 | 171 | OpenDrain = 3 |
| mbed_official | 52:a51c77007319 | 172 | } PinMode; |
| mbed_official | 52:a51c77007319 | 173 | |
| mbed_official | 52:a51c77007319 | 174 | #ifdef __cplusplus |
| mbed_official | 52:a51c77007319 | 175 | } |
| mbed_official | 52:a51c77007319 | 176 | #endif |
| mbed_official | 52:a51c77007319 | 177 | |
| mbed_official | 52:a51c77007319 | 178 | #endif |
