boards: nxp: frdm_mcxe247: add i2c feature
- support accel feature using lpi2c0 and enable accel cases: accel_trig/accel_polling - enable i2c_target_api case using lpi2c0 and lpi2c1 Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
This commit is contained in:
@@ -26,6 +26,26 @@
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_lpi2c0: pinmux_lpi2c0 {
|
||||
group0 {
|
||||
pinmux = <LPI2C0_SCL_PTA3>,
|
||||
<LPI2C0_SDA_PTA2>;
|
||||
drive-strength = "low";
|
||||
slew-rate = "slow";
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_lpi2c1: pinmux_lpi2c1 {
|
||||
group0 {
|
||||
pinmux = <LPI2C1_SCL_PTD9>,
|
||||
<LPI2C1_SDA_PTD8>;
|
||||
drive-strength = "low";
|
||||
slew-rate = "slow";
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
|
||||
pinmux_adc0: pinmux_adc0 {
|
||||
group0 {
|
||||
pinmux = <ADC0_SE1_PTA1>,
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
sw0 = &user_button_2;
|
||||
sw1 = &user_button_3;
|
||||
rtc = &counter_rtc;
|
||||
accel0 = &fxls8974;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -221,6 +222,24 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&lpi2c0 {
|
||||
pinctrl-0 = <&pinmux_lpi2c0>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
fxls8974: fxls8974@18 {
|
||||
compatible = "nxp,fxls8974";
|
||||
reg = <0x18>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&lpi2c1 {
|
||||
pinctrl-0 = <&pinmux_lpi2c1>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&edma {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@ toolchain:
|
||||
- gnuarmemb
|
||||
supported:
|
||||
- uart
|
||||
- i2c
|
||||
- gpio
|
||||
- adc
|
||||
- arduino_gpio
|
||||
|
||||
1
samples/sensor/accel_trig/boards/frdm_mcxe247.conf
Normal file
1
samples/sensor/accel_trig/boards/frdm_mcxe247.conf
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_FXLS8974_TRIGGER_OWN_THREAD=y
|
||||
11
samples/sensor/accel_trig/boards/frdm_mcxe247.overlay
Normal file
11
samples/sensor/accel_trig/boards/frdm_mcxe247.overlay
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Copyright 2025 NXP
|
||||
*/
|
||||
|
||||
&fxls8974 {
|
||||
status = "okay";
|
||||
int1-gpios = <&gpioe 14 GPIO_ACTIVE_LOW>;
|
||||
int2-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
31
tests/drivers/i2c/i2c_target_api/boards/frdm_mcxe247.overlay
Normal file
31
tests/drivers/i2c/i2c_target_api/boards/frdm_mcxe247.overlay
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2025 NXP
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* To test this sample, connect
|
||||
* LPI2C0 SCL(J2-20) --> LPI2C3 SCL(J5-5)
|
||||
* LPI2C0 SDA(J2-18) --> LPI2C3 SDA(J5-6)
|
||||
*/
|
||||
|
||||
&lpi2c0 {
|
||||
eeprom0: eeprom@54 {
|
||||
compatible = "zephyr,i2c-target-eeprom";
|
||||
reg = <0x54>;
|
||||
size = <256>;
|
||||
};
|
||||
};
|
||||
|
||||
&lpi2c1 {
|
||||
eeprom1: eeprom@56 {
|
||||
compatible = "zephyr,i2c-target-eeprom";
|
||||
reg = <0x56>;
|
||||
size = <256>;
|
||||
};
|
||||
};
|
||||
|
||||
/* Disable the FXLS8974 sensor to avoid conflict with accel samples */
|
||||
&fxls8974 {
|
||||
status = "disabled";
|
||||
};
|
||||
Reference in New Issue
Block a user