4CV4_2do_2019 / Mbed 2 deprecated STM32-F103C8_Plantilla_1

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PinNames.h Source File

PinNames.h

00001 /* mbed Microcontroller Library
00002  *******************************************************************************
00003  * Copyright (c) 2014, STMicroelectronics
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  * modification, are permitted provided that the following conditions are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright notice,
00011  *    this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright notice,
00013  *    this list of conditions and the following disclaimer in the documentation
00014  *    and/or other materials provided with the distribution.
00015  * 3. Neither the name of STMicroelectronics nor the names of its contributors
00016  *    may be used to endorse or promote products derived from this software
00017  *    without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00020  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00023  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00024  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00025  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00026  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00027  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *******************************************************************************
00030  
00031  */
00032 #ifndef MBED_PINNAMES_H
00033 #define MBED_PINNAMES_H
00034 
00035 #include "cmsis.h"
00036 #include "PinNamesTypes.h"
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 //UART to AMB8826
00043 #define TXD1      PA_9
00044 #define RXD1      PA_10
00045 #define CTS1      PA_11
00046 int baudRate = 115200;
00047 
00048 //UART to Silicon Labs CP210x
00049 #define TXD2      PA_2
00050 #define RXD2      PA_3
00051 
00052 //UART to FTDI
00053 #define TXD3      PB_10
00054 #define RXD3      PB_11
00055 
00056 //I2C
00057 #define I2C1_SCL  PB_6
00058 #define I2C1_SDA  PB_7
00059 
00060 #define I2C2_SCL  PB_10
00061 #define I2C2_SDA  PB_11
00062 
00063 //SPI
00064 #define SPI1_MOSI PA_7
00065 #define SPI1_MISO PA_6
00066 #define SPI1_SCLK PA_5
00067 #define SPI1_NSS1 PA_4
00068 #define SDsel     PA_4
00069 
00070 #define SPI2_MOSI PB_15
00071 #define SPI2_MISO PB_14
00072 #define SPI2_SCLK PB_13
00073 #define SPI2_NSS2 PB_12
00074 
00075 //CAN
00076 #define CAN1_RX   PA_11
00077 #define CAN1_TX   PA_12
00078 
00079 //USB   CDC
00080 #define USB_POS   PA_12
00081 #define USB_NEG   PA_11
00082 
00083 //ADC
00084 #define Uin       PA_1
00085 #define Ubatt     PA_0
00086 
00087 typedef enum {
00088     // Not connected
00089     NC = (int)0xFFFFFFFF,
00090 
00091     // Ports
00092     PA_0  = 0x00,
00093     PA_1  = 0x01,
00094     PA_2  = 0x02,
00095     PA_3  = 0x03,
00096     PA_4  = 0x04,
00097     PA_5  = 0x05,
00098     PA_6  = 0x06,
00099     PA_7  = 0x07,
00100     PA_8  = 0x08,
00101     PA_9  = 0x09,
00102     PA_10 = 0x0A,
00103     PA_11 = 0x0B,
00104     PA_12 = 0x0C,
00105     PA_13 = NC,
00106     PA_14 = NC,
00107     PA_15 = 0x0F,
00108 
00109     PB_0  = 0x10,
00110     PB_1  = 0x11,
00111     PB_2  = NC,
00112     PB_3  = 0x13,
00113     PB_4  = 0x14,
00114     PB_5  = 0x15,
00115     PB_6  = 0x16,
00116     PB_7  = 0x17,
00117     PB_8  = 0x18,
00118     PB_9  = 0x19,
00119     PB_10 = 0x1A,
00120     PB_11 = 0x1B,
00121     PB_12 = 0x1C,
00122     PB_13 = 0x1D,
00123     PB_14 = 0x1E,
00124     PB_15 = 0x1F,
00125 
00126     PC_0  = NC,
00127     PC_1  = NC,
00128     PC_2  = NC,
00129     PC_3  = NC,
00130     PC_4  = NC,
00131     PC_5  = NC,
00132     PC_6  = NC,
00133     PC_7  = NC,
00134     PC_8  = NC,
00135     PC_9  = NC,
00136     PC_10 = NC,
00137     PC_11 = NC,
00138     PC_12 = NC,
00139     PC_13 = 0x2D,
00140     PC_14 = 0x2E,
00141     PC_15 = 0x2F,
00142 
00143     PD_2  = NC,
00144 
00145     // ADC internal channels
00146     ADC_TEMP = 0xF0,
00147     ADC_VREF = 0xF1,
00148 
00149     // Arduino connector namings
00150     A0          = PA_0,
00151     A1          = PA_1,
00152     A2          = PA_4,
00153     A3          = PB_0,
00154     A4          = NC,
00155     A5          = NC,
00156     D0          = PA_3,
00157     D1          = PA_2,
00158     D2          = PA_10,
00159     D3          = PB_3,
00160     D4          = PB_5,
00161     D5          = PB_4,
00162     D6          = PB_10,
00163     D7          = PA_8,
00164     D8          = PA_9,
00165     D9          = NC,
00166     D10         = PB_6,
00167     D11         = PA_7,
00168     D12         = PA_6,
00169     D13         = PA_5,
00170     D14         = PB_9,
00171     D15         = PB_8,
00172 
00173     // Generic signals namings
00174     Red_Led     = NC,
00175     Green_Led   = PC_13,
00176     Blue_Led    = NC,
00177     LED1        = PC_13,
00178     LED2        = NC,
00179     LED3        = NC,
00180     LED4        = NC,
00181     USER_BUTTON = NC,    
00182     SERIAL_TX   = PA_2,
00183     SERIAL_RX   = PA_3,
00184     USBTX       = PA_12,
00185     USBRX       = PA_11,
00186     CANRX       = PB_8,    
00187     CANTX       = PB_9,
00188     I2C_SCL     = PB_6,
00189     I2C_SDA     = PB_7,
00190     SPI_MOSI    = PA_7,
00191     SPI_MISO    = PA_6,
00192     SPI_SCK     = PA_5,
00193     SPI_CS      = PA_4,
00194     TRACE_SWO   = PB_3,
00195     SWO         = PB_3
00196 } PinName;
00197 
00198 #ifdef __cplusplus
00199 }
00200 #endif
00201 
00202 #endif