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 * 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 // LPC11U Pin Names
AnnaBridge 171:3a7713b1edbc 34 P0_0 = 0,
AnnaBridge 171:3a7713b1edbc 35 P0_1 = 1,
AnnaBridge 171:3a7713b1edbc 36 P0_2 = 2,
AnnaBridge 171:3a7713b1edbc 37 P0_3 = 3,
AnnaBridge 171:3a7713b1edbc 38 P0_4 = 4,
AnnaBridge 171:3a7713b1edbc 39 P0_5 = 5,
AnnaBridge 171:3a7713b1edbc 40 P0_6 = 6,
AnnaBridge 171:3a7713b1edbc 41 P0_7 = 7,
AnnaBridge 171:3a7713b1edbc 42 P0_8 = 8,
AnnaBridge 171:3a7713b1edbc 43 P0_9 = 9,
AnnaBridge 171:3a7713b1edbc 44 P0_10 = 10,
AnnaBridge 171:3a7713b1edbc 45 P0_11 = 11,
AnnaBridge 171:3a7713b1edbc 46 P0_12 = 12,
AnnaBridge 171:3a7713b1edbc 47 P0_13 = 13,
AnnaBridge 171:3a7713b1edbc 48 P0_14 = 14,
AnnaBridge 171:3a7713b1edbc 49 P0_15 = 15,
AnnaBridge 171:3a7713b1edbc 50 P0_16 = 16,
AnnaBridge 171:3a7713b1edbc 51 P0_17 = 17,
AnnaBridge 171:3a7713b1edbc 52 P0_18 = 18,
AnnaBridge 171:3a7713b1edbc 53 P0_19 = 19,
AnnaBridge 171:3a7713b1edbc 54 P0_20 = 20,
AnnaBridge 171:3a7713b1edbc 55 P0_21 = 21,
AnnaBridge 171:3a7713b1edbc 56 P0_22 = 22,
AnnaBridge 171:3a7713b1edbc 57 P0_23 = 23,
AnnaBridge 171:3a7713b1edbc 58 P0_24 = 24,
AnnaBridge 171:3a7713b1edbc 59 P0_25 = 25,
AnnaBridge 171:3a7713b1edbc 60 P0_26 = 26,
AnnaBridge 171:3a7713b1edbc 61 P0_27 = 27,
AnnaBridge 171:3a7713b1edbc 62
AnnaBridge 171:3a7713b1edbc 63 P1_0 = 32,
AnnaBridge 171:3a7713b1edbc 64 P1_1 = 33,
AnnaBridge 171:3a7713b1edbc 65 P1_2 = 34,
AnnaBridge 171:3a7713b1edbc 66 P1_3 = 35,
AnnaBridge 171:3a7713b1edbc 67 P1_4 = 36,
AnnaBridge 171:3a7713b1edbc 68 P1_5 = 37,
AnnaBridge 171:3a7713b1edbc 69 P1_6 = 38,
AnnaBridge 171:3a7713b1edbc 70 P1_7 = 39,
AnnaBridge 171:3a7713b1edbc 71 P1_8 = 40,
AnnaBridge 171:3a7713b1edbc 72 P1_9 = 41,
AnnaBridge 171:3a7713b1edbc 73 P1_10 = 42,
AnnaBridge 171:3a7713b1edbc 74 P1_11 = 43,
AnnaBridge 171:3a7713b1edbc 75 P1_12 = 44,
AnnaBridge 171:3a7713b1edbc 76 P1_13 = 45,
AnnaBridge 171:3a7713b1edbc 77 P1_14 = 46,
AnnaBridge 171:3a7713b1edbc 78 P1_15 = 47,
AnnaBridge 171:3a7713b1edbc 79 P1_16 = 48,
AnnaBridge 171:3a7713b1edbc 80 P1_17 = 49,
AnnaBridge 171:3a7713b1edbc 81 P1_18 = 50,
AnnaBridge 171:3a7713b1edbc 82 P1_19 = 51,
AnnaBridge 171:3a7713b1edbc 83 P1_20 = 52,
AnnaBridge 171:3a7713b1edbc 84 P1_21 = 53,
AnnaBridge 171:3a7713b1edbc 85 P1_22 = 54,
AnnaBridge 171:3a7713b1edbc 86 P1_23 = 55,
AnnaBridge 171:3a7713b1edbc 87 P1_24 = 56,
AnnaBridge 171:3a7713b1edbc 88 P1_25 = 57,
AnnaBridge 171:3a7713b1edbc 89 P1_26 = 58,
AnnaBridge 171:3a7713b1edbc 90 P1_27 = 59,
AnnaBridge 171:3a7713b1edbc 91 P1_28 = 60,
AnnaBridge 171:3a7713b1edbc 92 P1_29 = 61,
AnnaBridge 171:3a7713b1edbc 93
AnnaBridge 171:3a7713b1edbc 94 P1_31 = 63,
AnnaBridge 171:3a7713b1edbc 95
AnnaBridge 171:3a7713b1edbc 96 // mbed DIP Pin Names
AnnaBridge 171:3a7713b1edbc 97 p5 = P0_9,
AnnaBridge 171:3a7713b1edbc 98 p6 = P0_8,
AnnaBridge 171:3a7713b1edbc 99 p7 = P1_29,
AnnaBridge 171:3a7713b1edbc 100 p8 = P0_2,
AnnaBridge 171:3a7713b1edbc 101 p9 = P1_27,
AnnaBridge 171:3a7713b1edbc 102 p10 = P1_26,
AnnaBridge 171:3a7713b1edbc 103 p11 = P1_22,
AnnaBridge 171:3a7713b1edbc 104 p12 = P1_21,
AnnaBridge 171:3a7713b1edbc 105 p13 = P1_20,
AnnaBridge 171:3a7713b1edbc 106 p14 = P1_23,
AnnaBridge 171:3a7713b1edbc 107 p15 = P0_11,
AnnaBridge 171:3a7713b1edbc 108 p16 = P0_12,
AnnaBridge 171:3a7713b1edbc 109 p17 = P0_13,
AnnaBridge 171:3a7713b1edbc 110 p18 = P0_14,
AnnaBridge 171:3a7713b1edbc 111 p19 = P0_16,
AnnaBridge 171:3a7713b1edbc 112 p20 = P0_22,
AnnaBridge 171:3a7713b1edbc 113 p21 = P0_7,
AnnaBridge 171:3a7713b1edbc 114 p22 = P0_17,
AnnaBridge 171:3a7713b1edbc 115 p23 = P1_17,
AnnaBridge 171:3a7713b1edbc 116 p24 = P1_18,
AnnaBridge 171:3a7713b1edbc 117 p25 = P1_24,
AnnaBridge 171:3a7713b1edbc 118 p26 = P1_25,
AnnaBridge 171:3a7713b1edbc 119 p27 = P0_4,
AnnaBridge 171:3a7713b1edbc 120 p28 = P0_5,
AnnaBridge 171:3a7713b1edbc 121 p29 = P1_5,
AnnaBridge 171:3a7713b1edbc 122 p30 = P1_2,
AnnaBridge 171:3a7713b1edbc 123
AnnaBridge 171:3a7713b1edbc 124 p33 = P0_3,
AnnaBridge 171:3a7713b1edbc 125 p34 = P1_15,
AnnaBridge 171:3a7713b1edbc 126 p35 = P0_20,
AnnaBridge 171:3a7713b1edbc 127 p36 = P0_21,
AnnaBridge 171:3a7713b1edbc 128
AnnaBridge 171:3a7713b1edbc 129 // Other mbed Pin Names
AnnaBridge 171:3a7713b1edbc 130 LED1 = P1_8,
AnnaBridge 171:3a7713b1edbc 131 LED2 = P1_9,
AnnaBridge 171:3a7713b1edbc 132 LED3 = P1_10,
AnnaBridge 171:3a7713b1edbc 133 LED4 = P1_11,
AnnaBridge 171:3a7713b1edbc 134
AnnaBridge 171:3a7713b1edbc 135 USBTX = P0_19,
AnnaBridge 171:3a7713b1edbc 136 USBRX = P0_18,
AnnaBridge 171:3a7713b1edbc 137
AnnaBridge 171:3a7713b1edbc 138 // for Arch V1.1
AnnaBridge 171:3a7713b1edbc 139 D0 = P0_18,
AnnaBridge 171:3a7713b1edbc 140 D1 = P0_19,
AnnaBridge 171:3a7713b1edbc 141 D2 = P0_17,
AnnaBridge 171:3a7713b1edbc 142 D3 = P1_17,
AnnaBridge 171:3a7713b1edbc 143 D4 = P1_18,
AnnaBridge 171:3a7713b1edbc 144 D5 = P1_24,
AnnaBridge 171:3a7713b1edbc 145 D6 = P1_25,
AnnaBridge 171:3a7713b1edbc 146 D7 = P1_5,
AnnaBridge 171:3a7713b1edbc 147 D8 = P1_26,
AnnaBridge 171:3a7713b1edbc 148 D9 = P1_27,
AnnaBridge 171:3a7713b1edbc 149 D10 = P0_2,
AnnaBridge 171:3a7713b1edbc 150 D11 = P0_9, // P1_29 for Arch V1.0
AnnaBridge 171:3a7713b1edbc 151 D12 = P0_8,
AnnaBridge 171:3a7713b1edbc 152 D13 = P1_29, // P0_9 for Arch V1.0
AnnaBridge 171:3a7713b1edbc 153
AnnaBridge 171:3a7713b1edbc 154 D14 = P0_5,
AnnaBridge 171:3a7713b1edbc 155 D15 = P0_4,
AnnaBridge 171:3a7713b1edbc 156
AnnaBridge 171:3a7713b1edbc 157 A0 = P0_11,
AnnaBridge 171:3a7713b1edbc 158 A1 = P0_12,
AnnaBridge 171:3a7713b1edbc 159 A2 = P0_13,
AnnaBridge 171:3a7713b1edbc 160 A3 = P0_14,
AnnaBridge 171:3a7713b1edbc 161 A4 = P0_16,
AnnaBridge 171:3a7713b1edbc 162 A5 = P0_22,
AnnaBridge 171:3a7713b1edbc 163
AnnaBridge 171:3a7713b1edbc 164 I2C_SCL = D15,
AnnaBridge 171:3a7713b1edbc 165 I2C_SDA = D14,
AnnaBridge 171:3a7713b1edbc 166
AnnaBridge 171:3a7713b1edbc 167 // Not connected
AnnaBridge 171:3a7713b1edbc 168 NC = (int)0xFFFFFFFF,
AnnaBridge 171:3a7713b1edbc 169 } PinName;
AnnaBridge 171:3a7713b1edbc 170
AnnaBridge 171:3a7713b1edbc 171 typedef enum {
AnnaBridge 171:3a7713b1edbc 172 CHANNEL0 = FLEX_INT0_IRQn,
AnnaBridge 171:3a7713b1edbc 173 CHANNEL1 = FLEX_INT1_IRQn,
AnnaBridge 171:3a7713b1edbc 174 CHANNEL2 = FLEX_INT2_IRQn,
AnnaBridge 171:3a7713b1edbc 175 CHANNEL3 = FLEX_INT3_IRQn,
AnnaBridge 171:3a7713b1edbc 176 CHANNEL4 = FLEX_INT4_IRQn,
AnnaBridge 171:3a7713b1edbc 177 CHANNEL5 = FLEX_INT5_IRQn,
AnnaBridge 171:3a7713b1edbc 178 CHANNEL6 = FLEX_INT6_IRQn,
AnnaBridge 171:3a7713b1edbc 179 CHANNEL7 = FLEX_INT7_IRQn
AnnaBridge 171:3a7713b1edbc 180 } Channel;
AnnaBridge 171:3a7713b1edbc 181
AnnaBridge 171:3a7713b1edbc 182 typedef enum {
AnnaBridge 171:3a7713b1edbc 183 PullUp = 2,
AnnaBridge 171:3a7713b1edbc 184 PullDown = 1,
AnnaBridge 171:3a7713b1edbc 185 PullNone = 0,
AnnaBridge 171:3a7713b1edbc 186 Repeater = 3,
AnnaBridge 171:3a7713b1edbc 187 OpenDrain = 4,
AnnaBridge 171:3a7713b1edbc 188 PullDefault = PullDown
AnnaBridge 171:3a7713b1edbc 189 } PinMode;
AnnaBridge 171:3a7713b1edbc 190
AnnaBridge 171:3a7713b1edbc 191 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 192 }
AnnaBridge 171:3a7713b1edbc 193 #endif
AnnaBridge 171:3a7713b1edbc 194
AnnaBridge 171:3a7713b1edbc 195 #endif