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:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
mbed library. Release version 164

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 171:3a7713b1edbc 1 /* mbed Microcontroller Library
AnnaBridge 171:3a7713b1edbc 2 * Copyright (c) 2006-2013 ARM Limited
AnnaBridge 171:3a7713b1edbc 3 *
AnnaBridge 171:3a7713b1edbc 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 171:3a7713b1edbc 5 * you may not use this file except in compliance with the License.
AnnaBridge 171:3a7713b1edbc 6 * You may obtain a copy of the License at
AnnaBridge 171:3a7713b1edbc 7 *
AnnaBridge 171:3a7713b1edbc 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 171:3a7713b1edbc 9 *
AnnaBridge 171:3a7713b1edbc 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 171:3a7713b1edbc 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 171:3a7713b1edbc 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 171:3a7713b1edbc 13 * See the License for the specific language governing permissions and
AnnaBridge 171:3a7713b1edbc 14 * limitations under the License.
AnnaBridge 171:3a7713b1edbc 15 */
AnnaBridge 171:3a7713b1edbc 16 #ifndef MBED_PINNAMES_H
AnnaBridge 171:3a7713b1edbc 17 #define MBED_PINNAMES_H
AnnaBridge 171:3a7713b1edbc 18
AnnaBridge 171:3a7713b1edbc 19 #include "cmsis.h"
AnnaBridge 171:3a7713b1edbc 20
AnnaBridge 171:3a7713b1edbc 21 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 22 extern "C" {
AnnaBridge 171:3a7713b1edbc 23 #endif
AnnaBridge 171:3a7713b1edbc 24
AnnaBridge 171:3a7713b1edbc 25 typedef enum {
AnnaBridge 171:3a7713b1edbc 26 PIN_INPUT,
AnnaBridge 171:3a7713b1edbc 27 PIN_OUTPUT
AnnaBridge 171:3a7713b1edbc 28 } PinDirection;
AnnaBridge 171:3a7713b1edbc 29
AnnaBridge 171:3a7713b1edbc 30 #define PORT_SHIFT 5
AnnaBridge 171:3a7713b1edbc 31
AnnaBridge 171:3a7713b1edbc 32 typedef enum {
AnnaBridge 171:3a7713b1edbc 33 // LPC Pin Names
AnnaBridge 171:3a7713b1edbc 34 P0_0 = LPC_GPIO0_BASE,
AnnaBridge 171:3a7713b1edbc 35 P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31,
AnnaBridge 171:3a7713b1edbc 36 P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31,
AnnaBridge 171:3a7713b1edbc 37 P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15, P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23, P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31,
AnnaBridge 171:3a7713b1edbc 38 P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15, P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23, P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31,
AnnaBridge 171:3a7713b1edbc 39 P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15, P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23, P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31,
AnnaBridge 171:3a7713b1edbc 40
AnnaBridge 171:3a7713b1edbc 41 // mbed DIP Pin Names
AnnaBridge 171:3a7713b1edbc 42 p5 = P0_9,
AnnaBridge 171:3a7713b1edbc 43 p6 = P0_8,
AnnaBridge 171:3a7713b1edbc 44 p7 = P0_7,
AnnaBridge 171:3a7713b1edbc 45 p8 = P0_6,
AnnaBridge 171:3a7713b1edbc 46 p9 = P0_0,
AnnaBridge 171:3a7713b1edbc 47 p10 = P0_1,
AnnaBridge 171:3a7713b1edbc 48 p11 = P0_18,
AnnaBridge 171:3a7713b1edbc 49 p12 = P0_17,
AnnaBridge 171:3a7713b1edbc 50 p13 = P0_15,
AnnaBridge 171:3a7713b1edbc 51 p14 = P0_16,
AnnaBridge 171:3a7713b1edbc 52 p15 = P0_23,
AnnaBridge 171:3a7713b1edbc 53 p16 = P0_24,
AnnaBridge 171:3a7713b1edbc 54 p17 = P0_25,
AnnaBridge 171:3a7713b1edbc 55 p18 = P0_26,
AnnaBridge 171:3a7713b1edbc 56 p19 = P1_30,
AnnaBridge 171:3a7713b1edbc 57 p20 = P1_31,
AnnaBridge 171:3a7713b1edbc 58 #if defined(TARGET_LPC1769)
AnnaBridge 171:3a7713b1edbc 59 p21 = P0_2,
AnnaBridge 171:3a7713b1edbc 60 p22 = P0_3,
AnnaBridge 171:3a7713b1edbc 61 p23 = P0_21,
AnnaBridge 171:3a7713b1edbc 62 p24 = P0_22,
AnnaBridge 171:3a7713b1edbc 63 p25 = P0_27,
AnnaBridge 171:3a7713b1edbc 64 p26 = P0_28,
AnnaBridge 171:3a7713b1edbc 65 p27 = P2_13,
AnnaBridge 171:3a7713b1edbc 66
AnnaBridge 171:3a7713b1edbc 67 p38 = P0_4,
AnnaBridge 171:3a7713b1edbc 68 p39 = P0_5,
AnnaBridge 171:3a7713b1edbc 69 p40 = P0_10,
AnnaBridge 171:3a7713b1edbc 70 p41 = P0_11,
AnnaBridge 171:3a7713b1edbc 71 p42 = P2_0,
AnnaBridge 171:3a7713b1edbc 72 p43 = P2_1,
AnnaBridge 171:3a7713b1edbc 73 p44 = P2_2,
AnnaBridge 171:3a7713b1edbc 74 p45 = P2_3,
AnnaBridge 171:3a7713b1edbc 75 p46 = P2_4,
AnnaBridge 171:3a7713b1edbc 76 p47 = P2_5,
AnnaBridge 171:3a7713b1edbc 77 p48 = P2_6,
AnnaBridge 171:3a7713b1edbc 78 p49 = P2_7,
AnnaBridge 171:3a7713b1edbc 79 p50 = P2_8,
AnnaBridge 171:3a7713b1edbc 80 p51 = P2_10,
AnnaBridge 171:3a7713b1edbc 81 p52 = P2_11,
AnnaBridge 171:3a7713b1edbc 82 p53 = P2_12,
AnnaBridge 171:3a7713b1edbc 83 #else
AnnaBridge 171:3a7713b1edbc 84 p21 = P2_5,
AnnaBridge 171:3a7713b1edbc 85 p22 = P2_4,
AnnaBridge 171:3a7713b1edbc 86 p23 = P2_3,
AnnaBridge 171:3a7713b1edbc 87 p24 = P2_2,
AnnaBridge 171:3a7713b1edbc 88 p25 = P2_1,
AnnaBridge 171:3a7713b1edbc 89 p26 = P2_0,
AnnaBridge 171:3a7713b1edbc 90 p27 = P0_11,
AnnaBridge 171:3a7713b1edbc 91 p28 = P0_10,
AnnaBridge 171:3a7713b1edbc 92 p29 = P0_5,
AnnaBridge 171:3a7713b1edbc 93 p30 = P0_4,
AnnaBridge 171:3a7713b1edbc 94 #endif
AnnaBridge 171:3a7713b1edbc 95
AnnaBridge 171:3a7713b1edbc 96 // Other mbed Pin Names
AnnaBridge 171:3a7713b1edbc 97 #ifdef MCB1700
AnnaBridge 171:3a7713b1edbc 98 LED1 = P1_28,
AnnaBridge 171:3a7713b1edbc 99 LED2 = P1_29,
AnnaBridge 171:3a7713b1edbc 100 LED3 = P1_31,
AnnaBridge 171:3a7713b1edbc 101 LED4 = P2_2,
AnnaBridge 171:3a7713b1edbc 102 #elif defined(TARGET_LPC1769)
AnnaBridge 171:3a7713b1edbc 103 LED1 = P0_22,
AnnaBridge 171:3a7713b1edbc 104 LED2 = P0_22,
AnnaBridge 171:3a7713b1edbc 105 LED3 = P0_22,
AnnaBridge 171:3a7713b1edbc 106 LED4 = P0_22,
AnnaBridge 171:3a7713b1edbc 107 #else
AnnaBridge 171:3a7713b1edbc 108 LED1 = P1_18,
AnnaBridge 171:3a7713b1edbc 109 LED2 = P1_20,
AnnaBridge 171:3a7713b1edbc 110 LED3 = P1_21,
AnnaBridge 171:3a7713b1edbc 111 LED4 = P1_23,
AnnaBridge 171:3a7713b1edbc 112 #endif
AnnaBridge 171:3a7713b1edbc 113 USBTX = P0_2,
AnnaBridge 171:3a7713b1edbc 114 USBRX = P0_3,
AnnaBridge 171:3a7713b1edbc 115
AnnaBridge 171:3a7713b1edbc 116 // Arch Pro Pin Names
AnnaBridge 171:3a7713b1edbc 117 D0 = P4_29,
AnnaBridge 171:3a7713b1edbc 118 D1 = P4_28,
AnnaBridge 171:3a7713b1edbc 119 D2 = P0_4,
AnnaBridge 171:3a7713b1edbc 120 D3 = P0_5,
AnnaBridge 171:3a7713b1edbc 121 D4 = P2_2,
AnnaBridge 171:3a7713b1edbc 122 D5 = P2_3,
AnnaBridge 171:3a7713b1edbc 123 D6 = P2_4,
AnnaBridge 171:3a7713b1edbc 124 D7 = P2_5,
AnnaBridge 171:3a7713b1edbc 125 D8 = P0_0,
AnnaBridge 171:3a7713b1edbc 126 D9 = P0_1,
AnnaBridge 171:3a7713b1edbc 127 D10 = P0_6,
AnnaBridge 171:3a7713b1edbc 128 D11 = P0_9,
AnnaBridge 171:3a7713b1edbc 129 D12 = P0_8,
AnnaBridge 171:3a7713b1edbc 130 D13 = P0_7,
AnnaBridge 171:3a7713b1edbc 131 D14 = P0_27,
AnnaBridge 171:3a7713b1edbc 132 D15 = P0_28,
AnnaBridge 171:3a7713b1edbc 133
AnnaBridge 171:3a7713b1edbc 134 A0 = P0_23,
AnnaBridge 171:3a7713b1edbc 135 A1 = P0_24,
AnnaBridge 171:3a7713b1edbc 136 A2 = P0_25,
AnnaBridge 171:3a7713b1edbc 137 A3 = P0_26,
AnnaBridge 171:3a7713b1edbc 138 A4 = P1_30,
AnnaBridge 171:3a7713b1edbc 139 A5 = P1_31,
AnnaBridge 171:3a7713b1edbc 140
AnnaBridge 171:3a7713b1edbc 141 // Not connected
AnnaBridge 171:3a7713b1edbc 142 NC = (int)0xFFFFFFFF,
AnnaBridge 171:3a7713b1edbc 143
AnnaBridge 171:3a7713b1edbc 144 I2C_SCL0 = NC,
AnnaBridge 171:3a7713b1edbc 145 I2C_SDA0 = NC,
AnnaBridge 171:3a7713b1edbc 146 I2C_SCL1 = p10,
AnnaBridge 171:3a7713b1edbc 147 I2C_SDA1 = p9,
AnnaBridge 171:3a7713b1edbc 148 I2C_SCL2 = P0_11, // pin used by application board
AnnaBridge 171:3a7713b1edbc 149 I2C_SDA2 = P0_10, // pin used by application board
AnnaBridge 171:3a7713b1edbc 150 I2C_SCL = I2C_SCL2,
AnnaBridge 171:3a7713b1edbc 151 I2C_SDA = I2C_SDA2,
AnnaBridge 171:3a7713b1edbc 152 } PinName;
AnnaBridge 171:3a7713b1edbc 153
AnnaBridge 171:3a7713b1edbc 154 typedef enum {
AnnaBridge 171:3a7713b1edbc 155 PullUp = 0,
AnnaBridge 171:3a7713b1edbc 156 PullDown = 3,
AnnaBridge 171:3a7713b1edbc 157 PullNone = 2,
AnnaBridge 171:3a7713b1edbc 158 Repeater = 1,
AnnaBridge 171:3a7713b1edbc 159 OpenDrain = 4,
AnnaBridge 171:3a7713b1edbc 160 PullDefault = PullDown
AnnaBridge 171:3a7713b1edbc 161 } PinMode;
AnnaBridge 171:3a7713b1edbc 162
AnnaBridge 171:3a7713b1edbc 163 // version of PINCON_TypeDef using register arrays
AnnaBridge 171:3a7713b1edbc 164 typedef struct {
AnnaBridge 171:3a7713b1edbc 165 __IO uint32_t PINSEL[11];
AnnaBridge 171:3a7713b1edbc 166 uint32_t RESERVED0[5];
AnnaBridge 171:3a7713b1edbc 167 __IO uint32_t PINMODE[10];
AnnaBridge 171:3a7713b1edbc 168 __IO uint32_t PINMODE_OD[5];
AnnaBridge 171:3a7713b1edbc 169 } PINCONARRAY_TypeDef;
AnnaBridge 171:3a7713b1edbc 170
AnnaBridge 171:3a7713b1edbc 171 #define PINCONARRAY ((PINCONARRAY_TypeDef *)LPC_PINCON_BASE)
AnnaBridge 171:3a7713b1edbc 172
AnnaBridge 171:3a7713b1edbc 173 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 174 }
AnnaBridge 171:3a7713b1edbc 175 #endif
AnnaBridge 171:3a7713b1edbc 176
AnnaBridge 171:3a7713b1edbc 177 #endif