mbed.h library with any bug fixes AV finds.

Dependents:   micromouse4_encoder_testing PID_Test Lab1_Test WorkingPID ... more

Committer:
aravindsv
Date:
Mon Nov 02 02:26:59 2015 +0000
Revision:
0:ba7650f404af
Reduced HSE_STARTUP_TIMEOUT to 500 ms, fixed some compiler warnings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aravindsv 0:ba7650f404af 1 /* mbed Microcontroller Library
aravindsv 0:ba7650f404af 2 * Copyright (c) 2006-2014 ARM Limited
aravindsv 0:ba7650f404af 3 *
aravindsv 0:ba7650f404af 4 * Licensed under the Apache License, Version 2.0 (the "License");
aravindsv 0:ba7650f404af 5 * you may not use this file except in compliance with the License.
aravindsv 0:ba7650f404af 6 * You may obtain a copy of the License at
aravindsv 0:ba7650f404af 7 *
aravindsv 0:ba7650f404af 8 * http://www.apache.org/licenses/LICENSE-2.0
aravindsv 0:ba7650f404af 9 *
aravindsv 0:ba7650f404af 10 * Unless required by applicable law or agreed to in writing, software
aravindsv 0:ba7650f404af 11 * distributed under the License is distributed on an "AS IS" BASIS,
aravindsv 0:ba7650f404af 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
aravindsv 0:ba7650f404af 13 * See the License for the specific language governing permissions and
aravindsv 0:ba7650f404af 14 * limitations under the License.
aravindsv 0:ba7650f404af 15 */
aravindsv 0:ba7650f404af 16 #ifndef MBED_PINNAMES_H
aravindsv 0:ba7650f404af 17 #define MBED_PINNAMES_H
aravindsv 0:ba7650f404af 18
aravindsv 0:ba7650f404af 19 #include "cmsis.h"
aravindsv 0:ba7650f404af 20
aravindsv 0:ba7650f404af 21 #ifdef __cplusplus
aravindsv 0:ba7650f404af 22 extern "C" {
aravindsv 0:ba7650f404af 23 #endif
aravindsv 0:ba7650f404af 24
aravindsv 0:ba7650f404af 25 typedef enum {
aravindsv 0:ba7650f404af 26 PIN_INPUT,
aravindsv 0:ba7650f404af 27 PIN_OUTPUT
aravindsv 0:ba7650f404af 28 } PinDirection;
aravindsv 0:ba7650f404af 29
aravindsv 0:ba7650f404af 30 #define PORT_SHIFT 16
aravindsv 0:ba7650f404af 31 #define PIN_SHIFT 9
aravindsv 0:ba7650f404af 32
aravindsv 0:ba7650f404af 33 typedef enum {
aravindsv 0:ba7650f404af 34 // LPC11U68 Pin Names (PORT[19:16] + PIN[15:9] + IOCON offset[8:0])
aravindsv 0:ba7650f404af 35
aravindsv 0:ba7650f404af 36 P0_0 = (0 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x000,
aravindsv 0:ba7650f404af 37 P0_1 = (0 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x004,
aravindsv 0:ba7650f404af 38 P0_2 = (0 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x008,
aravindsv 0:ba7650f404af 39 P0_3 = (0 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x00C,
aravindsv 0:ba7650f404af 40 P0_4 = (0 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x010,
aravindsv 0:ba7650f404af 41 P0_5 = (0 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x014,
aravindsv 0:ba7650f404af 42 P0_6 = (0 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x018,
aravindsv 0:ba7650f404af 43 P0_7 = (0 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x01C,
aravindsv 0:ba7650f404af 44 P0_8 = (0 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x020,
aravindsv 0:ba7650f404af 45 P0_9 = (0 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x024,
aravindsv 0:ba7650f404af 46 P0_10= (0 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x028,
aravindsv 0:ba7650f404af 47 P0_11= (0 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x02C,
aravindsv 0:ba7650f404af 48 P0_12= (0 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x030,
aravindsv 0:ba7650f404af 49 P0_13= (0 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x034,
aravindsv 0:ba7650f404af 50 P0_14= (0 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x038,
aravindsv 0:ba7650f404af 51 P0_15= (0 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x03C,
aravindsv 0:ba7650f404af 52 P0_16= (0 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x040,
aravindsv 0:ba7650f404af 53 P0_17= (0 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x044,
aravindsv 0:ba7650f404af 54 P0_18= (0 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x048,
aravindsv 0:ba7650f404af 55 P0_19= (0 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x04C,
aravindsv 0:ba7650f404af 56 P0_20= (0 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x050,
aravindsv 0:ba7650f404af 57 P0_21= (0 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x054,
aravindsv 0:ba7650f404af 58 P0_22= (0 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x058,
aravindsv 0:ba7650f404af 59 P0_23= (0 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x05C,
aravindsv 0:ba7650f404af 60
aravindsv 0:ba7650f404af 61 P1_0 = (1 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x060,
aravindsv 0:ba7650f404af 62 P1_1 = (1 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x064,
aravindsv 0:ba7650f404af 63 P1_2 = (1 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x068,
aravindsv 0:ba7650f404af 64 P1_3 = (1 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x06C,
aravindsv 0:ba7650f404af 65 P1_4 = (1 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x070,
aravindsv 0:ba7650f404af 66 P1_5 = (1 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x074,
aravindsv 0:ba7650f404af 67 P1_6 = (1 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x078,
aravindsv 0:ba7650f404af 68 P1_7 = (1 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x07C,
aravindsv 0:ba7650f404af 69 P1_8 = (1 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x080,
aravindsv 0:ba7650f404af 70 P1_9 = (1 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x084,
aravindsv 0:ba7650f404af 71 P1_10= (1 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x088,
aravindsv 0:ba7650f404af 72 P1_11= (1 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x08C,
aravindsv 0:ba7650f404af 73 P1_12= (1 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x090,
aravindsv 0:ba7650f404af 74 P1_13= (1 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x094,
aravindsv 0:ba7650f404af 75 P1_14= (1 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x098,
aravindsv 0:ba7650f404af 76 P1_15= (1 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x09C,
aravindsv 0:ba7650f404af 77 P1_16= (1 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x0A0,
aravindsv 0:ba7650f404af 78 P1_17= (1 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x0A4,
aravindsv 0:ba7650f404af 79 P1_18= (1 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x0A8,
aravindsv 0:ba7650f404af 80 P1_19= (1 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x0AC,
aravindsv 0:ba7650f404af 81 P1_20= (1 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x0B0,
aravindsv 0:ba7650f404af 82 P1_21= (1 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x0B4,
aravindsv 0:ba7650f404af 83 P1_22= (1 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x0B8,
aravindsv 0:ba7650f404af 84 P1_23= (1 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x0BC,
aravindsv 0:ba7650f404af 85 P1_24= (1 << PORT_SHIFT) | (24<< PIN_SHIFT) | 0x0C0,
aravindsv 0:ba7650f404af 86 P1_25= (1 << PORT_SHIFT) | (25<< PIN_SHIFT) | 0x0C4,
aravindsv 0:ba7650f404af 87 P1_26= (1 << PORT_SHIFT) | (26<< PIN_SHIFT) | 0x0C8,
aravindsv 0:ba7650f404af 88 P1_27= (1 << PORT_SHIFT) | (27<< PIN_SHIFT) | 0x0CC,
aravindsv 0:ba7650f404af 89 P1_28= (1 << PORT_SHIFT) | (28<< PIN_SHIFT) | 0x0D0,
aravindsv 0:ba7650f404af 90 P1_29= (1 << PORT_SHIFT) | (29<< PIN_SHIFT) | 0x0D4,
aravindsv 0:ba7650f404af 91 P1_30= (1 << PORT_SHIFT) | (30<< PIN_SHIFT) | 0x0D8,
aravindsv 0:ba7650f404af 92 P1_31= (1 << PORT_SHIFT) | (31<< PIN_SHIFT) | 0x0DC,
aravindsv 0:ba7650f404af 93
aravindsv 0:ba7650f404af 94 P2_0 = (2 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x0F0,
aravindsv 0:ba7650f404af 95 P2_1 = (2 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x0F4,
aravindsv 0:ba7650f404af 96 P2_2 = (2 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x0FC,
aravindsv 0:ba7650f404af 97 P2_3 = (2 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x100,
aravindsv 0:ba7650f404af 98 P2_4 = (2 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x104,
aravindsv 0:ba7650f404af 99 P2_5 = (2 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0x108,
aravindsv 0:ba7650f404af 100 P2_6 = (2 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0x10C,
aravindsv 0:ba7650f404af 101 P2_7 = (2 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x110,
aravindsv 0:ba7650f404af 102 P2_8 = (2 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x114,
aravindsv 0:ba7650f404af 103 P2_9 = (2 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x118,
aravindsv 0:ba7650f404af 104 P2_10= (2 << PORT_SHIFT) | (10<< PIN_SHIFT) | 0x11C,
aravindsv 0:ba7650f404af 105 P2_11= (2 << PORT_SHIFT) | (11<< PIN_SHIFT) | 0x120,
aravindsv 0:ba7650f404af 106 P2_12= (2 << PORT_SHIFT) | (12<< PIN_SHIFT) | 0x124,
aravindsv 0:ba7650f404af 107 P2_13= (2 << PORT_SHIFT) | (13<< PIN_SHIFT) | 0x128,
aravindsv 0:ba7650f404af 108 P2_14= (2 << PORT_SHIFT) | (14<< PIN_SHIFT) | 0x12C,
aravindsv 0:ba7650f404af 109 P2_15= (2 << PORT_SHIFT) | (15<< PIN_SHIFT) | 0x130,
aravindsv 0:ba7650f404af 110 P2_16= (2 << PORT_SHIFT) | (16<< PIN_SHIFT) | 0x134,
aravindsv 0:ba7650f404af 111 P2_17= (2 << PORT_SHIFT) | (17<< PIN_SHIFT) | 0x138,
aravindsv 0:ba7650f404af 112 P2_18= (2 << PORT_SHIFT) | (18<< PIN_SHIFT) | 0x13C,
aravindsv 0:ba7650f404af 113 P2_19= (2 << PORT_SHIFT) | (19<< PIN_SHIFT) | 0x140,
aravindsv 0:ba7650f404af 114 P2_20= (2 << PORT_SHIFT) | (20<< PIN_SHIFT) | 0x144,
aravindsv 0:ba7650f404af 115 P2_21= (2 << PORT_SHIFT) | (21<< PIN_SHIFT) | 0x148,
aravindsv 0:ba7650f404af 116 P2_22= (2 << PORT_SHIFT) | (22<< PIN_SHIFT) | 0x14C,
aravindsv 0:ba7650f404af 117 P2_23= (2 << PORT_SHIFT) | (23<< PIN_SHIFT) | 0x150,
aravindsv 0:ba7650f404af 118
aravindsv 0:ba7650f404af 119 LED_RED = P2_17,
aravindsv 0:ba7650f404af 120 LED_GREEN = P2_16,
aravindsv 0:ba7650f404af 121 LED_BLUE = P2_18,
aravindsv 0:ba7650f404af 122
aravindsv 0:ba7650f404af 123 // mbed original LED naming
aravindsv 0:ba7650f404af 124 LED1 = LED_RED,
aravindsv 0:ba7650f404af 125 LED2 = LED_GREEN,
aravindsv 0:ba7650f404af 126 LED3 = LED_BLUE,
aravindsv 0:ba7650f404af 127 LED4 = LED_BLUE,
aravindsv 0:ba7650f404af 128
aravindsv 0:ba7650f404af 129 // Serial to USB pins
aravindsv 0:ba7650f404af 130 USBTX = P0_19,
aravindsv 0:ba7650f404af 131 USBRX = P0_18,
aravindsv 0:ba7650f404af 132
aravindsv 0:ba7650f404af 133 // Arduino Shield Receptacles Names
aravindsv 0:ba7650f404af 134 D0 = P0_18,
aravindsv 0:ba7650f404af 135 D1 = P0_19,
aravindsv 0:ba7650f404af 136 D2 = P1_18,
aravindsv 0:ba7650f404af 137 D3 = P1_24,
aravindsv 0:ba7650f404af 138 D4 = P1_19,
aravindsv 0:ba7650f404af 139 D5 = P1_26,
aravindsv 0:ba7650f404af 140 D6 = P1_27,
aravindsv 0:ba7650f404af 141 D7 = P1_25,
aravindsv 0:ba7650f404af 142 D8 = P1_28,
aravindsv 0:ba7650f404af 143 D9 = P2_3,
aravindsv 0:ba7650f404af 144 D10= P0_2,
aravindsv 0:ba7650f404af 145 D11= P0_9,
aravindsv 0:ba7650f404af 146 D12= P0_8,
aravindsv 0:ba7650f404af 147 D13= P1_29,
aravindsv 0:ba7650f404af 148 D14= P0_5,
aravindsv 0:ba7650f404af 149 D15= P0_4,
aravindsv 0:ba7650f404af 150
aravindsv 0:ba7650f404af 151 A0 = P1_9,
aravindsv 0:ba7650f404af 152 A1 = P0_14,
aravindsv 0:ba7650f404af 153 A2 = P0_13,
aravindsv 0:ba7650f404af 154 A3 = P0_12,
aravindsv 0:ba7650f404af 155 A4 = P0_5, // same port as SDA
aravindsv 0:ba7650f404af 156 A5 = P0_4, // same port as SCL
aravindsv 0:ba7650f404af 157 SDA= P0_5, // same port as A4
aravindsv 0:ba7650f404af 158 SCL= P0_4, // same port as A5
aravindsv 0:ba7650f404af 159
aravindsv 0:ba7650f404af 160 // Not connected
aravindsv 0:ba7650f404af 161 NC = (int)0xFFFFFFFF,
aravindsv 0:ba7650f404af 162 } PinName;
aravindsv 0:ba7650f404af 163
aravindsv 0:ba7650f404af 164 typedef enum {
aravindsv 0:ba7650f404af 165 PullUp = 2,
aravindsv 0:ba7650f404af 166 PullDown = 1,
aravindsv 0:ba7650f404af 167 PullNone = 0,
aravindsv 0:ba7650f404af 168 Repeater = 3,
aravindsv 0:ba7650f404af 169 OpenDrain = 4,
aravindsv 0:ba7650f404af 170 PullDefault = PullDown
aravindsv 0:ba7650f404af 171 } PinMode;
aravindsv 0:ba7650f404af 172
aravindsv 0:ba7650f404af 173 #define STDIO_UART_TX USBTX
aravindsv 0:ba7650f404af 174 #define STDIO_UART_RX USBRX
aravindsv 0:ba7650f404af 175 #define STDIO_UART UART_0
aravindsv 0:ba7650f404af 176
aravindsv 0:ba7650f404af 177 #ifdef __cplusplus
aravindsv 0:ba7650f404af 178 }
aravindsv 0:ba7650f404af 179 #endif
aravindsv 0:ba7650f404af 180
aravindsv 0:ba7650f404af 181 #endif