The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 171:3a7713b1edbc 1 /* mbed Microcontroller Library
AnnaBridge 171:3a7713b1edbc 2 *******************************************************************************
AnnaBridge 171:3a7713b1edbc 3 * Copyright (c) 2018, STMicroelectronics
AnnaBridge 171:3a7713b1edbc 4 * All rights reserved.
AnnaBridge 171:3a7713b1edbc 5 *
AnnaBridge 171:3a7713b1edbc 6 * Redistribution and use in source and binary forms, with or without
AnnaBridge 171:3a7713b1edbc 7 * modification, are permitted provided that the following conditions are met:
AnnaBridge 171:3a7713b1edbc 8 *
AnnaBridge 171:3a7713b1edbc 9 * 1. Redistributions of source code must retain the above copyright notice,
AnnaBridge 171:3a7713b1edbc 10 * this list of conditions and the following disclaimer.
AnnaBridge 171:3a7713b1edbc 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
AnnaBridge 171:3a7713b1edbc 12 * this list of conditions and the following disclaimer in the documentation
AnnaBridge 171:3a7713b1edbc 13 * and/or other materials provided with the distribution.
AnnaBridge 171:3a7713b1edbc 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
AnnaBridge 171:3a7713b1edbc 15 * may be used to endorse or promote products derived from this software
AnnaBridge 171:3a7713b1edbc 16 * without specific prior written permission.
AnnaBridge 171:3a7713b1edbc 17 *
AnnaBridge 171:3a7713b1edbc 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AnnaBridge 171:3a7713b1edbc 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
AnnaBridge 171:3a7713b1edbc 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 171:3a7713b1edbc 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
AnnaBridge 171:3a7713b1edbc 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
AnnaBridge 171:3a7713b1edbc 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
AnnaBridge 171:3a7713b1edbc 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
AnnaBridge 171:3a7713b1edbc 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
AnnaBridge 171:3a7713b1edbc 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
AnnaBridge 171:3a7713b1edbc 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 171:3a7713b1edbc 28 *******************************************************************************
AnnaBridge 171:3a7713b1edbc 29 */
AnnaBridge 171:3a7713b1edbc 30
AnnaBridge 171:3a7713b1edbc 31 #ifndef MBED_PINNAMES_H
AnnaBridge 171:3a7713b1edbc 32 #define MBED_PINNAMES_H
AnnaBridge 171:3a7713b1edbc 33
AnnaBridge 171:3a7713b1edbc 34 #include "cmsis.h"
AnnaBridge 171:3a7713b1edbc 35 #include "PinNamesTypes.h"
AnnaBridge 171:3a7713b1edbc 36
AnnaBridge 171:3a7713b1edbc 37 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 38 extern "C" {
AnnaBridge 171:3a7713b1edbc 39 #endif
AnnaBridge 171:3a7713b1edbc 40
AnnaBridge 171:3a7713b1edbc 41 typedef enum {
AnnaBridge 171:3a7713b1edbc 42 ALT0 = 0x100,
AnnaBridge 171:3a7713b1edbc 43 ALT1 = 0x200,
AnnaBridge 171:3a7713b1edbc 44 ALT2 = 0x300,
AnnaBridge 171:3a7713b1edbc 45 ALT3 = 0x400
AnnaBridge 171:3a7713b1edbc 46 } ALTx;
AnnaBridge 171:3a7713b1edbc 47
AnnaBridge 171:3a7713b1edbc 48 typedef enum {
AnnaBridge 171:3a7713b1edbc 49 PA_0 = 0x00,
AnnaBridge 171:3a7713b1edbc 50 PA_1 = 0x01,
AnnaBridge 171:3a7713b1edbc 51 PA_2 = 0x02,
AnnaBridge 171:3a7713b1edbc 52 PA_3 = 0x03,
AnnaBridge 171:3a7713b1edbc 53 PA_4 = 0x04,
AnnaBridge 171:3a7713b1edbc 54 PA_5 = 0x05,
AnnaBridge 171:3a7713b1edbc 55 PA_6 = 0x06,
AnnaBridge 171:3a7713b1edbc 56 PA_7 = 0x07,
AnnaBridge 171:3a7713b1edbc 57 PA_7_ALT0 = PA_7 | ALT0,
AnnaBridge 171:3a7713b1edbc 58 PA_8 = 0x08,
AnnaBridge 171:3a7713b1edbc 59 PA_9 = 0x09,
AnnaBridge 171:3a7713b1edbc 60 PA_10 = 0x0A,
AnnaBridge 171:3a7713b1edbc 61 PA_11 = 0x0B,
AnnaBridge 171:3a7713b1edbc 62 PA_11_ALT0 = PA_11 | ALT0,
AnnaBridge 171:3a7713b1edbc 63 PA_12 = 0x0C,
AnnaBridge 171:3a7713b1edbc 64 PA_12_ALT0 = PA_12 | ALT0,
AnnaBridge 171:3a7713b1edbc 65 PA_13 = 0x0D,
AnnaBridge 171:3a7713b1edbc 66 PA_14 = 0x0E,
AnnaBridge 171:3a7713b1edbc 67 PA_15 = 0x0F,
AnnaBridge 171:3a7713b1edbc 68
AnnaBridge 171:3a7713b1edbc 69 PB_0 = 0x10,
AnnaBridge 171:3a7713b1edbc 70 PB_1 = 0x11,
AnnaBridge 171:3a7713b1edbc 71 PB_2 = 0x12,
AnnaBridge 171:3a7713b1edbc 72 PB_3 = 0x13,
AnnaBridge 171:3a7713b1edbc 73 PB_4 = 0x14,
AnnaBridge 171:3a7713b1edbc 74 PB_5 = 0x15,
AnnaBridge 171:3a7713b1edbc 75 PB_6 = 0x16,
AnnaBridge 171:3a7713b1edbc 76 PB_7 = 0x17,
AnnaBridge 171:3a7713b1edbc 77 PB_8 = 0x18,
AnnaBridge 171:3a7713b1edbc 78 PB_9 = 0x19,
AnnaBridge 171:3a7713b1edbc 79 PB_10 = 0x1A,
AnnaBridge 171:3a7713b1edbc 80 PB_11 = 0x1B,
AnnaBridge 171:3a7713b1edbc 81 PB_12 = 0x1C,
AnnaBridge 171:3a7713b1edbc 82 PB_13 = 0x1D,
AnnaBridge 171:3a7713b1edbc 83 PB_14 = 0x1E,
AnnaBridge 171:3a7713b1edbc 84 PB_14_ALT0 = PB_14 | ALT0,
AnnaBridge 171:3a7713b1edbc 85 PB_15 = 0x1F,
AnnaBridge 171:3a7713b1edbc 86 PB_15_ALT0 = PB_15 | ALT0,
AnnaBridge 171:3a7713b1edbc 87 PB_15_ALT1 = PB_15 | ALT1,
AnnaBridge 171:3a7713b1edbc 88
AnnaBridge 171:3a7713b1edbc 89 PC_0 = 0x20,
AnnaBridge 171:3a7713b1edbc 90 PC_1 = 0x21,
AnnaBridge 171:3a7713b1edbc 91 PC_2 = 0x22,
AnnaBridge 171:3a7713b1edbc 92 PC_3 = 0x23,
AnnaBridge 171:3a7713b1edbc 93 PC_4 = 0x24,
AnnaBridge 171:3a7713b1edbc 94 PC_5 = 0x25,
AnnaBridge 171:3a7713b1edbc 95 PC_6 = 0x26,
AnnaBridge 171:3a7713b1edbc 96 PC_7 = 0x27,
AnnaBridge 171:3a7713b1edbc 97 PC_8 = 0x28,
AnnaBridge 171:3a7713b1edbc 98 PC_9 = 0x29,
AnnaBridge 171:3a7713b1edbc 99 PC_10 = 0x2A,
AnnaBridge 171:3a7713b1edbc 100 PC_11 = 0x2B,
AnnaBridge 171:3a7713b1edbc 101 PC_12 = 0x2C,
AnnaBridge 171:3a7713b1edbc 102 PC_13 = 0x2D,
AnnaBridge 171:3a7713b1edbc 103 PC_14 = 0x2E,
AnnaBridge 171:3a7713b1edbc 104 PC_15 = 0x2F,
AnnaBridge 171:3a7713b1edbc 105
AnnaBridge 171:3a7713b1edbc 106 PD_2 = 0x32,
AnnaBridge 171:3a7713b1edbc 107
AnnaBridge 171:3a7713b1edbc 108 PF_0 = 0x50,
AnnaBridge 171:3a7713b1edbc 109 PF_1 = 0x51,
AnnaBridge 171:3a7713b1edbc 110
AnnaBridge 171:3a7713b1edbc 111 // ADC internal channels
AnnaBridge 171:3a7713b1edbc 112 ADC_TEMP = 0xF0,
AnnaBridge 171:3a7713b1edbc 113 ADC_VREF = 0xF1,
AnnaBridge 171:3a7713b1edbc 114 ADC_VBAT = 0xF2,
AnnaBridge 171:3a7713b1edbc 115
AnnaBridge 171:3a7713b1edbc 116 // Arduino connector namings
AnnaBridge 171:3a7713b1edbc 117 A0 = PA_0,
AnnaBridge 171:3a7713b1edbc 118 A1 = PA_1,
AnnaBridge 171:3a7713b1edbc 119 A2 = PA_4,
AnnaBridge 171:3a7713b1edbc 120 A3 = PB_0,
AnnaBridge 171:3a7713b1edbc 121 A4 = PC_1,
AnnaBridge 171:3a7713b1edbc 122 A5 = PC_0,
AnnaBridge 171:3a7713b1edbc 123 D0 = PA_3,
AnnaBridge 171:3a7713b1edbc 124 D1 = PA_2,
AnnaBridge 171:3a7713b1edbc 125 D2 = PA_10,
AnnaBridge 171:3a7713b1edbc 126 D3 = PB_3,
AnnaBridge 171:3a7713b1edbc 127 D4 = PB_5,
AnnaBridge 171:3a7713b1edbc 128 D5 = PB_4,
AnnaBridge 171:3a7713b1edbc 129 D6 = PB_10,
AnnaBridge 171:3a7713b1edbc 130 D7 = PA_8,
AnnaBridge 171:3a7713b1edbc 131 D8 = PA_9,
AnnaBridge 171:3a7713b1edbc 132 D9 = PC_7,
AnnaBridge 171:3a7713b1edbc 133 D10 = PB_6,
AnnaBridge 171:3a7713b1edbc 134 D11 = PB_15,
AnnaBridge 171:3a7713b1edbc 135 D12 = PB_14,
AnnaBridge 171:3a7713b1edbc 136 D13 = PB_13,
AnnaBridge 171:3a7713b1edbc 137 D14 = PB_9,
AnnaBridge 171:3a7713b1edbc 138 D15 = PB_8,
AnnaBridge 171:3a7713b1edbc 139
AnnaBridge 171:3a7713b1edbc 140 // STDIO for console print
AnnaBridge 171:3a7713b1edbc 141 #ifdef MBED_CONF_TARGET_STDIO_UART_TX
AnnaBridge 171:3a7713b1edbc 142 STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
AnnaBridge 171:3a7713b1edbc 143 #else
AnnaBridge 171:3a7713b1edbc 144 STDIO_UART_TX = PA_2,
AnnaBridge 171:3a7713b1edbc 145 #endif
AnnaBridge 171:3a7713b1edbc 146 #ifdef MBED_CONF_TARGET_STDIO_UART_RX
AnnaBridge 171:3a7713b1edbc 147 STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
AnnaBridge 171:3a7713b1edbc 148 #else
AnnaBridge 171:3a7713b1edbc 149 STDIO_UART_RX = PA_3,
AnnaBridge 171:3a7713b1edbc 150 #endif
AnnaBridge 171:3a7713b1edbc 151
AnnaBridge 171:3a7713b1edbc 152 // Generic signals namings
AnnaBridge 171:3a7713b1edbc 153 LED1 = PB_13,
AnnaBridge 171:3a7713b1edbc 154 LED2 = PB_13,
AnnaBridge 171:3a7713b1edbc 155 LED3 = PB_13,
AnnaBridge 171:3a7713b1edbc 156 LED4 = PB_13,
AnnaBridge 171:3a7713b1edbc 157 USER_BUTTON = PC_13,
AnnaBridge 171:3a7713b1edbc 158 // Standardized button names
AnnaBridge 171:3a7713b1edbc 159 BUTTON1 = USER_BUTTON,
AnnaBridge 171:3a7713b1edbc 160 SERIAL_TX = STDIO_UART_TX,
AnnaBridge 171:3a7713b1edbc 161 SERIAL_RX = STDIO_UART_RX,
AnnaBridge 171:3a7713b1edbc 162 USBTX = STDIO_UART_TX,
AnnaBridge 171:3a7713b1edbc 163 USBRX = STDIO_UART_RX,
AnnaBridge 171:3a7713b1edbc 164 I2C_SCL = PB_8,
AnnaBridge 171:3a7713b1edbc 165 I2C_SDA = PB_9,
AnnaBridge 171:3a7713b1edbc 166 SPI_MOSI = PB_15,
AnnaBridge 171:3a7713b1edbc 167 SPI_MISO = PB_14,
AnnaBridge 171:3a7713b1edbc 168 SPI_SCK = PB_13,
AnnaBridge 171:3a7713b1edbc 169 SPI_CS = PB_6,
AnnaBridge 171:3a7713b1edbc 170 PWM_OUT = PB_4,
AnnaBridge 171:3a7713b1edbc 171
AnnaBridge 171:3a7713b1edbc 172 /**** USB pins ****/
AnnaBridge 171:3a7713b1edbc 173 USB_DM = PA_11,
AnnaBridge 171:3a7713b1edbc 174 USB_DP = PA_12,
AnnaBridge 171:3a7713b1edbc 175
AnnaBridge 171:3a7713b1edbc 176 /**** OSCILLATOR pins ****/
AnnaBridge 171:3a7713b1edbc 177 RCC_OSC32_IN = PC_14,
AnnaBridge 171:3a7713b1edbc 178 RCC_OSC32_OUT = PC_15,
AnnaBridge 171:3a7713b1edbc 179 RCC_OSC_IN = PF_0,
AnnaBridge 171:3a7713b1edbc 180 RCC_OSC_OUT = PF_1,
AnnaBridge 171:3a7713b1edbc 181
AnnaBridge 171:3a7713b1edbc 182 /**** DEBUG pins ****/
AnnaBridge 171:3a7713b1edbc 183 SYS_JTCK_SWCLK = PA_14,
AnnaBridge 171:3a7713b1edbc 184 SYS_JTDI = PA_15,
AnnaBridge 171:3a7713b1edbc 185 SYS_JTDO_TRACESWO = PB_3,
AnnaBridge 171:3a7713b1edbc 186 SYS_JTMS_SWDIO = PA_13,
AnnaBridge 171:3a7713b1edbc 187 SYS_NJTRST = PB_4,
AnnaBridge 171:3a7713b1edbc 188 SYS_WKUP1 = PA_0,
AnnaBridge 171:3a7713b1edbc 189 SYS_WKUP2 = PC_13,
AnnaBridge 171:3a7713b1edbc 190
AnnaBridge 171:3a7713b1edbc 191 // Not connected
AnnaBridge 171:3a7713b1edbc 192 NC = (int)0xFFFFFFFF
AnnaBridge 171:3a7713b1edbc 193 } PinName;
AnnaBridge 171:3a7713b1edbc 194
AnnaBridge 171:3a7713b1edbc 195 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 196 }
AnnaBridge 171:3a7713b1edbc 197 #endif
AnnaBridge 171:3a7713b1edbc 198
AnnaBridge 171:3a7713b1edbc 199 #endif