mbed support for STM32F103C8T6 (Blue Pill) boards

Dependents:   STM32F103C8T6_nRF24L01P_Hello_World Serial_over_Ethernet STM32F103C8T6_LoRaWAN-lmic-app STM32F103C8T6_WebUSBDFU ... more

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  *
00009  * 1. Redistributions of source code must retain the above copyright notice,
00010  *    this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright notice,
00012  *    this list of conditions and the following disclaimer in the documentation
00013  *    and/or other materials provided with the distribution.
00014  * 3. Neither the name of STMicroelectronics nor the names of its contributors
00015  *    may be used to endorse or promote products derived from this software
00016  *    without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00022  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00024  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00025  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00026  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00027  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  *******************************************************************************
00029  *
00030  * Modified by Zoltan Hudak 2017
00031  *
00032  */
00033 #ifndef MBED_PINNAMES_H
00034 #define MBED_PINNAMES_H
00035 
00036 #include "cmsis.h"
00037 #include "PinNamesTypes.h"
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 typedef enum {
00044     // Not connected
00045     NC = (int)0xFFFFFFFF,
00046 
00047     // Ports
00048     PA_0  = 0x00,
00049     PA_1  = 0x01,
00050     PA_2  = 0x02,
00051     PA_3  = 0x03,
00052     PA_4  = 0x04,
00053     PA_5  = 0x05,
00054     PA_6  = 0x06,
00055     PA_7  = 0x07,
00056     PA_8  = 0x08,
00057     PA_9  = 0x09,
00058     PA_10 = 0x0A,
00059     PA_11 = 0x0B,
00060     PA_12 = 0x0C,
00061     PA_13 = NC,
00062     PA_14 = NC,
00063     PA_15 = 0x0F,
00064 
00065     PB_0  = 0x10,
00066     PB_1  = 0x11,
00067     PB_2  = NC,
00068     PB_3  = 0x13,
00069     PB_4  = 0x14,
00070     PB_5  = 0x15,
00071     PB_6  = 0x16,
00072     PB_7  = 0x17,
00073     PB_8  = 0x18,
00074     PB_9  = 0x19,
00075     PB_10 = 0x1A,
00076     PB_11 = 0x1B,
00077     PB_12 = 0x1C,
00078     PB_13 = 0x1D,
00079     PB_14 = 0x1E,
00080     PB_15 = 0x1F,
00081 
00082     PC_0  = NC,
00083     PC_1  = NC,
00084     PC_2  = NC,
00085     PC_3  = NC,
00086     PC_4  = NC,
00087     PC_5  = NC,
00088     PC_6  = NC,
00089     PC_7  = NC,
00090     PC_8  = NC,
00091     PC_9  = NC,
00092     PC_10 = NC,
00093     PC_11 = NC,
00094     PC_12 = NC,
00095     PC_13 = 0x2D,
00096     PC_14 = 0x2E,
00097     PC_15 = 0x2F,
00098 
00099     PD_2  = NC,
00100 
00101     // ADC internal channels
00102     ADC_TEMP = 0xF0,
00103     ADC_VREF = 0xF1,
00104 
00105     // Arduino connector namings
00106     A0          = PA_0,
00107     A1          = PA_1,
00108     A2          = PA_4,
00109     A3          = PB_0,
00110     A4          = NC,
00111     A5          = NC,
00112     D0          = PA_3,
00113     D1          = PA_2,
00114     D2          = PA_10,
00115     D3          = PB_3,
00116     D4          = PB_5,
00117     D5          = PB_4,
00118     D6          = PB_10,
00119     D7          = PA_8,
00120     D8          = PA_9,
00121     D9          = NC,
00122     D10         = PB_6,
00123     D11         = PA_7,
00124     D12         = PA_6,
00125     D13         = PA_5,
00126     D14         = PB_9,
00127     D15         = PB_8,
00128 
00129     // Generic signals namings
00130     LED1        = PC_13,
00131     LED2        = NC,
00132     LED3        = NC,
00133     LED4        = NC,
00134     USER_BUTTON = NC,
00135     SERIAL_TX   = PA_2,
00136     SERIAL_RX   = PA_3,
00137     USBTX       = PA_2,
00138     USBRX       = PA_3,
00139     I2C_SCL     = PB_8,
00140     I2C_SDA     = PB_9,
00141     SPI_MOSI    = PA_7,
00142     SPI_MISO    = PA_6,
00143     SPI_SCK     = PA_5,
00144     SPI_CS      = PB_6,
00145     PWM_OUT     = PB_3
00146 } PinName;
00147 
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151 
00152 #endif