Skip to content

Commit 93ae6f9

Browse files
Merge pull request #4290 from NXPmicro/Add_LPC54114_Support
Add mbed support for LPCXpresso54114 & LPCXpresso54608 boards
2 parents c5a5ff0 + 316b859 commit 93ae6f9

File tree

212 files changed

+87286
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+87286
-6
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
#include "PortNames.h"
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
typedef enum {
27+
OSC32KCLK = 0,
28+
} RTCName;
29+
30+
typedef enum {
31+
UART_0 = Flexcomm0,
32+
UART_1 = Flexcomm2
33+
} UARTName;
34+
35+
#define STDIO_UART_TX USBTX
36+
#define STDIO_UART_RX USBRX
37+
#define STDIO_UART UART_0
38+
39+
typedef enum {
40+
I2C_0 = Flexcomm1,
41+
I2C_1 = Flexcomm4
42+
} I2CName;
43+
44+
#define TPM_SHIFT 8
45+
typedef enum {
46+
PWM_1 = (0 << TPM_SHIFT) | (0), // FTM0 CH0
47+
PWM_2 = (0 << TPM_SHIFT) | (1), // FTM0 CH1
48+
PWM_3 = (0 << TPM_SHIFT) | (2), // FTM0 CH2
49+
PWM_4 = (0 << TPM_SHIFT) | (3), // FTM0 CH3
50+
PWM_5 = (0 << TPM_SHIFT) | (4), // FTM0 CH4
51+
PWM_6 = (0 << TPM_SHIFT) | (5), // FTM0 CH5
52+
PWM_7 = (0 << TPM_SHIFT) | (6), // FTM0 CH6
53+
PWM_8 = (0 << TPM_SHIFT) | (7), // FTM0 CH7
54+
PWM_9 = (1 << TPM_SHIFT) | (0), // FTM1 CH0
55+
PWM_10 = (1 << TPM_SHIFT) | (1), // FTM1 CH1
56+
PWM_11 = (1 << TPM_SHIFT) | (2), // FTM1 CH2
57+
PWM_12 = (1 << TPM_SHIFT) | (3), // FTM1 CH3
58+
PWM_13 = (1 << TPM_SHIFT) | (4), // FTM1 CH4
59+
PWM_14 = (1 << TPM_SHIFT) | (5), // FTM1 CH5
60+
PWM_15 = (1 << TPM_SHIFT) | (6), // FTM1 CH6
61+
PWM_16 = (1 << TPM_SHIFT) | (7), // FTM1 CH7
62+
PWM_17 = (2 << TPM_SHIFT) | (0), // FTM2 CH0
63+
PWM_18 = (2 << TPM_SHIFT) | (1), // FTM2 CH1
64+
PWM_19 = (2 << TPM_SHIFT) | (2), // FTM2 CH2
65+
PWM_20 = (2 << TPM_SHIFT) | (3), // FTM2 CH3
66+
PWM_21 = (2 << TPM_SHIFT) | (4), // FTM2 CH4
67+
PWM_22 = (2 << TPM_SHIFT) | (5), // FTM2 CH5
68+
PWM_23 = (2 << TPM_SHIFT) | (6), // FTM2 CH6
69+
PWM_24 = (2 << TPM_SHIFT) | (7), // FTM2 CH7
70+
PWM_25 = (3 << TPM_SHIFT) | (0), // FTM3 CH0
71+
PWM_26 = (3 << TPM_SHIFT) | (1), // FTM3 CH1
72+
PWM_27 = (3 << TPM_SHIFT) | (2), // FTM3 CH2
73+
PWM_28 = (3 << TPM_SHIFT) | (3), // FTM3 CH3
74+
PWM_29 = (3 << TPM_SHIFT) | (4), // FTM3 CH4
75+
PWM_30 = (3 << TPM_SHIFT) | (5), // FTM3 CH5
76+
PWM_31 = (3 << TPM_SHIFT) | (6), // FTM3 CH6
77+
PWM_32 = (3 << TPM_SHIFT) | (7), // FTM3 CH7
78+
} PWMName;
79+
80+
#define ADC_INSTANCE_SHIFT 8
81+
#define ADC_B_CHANNEL_SHIFT 5
82+
typedef enum {
83+
ADC0_SE0 = 0,
84+
ADC0_SE1 = 1,
85+
ADC0_SE2 = 2,
86+
ADC0_SE3 = 3,
87+
ADC0_SE4 = 4,
88+
ADC0_SE5 = 5,
89+
ADC0_SE6 = 6,
90+
ADC0_SE7 = 7,
91+
ADC0_SE8 = 8,
92+
ADC0_SE9 = 9,
93+
ADC0_SE10 = 10,
94+
ADC0_SE11 = 11,
95+
} ADCName;
96+
97+
98+
typedef enum {
99+
SPI_0 = Flexcomm3,
100+
SPI_1 = Flexcomm5
101+
} SPIName;
102+
103+
#ifdef __cplusplus
104+
}
105+
#endif
106+
107+
#endif
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
17+
#include "PeripheralPins.h"
18+
19+
/************RTC***************/
20+
const PinMap PinMap_RTC[] = {
21+
{NC, OSC32KCLK, 0},
22+
};
23+
24+
/************ADC***************/
25+
const PinMap PinMap_ADC[] = {
26+
{P0_30, ADC0_SE1, 0},
27+
{P1_4, ADC0_SE7, 0},
28+
{P1_5, ADC0_SE8, 0},
29+
{P1_8, ADC0_SE11, 0},
30+
{NC , NC , 0}
31+
};
32+
33+
/************DAC***************/
34+
const PinMap PinMap_DAC[] = {
35+
{NC , NC , 0}
36+
};
37+
38+
/************I2C***************/
39+
const PinMap PinMap_I2C_SDA[] = {
40+
{P0_24, I2C_0, 1},
41+
{P0_26, I2C_1, 1},
42+
{NC , NC , 0}
43+
};
44+
45+
const PinMap PinMap_I2C_SCL[] = {
46+
{P0_23, I2C_0, 1},
47+
{P0_25, I2C_1, 1},
48+
{NC , NC , 0}
49+
};
50+
51+
/************UART***************/
52+
const PinMap PinMap_UART_TX[] = {
53+
{P0_1, UART_0, 1},
54+
{P0_9, UART_1, 1},
55+
{NC , NC , 0}
56+
};
57+
58+
const PinMap PinMap_UART_RX[] = {
59+
{P0_0, UART_0, 1},
60+
{P0_8, UART_1, 1},
61+
{NC , NC , 0}
62+
};
63+
64+
const PinMap PinMap_UART_CTS[] = {
65+
{NC , NC , 0}
66+
};
67+
68+
const PinMap PinMap_UART_RTS[] = {
69+
{NC , NC , 0}
70+
};
71+
72+
/************SPI***************/
73+
const PinMap PinMap_SPI_SCLK[] = {
74+
{P0_11, SPI_0, 1},
75+
{P0_19, SPI_1, 1},
76+
{NC , NC , 0}
77+
};
78+
79+
const PinMap PinMap_SPI_MOSI[] = {
80+
{P0_12, SPI_0, 1},
81+
{P0_20, SPI_1, 1},
82+
{NC , NC , 0}
83+
};
84+
85+
const PinMap PinMap_SPI_MISO[] = {
86+
{P0_13, SPI_0, 1},
87+
{P0_18, SPI_1, 1},
88+
{NC , NC , 0}
89+
};
90+
91+
const PinMap PinMap_SPI_SSEL[] = {
92+
{P0_14, SPI_0, 1},
93+
{P1_1, SPI_1, 4},
94+
{P1_2, SPI_1, 4},
95+
{NC , NC , 0}
96+
};
97+
98+
/************PWM***************/
99+
const PinMap PinMap_PWM[] = {
100+
{NC , NC , 0}
101+
};
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
P0_0 = 0,
34+
P0_1 = 1,
35+
P0_2 = 2,
36+
P0_3 = 3,
37+
P0_4 = 4,
38+
P0_5 = 5,
39+
P0_6 = 6,
40+
P0_7 = 7,
41+
P0_8 = 8,
42+
P0_9 = 9,
43+
P0_10 = 10,
44+
P0_11 = 11,
45+
P0_12 = 12,
46+
P0_13 = 13,
47+
P0_14 = 14,
48+
P0_15 = 15,
49+
P0_16 = 16,
50+
P0_17 = 17,
51+
P0_18 = 18,
52+
P0_19 = 19,
53+
P0_20 = 20,
54+
P0_21 = 21,
55+
P0_22 = 22,
56+
P0_23 = 23,
57+
P0_24 = 24,
58+
P0_25 = 25,
59+
P0_26 = 26,
60+
P0_29 = 29,
61+
P0_30 = 30,
62+
P0_31 = 31,
63+
64+
P1_0 = 32,
65+
P1_1 = 33,
66+
P1_2 = 34,
67+
P1_3 = 35,
68+
P1_4 = 36,
69+
P1_5 = 37,
70+
P1_6 = 38,
71+
P1_7 = 39,
72+
P1_8 = 40,
73+
P1_9 = 41,
74+
P1_10 = 42,
75+
P1_11 = 43,
76+
P1_12 = 44,
77+
P1_13 = 45,
78+
P1_14 = 46,
79+
P1_15 = 47,
80+
P1_16 = 48,
81+
P1_17 = 49,
82+
83+
LED_RED = P0_29,
84+
LED_GREEN = P1_10,
85+
LED_BLUE = P1_9,
86+
87+
// mbed original LED naming
88+
LED1 = LED_RED,
89+
LED2 = LED_GREEN,
90+
LED3 = LED_BLUE,
91+
LED4 = LED_RED,
92+
93+
//Push buttons
94+
SW1 = P0_24,
95+
SW2 = P0_31,
96+
SW3 = P0_4,
97+
98+
// USB Pins
99+
USBTX = P0_1,
100+
USBRX = P0_0,
101+
102+
// Arduino Headers
103+
D0 = P0_8,
104+
D1 = P0_9,
105+
D2 = P0_10,
106+
D3 = P1_12,
107+
D4 = P1_13,
108+
D5 = P0_29,
109+
D6 = P1_0,
110+
D7 = P1_14,
111+
D8 = P1_16,
112+
D9 = P1_15,
113+
D10 = P1_1,
114+
D11 = P0_20,
115+
D12 = P0_18,
116+
D13 = P0_19,
117+
D14 = P0_26,
118+
D15 = P0_25,
119+
120+
I2C_SCL = D15,
121+
I2C_SDA = D14,
122+
123+
// Not connected
124+
NC = (int)0xFFFFFFFF,
125+
126+
A0 = P0_30,
127+
A1 = NC,
128+
A2 = P1_8,
129+
A3 = P1_10,
130+
A4 = P1_4,
131+
A5 = P1_5
132+
} PinName;
133+
134+
135+
typedef enum {
136+
PullNone = 0,
137+
PullDown = 1,
138+
PullUp = 2,
139+
PullDefault = PullUp
140+
} PinMode;
141+
142+
#ifdef __cplusplus
143+
}
144+
#endif
145+
146+
#endif

0 commit comments

Comments
 (0)