boards: nxp: frdm_mcxa156: Support lpi2c for NXP frdm_mcxa156 board

Support lpi2c for NXP frdm_mcxa156 board.

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
This commit is contained in:
Neil Chen 2024-12-11 16:32:01 +08:00 committed by Benjamin Cabé
parent ba572cc25e
commit 2f278dba07
5 changed files with 68 additions and 0 deletions

View file

@ -137,6 +137,26 @@ static int frdm_mcxa156_init(void)
SPC_EnableActiveModeAnalogModules(SPC0, (kSPC_controlCmp0 | kSPC_controlCmp0Dac)); SPC_EnableActiveModeAnalogModules(SPC0, (kSPC_controlCmp0 | kSPC_controlCmp0Dac));
#endif #endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c0))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C0, 1u);
CLOCK_AttachClk(kFRO12M_to_LPI2C0);
#endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c1))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C1, 1u);
CLOCK_AttachClk(kFRO12M_to_LPI2C1);
#endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c2))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C2, 1u);
CLOCK_AttachClk(kFRO12M_to_LPI2C2);
#endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c3))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C3, 1u);
CLOCK_AttachClk(kFRO12M_to_LPI2C3);
#endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lptmr0)) #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lptmr0))
/* /*

View file

@ -58,6 +58,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| DAC | on-chip | dac | | DAC | on-chip | dac |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| LPCMP | on-chip | sensor(comparator) | | LPCMP | on-chip | sensor(comparator) |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| LPTMR | on-chip | counter | | LPTMR | on-chip | counter |

View file

@ -47,4 +47,37 @@
bias-pull-up; bias-pull-up;
}; };
}; };
pinmux_lpi2c0: pinmux_lpi2c0 {
group0 {
pinmux = <LPI2C0_SDA_P0_16>,
<LPI2C0_SCL_P0_17>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
bias-pull-up;
drive-open-drain;
};
};
pinmux_lpi2c2: pinmux_lpi2c2 {
group0 {
pinmux = <LPI2C2_SDA_P1_8>,
<LPI2C2_SCL_P1_9>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
bias-pull-up;
drive-open-drain;
};
};
pinmux_lpi2c3: pinmux_lpi2c3 {
group0 {
pinmux = <LPI2C3_SDA_P3_28>,
<LPI2C3_SCL_P3_27>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
bias-pull-up;
drive-open-drain;
};
};
}; };

View file

@ -114,6 +114,18 @@
pinctrl-names = "default"; pinctrl-names = "default";
}; };
&lpi2c0 {
status = "okay";
pinctrl-0 = <&pinmux_lpi2c0>;
pinctrl-names = "default";
};
&lpi2c3 {
status = "okay";
pinctrl-0 = <&pinmux_lpi2c3>;
pinctrl-names = "default";
};
&lptmr0 { &lptmr0 {
status = "okay"; status = "okay";
}; };

View file

@ -20,6 +20,7 @@ supported:
- gpio - gpio
- counter - counter
- dac - dac
- i2c
- pwm - pwm
- usb_device - usb_device
- usbd - usbd