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.
Dependencies: mbed
PinNames.h@0:f428b670026a, 2019-10-26 (annotated)
- Committer:
 - Mgiris
 - Date:
 - Sat Oct 26 03:57:39 2019 +0000
 - Revision:
 - 0:f428b670026a
 
Torreta
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| Mgiris | 0:f428b670026a | 1 | /* mbed Microcontroller Library | 
| Mgiris | 0:f428b670026a | 2 | ******************************************************************************* | 
| Mgiris | 0:f428b670026a | 3 | * Copyright (c) 2014, STMicroelectronics | 
| Mgiris | 0:f428b670026a | 4 | * All rights reserved. | 
| Mgiris | 0:f428b670026a | 5 | * | 
| Mgiris | 0:f428b670026a | 6 | * Redistribution and use in source and binary forms, with or without | 
| Mgiris | 0:f428b670026a | 7 | * modification, are permitted provided that the following conditions are met: | 
| Mgiris | 0:f428b670026a | 8 | * | 
| Mgiris | 0:f428b670026a | 9 | * 1. Redistributions of source code must retain the above copyright notice, | 
| Mgiris | 0:f428b670026a | 10 | * this list of conditions and the following disclaimer. | 
| Mgiris | 0:f428b670026a | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, | 
| Mgiris | 0:f428b670026a | 12 | * this list of conditions and the following disclaimer in the documentation | 
| Mgiris | 0:f428b670026a | 13 | * and/or other materials provided with the distribution. | 
| Mgiris | 0:f428b670026a | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors | 
| Mgiris | 0:f428b670026a | 15 | * may be used to endorse or promote products derived from this software | 
| Mgiris | 0:f428b670026a | 16 | * without specific prior written permission. | 
| Mgiris | 0:f428b670026a | 17 | * | 
| Mgiris | 0:f428b670026a | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 
| Mgiris | 0:f428b670026a | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
| Mgiris | 0:f428b670026a | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 
| Mgiris | 0:f428b670026a | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | 
| Mgiris | 0:f428b670026a | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
| Mgiris | 0:f428b670026a | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 
| Mgiris | 0:f428b670026a | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | 
| Mgiris | 0:f428b670026a | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
| Mgiris | 0:f428b670026a | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
| Mgiris | 0:f428b670026a | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| Mgiris | 0:f428b670026a | 28 | ******************************************************************************* | 
| Mgiris | 0:f428b670026a | 29 | |
| Mgiris | 0:f428b670026a | 30 | */ | 
| Mgiris | 0:f428b670026a | 31 | #ifndef MBED_PINNAMES_H | 
| Mgiris | 0:f428b670026a | 32 | #define MBED_PINNAMES_H | 
| Mgiris | 0:f428b670026a | 33 | |
| Mgiris | 0:f428b670026a | 34 | #include "cmsis.h" | 
| Mgiris | 0:f428b670026a | 35 | #include "PinNamesTypes.h" | 
| Mgiris | 0:f428b670026a | 36 | |
| Mgiris | 0:f428b670026a | 37 | #ifdef __cplusplus | 
| Mgiris | 0:f428b670026a | 38 | extern "C" { | 
| Mgiris | 0:f428b670026a | 39 | #endif | 
| Mgiris | 0:f428b670026a | 40 | |
| Mgiris | 0:f428b670026a | 41 | //UART to AMB8826 | 
| Mgiris | 0:f428b670026a | 42 | #define TXD1 PA_9 | 
| Mgiris | 0:f428b670026a | 43 | #define RXD1 PA_10 | 
| Mgiris | 0:f428b670026a | 44 | #define CTS1 PA_11 | 
| Mgiris | 0:f428b670026a | 45 | int baudRate = 115200; | 
| Mgiris | 0:f428b670026a | 46 | |
| Mgiris | 0:f428b670026a | 47 | //UART to Silicon Labs CP210x | 
| Mgiris | 0:f428b670026a | 48 | #define TXD2 PA_2 | 
| Mgiris | 0:f428b670026a | 49 | #define RXD2 PA_3 | 
| Mgiris | 0:f428b670026a | 50 | |
| Mgiris | 0:f428b670026a | 51 | //UART to FTDI | 
| Mgiris | 0:f428b670026a | 52 | #define TXD3 PB_10 | 
| Mgiris | 0:f428b670026a | 53 | #define RXD3 PB_11 | 
| Mgiris | 0:f428b670026a | 54 | |
| Mgiris | 0:f428b670026a | 55 | //I2C | 
| Mgiris | 0:f428b670026a | 56 | #define I2C1_SCL PB_6 | 
| Mgiris | 0:f428b670026a | 57 | #define I2C1_SDA PB_7 | 
| Mgiris | 0:f428b670026a | 58 | |
| Mgiris | 0:f428b670026a | 59 | #define I2C2_SCL PB_10 | 
| Mgiris | 0:f428b670026a | 60 | #define I2C2_SDA PB_11 | 
| Mgiris | 0:f428b670026a | 61 | |
| Mgiris | 0:f428b670026a | 62 | //SPI | 
| Mgiris | 0:f428b670026a | 63 | #define SPI1_MOSI PA_7 | 
| Mgiris | 0:f428b670026a | 64 | #define SPI1_MISO PA_6 | 
| Mgiris | 0:f428b670026a | 65 | #define SPI1_SCLK PA_5 | 
| Mgiris | 0:f428b670026a | 66 | #define SPI1_NSS1 PA_4 | 
| Mgiris | 0:f428b670026a | 67 | #define SDsel PA_4 | 
| Mgiris | 0:f428b670026a | 68 | |
| Mgiris | 0:f428b670026a | 69 | #define SPI2_MOSI PB_15 | 
| Mgiris | 0:f428b670026a | 70 | #define SPI2_MISO PB_14 | 
| Mgiris | 0:f428b670026a | 71 | #define SPI2_SCLK PB_13 | 
| Mgiris | 0:f428b670026a | 72 | #define SPI2_NSS2 PB_12 | 
| Mgiris | 0:f428b670026a | 73 | |
| Mgiris | 0:f428b670026a | 74 | //CAN | 
| Mgiris | 0:f428b670026a | 75 | #define CAN1_RX PA_11 | 
| Mgiris | 0:f428b670026a | 76 | #define CAN1_TX PA_12 | 
| Mgiris | 0:f428b670026a | 77 | |
| Mgiris | 0:f428b670026a | 78 | //USB CDC | 
| Mgiris | 0:f428b670026a | 79 | #define USB_POS PA_12 | 
| Mgiris | 0:f428b670026a | 80 | #define USB_NEG PA_11 | 
| Mgiris | 0:f428b670026a | 81 | |
| Mgiris | 0:f428b670026a | 82 | //ADC | 
| Mgiris | 0:f428b670026a | 83 | #define Uin PA_1 | 
| Mgiris | 0:f428b670026a | 84 | #define Ubatt PA_0 | 
| Mgiris | 0:f428b670026a | 85 | |
| Mgiris | 0:f428b670026a | 86 | typedef enum { | 
| Mgiris | 0:f428b670026a | 87 | // Not connected | 
| Mgiris | 0:f428b670026a | 88 | NC = (int)0xFFFFFFFF, | 
| Mgiris | 0:f428b670026a | 89 | |
| Mgiris | 0:f428b670026a | 90 | // Ports | 
| Mgiris | 0:f428b670026a | 91 | PA_0 = 0x00, | 
| Mgiris | 0:f428b670026a | 92 | PA_1 = 0x01, | 
| Mgiris | 0:f428b670026a | 93 | PA_2 = 0x02, | 
| Mgiris | 0:f428b670026a | 94 | PA_3 = 0x03, | 
| Mgiris | 0:f428b670026a | 95 | PA_4 = 0x04, | 
| Mgiris | 0:f428b670026a | 96 | PA_5 = 0x05, | 
| Mgiris | 0:f428b670026a | 97 | PA_6 = 0x06, | 
| Mgiris | 0:f428b670026a | 98 | PA_7 = 0x07, | 
| Mgiris | 0:f428b670026a | 99 | PA_8 = 0x08, | 
| Mgiris | 0:f428b670026a | 100 | PA_9 = 0x09, | 
| Mgiris | 0:f428b670026a | 101 | PA_10 = 0x0A, | 
| Mgiris | 0:f428b670026a | 102 | PA_11 = 0x0B, | 
| Mgiris | 0:f428b670026a | 103 | PA_12 = 0x0C, | 
| Mgiris | 0:f428b670026a | 104 | PA_13 = NC, | 
| Mgiris | 0:f428b670026a | 105 | PA_14 = NC, | 
| Mgiris | 0:f428b670026a | 106 | PA_15 = 0x0F, | 
| Mgiris | 0:f428b670026a | 107 | |
| Mgiris | 0:f428b670026a | 108 | PB_0 = 0x10, | 
| Mgiris | 0:f428b670026a | 109 | PB_1 = 0x11, | 
| Mgiris | 0:f428b670026a | 110 | PB_2 = NC, | 
| Mgiris | 0:f428b670026a | 111 | PB_3 = 0x13, | 
| Mgiris | 0:f428b670026a | 112 | PB_4 = 0x14, | 
| Mgiris | 0:f428b670026a | 113 | PB_5 = 0x15, | 
| Mgiris | 0:f428b670026a | 114 | PB_6 = 0x16, | 
| Mgiris | 0:f428b670026a | 115 | PB_7 = 0x17, | 
| Mgiris | 0:f428b670026a | 116 | PB_8 = 0x18, | 
| Mgiris | 0:f428b670026a | 117 | PB_9 = 0x19, | 
| Mgiris | 0:f428b670026a | 118 | PB_10 = 0x1A, | 
| Mgiris | 0:f428b670026a | 119 | PB_11 = 0x1B, | 
| Mgiris | 0:f428b670026a | 120 | PB_12 = 0x1C, | 
| Mgiris | 0:f428b670026a | 121 | PB_13 = 0x1D, | 
| Mgiris | 0:f428b670026a | 122 | PB_14 = 0x1E, | 
| Mgiris | 0:f428b670026a | 123 | PB_15 = 0x1F, | 
| Mgiris | 0:f428b670026a | 124 | |
| Mgiris | 0:f428b670026a | 125 | PC_0 = NC, | 
| Mgiris | 0:f428b670026a | 126 | PC_1 = NC, | 
| Mgiris | 0:f428b670026a | 127 | PC_2 = NC, | 
| Mgiris | 0:f428b670026a | 128 | PC_3 = NC, | 
| Mgiris | 0:f428b670026a | 129 | PC_4 = NC, | 
| Mgiris | 0:f428b670026a | 130 | PC_5 = NC, | 
| Mgiris | 0:f428b670026a | 131 | PC_6 = NC, | 
| Mgiris | 0:f428b670026a | 132 | PC_7 = NC, | 
| Mgiris | 0:f428b670026a | 133 | PC_8 = NC, | 
| Mgiris | 0:f428b670026a | 134 | PC_9 = NC, | 
| Mgiris | 0:f428b670026a | 135 | PC_10 = NC, | 
| Mgiris | 0:f428b670026a | 136 | PC_11 = NC, | 
| Mgiris | 0:f428b670026a | 137 | PC_12 = NC, | 
| Mgiris | 0:f428b670026a | 138 | PC_13 = 0x2D, | 
| Mgiris | 0:f428b670026a | 139 | PC_14 = 0x2E, | 
| Mgiris | 0:f428b670026a | 140 | PC_15 = 0x2F, | 
| Mgiris | 0:f428b670026a | 141 | |
| Mgiris | 0:f428b670026a | 142 | PD_2 = NC, | 
| Mgiris | 0:f428b670026a | 143 | |
| Mgiris | 0:f428b670026a | 144 | // ADC internal channels | 
| Mgiris | 0:f428b670026a | 145 | ADC_TEMP = 0xF0, | 
| Mgiris | 0:f428b670026a | 146 | ADC_VREF = 0xF1, | 
| Mgiris | 0:f428b670026a | 147 | |
| Mgiris | 0:f428b670026a | 148 | // Arduino connector namings | 
| Mgiris | 0:f428b670026a | 149 | A0 = PA_0, | 
| Mgiris | 0:f428b670026a | 150 | A1 = PA_1, | 
| Mgiris | 0:f428b670026a | 151 | A2 = PA_4, | 
| Mgiris | 0:f428b670026a | 152 | A3 = PB_0, | 
| Mgiris | 0:f428b670026a | 153 | A4 = NC, | 
| Mgiris | 0:f428b670026a | 154 | A5 = NC, | 
| Mgiris | 0:f428b670026a | 155 | D0 = PA_3, | 
| Mgiris | 0:f428b670026a | 156 | D1 = PA_2, | 
| Mgiris | 0:f428b670026a | 157 | D2 = PA_10, | 
| Mgiris | 0:f428b670026a | 158 | D3 = PB_3, | 
| Mgiris | 0:f428b670026a | 159 | D4 = PB_5, | 
| Mgiris | 0:f428b670026a | 160 | D5 = PB_4, | 
| Mgiris | 0:f428b670026a | 161 | D6 = PB_10, | 
| Mgiris | 0:f428b670026a | 162 | D7 = PA_8, | 
| Mgiris | 0:f428b670026a | 163 | D8 = PA_9, | 
| Mgiris | 0:f428b670026a | 164 | D9 = NC, | 
| Mgiris | 0:f428b670026a | 165 | D10 = PB_6, | 
| Mgiris | 0:f428b670026a | 166 | D11 = PA_7, | 
| Mgiris | 0:f428b670026a | 167 | D12 = PA_6, | 
| Mgiris | 0:f428b670026a | 168 | D13 = PA_5, | 
| Mgiris | 0:f428b670026a | 169 | D14 = PB_9, | 
| Mgiris | 0:f428b670026a | 170 | D15 = PB_8, | 
| Mgiris | 0:f428b670026a | 171 | |
| Mgiris | 0:f428b670026a | 172 | // Generic signals namings | 
| Mgiris | 0:f428b670026a | 173 | Red_Led = NC, | 
| Mgiris | 0:f428b670026a | 174 | Green_Led = PC_13, | 
| Mgiris | 0:f428b670026a | 175 | Blue_Led = NC, | 
| Mgiris | 0:f428b670026a | 176 | LED1 = PC_13, | 
| Mgiris | 0:f428b670026a | 177 | LED2 = NC, | 
| Mgiris | 0:f428b670026a | 178 | LED3 = NC, | 
| Mgiris | 0:f428b670026a | 179 | LED4 = NC, | 
| Mgiris | 0:f428b670026a | 180 | USER_BUTTON = NC, | 
| Mgiris | 0:f428b670026a | 181 | SERIAL_TX = PA_2, | 
| Mgiris | 0:f428b670026a | 182 | SERIAL_RX = PA_3, | 
| Mgiris | 0:f428b670026a | 183 | USBTX = PA_12, | 
| Mgiris | 0:f428b670026a | 184 | USBRX = PA_11, | 
| Mgiris | 0:f428b670026a | 185 | CANRX = PB_8, | 
| Mgiris | 0:f428b670026a | 186 | CANTX = PB_9, | 
| Mgiris | 0:f428b670026a | 187 | I2C_SCL = PB_6, | 
| Mgiris | 0:f428b670026a | 188 | I2C_SDA = PB_7, | 
| Mgiris | 0:f428b670026a | 189 | SPI_MOSI = PA_7, | 
| Mgiris | 0:f428b670026a | 190 | SPI_MISO = PA_6, | 
| Mgiris | 0:f428b670026a | 191 | SPI_SCK = PA_5, | 
| Mgiris | 0:f428b670026a | 192 | SPI_CS = PA_4, | 
| Mgiris | 0:f428b670026a | 193 | TRACE_SWO = PB_3, | 
| Mgiris | 0:f428b670026a | 194 | SWO = PB_3 | 
| Mgiris | 0:f428b670026a | 195 | } PinName; | 
| Mgiris | 0:f428b670026a | 196 | |
| Mgiris | 0:f428b670026a | 197 | #ifdef __cplusplus | 
| Mgiris | 0:f428b670026a | 198 | } | 
| Mgiris | 0:f428b670026a | 199 | #endif | 
| Mgiris | 0:f428b670026a | 200 | |
| Mgiris | 0:f428b670026a | 201 | #endif |