2bdbeedc6c5cf467844668d8aa4ac46f737caf25
[clinton/Smoothieware.git] / gcc4mbed / external / mbed / PinNames.h
1 /* mbed Microcontroller Library - PinNames
2 * Copyright (C) 2008-2011 ARM Limited. All rights reserved.
3 *
4 * Provides the mapping of mbed DIP and LPC Pin Names
5 */
6
7 #ifndef MBED_PINNAMES_H
8 #define MBED_PINNAMES_H
9
10 #include "cmsis.h"
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
17
18 enum PinName {
19
20 // LPC Pin Names
21 P0_0 = LPC_GPIO0_BASE, P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7
22 , P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15
23 , P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23
24 , P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31
25 , P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7
26 , P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15
27 , P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23
28 , P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31
29 , P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7
30 , P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15
31 , P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23
32 , P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31
33 , P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7
34 , P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15
35 , P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23
36 , P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31
37 , P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7
38 , P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15
39 , P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23
40 , P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31
41
42 // mbed DIP Pin Names
43 , p5 = P0_9
44 , p6 = P0_8
45 , p7 = P0_7
46 , p8 = P0_6
47 , p9 = P0_0
48 , p10 = P0_1
49 , p11 = P0_18
50 , p12 = P0_17
51 , p13 = P0_15
52 , p14 = P0_16
53 , p15 = P0_23
54 , p16 = P0_24
55 , p17 = P0_25
56 , p18 = P0_26
57 , p19 = P1_30
58 , p20 = P1_31
59 , p21 = P2_5
60 , p22 = P2_4
61 , p23 = P2_3
62 , p24 = P2_2
63 , p25 = P2_1
64 , p26 = P2_0
65 , p27 = P0_11
66 , p28 = P0_10
67 , p29 = P0_5
68 , p30 = P0_4
69
70 // Other mbed Pin Names
71 #ifdef MCB1700
72 , LED1 = P1_28
73 , LED2 = P1_29
74 , LED3 = P1_31
75 , LED4 = P2_2
76 #else
77 , LED1 = P1_18
78 , LED2 = P1_20
79 , LED3 = P1_21
80 , LED4 = P1_23
81 #endif
82 , USBTX = P0_2
83 , USBRX = P0_3
84
85 // Not connected
86 , NC = (int)0xFFFFFFFF
87
88 };
89 typedef enum PinName PinName;
90
91 enum PinMode {
92 PullUp = 0
93 , PullDown = 3
94 , PullNone = 2
95 , OpenDrain = 4
96 };
97 typedef enum PinMode PinMode;
98
99 // version of PINCON_TypeDef using register arrays
100 typedef struct {
101 __IO uint32_t PINSEL[11];
102 uint32_t RESERVED0[5];
103 __IO uint32_t PINMODE[10];
104 #ifndef TARGET_LPC2368
105 // Open drain mode is not available on LPC2368
106 __IO uint32_t PINMODE_OD[5];
107 #endif
108 } PINCONARRAY_TypeDef;
109
110 #define PINCONARRAY ((PINCONARRAY_TypeDef *)LPC_PINCON_BASE)
111
112
113 #elif defined(TARGET_LPC11U24)
114
115 enum PinName {
116
117 // LPC11U Pin Names
118 P0_0 = 0
119 , P0_1 = 1
120 , P0_2 = 2
121 , P0_3 = 3
122 , P0_4 = 4
123 , P0_5 = 5
124 , P0_6 = 6
125 , P0_7 = 7
126 , P0_8 = 8
127 , P0_9 = 9
128 , P0_10 = 10
129 , P0_11 = 11
130 , P0_12 = 12
131 , P0_13 = 13
132 , P0_14 = 14
133 , P0_15 = 15
134 , P0_16 = 16
135 , P0_17 = 17
136 , P0_18 = 18
137 , P0_19 = 19
138 , P0_20 = 20
139 , P0_21 = 21
140 , P0_22 = 22
141 , P0_23 = 23
142 , P0_24 = 24
143 , P0_25 = 25
144 , P0_26 = 26
145 , P0_27 = 27
146
147 , P1_0 = 32
148 , P1_1 = 33
149 , P1_2 = 34
150 , P1_3 = 35
151 , P1_4 = 36
152 , P1_5 = 37
153 , P1_6 = 38
154 , P1_7 = 39
155 , P1_8 = 40
156 , P1_9 = 41
157 , P1_10 = 42
158 , P1_11 = 43
159 , P1_12 = 44
160 , P1_13 = 45
161 , P1_14 = 46
162 , P1_15 = 47
163 , P1_16 = 48
164 , P1_17 = 49
165 , P1_18 = 50
166 , P1_19 = 51
167 , P1_20 = 52
168 , P1_21 = 53
169 , P1_22 = 54
170 , P1_23 = 55
171 , P1_24 = 56
172 , P1_25 = 57
173 , P1_26 = 58
174 , P1_27 = 59
175 , P1_28 = 60
176 , P1_29 = 61
177
178 , P1_31 = 63
179
180 // mbed DIP Pin Names
181 , p5 = P0_9
182 , p6 = P0_8
183 , p7 = P1_29
184 , p8 = P0_2
185 , p9 = P1_27
186 , p10 = P1_26
187 , p11 = P1_22
188 , p12 = P1_21
189 , p13 = P1_20
190 , p14 = P1_23
191 , p15 = P0_11
192 , p16 = P0_12
193 , p17 = P0_13
194 , p18 = P0_14
195 , p19 = P0_16
196 , p20 = P0_22
197 , p21 = P0_7
198 , p22 = P0_17
199 , p23 = P1_17
200 , p24 = P1_18
201 , p25 = P1_24
202 , p26 = P1_25
203 , p27 = P0_4
204 , p28 = P0_5
205 , p29 = P1_5
206 , p30 = P1_2
207
208 , p33 = P0_3
209 , p34 = P1_15
210 , p35 = P0_20
211 , p36 = P0_21
212
213 // Other mbed Pin Names
214 , LED1 = P1_8
215 , LED2 = P1_9
216 , LED3 = P1_10
217 , LED4 = P1_11
218
219 , USBTX = P0_19
220 , USBRX = P0_18
221
222 // Not connected
223 , NC = (int)0xFFFFFFFF
224
225 };
226 typedef enum PinName PinName;
227
228 typedef enum {
229 CHANNEL0=FLEX_INT0_IRQn,
230 CHANNEL1=FLEX_INT1_IRQn,
231 CHANNEL2=FLEX_INT2_IRQn,
232 CHANNEL3=FLEX_INT3_IRQn,
233 CHANNEL4=FLEX_INT4_IRQn,
234 CHANNEL5=FLEX_INT5_IRQn,
235 CHANNEL6=FLEX_INT6_IRQn,
236 CHANNEL7=FLEX_INT7_IRQn
237 } Channel;
238
239 enum PinMode {
240 PullUp = 2
241 , PullDown = 1
242 , PullNone = 0
243 , Repeater = 3
244 , OpenDrain = 4
245 };
246 typedef enum PinMode PinMode;
247 #endif
248
249
250 #ifdef __cplusplus
251 }
252 #endif
253
254 #endif