Skip to content

Commit 8007085

Browse files
committed
Add testing pinmaps to LPC15XX and LPC8XX devices
Add pinmap tables to the LPC15XX and LPC8XX families to allow testing.
1 parent c7a1946 commit 8007085

File tree

14 files changed

+634
-49
lines changed

14 files changed

+634
-49
lines changed

targets/TARGET_NXP/TARGET_LPC15XX/analogout_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
#include "cmsis.h"
1919
#include "pinmap.h"
2020

21+
static const PinMap PinMap_DAC[] = {
22+
{P0_12, 0, 0},
23+
24+
{NC, NC, 0}
25+
};
26+
2127
void analogout_init(dac_t *obj, PinName pin) {
2228
MBED_ASSERT(pin == P0_12);
2329

targets/TARGET_NXP/TARGET_LPC15XX/can_api.c

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,89 @@ static can_irq_handler irq_handler;
9191
#define IRQ_ENABLE_ANY (IRQ_ENABLE_STATUS | IRQ_ENABLE_ERROR)
9292
static uint32_t enabled_irqs = 0;
9393

94+
// Pinmap used for testing only
95+
static const PinMap PinMap_CAN_testing[] = {
96+
{P0_0, 0, 0},
97+
{P0_1, 0, 0},
98+
{P0_2, 0, 0},
99+
{P0_3, 0, 0},
100+
{P0_4, 0, 0},
101+
{P0_5, 0, 0},
102+
{P0_6, 0, 0},
103+
{P0_7, 0, 0},
104+
{P0_8, 0, 0},
105+
{P0_9, 0, 0},
106+
{P0_10, 0, 0},
107+
{P0_11, 0, 0},
108+
{P0_12, 0, 0},
109+
{P0_13, 0, 0},
110+
{P0_14, 0, 0},
111+
{P0_15, 0, 0},
112+
{P0_16, 0, 0},
113+
{P0_17, 0, 0},
114+
{P0_18, 0, 0},
115+
{P0_19, 0, 0},
116+
{P0_20, 0, 0},
117+
{P0_21, 0, 0},
118+
{P0_22, 0, 0},
119+
{P0_23, 0, 0},
120+
{P0_24, 0, 0},
121+
{P0_25, 0, 0},
122+
{P0_26, 0, 0},
123+
{P0_27, 0, 0},
124+
{P0_28, 0, 0},
125+
{P0_29, 0, 0},
126+
{P0_30, 0, 0},
127+
{P0_31, 0, 0},
128+
{P1_0, 0, 0},
129+
{P1_1, 0, 0},
130+
{P1_2, 0, 0},
131+
{P1_3, 0, 0},
132+
{P1_4, 0, 0},
133+
{P1_5, 0, 0},
134+
{P1_6, 0, 0},
135+
{P1_7, 0, 0},
136+
{P1_8, 0, 0},
137+
{P1_9, 0, 0},
138+
{P1_10, 0, 0},
139+
{P1_11, 0, 0},
140+
{P1_12, 0, 0},
141+
{P1_13, 0, 0},
142+
{P1_14, 0, 0},
143+
{P1_15, 0, 0},
144+
{P1_16, 0, 0},
145+
{P1_17, 0, 0},
146+
{P1_18, 0, 0},
147+
{P1_19, 0, 0},
148+
{P1_20, 0, 0},
149+
{P1_21, 0, 0},
150+
{P1_22, 0, 0},
151+
{P1_23, 0, 0},
152+
{P1_24, 0, 0},
153+
{P1_25, 0, 0},
154+
{P1_26, 0, 0},
155+
{P1_27, 0, 0},
156+
{P1_28, 0, 0},
157+
{P1_29, 0, 0},
158+
{P1_30, 0, 0},
159+
{P1_31, 0, 0},
160+
{P2_0, 0, 0},
161+
{P2_1, 0, 0},
162+
{P2_2, 0, 0},
163+
{P2_3, 0, 0},
164+
{P2_4, 0, 0},
165+
{P2_5, 0, 0},
166+
{P2_6, 0, 0},
167+
{P2_7, 0, 0},
168+
{P2_8, 0, 0},
169+
{P2_9, 0, 0},
170+
{P2_10, 0, 0},
171+
{P2_11, 0, 0},
172+
{P2_12, 0, 0},
173+
174+
{NC, NC, 0}
175+
};
176+
94177
static inline void can_disable(can_t *obj) {
95178
LPC_C_CAN0->CANCNTL |= 0x1;
96179
}
@@ -629,10 +712,10 @@ void can_monitor(can_t *obj, int silent) {
629712

630713
const PinMap *can_rd_pinmap()
631714
{
632-
return PinMap_CAN_TD;
715+
return PinMap_CAN_testing;
633716
}
634717

635718
const PinMap *can_td_pinmap()
636719
{
637-
return PinMap_CAN_RD;
720+
return PinMap_CAN_testing;
638721
}

targets/TARGET_NXP/TARGET_LPC15XX/i2c_api.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ static uint8_t repeated_start = 0;
2222

2323
#define I2C_STAT(x) ((LPC_I2C0->STAT >> 1) & (0x07))
2424

25+
static const PinMap PinMap_I2C_SDA[] = {
26+
{P0_23, 0, 0},
27+
28+
{NC, NC, 0}
29+
};
30+
31+
static const PinMap PinMap_I2C_SCL[] = {
32+
{P0_22, 0, 0},
33+
34+
{NC, NC, 0}
35+
};
36+
2537
static inline int i2c_status(i2c_t *obj) {
2638
return I2C_STAT(obj);
2739
}

targets/TARGET_NXP/TARGET_LPC15XX/pwmout_api.c

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,89 @@ static LPC_SCT0_Type *SCTs[4] = {
2626
(LPC_SCT0_Type*)LPC_SCT3,
2727
};
2828

29+
// Pinmap used for testing only
30+
static const PinMap PinMap_PWM_testing[] = {
31+
{P0_0, 0, 0},
32+
{P0_1, 0, 0},
33+
{P0_2, 0, 0},
34+
{P0_3, 0, 0},
35+
{P0_4, 0, 0},
36+
{P0_5, 0, 0},
37+
{P0_6, 0, 0},
38+
{P0_7, 0, 0},
39+
{P0_8, 0, 0},
40+
{P0_9, 0, 0},
41+
{P0_10, 0, 0},
42+
{P0_11, 0, 0},
43+
{P0_12, 0, 0},
44+
{P0_13, 0, 0},
45+
{P0_14, 0, 0},
46+
{P0_15, 0, 0},
47+
{P0_16, 0, 0},
48+
{P0_17, 0, 0},
49+
{P0_18, 0, 0},
50+
{P0_19, 0, 0},
51+
{P0_20, 0, 0},
52+
{P0_21, 0, 0},
53+
{P0_22, 0, 0},
54+
{P0_23, 0, 0},
55+
{P0_24, 0, 0},
56+
{P0_25, 0, 0},
57+
{P0_26, 0, 0},
58+
{P0_27, 0, 0},
59+
{P0_28, 0, 0},
60+
{P0_29, 0, 0},
61+
{P0_30, 0, 0},
62+
{P0_31, 0, 0},
63+
{P1_0, 0, 0},
64+
{P1_1, 0, 0},
65+
{P1_2, 0, 0},
66+
{P1_3, 0, 0},
67+
{P1_4, 0, 0},
68+
{P1_5, 0, 0},
69+
{P1_6, 0, 0},
70+
{P1_7, 0, 0},
71+
{P1_8, 0, 0},
72+
{P1_9, 0, 0},
73+
{P1_10, 0, 0},
74+
{P1_11, 0, 0},
75+
{P1_12, 0, 0},
76+
{P1_13, 0, 0},
77+
{P1_14, 0, 0},
78+
{P1_15, 0, 0},
79+
{P1_16, 0, 0},
80+
{P1_17, 0, 0},
81+
{P1_18, 0, 0},
82+
{P1_19, 0, 0},
83+
{P1_20, 0, 0},
84+
{P1_21, 0, 0},
85+
{P1_22, 0, 0},
86+
{P1_23, 0, 0},
87+
{P1_24, 0, 0},
88+
{P1_25, 0, 0},
89+
{P1_26, 0, 0},
90+
{P1_27, 0, 0},
91+
{P1_28, 0, 0},
92+
{P1_29, 0, 0},
93+
{P1_30, 0, 0},
94+
{P1_31, 0, 0},
95+
{P2_0, 0, 0},
96+
{P2_1, 0, 0},
97+
{P2_2, 0, 0},
98+
{P2_3, 0, 0},
99+
{P2_4, 0, 0},
100+
{P2_5, 0, 0},
101+
{P2_6, 0, 0},
102+
{P2_7, 0, 0},
103+
{P2_8, 0, 0},
104+
{P2_9, 0, 0},
105+
{P2_10, 0, 0},
106+
{P2_11, 0, 0},
107+
{P2_12, 0, 0},
108+
109+
{NC, NC, 0}
110+
};
111+
29112
// bit flags for used SCTs
30113
static unsigned char sct_used = (1 << 3);
31114
static int get_available_sct(void) {
@@ -205,6 +288,6 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
205288

206289
const PinMap *pwmout_pinmap()
207290
{
208-
return PinMap_PWM;
291+
return PinMap_PWM_testing;
209292
}
210293

targets/TARGET_NXP/TARGET_LPC15XX/serial_api.c

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,89 @@ static const SWM_Map SWM_UART_CTS[] = {
5252
{3, 8} // not available
5353
};
5454

55+
// Pinmap used for testing only
56+
static const PinMap PinMap_UART_testing[] = {
57+
{P0_0, 0, 0},
58+
{P0_1, 0, 0},
59+
{P0_2, 0, 0},
60+
{P0_3, 0, 0},
61+
{P0_4, 0, 0},
62+
{P0_5, 0, 0},
63+
{P0_6, 0, 0},
64+
{P0_7, 0, 0},
65+
{P0_8, 0, 0},
66+
{P0_9, 0, 0},
67+
{P0_10, 0, 0},
68+
{P0_11, 0, 0},
69+
{P0_12, 0, 0},
70+
{P0_13, 0, 0},
71+
{P0_14, 0, 0},
72+
{P0_15, 0, 0},
73+
{P0_16, 0, 0},
74+
{P0_17, 0, 0},
75+
{P0_18, 0, 0},
76+
{P0_19, 0, 0},
77+
{P0_20, 0, 0},
78+
{P0_21, 0, 0},
79+
{P0_22, 0, 0},
80+
{P0_23, 0, 0},
81+
{P0_24, 0, 0},
82+
{P0_25, 0, 0},
83+
{P0_26, 0, 0},
84+
{P0_27, 0, 0},
85+
{P0_28, 0, 0},
86+
{P0_29, 0, 0},
87+
{P0_30, 0, 0},
88+
{P0_31, 0, 0},
89+
{P1_0, 0, 0},
90+
{P1_1, 0, 0},
91+
{P1_2, 0, 0},
92+
{P1_3, 0, 0},
93+
{P1_4, 0, 0},
94+
{P1_5, 0, 0},
95+
{P1_6, 0, 0},
96+
{P1_7, 0, 0},
97+
{P1_8, 0, 0},
98+
{P1_9, 0, 0},
99+
{P1_10, 0, 0},
100+
{P1_11, 0, 0},
101+
{P1_12, 0, 0},
102+
{P1_13, 0, 0},
103+
{P1_14, 0, 0},
104+
{P1_15, 0, 0},
105+
{P1_16, 0, 0},
106+
{P1_17, 0, 0},
107+
{P1_18, 0, 0},
108+
{P1_19, 0, 0},
109+
{P1_20, 0, 0},
110+
{P1_21, 0, 0},
111+
{P1_22, 0, 0},
112+
{P1_23, 0, 0},
113+
{P1_24, 0, 0},
114+
{P1_25, 0, 0},
115+
{P1_26, 0, 0},
116+
{P1_27, 0, 0},
117+
{P1_28, 0, 0},
118+
{P1_29, 0, 0},
119+
{P1_30, 0, 0},
120+
{P1_31, 0, 0},
121+
{P2_0, 0, 0},
122+
{P2_1, 0, 0},
123+
{P2_2, 0, 0},
124+
{P2_3, 0, 0},
125+
{P2_4, 0, 0},
126+
{P2_5, 0, 0},
127+
{P2_6, 0, 0},
128+
{P2_7, 0, 0},
129+
{P2_8, 0, 0},
130+
{P2_9, 0, 0},
131+
{P2_10, 0, 0},
132+
{P2_11, 0, 0},
133+
{P2_12, 0, 0},
134+
135+
{NC, NC, 0}
136+
};
137+
55138
// bit flags for used UARTs
56139
static unsigned char uart_used = 0;
57140
static int get_available_uart(void) {
@@ -316,21 +399,21 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
316399

317400
const PinMap *serial_tx_pinmap()
318401
{
319-
return PinMap_UART_TX;
402+
return PinMap_UART_testing;
320403
}
321404

322405
const PinMap *serial_rx_pinmap()
323406
{
324-
return PinMap_UART_RX;
407+
return PinMap_UART_testing;
325408
}
326409

327410
const PinMap *serial_cts_pinmap()
328411
{
329-
return PinMap_UART_CTS;
412+
return PinMap_UART_testing;
330413
}
331414

332415
const PinMap *serial_rts_pinmap()
333416
{
334-
return PinMap_UART_RTS;
417+
return PinMap_UART_testing;
335418
}
336419

0 commit comments

Comments
 (0)