mbed library sources modified for open wear

Dependents:   openwear-lifelogger-example

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Sep 25 10:30:04 2013 +0100
Revision:
30:91c1d09ada54
Child:
113:65a335a675de
Synchronized with git revision 8f57c1e84759991fa81ede0da2b4aabe8530fa09

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 30:91c1d09ada54 1 /* mbed Microcontroller Library
mbed_official 30:91c1d09ada54 2 * Copyright (c) 2006-2013 ARM Limited
mbed_official 30:91c1d09ada54 3 *
mbed_official 30:91c1d09ada54 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 30:91c1d09ada54 5 * you may not use this file except in compliance with the License.
mbed_official 30:91c1d09ada54 6 * You may obtain a copy of the License at
mbed_official 30:91c1d09ada54 7 *
mbed_official 30:91c1d09ada54 8 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 30:91c1d09ada54 9 *
mbed_official 30:91c1d09ada54 10 * Unless required by applicable law or agreed to in writing, software
mbed_official 30:91c1d09ada54 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 30:91c1d09ada54 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 30:91c1d09ada54 13 * See the License for the specific language governing permissions and
mbed_official 30:91c1d09ada54 14 * limitations under the License.
mbed_official 30:91c1d09ada54 15 */
mbed_official 30:91c1d09ada54 16 #ifndef MBED_PINNAMES_H
mbed_official 30:91c1d09ada54 17 #define MBED_PINNAMES_H
mbed_official 30:91c1d09ada54 18
mbed_official 30:91c1d09ada54 19 #include "cmsis.h"
mbed_official 30:91c1d09ada54 20
mbed_official 30:91c1d09ada54 21 #ifdef __cplusplus
mbed_official 30:91c1d09ada54 22 extern "C" {
mbed_official 30:91c1d09ada54 23 #endif
mbed_official 30:91c1d09ada54 24
mbed_official 30:91c1d09ada54 25 typedef enum {
mbed_official 30:91c1d09ada54 26 PIN_INPUT,
mbed_official 30:91c1d09ada54 27 PIN_OUTPUT
mbed_official 30:91c1d09ada54 28 } PinDirection;
mbed_official 30:91c1d09ada54 29
mbed_official 30:91c1d09ada54 30 #define PORT_SHIFT 12
mbed_official 30:91c1d09ada54 31 #define PIN_SHIFT 8
mbed_official 30:91c1d09ada54 32
mbed_official 30:91c1d09ada54 33 typedef enum {
mbed_official 30:91c1d09ada54 34 // LPC1114 Pin Names (PORT[15:12] + PIN[11:8] + IOCON offset[7:0])
mbed_official 30:91c1d09ada54 35
mbed_official 30:91c1d09ada54 36 P0_0 = (0 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x0c,
mbed_official 30:91c1d09ada54 37 P0_1 = (0 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x10,
mbed_official 30:91c1d09ada54 38 P0_2 = (0 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x1c,
mbed_official 30:91c1d09ada54 39 P0_3 = (0 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x2c,
mbed_official 30:91c1d09ada54 40 P0_4 = (0 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x30,
mbed_official 30:91c1d09ada54 41 P0_5 = (0 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x34,
mbed_official 30:91c1d09ada54 42 P0_6 = (0 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x4c,
mbed_official 30:91c1d09ada54 43 P0_7 = (0 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x50,
mbed_official 30:91c1d09ada54 44 P0_8 = (0 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x60,
mbed_official 30:91c1d09ada54 45 P0_9 = (0 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x64,
mbed_official 30:91c1d09ada54 46 P0_10 = (0 << PORT_SHIFT) | (10 << PIN_SHIFT) | 0x68,
mbed_official 30:91c1d09ada54 47 P0_11 = (0 << PORT_SHIFT) | (11 << PIN_SHIFT) | 0x74,
mbed_official 30:91c1d09ada54 48
mbed_official 30:91c1d09ada54 49 P1_0 = (1 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x78,
mbed_official 30:91c1d09ada54 50 P1_1 = (1 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x7c,
mbed_official 30:91c1d09ada54 51 P1_2 = (1 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x80,
mbed_official 30:91c1d09ada54 52 P1_3 = (1 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x90,
mbed_official 30:91c1d09ada54 53 P1_4 = (1 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x94,
mbed_official 30:91c1d09ada54 54 P1_5 = (1 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0xa0,
mbed_official 30:91c1d09ada54 55 P1_6 = (1 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0xa4,
mbed_official 30:91c1d09ada54 56 P1_7 = (1 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0xa8,
mbed_official 30:91c1d09ada54 57 P1_8 = (1 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x14,
mbed_official 30:91c1d09ada54 58 P1_9 = (1 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x38,
mbed_official 30:91c1d09ada54 59 P1_10 = (1 << PORT_SHIFT) | (10 << PIN_SHIFT) | 0x6c,
mbed_official 30:91c1d09ada54 60 P1_11 = (1 << PORT_SHIFT) | (11 << PIN_SHIFT) | 0x98,
mbed_official 30:91c1d09ada54 61
mbed_official 30:91c1d09ada54 62 P2_0 = (2 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x08,
mbed_official 30:91c1d09ada54 63 P2_1 = (2 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x28,
mbed_official 30:91c1d09ada54 64 P2_2 = (2 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x5c,
mbed_official 30:91c1d09ada54 65 P2_3 = (2 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x8c,
mbed_official 30:91c1d09ada54 66 P2_4 = (2 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x40,
mbed_official 30:91c1d09ada54 67 P2_5 = (2 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x44,
mbed_official 30:91c1d09ada54 68 P2_6 = (2 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x00,
mbed_official 30:91c1d09ada54 69 P2_7 = (2 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x20,
mbed_official 30:91c1d09ada54 70 P2_8 = (2 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x24,
mbed_official 30:91c1d09ada54 71 P2_9 = (2 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x54,
mbed_official 30:91c1d09ada54 72 P2_10 = (2 << PORT_SHIFT) | (10 << PIN_SHIFT) | 0x58,
mbed_official 30:91c1d09ada54 73 P2_11 = (2 << PORT_SHIFT) | (11 << PIN_SHIFT) | 0x70,
mbed_official 30:91c1d09ada54 74
mbed_official 30:91c1d09ada54 75 P3_0 = (3 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x84,
mbed_official 30:91c1d09ada54 76 P3_1 = (3 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x88,
mbed_official 30:91c1d09ada54 77 P3_2 = (3 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x9c,
mbed_official 30:91c1d09ada54 78 P3_3 = (3 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0xac,
mbed_official 30:91c1d09ada54 79 P3_4 = (3 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x3c,
mbed_official 30:91c1d09ada54 80 P3_5 = (3 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x48,
mbed_official 30:91c1d09ada54 81
mbed_official 30:91c1d09ada54 82 // mbed DIP Pin Names (CQ board)
mbed_official 30:91c1d09ada54 83 p4 = P0_0,
mbed_official 30:91c1d09ada54 84 p5 = P0_9,
mbed_official 30:91c1d09ada54 85 p6 = P0_8,
mbed_official 30:91c1d09ada54 86 p7 = P0_6,
mbed_official 30:91c1d09ada54 87 p8 = P1_5,
mbed_official 30:91c1d09ada54 88 p9 = P1_7,
mbed_official 30:91c1d09ada54 89 p10 = P1_6,
mbed_official 30:91c1d09ada54 90 p11 = P0_7,
mbed_official 30:91c1d09ada54 91 p12 = P1_0,
mbed_official 30:91c1d09ada54 92 p13 = P1_1,
mbed_official 30:91c1d09ada54 93 p14 = P1_2,
mbed_official 30:91c1d09ada54 94 p15 = P0_11,
mbed_official 30:91c1d09ada54 95 p16 = P1_0,
mbed_official 30:91c1d09ada54 96 p17 = P1_1,
mbed_official 30:91c1d09ada54 97 p18 = P1_2,
mbed_official 30:91c1d09ada54 98 p19 = P1_3,
mbed_official 30:91c1d09ada54 99 p20 = P1_4,
mbed_official 30:91c1d09ada54 100 p21 = P0_10,
mbed_official 30:91c1d09ada54 101 p22 = P0_2,
mbed_official 30:91c1d09ada54 102 p23 = P0_11,
mbed_official 30:91c1d09ada54 103 p24 = P0_2,
mbed_official 30:91c1d09ada54 104 p25 = P1_8,
mbed_official 30:91c1d09ada54 105 p26 = P1_9,
mbed_official 30:91c1d09ada54 106 p27 = P0_4,
mbed_official 30:91c1d09ada54 107 p28 = P0_5,
mbed_official 30:91c1d09ada54 108 p29 = P0_3,
mbed_official 30:91c1d09ada54 109 p30 = P0_1,
mbed_official 30:91c1d09ada54 110
mbed_official 30:91c1d09ada54 111 // Other mbed Pin Names
mbed_official 30:91c1d09ada54 112 LED1 = P1_5,
mbed_official 30:91c1d09ada54 113 LED2 = P0_7,
mbed_official 30:91c1d09ada54 114 LED3 = P1_5,
mbed_official 30:91c1d09ada54 115 LED4 = P0_7,
mbed_official 30:91c1d09ada54 116
mbed_official 30:91c1d09ada54 117 USBTX = P1_7,
mbed_official 30:91c1d09ada54 118 USBRX = P1_6,
mbed_official 30:91c1d09ada54 119
mbed_official 30:91c1d09ada54 120 // mbed DIP Pin Names (LPCXpresso LPC1114)
mbed_official 30:91c1d09ada54 121 xp4 = P0_0,
mbed_official 30:91c1d09ada54 122 xp5 = P0_9,
mbed_official 30:91c1d09ada54 123 xp6 = P0_8,
mbed_official 30:91c1d09ada54 124 xp7 = P2_11,
mbed_official 30:91c1d09ada54 125 xp8 = P0_2,
mbed_official 30:91c1d09ada54 126 xp9 = P1_7,
mbed_official 30:91c1d09ada54 127 xp10 = P1_6,
mbed_official 30:91c1d09ada54 128 xp11 = P0_7,
mbed_official 30:91c1d09ada54 129 xp12 = P2_0,
mbed_official 30:91c1d09ada54 130 xp13 = P2_1,
mbed_official 30:91c1d09ada54 131 xp14 = P2_2,
mbed_official 30:91c1d09ada54 132 xp15 = P0_11,
mbed_official 30:91c1d09ada54 133 xp16 = P1_0,
mbed_official 30:91c1d09ada54 134 xp17 = P1_1,
mbed_official 30:91c1d09ada54 135 xp18 = P1_2,
mbed_official 30:91c1d09ada54 136 xp19 = P1_3,
mbed_official 30:91c1d09ada54 137 xp20 = P1_4,
mbed_official 30:91c1d09ada54 138 xp21 = P1_5,
mbed_official 30:91c1d09ada54 139 xp22 = P1_8,
mbed_official 30:91c1d09ada54 140 xp23 = P0_6,
mbed_official 30:91c1d09ada54 141 xp24 = P0_10,
mbed_official 30:91c1d09ada54 142 xp25 = P3_0,
mbed_official 30:91c1d09ada54 143 xp26 = P3_1,
mbed_official 30:91c1d09ada54 144 xp27 = P3_2,
mbed_official 30:91c1d09ada54 145
mbed_official 30:91c1d09ada54 146 xp29 = P3_3,
mbed_official 30:91c1d09ada54 147 xp30 = P2_10,
mbed_official 30:91c1d09ada54 148 xp31 = P2_9,
mbed_official 30:91c1d09ada54 149 xp32 = P2_8,
mbed_official 30:91c1d09ada54 150 xp33 = P2_7,
mbed_official 30:91c1d09ada54 151 xp34 = P2_6,
mbed_official 30:91c1d09ada54 152 xp35 = P2_5,
mbed_official 30:91c1d09ada54 153 xp36 = P2_4,
mbed_official 30:91c1d09ada54 154 xp37 = P2_3,
mbed_official 30:91c1d09ada54 155 xp38 = P1_11,
mbed_official 30:91c1d09ada54 156 xp39 = P1_10,
mbed_official 30:91c1d09ada54 157 xp40 = P1_9,
mbed_official 30:91c1d09ada54 158 xp41 = P0_4,
mbed_official 30:91c1d09ada54 159 xp42 = P0_5,
mbed_official 30:91c1d09ada54 160 xp43 = P0_3,
mbed_official 30:91c1d09ada54 161 xp44 = P0_1,
mbed_official 30:91c1d09ada54 162
mbed_official 30:91c1d09ada54 163 // Other mbed Pin Names
mbed_official 30:91c1d09ada54 164 xLED1 = P0_7,
mbed_official 30:91c1d09ada54 165
mbed_official 30:91c1d09ada54 166 // DIP Package Names
mbed_official 30:91c1d09ada54 167
mbed_official 30:91c1d09ada54 168 dp1 = P0_8,
mbed_official 30:91c1d09ada54 169 dp2 = P0_9,
mbed_official 30:91c1d09ada54 170 dp3 = P0_10,
mbed_official 30:91c1d09ada54 171 dp4 = P0_11,
mbed_official 30:91c1d09ada54 172 dp5 = P0_5,
mbed_official 30:91c1d09ada54 173 dp6 = P0_6,
mbed_official 30:91c1d09ada54 174 dp9 = P1_0,
mbed_official 30:91c1d09ada54 175 dp10 = P1_1,
mbed_official 30:91c1d09ada54 176 dp11 = P1_2,
mbed_official 30:91c1d09ada54 177 dp12 = P1_3,
mbed_official 30:91c1d09ada54 178 dp13 = P1_4,
mbed_official 30:91c1d09ada54 179 dp14 = P1_5,
mbed_official 30:91c1d09ada54 180 dp15 = P1_6,
mbed_official 30:91c1d09ada54 181 dp16 = P1_7,
mbed_official 30:91c1d09ada54 182 dp17 = P1_8,
mbed_official 30:91c1d09ada54 183 dp18 = P1_9,
mbed_official 30:91c1d09ada54 184 dp23 = P0_0,
mbed_official 30:91c1d09ada54 185 dp24 = P0_1,
mbed_official 30:91c1d09ada54 186 dp25 = P0_2,
mbed_official 30:91c1d09ada54 187 dp26 = P0_3,
mbed_official 30:91c1d09ada54 188 dp27 = P0_4,
mbed_official 30:91c1d09ada54 189 dp28 = P0_7,
mbed_official 30:91c1d09ada54 190
mbed_official 30:91c1d09ada54 191 // Not connected
mbed_official 30:91c1d09ada54 192 NC = (int)0xFFFFFFFF,
mbed_official 30:91c1d09ada54 193 } PinName;
mbed_official 30:91c1d09ada54 194
mbed_official 30:91c1d09ada54 195 typedef enum {
mbed_official 30:91c1d09ada54 196 CHANNEL0 = WAKEUP0_IRQn,
mbed_official 30:91c1d09ada54 197 CHANNEL1 = WAKEUP1_IRQn,
mbed_official 30:91c1d09ada54 198 CHANNEL2 = WAKEUP2_IRQn,
mbed_official 30:91c1d09ada54 199 CHANNEL3 = WAKEUP3_IRQn,
mbed_official 30:91c1d09ada54 200 CHANNEL4 = WAKEUP4_IRQn,
mbed_official 30:91c1d09ada54 201 CHANNEL5 = WAKEUP5_IRQn,
mbed_official 30:91c1d09ada54 202 CHANNEL6 = WAKEUP6_IRQn,
mbed_official 30:91c1d09ada54 203 CHANNEL7 = WAKEUP7_IRQn
mbed_official 30:91c1d09ada54 204 } Channel;
mbed_official 30:91c1d09ada54 205
mbed_official 30:91c1d09ada54 206 typedef enum {
mbed_official 30:91c1d09ada54 207 PullUp = 2,
mbed_official 30:91c1d09ada54 208 PullDown = 1,
mbed_official 30:91c1d09ada54 209 PullNone = 0,
mbed_official 30:91c1d09ada54 210 Repeater = 3,
mbed_official 30:91c1d09ada54 211 OpenDrain = 4
mbed_official 30:91c1d09ada54 212 } PinMode;
mbed_official 30:91c1d09ada54 213
mbed_official 30:91c1d09ada54 214 #ifdef __cplusplus
mbed_official 30:91c1d09ada54 215 }
mbed_official 30:91c1d09ada54 216 #endif
mbed_official 30:91c1d09ada54 217
mbed_official 30:91c1d09ada54 218 #endif