Skip to content

Commit 522da04

Browse files
committed
Merge pull request #12 from micromint/master
Update targets and pins for LPC43xx
2 parents a2e5281 + 804176b commit 522da04

File tree

2 files changed

+199
-5
lines changed

2 files changed

+199
-5
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC43XX/PinNames.h

Lines changed: 177 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef enum {
3030
#define PORT_SHIFT 5
3131
#define NO_GPIO 15
3232

33-
// On the LPC43xx the hardware pin name and the GPIO pin name are not the same.
33+
// On the LPC43xx the MCU pin name and the GPIO pin name are not the same.
3434
// Encode SCU and GPIO offsets as a pin identifier
3535
#define MBED_PIN(group, num, port, pin) ((SCU_OFF(group,num) << 16) + GPIO_OFF(port,pin))
3636

@@ -75,7 +75,7 @@ typedef enum {
7575
P1_4 = MBED_PIN(0x01, 4, 0, 11), // GPIO0[11]
7676
P1_5 = MBED_PIN(0x01, 5, 1, 8), // GPIO1[8]
7777
P1_6 = MBED_PIN(0x01, 6, 1, 9), // GPIO1[9]
78-
P1_7 = MBED_PIN(0x01, 7, 1, 10), // GPIO1[10]
78+
P1_7 = MBED_PIN(0x01, 7, 1, 0), // GPIO1[0]
7979
P1_8 = MBED_PIN(0x01, 8, 1, 1), // GPIO1[1]
8080
P1_9 = MBED_PIN(0x01, 9, 1, 2), // GPIO1[2]
8181
P1_10 = MBED_PIN(0x01, 10, 1, 3), // GPIO1[3]
@@ -98,7 +98,7 @@ typedef enum {
9898
P2_5 = MBED_PIN(0x02, 5, 5, 5), // GPIO5[5] high-drive
9999
P2_6 = MBED_PIN(0x02, 6, 5, 6), // GPIO5[6]
100100
P2_7 = MBED_PIN(0x02, 7, 0, 7), // GPIO0[7]
101-
P2_8 = MBED_PIN(0x02, 8, 5, 0), // GPIO5[7]
101+
P2_8 = MBED_PIN(0x02, 8, 5, 7), // GPIO5[7]
102102
P2_9 = MBED_PIN(0x02, 9, 1, 10), // GPIO1[10]
103103
P2_10 = MBED_PIN(0x02, 10, 0, 14), // GPIO0[14]
104104
P2_11 = MBED_PIN(0x02, 11, 1, 11), // GPIO1[11]
@@ -127,7 +127,7 @@ typedef enum {
127127
P4_9 = MBED_PIN(0x04, 9, 5, 13), // GPIO5[13]
128128
P4_10 = MBED_PIN(0x04, 10, 5, 14), // GPIO5[14]
129129

130-
P5_0 = MBED_PIN(0x05, 0, 2, 0), // GPIO2[9]
130+
P5_0 = MBED_PIN(0x05, 0, 2, 9), // GPIO2[9]
131131
P5_1 = MBED_PIN(0x05, 1, 2, 10), // GPIO2[10]
132132
P5_2 = MBED_PIN(0x05, 2, 2, 11), // GPIO2[11]
133133
P5_3 = MBED_PIN(0x05, 3, 2, 12), // GPIO2[12]
@@ -255,6 +255,179 @@ typedef enum {
255255
PF_10 = MBED_PIN(0x0F, 10, 7, 24), // GPIO7[24]
256256
PF_11 = MBED_PIN(0x0F, 11, 7, 25), // GPIO7[25]
257257

258+
// GPIO pins from MCU pins
259+
GPIO0_0 = P0_0,
260+
GPIO0_1 = P0_1 ,
261+
GPIO0_2 = P1_15,
262+
GPIO0_3 = P1_16,
263+
GPIO0_4 = P1_0,
264+
GPIO0_5 = P6_6,
265+
GPIO0_6 = P3_6,
266+
GPIO0_7 = P2_7,
267+
GPIO0_8 = P1_1,
268+
GPIO0_9 = P1_2,
269+
GPIO0_10 = P1_3,
270+
GPIO0_11 = P1_4,
271+
GPIO0_12 = P1_17,
272+
GPIO0_13 = P1_18,
273+
GPIO0_14 = P2_10,
274+
GPIO0_15 = P1_20,
275+
276+
GPIO1_0 = P1_7,
277+
GPIO1_1 = P1_8,
278+
GPIO1_2 = P1_9,
279+
GPIO1_3 = P1_10,
280+
GPIO1_4 = P1_11,
281+
GPIO1_5 = P1_12,
282+
GPIO1_6 = P1_13,
283+
GPIO1_7 = P1_14,
284+
GPIO1_8 = P1_5,
285+
GPIO1_9 = P1_6,
286+
GPIO1_10 = P2_9,
287+
GPIO1_11 = P2_11,
288+
GPIO1_12 = P2_12,
289+
GPIO1_13 = P2_13,
290+
GPIO1_14 = P3_4,
291+
GPIO1_15 = P3_5,
292+
293+
GPIO2_0 = P4_0,
294+
GPIO2_1 = P4_1,
295+
GPIO2_2 = P4_2,
296+
GPIO2_3 = P4_3,
297+
GPIO2_4 = P4_4,
298+
GPIO2_5 = P4_5,
299+
GPIO2_6 = P4_6,
300+
GPIO2_7 = P5_7,
301+
GPIO2_8 = P6_12,
302+
GPIO2_9 = P5_0,
303+
GPIO2_10 = P5_1,
304+
GPIO2_11 = P5_2,
305+
GPIO2_12 = P5_3,
306+
GPIO2_13 = P5_4,
307+
GPIO2_14 = P5_5,
308+
GPIO2_15 = P5_6,
309+
310+
GPIO3_0 = P6_1,
311+
GPIO3_1 = P6_2,
312+
GPIO3_2 = P6_3,
313+
GPIO3_3 = P6_4,
314+
GPIO3_4 = P6_5,
315+
GPIO3_5 = P6_9,
316+
GPIO3_6 = P6_10,
317+
GPIO3_7 = P6_11,
318+
GPIO3_8 = P7_0,
319+
GPIO3_9 = P7_1,
320+
GPIO3_10 = P7_2,
321+
GPIO3_11 = P7_3,
322+
GPIO3_12 = P7_4,
323+
GPIO3_13 = P7_5,
324+
GPIO3_14 = P7_6,
325+
GPIO3_15 = P7_7,
326+
327+
GPIO4_0 = P8_0,
328+
GPIO4_1 = P8_1,
329+
GPIO4_2 = P8_2,
330+
GPIO4_3 = P8_3,
331+
GPIO4_4 = P8_4,
332+
GPIO4_5 = P8_5,
333+
GPIO4_6 = P8_6,
334+
GPIO4_7 = P8_7,
335+
GPIO4_8 = PA_1,
336+
GPIO4_9 = PA_2,
337+
GPIO4_10 = PA_3,
338+
GPIO4_11 = P9_6,
339+
GPIO4_12 = P9_0,
340+
GPIO4_13 = P9_1,
341+
GPIO4_14 = P9_2,
342+
GPIO4_15 = P9_3,
343+
344+
GPIO5_0 = P2_0,
345+
GPIO5_1 = P2_1,
346+
GPIO5_2 = P2_2,
347+
GPIO5_3 = P2_3,
348+
GPIO5_4 = P2_4,
349+
GPIO5_5 = P2_5,
350+
GPIO5_6 = P2_6,
351+
GPIO5_7 = P2_8,
352+
GPIO5_8 = P3_1,
353+
GPIO5_9 = P3_2,
354+
GPIO5_10 = P3_7,
355+
GPIO5_11 = P3_8,
356+
GPIO5_12 = P4_8,
357+
GPIO5_13 = P4_9,
358+
GPIO5_14 = P4_10,
359+
GPIO5_15 = P6_7,
360+
GPIO5_16 = P6_8,
361+
GPIO5_17 = P9_4,
362+
GPIO5_18 = P9_5,
363+
GPIO5_19 = PA_4,
364+
GPIO5_20 = PB_0,
365+
GPIO5_21 = PB_1,
366+
GPIO5_22 = PB_2,
367+
GPIO5_23 = PB_3,
368+
GPIO5_24 = PB_4,
369+
GPIO5_25 = PB_5,
370+
GPIO5_26 = PB_6,
371+
372+
GPIO6_0 = PC_1,
373+
GPIO6_1 = PC_2,
374+
GPIO6_2 = PC_3,
375+
GPIO6_3 = PC_4,
376+
GPIO6_4 = PC_5,
377+
GPIO6_5 = PC_6,
378+
GPIO6_6 = PC_7,
379+
GPIO6_7 = PC_8,
380+
GPIO6_8 = PC_9,
381+
GPIO6_9 = PC_10,
382+
GPIO6_10 = PC_11,
383+
GPIO6_11 = PC_12,
384+
GPIO6_12 = PC_13,
385+
GPIO6_13 = PC_14,
386+
GPIO6_14 = PD_0,
387+
GPIO6_15 = PD_1,
388+
GPIO6_16 = PD_2,
389+
GPIO6_17 = PD_3,
390+
GPIO6_18 = PD_4,
391+
GPIO6_19 = PD_5,
392+
GPIO6_20 = PD_6,
393+
GPIO6_21 = PD_7,
394+
GPIO6_22 = PD_8,
395+
GPIO6_23 = PD_9,
396+
GPIO6_24 = PD_10,
397+
GPIO6_25 = PD_11,
398+
GPIO6_26 = PD_12,
399+
GPIO6_27 = PD_13,
400+
GPIO6_28 = PD_14,
401+
GPIO6_29 = PD_15,
402+
GPIO6_30 = PD_16,
403+
404+
GPIO7_0 = PE_0,
405+
GPIO7_1 = PE_1,
406+
GPIO7_2 = PE_2,
407+
GPIO7_3 = PE_3,
408+
GPIO7_4 = PE_4,
409+
GPIO7_5 = PE_5,
410+
GPIO7_6 = PE_5,
411+
GPIO7_7 = PE_7,
412+
GPIO7_8 = PE_8,
413+
GPIO7_9 = PE_9,
414+
GPIO7_10 = PE_10,
415+
GPIO7_11 = PE_11,
416+
GPIO7_12 = PE_12,
417+
GPIO7_13 = PE_13,
418+
GPIO7_14 = PE_14,
419+
GPIO7_15 = PE_15,
420+
GPIO7_16 = PF_1,
421+
GPIO7_17 = PF_2,
422+
GPIO7_18 = PF_3,
423+
GPIO7_19 = PF_5,
424+
GPIO7_20 = PF_6,
425+
GPIO7_21 = PF_7,
426+
GPIO7_22 = PF_8,
427+
GPIO7_23 = PF_9,
428+
GPIO7_24 = PF_10,
429+
GPIO7_25 = PF_11,
430+
258431
// Map mbed pin names to LPC43xx board signals
259432

260433
// Group 0x18 : CLKn pins

workspace_tools/targets.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __init__(self):
111111
self.supported_toolchains = ["ARM", "GCC_CR"]
112112

113113

114-
class LPC4330(Target):
114+
class LPC4330_M4(Target):
115115
def __init__(self):
116116
Target.__init__(self)
117117

@@ -121,6 +121,27 @@ def __init__(self):
121121

122122
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
123123

124+
125+
class LPC4330_M0(Target):
126+
def __init__(self):
127+
Target.__init__(self)
128+
129+
self.core = "Cortex-M0"
130+
131+
self.extra_labels = ['NXP', 'LPC43XX']
132+
133+
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
134+
135+
class LPC1800(Target):
136+
def __init__(self):
137+
Target.__init__(self)
138+
139+
self.core = "Cortex-M3"
140+
141+
self.extra_labels = ['NXP', 'LPC43XX']
142+
143+
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
144+
124145
class STM32F407(Target):
125146
def __init__(self):
126147
Target.__init__(self)

0 commit comments

Comments
 (0)