Skip to content

Commit 6553fd1

Browse files
NeilChen93kartben
authored andcommitted
boards: frdm_mcxc444: Add i2c support
Enable i2c and configure it to read accelerometer sensor on the board. Test it using sample.sensor.accel_polling. Signed-off-by: Neil Chen <[email protected]>
1 parent b3758a7 commit 6553fd1

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

boards/nxp/frdm_mcxc444/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ The ``frdm_mcxc444`` board target supports the following hardware features:
5555
+-----------+------------+-------------------------------------+
5656
| FLASH | on-chip | soc flash |
5757
+-----------+------------+-------------------------------------+
58+
| I2C | on-chip | i2c |
59+
+-----------+------------+-------------------------------------+
5860
| LPTMR | on-chip | counter |
5961
+-----------+------------+-------------------------------------+
6062
| PIT | on-chip | counter |

boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
#include <nxp/mcx/MCXC444VLH-pinctrl.h>
99

1010
&pinctrl {
11+
pinmux_i2c0: pinmux_i2c0 {
12+
group0 {
13+
pinmux = <I2C0_SCL_PTE24>,
14+
<I2C0_SDA_PTE25>;
15+
drive-strength = "low";
16+
drive-open-drain;
17+
slew-rate = "fast";
18+
};
19+
};
1120
pinmux_lpuart0: pinmux_lpuart0 {
1221
group0 {
1322
pinmux = <LPUART0_RX_PTA1>,

boards/nxp/frdm_mcxc444/frdm_mcxc444.dts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
led2 = &red_led;
2121
sw0 = &user_button_2;
2222
sw1 = &user_button_3;
23+
accel0 = &fxls8974;
2324
};
2425

2526
chosen {
@@ -90,6 +91,19 @@
9091
status = "okay";
9192
};
9293

94+
i2c0: &i2c0 {
95+
status = "okay";
96+
pinctrl-0 = <&pinmux_i2c0>;
97+
pinctrl-names = "default";
98+
99+
fxls8974: fxls8974@18 {
100+
status = "okay";
101+
compatible = "nxp,fxls8974";
102+
reg = <0x18>;
103+
int1-gpios = <&gpiod 1 GPIO_ACTIVE_LOW>;
104+
};
105+
};
106+
93107
&lpuart0 {
94108
status = "okay";
95109
current-speed = <115200>;

boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ supported:
1818
- counter
1919
- flash
2020
- gpio
21+
- i2c
2122
- uart
2223
testing:
2324
ignore_tags:

0 commit comments

Comments
 (0)