]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC82X/TARGET_SSCI824/PinNames.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_NXP / TARGET_LPC82X / TARGET_SSCI824 / 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     dp2 = P0_4,
66     dp3 = P0_28,
67     dp4 = P0_11,
68     dp5 = P0_10,
69     dp6 = P0_16,
70     dp7 = P0_27,
71     dp8 = P0_26,
72     dp9 = P0_25,
73     dp10 = P0_24,
74     dp11 = P0_15,
75     dp12 = P0_1,
76     
77     dp15 = P0_6,
78     dp16 = P0_0,
79     dp17 = P0_14,
80     dp18 = P0_23,
81     dp19 = P0_22,
82     dp20 = P0_21,
83     dp21 = P0_20,
84     dp22 = P0_19,
85     dp23 = P0_17,
86     dp24 = P0_13,
87     dp25 = P0_12,
88     dp26 = P0_5,
89     
90     LED_RED = P0_20,
91     LED_GREEN = P0_21,
92     LED_BLUE = P0_22,
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