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