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:
emilmont
Date:
Tue Feb 18 15:02:39 2014 +0000
Revision:
78:ed8466a608b4
Child:
79:0c05e21ae27e
Add KL05Z Target
Fix LPC11XX InterruptIn
Fix NUCLEO boards us_ticker
Fix NUCLEO_L152RE AnalogOut

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 78:ed8466a608b4 1 /* mbed Microcontroller Library
emilmont 78:ed8466a608b4 2 * Copyright (c) 2006-2013 ARM Limited
emilmont 78:ed8466a608b4 3 *
emilmont 78:ed8466a608b4 4 * Licensed under the Apache License, Version 2.0 (the "License");
emilmont 78:ed8466a608b4 5 * you may not use this file except in compliance with the License.
emilmont 78:ed8466a608b4 6 * You may obtain a copy of the License at
emilmont 78:ed8466a608b4 7 *
emilmont 78:ed8466a608b4 8 * http://www.apache.org/licenses/LICENSE-2.0
emilmont 78:ed8466a608b4 9 *
emilmont 78:ed8466a608b4 10 * Unless required by applicable law or agreed to in writing, software
emilmont 78:ed8466a608b4 11 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 78:ed8466a608b4 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 78:ed8466a608b4 13 * See the License for the specific language governing permissions and
emilmont 78:ed8466a608b4 14 * limitations under the License.
emilmont 78:ed8466a608b4 15 */
emilmont 78:ed8466a608b4 16 #ifndef MBED_PINNAMES_H
emilmont 78:ed8466a608b4 17 #define MBED_PINNAMES_H
emilmont 78:ed8466a608b4 18
emilmont 78:ed8466a608b4 19 #include "cmsis.h"
emilmont 78:ed8466a608b4 20
emilmont 78:ed8466a608b4 21 #ifdef __cplusplus
emilmont 78:ed8466a608b4 22 extern "C" {
emilmont 78:ed8466a608b4 23 #endif
emilmont 78:ed8466a608b4 24
emilmont 78:ed8466a608b4 25 typedef enum {
emilmont 78:ed8466a608b4 26 PIN_INPUT,
emilmont 78:ed8466a608b4 27 PIN_OUTPUT
emilmont 78:ed8466a608b4 28 } PinDirection;
emilmont 78:ed8466a608b4 29
emilmont 78:ed8466a608b4 30 /* PCR - 0x1000 */
emilmont 78:ed8466a608b4 31 #define PORT_SHIFT 12
emilmont 78:ed8466a608b4 32
emilmont 78:ed8466a608b4 33 typedef enum {
emilmont 78:ed8466a608b4 34 PTA0 = 0x0,
emilmont 78:ed8466a608b4 35 PTA1 = 0x4,
emilmont 78:ed8466a608b4 36 PTA2 = 0x8,
emilmont 78:ed8466a608b4 37 PTA3 = 0xc,
emilmont 78:ed8466a608b4 38 PTA4 = 0x10,
emilmont 78:ed8466a608b4 39 PTA5 = 0x14,
emilmont 78:ed8466a608b4 40 PTA6 = 0x18,
emilmont 78:ed8466a608b4 41 PTA7 = 0x1c,
emilmont 78:ed8466a608b4 42 PTA8 = 0x20,
emilmont 78:ed8466a608b4 43 PTA9 = 0x24,
emilmont 78:ed8466a608b4 44 PTA10 = 0x28,
emilmont 78:ed8466a608b4 45 PTA11 = 0x2c,
emilmont 78:ed8466a608b4 46 PTA12 = 0x30,
emilmont 78:ed8466a608b4 47 PTA13 = 0x34,
emilmont 78:ed8466a608b4 48 PTA14 = 0x38,
emilmont 78:ed8466a608b4 49 PTA15 = 0x3c,
emilmont 78:ed8466a608b4 50 PTA16 = 0x40,
emilmont 78:ed8466a608b4 51 PTA17 = 0x44,
emilmont 78:ed8466a608b4 52 PTA18 = 0x48,
emilmont 78:ed8466a608b4 53 PTA19 = 0x4c,
emilmont 78:ed8466a608b4 54 PTB0 = 0x1000,
emilmont 78:ed8466a608b4 55 PTB1 = 0x1004,
emilmont 78:ed8466a608b4 56 PTB2 = 0x1008,
emilmont 78:ed8466a608b4 57 PTB3 = 0x100c,
emilmont 78:ed8466a608b4 58 PTB4 = 0x1010,
emilmont 78:ed8466a608b4 59 PTB5 = 0x1014,
emilmont 78:ed8466a608b4 60 PTB6 = 0x1018,
emilmont 78:ed8466a608b4 61 PTB7 = 0x101c,
emilmont 78:ed8466a608b4 62 PTB8 = 0x1020,
emilmont 78:ed8466a608b4 63 PTB9 = 0x1024,
emilmont 78:ed8466a608b4 64 PTB10 = 0x1028,
emilmont 78:ed8466a608b4 65 PTB11 = 0x102c,
emilmont 78:ed8466a608b4 66 PTB12 = 0x1030,
emilmont 78:ed8466a608b4 67 PTB13 = 0x1034,
emilmont 78:ed8466a608b4 68 PTB14 = 0x1038,
emilmont 78:ed8466a608b4 69 PTB15 = 0x103c,
emilmont 78:ed8466a608b4 70 PTB16 = 0x1040,
emilmont 78:ed8466a608b4 71 PTB17 = 0x1044,
emilmont 78:ed8466a608b4 72 PTB18 = 0x1048,
emilmont 78:ed8466a608b4 73 PTB19 = 0x104c,
emilmont 78:ed8466a608b4 74 PTB20 = 0x1050,
emilmont 78:ed8466a608b4 75
emilmont 78:ed8466a608b4 76 LED_RED = PTB8,
emilmont 78:ed8466a608b4 77 LED_GREEN = PTB9,
emilmont 78:ed8466a608b4 78 LED_BLUE = PTB10,
emilmont 78:ed8466a608b4 79
emilmont 78:ed8466a608b4 80 // mbed original LED naming
emilmont 78:ed8466a608b4 81 LED1 = LED_BLUE,
emilmont 78:ed8466a608b4 82 LED2 = LED_GREEN,
emilmont 78:ed8466a608b4 83 LED3 = LED_RED,
emilmont 78:ed8466a608b4 84 LED4 = LED_RED,
emilmont 78:ed8466a608b4 85
emilmont 78:ed8466a608b4 86 // USB Pins
emilmont 78:ed8466a608b4 87 USBTX = PTB1,
emilmont 78:ed8466a608b4 88 USBRX = PTB2,
emilmont 78:ed8466a608b4 89
emilmont 78:ed8466a608b4 90 // Arduino Headers
emilmont 78:ed8466a608b4 91 D0 = PTB2,
emilmont 78:ed8466a608b4 92 D1 = PTB1,
emilmont 78:ed8466a608b4 93 D2 = PTA11,
emilmont 78:ed8466a608b4 94 D3 = PTB5,
emilmont 78:ed8466a608b4 95 D4 = PTA10,
emilmont 78:ed8466a608b4 96 D5 = PTA12,
emilmont 78:ed8466a608b4 97 D6 = PTB6,
emilmont 78:ed8466a608b4 98 D7 = PTB7,
emilmont 78:ed8466a608b4 99 D8 = PTA10,
emilmont 78:ed8466a608b4 100 D9 = PTB11,
emilmont 78:ed8466a608b4 101 D10 = PTA5,
emilmont 78:ed8466a608b4 102 D11 = PTA7,
emilmont 78:ed8466a608b4 103 D12 = PTA6,
emilmont 78:ed8466a608b4 104 D13 = PTB0,
emilmont 78:ed8466a608b4 105 D14 = PTB4,
emilmont 78:ed8466a608b4 106 D15 = PTB3,
emilmont 78:ed8466a608b4 107
emilmont 78:ed8466a608b4 108 A0 = PTB8,
emilmont 78:ed8466a608b4 109 A1 = PTB9,
emilmont 78:ed8466a608b4 110 A2 = PTA8,
emilmont 78:ed8466a608b4 111 A3 = PTA0,
emilmont 78:ed8466a608b4 112 A4 = PTA9,
emilmont 78:ed8466a608b4 113 A5 = PTB13,
emilmont 78:ed8466a608b4 114
emilmont 78:ed8466a608b4 115 // Not connected
emilmont 78:ed8466a608b4 116 NC = (int)0xFFFFFFFF
emilmont 78:ed8466a608b4 117 } PinName;
emilmont 78:ed8466a608b4 118
emilmont 78:ed8466a608b4 119 /* PullDown not available for KL05 */
emilmont 78:ed8466a608b4 120 typedef enum {
emilmont 78:ed8466a608b4 121 PullNone = 0,
emilmont 78:ed8466a608b4 122 PullUp = 2,
emilmont 78:ed8466a608b4 123 } PinMode;
emilmont 78:ed8466a608b4 124
emilmont 78:ed8466a608b4 125 #ifdef __cplusplus
emilmont 78:ed8466a608b4 126 }
emilmont 78:ed8466a608b4 127 #endif
emilmont 78:ed8466a608b4 128
emilmont 78:ed8466a608b4 129 #endif