Skip to content

Commit 1ae5a1d

Browse files
author
Bogdan Marinescu
committed
Added pin definitions for LPC11U35 quick stard board
1 parent f5e1f70 commit 1ae5a1d

File tree

7 files changed

+486
-1
lines changed

7 files changed

+486
-1
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
UART_0 = (int)LPC_USART_BASE
27+
} UARTName;
28+
29+
typedef enum {
30+
I2C_0 = (int)LPC_I2C_BASE
31+
} I2CName;
32+
33+
typedef enum {
34+
ADC0_0 = 0,
35+
ADC0_1,
36+
ADC0_2,
37+
ADC0_3,
38+
ADC0_4,
39+
ADC0_5,
40+
ADC0_6,
41+
ADC0_7
42+
} ADCName;
43+
44+
typedef enum {
45+
SPI_0 = (int)LPC_SSP0_BASE,
46+
SPI_1 = (int)LPC_SSP1_BASE
47+
} SPIName;
48+
49+
typedef enum {
50+
PWM_1 = 0,
51+
PWM_2,
52+
PWM_3,
53+
PWM_4,
54+
PWM_5,
55+
PWM_6,
56+
PWM_7,
57+
PWM_8,
58+
PWM_9,
59+
PWM_10,
60+
PWM_11
61+
} PWMName;
62+
63+
#define STDIO_UART_TX USBTX
64+
#define STDIO_UART_RX USBRX
65+
#define STDIO_UART UART_0
66+
67+
// Default peripherals
68+
#define MBED_SPI0 p5, p6, p7, p8
69+
#define MBED_SPI1 p11, p12, p13, p14
70+
71+
#define MBED_UART0 p9, p10
72+
#define MBED_UARTUSB USBTX, USBRX
73+
74+
#define MBED_I2C0 p28, p27
75+
76+
#define MBED_ANALOGIN0 p15
77+
#define MBED_ANALOGIN1 p16
78+
#define MBED_ANALOGIN2 p17
79+
#define MBED_ANALOGIN3 p18
80+
#define MBED_ANALOGIN4 p19
81+
#define MBED_ANALOGIN5 p20
82+
83+
#ifdef __cplusplus
84+
}
85+
#endif
86+
87+
#endif
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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 PORT_SHIFT 5
31+
32+
typedef enum {
33+
// LPC11U Pin Names
34+
P0_0 = 0,
35+
P0_1 = 1,
36+
P0_2 = 2,
37+
P0_3 = 3,
38+
P0_4 = 4,
39+
P0_5 = 5,
40+
P0_6 = 6,
41+
P0_7 = 7,
42+
P0_8 = 8,
43+
P0_9 = 9,
44+
P0_10 = 10,
45+
P0_11 = 11,
46+
P0_12 = 12,
47+
P0_13 = 13,
48+
P0_14 = 14,
49+
P0_15 = 15,
50+
P0_16 = 16,
51+
P0_17 = 17,
52+
P0_18 = 18,
53+
P0_19 = 19,
54+
P0_20 = 20,
55+
P0_21 = 21,
56+
P0_22 = 22,
57+
P0_23 = 23,
58+
P0_24 = 24,
59+
P0_25 = 25,
60+
P0_26 = 26,
61+
P0_27 = 27,
62+
63+
P1_0 = 32,
64+
P1_1 = 33,
65+
P1_2 = 34,
66+
P1_3 = 35,
67+
P1_4 = 36,
68+
P1_5 = 37,
69+
P1_6 = 38,
70+
P1_7 = 39,
71+
P1_8 = 40,
72+
P1_9 = 41,
73+
P1_10 = 42,
74+
P1_11 = 43,
75+
P1_12 = 44,
76+
P1_13 = 45,
77+
P1_14 = 46,
78+
P1_15 = 47,
79+
P1_16 = 48,
80+
P1_17 = 49,
81+
P1_18 = 50,
82+
P1_19 = 51,
83+
P1_20 = 52,
84+
P1_21 = 53,
85+
P1_22 = 54,
86+
P1_23 = 55,
87+
P1_24 = 56,
88+
P1_25 = 57,
89+
P1_26 = 58,
90+
P1_27 = 59,
91+
P1_28 = 60,
92+
P1_29 = 61,
93+
94+
P1_31 = 63,
95+
96+
// mbed DIP Pin Names
97+
p5 = P0_9,
98+
p6 = P0_8,
99+
p7 = P1_29,
100+
p8 = P0_2,
101+
p9 = P1_27,
102+
p10 = P1_26,
103+
p11 = P1_22,
104+
p12 = P1_21,
105+
p13 = P1_20,
106+
p14 = P1_23,
107+
p15 = P0_11,
108+
p16 = P0_12,
109+
p17 = P0_13,
110+
p18 = P0_14,
111+
p19 = P0_16,
112+
p20 = P0_22,
113+
p21 = P0_7,
114+
p22 = P0_17,
115+
p23 = P1_17,
116+
p24 = P1_18,
117+
p25 = P1_24,
118+
p26 = P1_25,
119+
p27 = P0_4,
120+
p28 = P0_5,
121+
p29 = P1_5,
122+
p30 = P1_2,
123+
124+
p33 = P0_3,
125+
p34 = P1_15,
126+
p35 = P0_20,
127+
p36 = P0_21,
128+
129+
// Other mbed Pin Names
130+
LED1 = P1_8,
131+
LED2 = P1_9,
132+
LED3 = P1_10,
133+
LED4 = P1_11,
134+
135+
USBTX = P0_19,
136+
USBRX = P0_18,
137+
138+
// Not connected
139+
NC = (int)0xFFFFFFFF,
140+
} PinName;
141+
142+
typedef enum {
143+
CHANNEL0 = FLEX_INT0_IRQn,
144+
CHANNEL1 = FLEX_INT1_IRQn,
145+
CHANNEL2 = FLEX_INT2_IRQn,
146+
CHANNEL3 = FLEX_INT3_IRQn,
147+
CHANNEL4 = FLEX_INT4_IRQn,
148+
CHANNEL5 = FLEX_INT5_IRQn,
149+
CHANNEL6 = FLEX_INT6_IRQn,
150+
CHANNEL7 = FLEX_INT7_IRQn
151+
} Channel;
152+
153+
typedef enum {
154+
PullUp = 2,
155+
PullDown = 1,
156+
PullNone = 0,
157+
Repeater = 3,
158+
OpenDrain = 4
159+
} PinMode;
160+
161+
#ifdef __cplusplus
162+
}
163+
#endif
164+
165+
#endif
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
UART_0 = (int)LPC_USART_BASE
27+
} UARTName;
28+
29+
typedef enum {
30+
I2C_0 = (int)LPC_I2C_BASE
31+
} I2CName;
32+
33+
typedef enum {
34+
ADC0_0 = 0,
35+
ADC0_1,
36+
ADC0_2,
37+
ADC0_3,
38+
ADC0_4,
39+
ADC0_5,
40+
ADC0_6,
41+
ADC0_7
42+
} ADCName;
43+
44+
typedef enum {
45+
SPI_0 = (int)LPC_SSP0_BASE,
46+
SPI_1 = (int)LPC_SSP1_BASE
47+
} SPIName;
48+
49+
typedef enum {
50+
PWM_1 = 0,
51+
PWM_2,
52+
PWM_3,
53+
PWM_4,
54+
PWM_5,
55+
PWM_6,
56+
PWM_7,
57+
PWM_8,
58+
PWM_9,
59+
PWM_10,
60+
PWM_11
61+
} PWMName;
62+
63+
#define STDIO_UART_TX UART_TX
64+
#define STDIO_UART_RX UART_RX
65+
#define STDIO_UART UART_0
66+
67+
#ifdef __cplusplus
68+
}
69+
#endif
70+
71+
#endif

0 commit comments

Comments
 (0)