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 by
TARGET_NUCLEO_F103RB/PinNames.h@74:a842253909c9, 2013-12-13 (annotated)
- Committer:
- bogdanm
- Date:
- Fri Dec 13 14:18:40 2013 +0200
- Revision:
- 74:a842253909c9
- Parent:
- 73:1efda918f0ba
- Child:
- 76:824293ae5e43
Release 74 of the mbed library
Main changes:
- added Embedded Artists LPC11U35 quick start board to the SDK
- fixes for LPC4088/NUCLEO_F103RB
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bogdanm | 73:1efda918f0ba | 1 | /* mbed Microcontroller Library |
| bogdanm | 73:1efda918f0ba | 2 | * Copyright (c) 2006-2013 ARM Limited |
| bogdanm | 73:1efda918f0ba | 3 | * |
| bogdanm | 73:1efda918f0ba | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| bogdanm | 73:1efda918f0ba | 5 | * you may not use this file except in compliance with the License. |
| bogdanm | 73:1efda918f0ba | 6 | * You may obtain a copy of the License at |
| bogdanm | 73:1efda918f0ba | 7 | * |
| bogdanm | 73:1efda918f0ba | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| bogdanm | 73:1efda918f0ba | 9 | * |
| bogdanm | 73:1efda918f0ba | 10 | * Unless required by applicable law or agreed to in writing, software |
| bogdanm | 73:1efda918f0ba | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| bogdanm | 73:1efda918f0ba | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| bogdanm | 73:1efda918f0ba | 13 | * See the License for the specific language governing permissions and |
| bogdanm | 73:1efda918f0ba | 14 | * limitations under the License. |
| bogdanm | 73:1efda918f0ba | 15 | */ |
| bogdanm | 73:1efda918f0ba | 16 | #ifndef MBED_PINNAMES_H |
| bogdanm | 73:1efda918f0ba | 17 | #define MBED_PINNAMES_H |
| bogdanm | 73:1efda918f0ba | 18 | |
| bogdanm | 73:1efda918f0ba | 19 | #include "cmsis.h" |
| bogdanm | 73:1efda918f0ba | 20 | |
| bogdanm | 73:1efda918f0ba | 21 | #ifdef __cplusplus |
| bogdanm | 73:1efda918f0ba | 22 | extern "C" { |
| bogdanm | 73:1efda918f0ba | 23 | #endif |
| bogdanm | 73:1efda918f0ba | 24 | |
| bogdanm | 73:1efda918f0ba | 25 | // MODE (see GPIOMode_TypeDef structure) |
| bogdanm | 73:1efda918f0ba | 26 | // AFNUM (see AF_mapping constant table) |
| bogdanm | 73:1efda918f0ba | 27 | #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM)) |
| bogdanm | 73:1efda918f0ba | 28 | #define STM_PIN_MODE(X) ((X) >> 8) |
| bogdanm | 73:1efda918f0ba | 29 | #define STM_PIN_AFNUM(X) ((X) & 0xFF) |
| bogdanm | 73:1efda918f0ba | 30 | |
| bogdanm | 73:1efda918f0ba | 31 | typedef enum { |
| bogdanm | 73:1efda918f0ba | 32 | PIN_INPUT, |
| bogdanm | 73:1efda918f0ba | 33 | PIN_OUTPUT |
| bogdanm | 73:1efda918f0ba | 34 | } PinDirection; |
| bogdanm | 73:1efda918f0ba | 35 | |
| bogdanm | 73:1efda918f0ba | 36 | typedef enum { |
| bogdanm | 73:1efda918f0ba | 37 | |
| bogdanm | 73:1efda918f0ba | 38 | // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F) |
| bogdanm | 73:1efda918f0ba | 39 | // low nibble = pin number |
| bogdanm | 73:1efda918f0ba | 40 | PA_0 = 0x00, |
| bogdanm | 73:1efda918f0ba | 41 | PA_1 = 0x01, |
| bogdanm | 73:1efda918f0ba | 42 | PA_2 = 0x02, |
| bogdanm | 73:1efda918f0ba | 43 | PA_3 = 0x03, |
| bogdanm | 73:1efda918f0ba | 44 | PA_4 = 0x04, |
| bogdanm | 73:1efda918f0ba | 45 | PA_5 = 0x05, |
| bogdanm | 73:1efda918f0ba | 46 | PA_6 = 0x06, |
| bogdanm | 73:1efda918f0ba | 47 | PA_7 = 0x07, |
| bogdanm | 73:1efda918f0ba | 48 | PA_8 = 0x08, |
| bogdanm | 73:1efda918f0ba | 49 | PA_9 = 0x09, |
| bogdanm | 73:1efda918f0ba | 50 | PA_10 = 0x0A, |
| bogdanm | 73:1efda918f0ba | 51 | PA_11 = 0x0B, |
| bogdanm | 73:1efda918f0ba | 52 | PA_12 = 0x0C, |
| bogdanm | 73:1efda918f0ba | 53 | PA_13 = 0x0D, |
| bogdanm | 73:1efda918f0ba | 54 | PA_14 = 0x0E, |
| bogdanm | 73:1efda918f0ba | 55 | PA_15 = 0x0F, |
| bogdanm | 73:1efda918f0ba | 56 | |
| bogdanm | 73:1efda918f0ba | 57 | PB_0 = 0x10, |
| bogdanm | 73:1efda918f0ba | 58 | PB_1 = 0x11, |
| bogdanm | 73:1efda918f0ba | 59 | PB_2 = 0x12, |
| bogdanm | 73:1efda918f0ba | 60 | PB_3 = 0x13, |
| bogdanm | 73:1efda918f0ba | 61 | PB_4 = 0x14, |
| bogdanm | 73:1efda918f0ba | 62 | PB_5 = 0x15, |
| bogdanm | 73:1efda918f0ba | 63 | PB_6 = 0x16, |
| bogdanm | 73:1efda918f0ba | 64 | PB_7 = 0x17, |
| bogdanm | 73:1efda918f0ba | 65 | PB_8 = 0x18, |
| bogdanm | 73:1efda918f0ba | 66 | PB_9 = 0x19, |
| bogdanm | 73:1efda918f0ba | 67 | PB_10 = 0x1A, |
| bogdanm | 73:1efda918f0ba | 68 | PB_11 = 0x1B, |
| bogdanm | 73:1efda918f0ba | 69 | PB_12 = 0x1C, |
| bogdanm | 73:1efda918f0ba | 70 | PB_13 = 0x1D, |
| bogdanm | 73:1efda918f0ba | 71 | PB_14 = 0x1E, |
| bogdanm | 73:1efda918f0ba | 72 | PB_15 = 0x1F, |
| bogdanm | 73:1efda918f0ba | 73 | |
| bogdanm | 73:1efda918f0ba | 74 | PC_0 = 0x20, |
| bogdanm | 73:1efda918f0ba | 75 | PC_1 = 0x21, |
| bogdanm | 73:1efda918f0ba | 76 | PC_2 = 0x22, |
| bogdanm | 73:1efda918f0ba | 77 | PC_3 = 0x23, |
| bogdanm | 73:1efda918f0ba | 78 | PC_4 = 0x24, |
| bogdanm | 73:1efda918f0ba | 79 | PC_5 = 0x25, |
| bogdanm | 73:1efda918f0ba | 80 | PC_6 = 0x26, |
| bogdanm | 73:1efda918f0ba | 81 | PC_7 = 0x27, |
| bogdanm | 73:1efda918f0ba | 82 | PC_8 = 0x28, |
| bogdanm | 73:1efda918f0ba | 83 | PC_9 = 0x29, |
| bogdanm | 73:1efda918f0ba | 84 | PC_10 = 0x2A, |
| bogdanm | 73:1efda918f0ba | 85 | PC_11 = 0x2B, |
| bogdanm | 73:1efda918f0ba | 86 | PC_12 = 0x2C, |
| bogdanm | 73:1efda918f0ba | 87 | PC_13 = 0x2D, |
| bogdanm | 73:1efda918f0ba | 88 | PC_14 = 0x2E, |
| bogdanm | 73:1efda918f0ba | 89 | PC_15 = 0x2F, |
| bogdanm | 73:1efda918f0ba | 90 | |
| bogdanm | 73:1efda918f0ba | 91 | PD_2 = 0x32, |
| bogdanm | 73:1efda918f0ba | 92 | PD_8 = 0x38, |
| bogdanm | 73:1efda918f0ba | 93 | |
| bogdanm | 74:a842253909c9 | 94 | // Arduino connector namings |
| bogdanm | 73:1efda918f0ba | 95 | A0 = PA_0, |
| bogdanm | 73:1efda918f0ba | 96 | A1 = PA_1, |
| bogdanm | 73:1efda918f0ba | 97 | A2 = PA_4, |
| bogdanm | 73:1efda918f0ba | 98 | A3 = PB_0, |
| bogdanm | 73:1efda918f0ba | 99 | A4 = PC_1, |
| bogdanm | 73:1efda918f0ba | 100 | A5 = PC_0, |
| bogdanm | 73:1efda918f0ba | 101 | D0 = PA_3, |
| bogdanm | 73:1efda918f0ba | 102 | D1 = PA_2, |
| bogdanm | 73:1efda918f0ba | 103 | D2 = PA_10, |
| bogdanm | 73:1efda918f0ba | 104 | D3 = PB_3, |
| bogdanm | 73:1efda918f0ba | 105 | D4 = PB_5, |
| bogdanm | 73:1efda918f0ba | 106 | D5 = PB_4, |
| bogdanm | 73:1efda918f0ba | 107 | D6 = PB_10, |
| bogdanm | 73:1efda918f0ba | 108 | D7 = PA_8, |
| bogdanm | 73:1efda918f0ba | 109 | D8 = PA_9, |
| bogdanm | 73:1efda918f0ba | 110 | D9 = PC_7, |
| bogdanm | 73:1efda918f0ba | 111 | D10 = PB_6, |
| bogdanm | 73:1efda918f0ba | 112 | D11 = PA_7, |
| bogdanm | 73:1efda918f0ba | 113 | D12 = PA_6, |
| bogdanm | 73:1efda918f0ba | 114 | D13 = PA_5, |
| bogdanm | 73:1efda918f0ba | 115 | D14 = PB_9, |
| bogdanm | 73:1efda918f0ba | 116 | D15 = PB_8, |
| bogdanm | 73:1efda918f0ba | 117 | |
| bogdanm | 74:a842253909c9 | 118 | // Generic signals namings |
| bogdanm | 74:a842253909c9 | 119 | LED1 = PA_5, |
| bogdanm | 74:a842253909c9 | 120 | LED2 = PA_5, |
| bogdanm | 74:a842253909c9 | 121 | LED3 = PA_5, |
| bogdanm | 74:a842253909c9 | 122 | LED4 = PA_5, |
| bogdanm | 73:1efda918f0ba | 123 | USER_BUTTON = PC_13, |
| bogdanm | 74:a842253909c9 | 124 | SERIAL_TX = PA_2, |
| bogdanm | 74:a842253909c9 | 125 | SERIAL_RX = PA_3, |
| bogdanm | 74:a842253909c9 | 126 | I2C_SCL = PB_8, |
| bogdanm | 74:a842253909c9 | 127 | I2C_SDA = PB_9, |
| bogdanm | 74:a842253909c9 | 128 | SPI_MOSI = PA_7, |
| bogdanm | 74:a842253909c9 | 129 | SPI_MISO = PA_6, |
| bogdanm | 74:a842253909c9 | 130 | SPI_SCK = PA_5, |
| bogdanm | 74:a842253909c9 | 131 | SPI_CS = PB_6, |
| bogdanm | 74:a842253909c9 | 132 | PWM_OUT = PB_3, |
| bogdanm | 73:1efda918f0ba | 133 | |
| bogdanm | 73:1efda918f0ba | 134 | // Not connected |
| bogdanm | 73:1efda918f0ba | 135 | NC = (int)0xFFFFFFFF |
| bogdanm | 73:1efda918f0ba | 136 | } PinName; |
| bogdanm | 73:1efda918f0ba | 137 | |
| bogdanm | 73:1efda918f0ba | 138 | typedef enum { |
| bogdanm | 73:1efda918f0ba | 139 | PullNone = 0, |
| bogdanm | 73:1efda918f0ba | 140 | PullUp = 1, |
| bogdanm | 73:1efda918f0ba | 141 | PullDown = 2, |
| bogdanm | 73:1efda918f0ba | 142 | OpenDrain = 3 |
| bogdanm | 73:1efda918f0ba | 143 | } PinMode; |
| bogdanm | 73:1efda918f0ba | 144 | |
| bogdanm | 73:1efda918f0ba | 145 | #ifdef __cplusplus |
| bogdanm | 73:1efda918f0ba | 146 | } |
| bogdanm | 73:1efda918f0ba | 147 | #endif |
| bogdanm | 73:1efda918f0ba | 148 | |
| bogdanm | 73:1efda918f0ba | 149 | #endif |
