Skip to content

Commit 21cff9b

Browse files
boards: arm: lpcxpresso55s16: add MCAN support
Add NXP LPC MCAN support for the NXP lpcxpresso55s16 board definition. Fixes #35437 Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 47f2b94 commit 21cff9b

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

boards/arm/lpcxpresso55s16/doc/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ hardware features:
7373
+-----------+------------+-------------------------------------+
7474
| CLOCK | on-chip | clock_control |
7575
+-----------+------------+-------------------------------------+
76+
| CAN | on-chip | canbus |
77+
+-----------+------------+-------------------------------------+
7678

7779
Other hardware features are not currently enabled.
7880

@@ -119,6 +121,10 @@ the functionality of a pin.
119121
+---------+-----------------+----------------------------+
120122
| PIO1_26 | GPIO | FXOS8700 INT1 |
121123
+---------+-----------------+----------------------------+
124+
| PIO1_22 | CAN | CAN RXD |
125+
+---------+-----------------+----------------------------+
126+
| PIO1_27 | CAN | CAN TXD |
127+
+---------+-----------------+----------------------------+
122128

123129
System Clock
124130
============

boards/arm/lpcxpresso55s16/lpcxpresso55s16.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ supported:
1818
- arduino_gpio
1919
- arduino_i2c
2020
- arduino_spi
21+
- can
22+
- canfd
2123
- gpio
2224
- i2c
2325
- spi

boards/arm/lpcxpresso55s16/lpcxpresso55s16_common.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
zephyr,console = &flexcomm0;
1313
zephyr,shell-uart = &flexcomm0;
1414
zephyr,entropy = &rng;
15+
zephyr,canbus = &can0;
1516
};
1617

1718
aliases{
@@ -131,6 +132,12 @@
131132
};
132133
};
133134

135+
&can0 {
136+
status = "okay";
137+
bus-speed = <125000>;
138+
bus-speed-data = <1000000>;
139+
};
140+
134141
&hs_lspi {
135142
status = "okay";
136143
};

boards/arm/lpcxpresso55s16/pinmux.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,28 @@ static int lpcxpresso_55s16_pinmux_init(const struct device *dev)
181181
IOCON_PIO_OPENDRAIN_DI);
182182
#endif
183183

184+
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(can0), nxp_lpc_mcan, okay) && CONFIG_CAN
185+
/* CAN RXD, TXD */
186+
uint32_t port1_pin22_config = (
187+
IOCON_PIO_FUNC9 |
188+
IOCON_PIO_MODE_INACT |
189+
IOCON_PIO_INV_DI |
190+
IOCON_PIO_DIGITAL_EN |
191+
IOCON_PIO_SLEW_STANDARD |
192+
IOCON_PIO_OPENDRAIN_DI
193+
);
194+
uint32_t port1_pin27_config = (
195+
IOCON_PIO_FUNC9 |
196+
IOCON_PIO_MODE_INACT |
197+
IOCON_PIO_INV_DI |
198+
IOCON_PIO_DIGITAL_EN |
199+
IOCON_PIO_SLEW_STANDARD |
200+
IOCON_PIO_OPENDRAIN_DI
201+
);
202+
pinmux_pin_set(port1, 22, port1_pin22_config);
203+
pinmux_pin_set(port1, 27, port1_pin27_config);
204+
#endif
205+
184206
return 0;
185207
}
186208

0 commit comments

Comments
 (0)