]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC82X/TARGET_LPC824/PinNames.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_NXP / TARGET_LPC82X / TARGET_LPC824 / PinNames.h
1 /* mbed Microcontroller Library
2 * Copyright (c) 2006-2013 ARM Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 #ifndef MBED_PINNAMES_H
17 #define MBED_PINNAMES_H
18
19 #include "cmsis.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef enum {
26 PIN_INPUT,
27 PIN_OUTPUT
28 } PinDirection;
29
30 #define PIN_SHIFT 8
31
32 typedef enum {
33 // LPC824 Pin Names (PIN[11:8] + IOCON offset[7:0])
34
35 P0_0 = ( 0 << PIN_SHIFT) | 0x44,
36 P0_1 = ( 1 << PIN_SHIFT) | 0x2C,
37 P0_2 = ( 2 << PIN_SHIFT) | 0x18,
38 P0_3 = ( 3 << PIN_SHIFT) | 0x14,
39 P0_4 = ( 4 << PIN_SHIFT) | 0x10,
40 P0_5 = ( 5 << PIN_SHIFT) | 0x0C,
41 P0_6 = ( 6 << PIN_SHIFT) | 0x40,
42 P0_7 = ( 7 << PIN_SHIFT) | 0x3C,
43 P0_8 = ( 8 << PIN_SHIFT) | 0x38,
44 P0_9 = ( 9 << PIN_SHIFT) | 0x34,
45 P0_10 = (10 << PIN_SHIFT) | 0x20,
46 P0_11 = (11 << PIN_SHIFT) | 0x1C,
47 P0_12 = (12 << PIN_SHIFT) | 0x08,
48 P0_13 = (13 << PIN_SHIFT) | 0x04,
49 P0_14 = (14 << PIN_SHIFT) | 0x48,
50 P0_15 = (15 << PIN_SHIFT) | 0x28,
51 P0_16 = (16 << PIN_SHIFT) | 0x24,
52 P0_17 = (17 << PIN_SHIFT) | 0x00,
53 P0_18 = (18 << PIN_SHIFT) | 0x78,
54 P0_19 = (19 << PIN_SHIFT) | 0x74,
55 P0_20 = (20 << PIN_SHIFT) | 0x70,
56 P0_21 = (21 << PIN_SHIFT) | 0x6C,
57 P0_22 = (22 << PIN_SHIFT) | 0x68,
58 P0_23 = (23 << PIN_SHIFT) | 0x64,
59 P0_24 = (24 << PIN_SHIFT) | 0x60,
60 P0_25 = (25 << PIN_SHIFT) | 0x5C,
61 P0_26 = (26 << PIN_SHIFT) | 0x58,
62 P0_27 = (27 << PIN_SHIFT) | 0x54,
63 P0_28 = (28 << PIN_SHIFT) | 0x50,
64
65 D0 = P0_0,
66 D1 = P0_4,
67 D2 = P0_19,
68 D3 = P0_12, // LED_RED
69 D4 = P0_18,
70 D5 = P0_28,
71 D6 = P0_16, // LED_GREEN
72 D7 = P0_17,
73 D8 = P0_13,
74 D9 = P0_27, // LED_BLUE
75 D10 = P0_15,
76 D11 = P0_26,
77 D12 = P0_25,
78 D13 = P0_24,
79 D14 = P0_11,
80 D15 = P0_10,
81
82 A0 = P0_6,
83 A1 = P0_14,
84 A2 = P0_23,
85 A3 = P0_22,
86 A4 = P0_21,
87 A5 = P0_20,
88
89 // LPC824-MAX board
90 LED_RED = P0_12,
91 LED_GREEN = P0_16,
92 LED_BLUE = P0_27,
93
94 // mbed original LED naming
95 LED1 = LED_RED,
96 LED2 = LED_GREEN,
97 LED3 = LED_BLUE,
98 LED4 = LED_BLUE,
99
100 // Serial to USB pins
101 USBTX = P0_7,
102 USBRX = P0_18,
103
104 // I2C pins
105 SCL = P0_10,
106 SDA = P0_11,
107 I2C_SCL = P0_10,
108 I2C_SDA = P0_11,
109
110 // Not connected
111 NC = (int)0xFFFFFFFF,
112 } PinName;
113
114 typedef enum {
115 PullUp = 2,
116 PullDown = 1,
117 PullNone = 0,
118 Repeater = 3,
119 OpenDrain = 4,
120 PullDefault = PullDown
121 } PinMode;
122
123 #define STDIO_UART_TX USBTX
124 #define STDIO_UART_RX USBRX
125
126 typedef struct {
127 unsigned char n;
128 unsigned char offset;
129 } SWM_Map;
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif
Imprint / Impressum