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 12
AnnaBridge 171:3a7713b1edbc 31
AnnaBridge 171:3a7713b1edbc 32 typedef enum {
AnnaBridge 171:3a7713b1edbc 33 PTA0 = 0x0,
AnnaBridge 171:3a7713b1edbc 34 PTA1 = 0x4,
AnnaBridge 171:3a7713b1edbc 35 PTA2 = 0x8,
AnnaBridge 171:3a7713b1edbc 36 PTA3 = 0xc,
AnnaBridge 171:3a7713b1edbc 37 PTA4 = 0x10,
AnnaBridge 171:3a7713b1edbc 38 PTA5 = 0x14,
AnnaBridge 171:3a7713b1edbc 39 PTA6 = 0x18,
AnnaBridge 171:3a7713b1edbc 40 PTA7 = 0x1c,
AnnaBridge 171:3a7713b1edbc 41 PTA8 = 0x20,
AnnaBridge 171:3a7713b1edbc 42 PTA9 = 0x24,
AnnaBridge 171:3a7713b1edbc 43 PTA10 = 0x28,
AnnaBridge 171:3a7713b1edbc 44 PTA11 = 0x2c,
AnnaBridge 171:3a7713b1edbc 45 PTA12 = 0x30,
AnnaBridge 171:3a7713b1edbc 46 PTA13 = 0x34,
AnnaBridge 171:3a7713b1edbc 47 PTA14 = 0x38,
AnnaBridge 171:3a7713b1edbc 48 PTA15 = 0x3c,
AnnaBridge 171:3a7713b1edbc 49 PTA16 = 0x40,
AnnaBridge 171:3a7713b1edbc 50 PTA17 = 0x44,
AnnaBridge 171:3a7713b1edbc 51 PTA18 = 0x48,
AnnaBridge 171:3a7713b1edbc 52 PTA19 = 0x4c,
AnnaBridge 171:3a7713b1edbc 53 PTA20 = 0x50,
AnnaBridge 171:3a7713b1edbc 54 PTA21 = 0x54,
AnnaBridge 171:3a7713b1edbc 55 PTA22 = 0x58,
AnnaBridge 171:3a7713b1edbc 56 PTA23 = 0x5c,
AnnaBridge 171:3a7713b1edbc 57 PTA24 = 0x60,
AnnaBridge 171:3a7713b1edbc 58 PTA25 = 0x64,
AnnaBridge 171:3a7713b1edbc 59 PTA26 = 0x68,
AnnaBridge 171:3a7713b1edbc 60 PTA27 = 0x6c,
AnnaBridge 171:3a7713b1edbc 61 PTA28 = 0x70,
AnnaBridge 171:3a7713b1edbc 62 PTA29 = 0x74,
AnnaBridge 171:3a7713b1edbc 63 PTA30 = 0x78,
AnnaBridge 171:3a7713b1edbc 64 PTA31 = 0x7c,
AnnaBridge 171:3a7713b1edbc 65 PTB0 = 0x1000,
AnnaBridge 171:3a7713b1edbc 66 PTB1 = 0x1004,
AnnaBridge 171:3a7713b1edbc 67 PTB2 = 0x1008,
AnnaBridge 171:3a7713b1edbc 68 PTB3 = 0x100c,
AnnaBridge 171:3a7713b1edbc 69 PTB4 = 0x1010,
AnnaBridge 171:3a7713b1edbc 70 PTB5 = 0x1014,
AnnaBridge 171:3a7713b1edbc 71 PTB6 = 0x1018,
AnnaBridge 171:3a7713b1edbc 72 PTB7 = 0x101c,
AnnaBridge 171:3a7713b1edbc 73 PTB8 = 0x1020,
AnnaBridge 171:3a7713b1edbc 74 PTB9 = 0x1024,
AnnaBridge 171:3a7713b1edbc 75 PTB10 = 0x1028,
AnnaBridge 171:3a7713b1edbc 76 PTB11 = 0x102c,
AnnaBridge 171:3a7713b1edbc 77 PTB12 = 0x1030,
AnnaBridge 171:3a7713b1edbc 78 PTB13 = 0x1034,
AnnaBridge 171:3a7713b1edbc 79 PTB14 = 0x1038,
AnnaBridge 171:3a7713b1edbc 80 PTB15 = 0x103c,
AnnaBridge 171:3a7713b1edbc 81 PTB16 = 0x1040,
AnnaBridge 171:3a7713b1edbc 82 PTB17 = 0x1044,
AnnaBridge 171:3a7713b1edbc 83 PTB18 = 0x1048,
AnnaBridge 171:3a7713b1edbc 84 PTB19 = 0x104c,
AnnaBridge 171:3a7713b1edbc 85 PTB20 = 0x1050,
AnnaBridge 171:3a7713b1edbc 86 PTB21 = 0x1054,
AnnaBridge 171:3a7713b1edbc 87 PTB22 = 0x1058,
AnnaBridge 171:3a7713b1edbc 88 PTB23 = 0x105c,
AnnaBridge 171:3a7713b1edbc 89 PTB24 = 0x1060,
AnnaBridge 171:3a7713b1edbc 90 PTB25 = 0x1064,
AnnaBridge 171:3a7713b1edbc 91 PTB26 = 0x1068,
AnnaBridge 171:3a7713b1edbc 92 PTB27 = 0x106c,
AnnaBridge 171:3a7713b1edbc 93 PTB28 = 0x1070,
AnnaBridge 171:3a7713b1edbc 94 PTB29 = 0x1074,
AnnaBridge 171:3a7713b1edbc 95 PTB30 = 0x1078,
AnnaBridge 171:3a7713b1edbc 96 PTB31 = 0x107c,
AnnaBridge 171:3a7713b1edbc 97 PTC0 = 0x2000,
AnnaBridge 171:3a7713b1edbc 98 PTC1 = 0x2004,
AnnaBridge 171:3a7713b1edbc 99 PTC2 = 0x2008,
AnnaBridge 171:3a7713b1edbc 100 PTC3 = 0x200c,
AnnaBridge 171:3a7713b1edbc 101 PTC4 = 0x2010,
AnnaBridge 171:3a7713b1edbc 102 PTC5 = 0x2014,
AnnaBridge 171:3a7713b1edbc 103 PTC6 = 0x2018,
AnnaBridge 171:3a7713b1edbc 104 PTC7 = 0x201c,
AnnaBridge 171:3a7713b1edbc 105 PTC8 = 0x2020,
AnnaBridge 171:3a7713b1edbc 106 PTC9 = 0x2024,
AnnaBridge 171:3a7713b1edbc 107 PTC10 = 0x2028,
AnnaBridge 171:3a7713b1edbc 108 PTC11 = 0x202c,
AnnaBridge 171:3a7713b1edbc 109 PTC12 = 0x2030,
AnnaBridge 171:3a7713b1edbc 110 PTC13 = 0x2034,
AnnaBridge 171:3a7713b1edbc 111 PTC14 = 0x2038,
AnnaBridge 171:3a7713b1edbc 112 PTC15 = 0x203c,
AnnaBridge 171:3a7713b1edbc 113 PTC16 = 0x2040,
AnnaBridge 171:3a7713b1edbc 114 PTC17 = 0x2044,
AnnaBridge 171:3a7713b1edbc 115 PTC18 = 0x2048,
AnnaBridge 171:3a7713b1edbc 116 PTC19 = 0x204c,
AnnaBridge 171:3a7713b1edbc 117 PTC20 = 0x2050,
AnnaBridge 171:3a7713b1edbc 118 PTC21 = 0x2054,
AnnaBridge 171:3a7713b1edbc 119 PTC22 = 0x2058,
AnnaBridge 171:3a7713b1edbc 120 PTC23 = 0x205c,
AnnaBridge 171:3a7713b1edbc 121 PTC24 = 0x2060,
AnnaBridge 171:3a7713b1edbc 122 PTC25 = 0x2064,
AnnaBridge 171:3a7713b1edbc 123 PTC26 = 0x2068,
AnnaBridge 171:3a7713b1edbc 124 PTC27 = 0x206c,
AnnaBridge 171:3a7713b1edbc 125 PTC28 = 0x2070,
AnnaBridge 171:3a7713b1edbc 126 PTC29 = 0x2074,
AnnaBridge 171:3a7713b1edbc 127 PTC30 = 0x2078,
AnnaBridge 171:3a7713b1edbc 128 PTC31 = 0x207c,
AnnaBridge 171:3a7713b1edbc 129 PTD0 = 0x3000,
AnnaBridge 171:3a7713b1edbc 130 PTD1 = 0x3004,
AnnaBridge 171:3a7713b1edbc 131 PTD2 = 0x3008,
AnnaBridge 171:3a7713b1edbc 132 PTD3 = 0x300c,
AnnaBridge 171:3a7713b1edbc 133 PTD4 = 0x3010,
AnnaBridge 171:3a7713b1edbc 134 PTD5 = 0x3014,
AnnaBridge 171:3a7713b1edbc 135 PTD6 = 0x3018,
AnnaBridge 171:3a7713b1edbc 136 PTD7 = 0x301c,
AnnaBridge 171:3a7713b1edbc 137 PTD8 = 0x3020,
AnnaBridge 171:3a7713b1edbc 138 PTD9 = 0x3024,
AnnaBridge 171:3a7713b1edbc 139 PTD10 = 0x3028,
AnnaBridge 171:3a7713b1edbc 140 PTD11 = 0x302c,
AnnaBridge 171:3a7713b1edbc 141 PTD12 = 0x3030,
AnnaBridge 171:3a7713b1edbc 142 PTD13 = 0x3034,
AnnaBridge 171:3a7713b1edbc 143 PTD14 = 0x3038,
AnnaBridge 171:3a7713b1edbc 144 PTD15 = 0x303c,
AnnaBridge 171:3a7713b1edbc 145 PTD16 = 0x3040,
AnnaBridge 171:3a7713b1edbc 146 PTD17 = 0x3044,
AnnaBridge 171:3a7713b1edbc 147 PTD18 = 0x3048,
AnnaBridge 171:3a7713b1edbc 148 PTD19 = 0x304c,
AnnaBridge 171:3a7713b1edbc 149 PTD20 = 0x3050,
AnnaBridge 171:3a7713b1edbc 150 PTD21 = 0x3054,
AnnaBridge 171:3a7713b1edbc 151 PTD22 = 0x3058,
AnnaBridge 171:3a7713b1edbc 152 PTD23 = 0x305c,
AnnaBridge 171:3a7713b1edbc 153 PTD24 = 0x3060,
AnnaBridge 171:3a7713b1edbc 154 PTD25 = 0x3064,
AnnaBridge 171:3a7713b1edbc 155 PTD26 = 0x3068,
AnnaBridge 171:3a7713b1edbc 156 PTD27 = 0x306c,
AnnaBridge 171:3a7713b1edbc 157 PTD28 = 0x3070,
AnnaBridge 171:3a7713b1edbc 158 PTD29 = 0x3074,
AnnaBridge 171:3a7713b1edbc 159 PTD30 = 0x3078,
AnnaBridge 171:3a7713b1edbc 160 PTD31 = 0x307c,
AnnaBridge 171:3a7713b1edbc 161 PTE0 = 0x4000,
AnnaBridge 171:3a7713b1edbc 162 PTE1 = 0x4004,
AnnaBridge 171:3a7713b1edbc 163 PTE2 = 0x4008,
AnnaBridge 171:3a7713b1edbc 164 PTE3 = 0x400c,
AnnaBridge 171:3a7713b1edbc 165 PTE4 = 0x4010,
AnnaBridge 171:3a7713b1edbc 166 PTE5 = 0x4014,
AnnaBridge 171:3a7713b1edbc 167 PTE6 = 0x4018,
AnnaBridge 171:3a7713b1edbc 168 PTE7 = 0x401c,
AnnaBridge 171:3a7713b1edbc 169 PTE8 = 0x4020,
AnnaBridge 171:3a7713b1edbc 170 PTE9 = 0x4024,
AnnaBridge 171:3a7713b1edbc 171 PTE10 = 0x4028,
AnnaBridge 171:3a7713b1edbc 172 PTE11 = 0x402c,
AnnaBridge 171:3a7713b1edbc 173 PTE12 = 0x4030,
AnnaBridge 171:3a7713b1edbc 174 PTE13 = 0x4034,
AnnaBridge 171:3a7713b1edbc 175 PTE14 = 0x4038,
AnnaBridge 171:3a7713b1edbc 176 PTE15 = 0x403c,
AnnaBridge 171:3a7713b1edbc 177 PTE16 = 0x4040,
AnnaBridge 171:3a7713b1edbc 178 PTE17 = 0x4044,
AnnaBridge 171:3a7713b1edbc 179 PTE18 = 0x4048,
AnnaBridge 171:3a7713b1edbc 180 PTE19 = 0x404c,
AnnaBridge 171:3a7713b1edbc 181 PTE20 = 0x4050,
AnnaBridge 171:3a7713b1edbc 182 PTE21 = 0x4054,
AnnaBridge 171:3a7713b1edbc 183 PTE22 = 0x4058,
AnnaBridge 171:3a7713b1edbc 184 PTE23 = 0x405c,
AnnaBridge 171:3a7713b1edbc 185 PTE24 = 0x4060,
AnnaBridge 171:3a7713b1edbc 186 PTE25 = 0x4064,
AnnaBridge 171:3a7713b1edbc 187 PTE26 = 0x4068,
AnnaBridge 171:3a7713b1edbc 188 PTE27 = 0x406c,
AnnaBridge 171:3a7713b1edbc 189 PTE28 = 0x4070,
AnnaBridge 171:3a7713b1edbc 190 PTE29 = 0x4074,
AnnaBridge 171:3a7713b1edbc 191 PTE30 = 0x4078,
AnnaBridge 171:3a7713b1edbc 192 PTE31 = 0x407c,
AnnaBridge 171:3a7713b1edbc 193
AnnaBridge 171:3a7713b1edbc 194 LED_RED = PTB18,
AnnaBridge 171:3a7713b1edbc 195 LED_GREEN = PTB19,
AnnaBridge 171:3a7713b1edbc 196 LED_BLUE = PTD1,
AnnaBridge 171:3a7713b1edbc 197
AnnaBridge 171:3a7713b1edbc 198 // mbed original LED naming
AnnaBridge 171:3a7713b1edbc 199 LED1 = LED_RED,
AnnaBridge 171:3a7713b1edbc 200 LED2 = LED_GREEN,
AnnaBridge 171:3a7713b1edbc 201 LED3 = LED_BLUE,
AnnaBridge 171:3a7713b1edbc 202 LED4 = LED_BLUE,
AnnaBridge 171:3a7713b1edbc 203
AnnaBridge 171:3a7713b1edbc 204 // USB Pins
AnnaBridge 171:3a7713b1edbc 205 USBTX = PTA2,
AnnaBridge 171:3a7713b1edbc 206 USBRX = PTA1,
AnnaBridge 171:3a7713b1edbc 207
AnnaBridge 171:3a7713b1edbc 208 // Arduino Headers
AnnaBridge 171:3a7713b1edbc 209 D0 = PTA1,
AnnaBridge 171:3a7713b1edbc 210 D1 = PTA2,
AnnaBridge 171:3a7713b1edbc 211 D2 = PTD4,
AnnaBridge 171:3a7713b1edbc 212 D3 = PTA12,
AnnaBridge 171:3a7713b1edbc 213 D4 = PTA4,
AnnaBridge 171:3a7713b1edbc 214 D5 = PTA5,
AnnaBridge 171:3a7713b1edbc 215 D6 = PTC8,
AnnaBridge 171:3a7713b1edbc 216 D7 = PTC9,
AnnaBridge 171:3a7713b1edbc 217 D8 = PTA13,
AnnaBridge 171:3a7713b1edbc 218 D9 = PTD5,
AnnaBridge 171:3a7713b1edbc 219 D10 = PTD0,
AnnaBridge 171:3a7713b1edbc 220 D11 = PTD2,
AnnaBridge 171:3a7713b1edbc 221 D12 = PTD3,
AnnaBridge 171:3a7713b1edbc 222 D13 = PTD1,
AnnaBridge 171:3a7713b1edbc 223 D14 = PTE0,
AnnaBridge 171:3a7713b1edbc 224 D15 = PTE1,
AnnaBridge 171:3a7713b1edbc 225
AnnaBridge 171:3a7713b1edbc 226 A0 = PTB0,
AnnaBridge 171:3a7713b1edbc 227 A1 = PTB1,
AnnaBridge 171:3a7713b1edbc 228 A2 = PTB2,
AnnaBridge 171:3a7713b1edbc 229 A3 = PTB3,
AnnaBridge 171:3a7713b1edbc 230 A4 = PTC2,
AnnaBridge 171:3a7713b1edbc 231 A5 = PTC1,
AnnaBridge 171:3a7713b1edbc 232
AnnaBridge 171:3a7713b1edbc 233 I2C_SCL = D15,
AnnaBridge 171:3a7713b1edbc 234 I2C_SDA = D14,
AnnaBridge 171:3a7713b1edbc 235
AnnaBridge 171:3a7713b1edbc 236 TSI_ELEC0 = PTB16,
AnnaBridge 171:3a7713b1edbc 237 TSI_ELEC1 = PTB17,
AnnaBridge 171:3a7713b1edbc 238
AnnaBridge 171:3a7713b1edbc 239 // Not connected
AnnaBridge 171:3a7713b1edbc 240 NC = (int)0xFFFFFFFF
AnnaBridge 171:3a7713b1edbc 241 } PinName;
AnnaBridge 171:3a7713b1edbc 242
AnnaBridge 171:3a7713b1edbc 243 /* PullDown not available for KL25 */
AnnaBridge 171:3a7713b1edbc 244 typedef enum {
AnnaBridge 171:3a7713b1edbc 245 PullNone = 0,
AnnaBridge 171:3a7713b1edbc 246 PullUp = 2,
AnnaBridge 171:3a7713b1edbc 247 PullDefault = PullUp
AnnaBridge 171:3a7713b1edbc 248 } PinMode;
AnnaBridge 171:3a7713b1edbc 249
AnnaBridge 171:3a7713b1edbc 250 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 251 }
AnnaBridge 171:3a7713b1edbc 252 #endif
AnnaBridge 171:3a7713b1edbc 253
AnnaBridge 171:3a7713b1edbc 254 #endif