Skip to content

Commit 33e88b0

Browse files
NeilChen93kartben
authored andcommitted
boards: nxp: frdm_mcxa153: Support lpcmp for NXP frdm_mcxa153 board
Support lpcmp for NXP frdm_mcxa153 board. Signed-off-by: Neil Chen <[email protected]>
1 parent 53dd770 commit 33e88b0

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

boards/nxp/frdm_mcxa153/board.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ void board_early_init_hook(void)
9797
CLOCK_EnableClock(kCLOCK_GateADC0);
9898
#endif
9999

100+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpcmp0))
101+
CLOCK_AttachClk(kFRO12M_to_CMP0);
102+
CLOCK_SetClockDiv(kCLOCK_DivCMP0_FUNC, 1U);
103+
SPC_EnableActiveModeAnalogModules(SPC0, (kSPC_controlCmp0 | kSPC_controlCmp0Dac));
104+
#endif
105+
100106
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0))
101107
CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u);
102108
CLOCK_AttachClk(kFRO12M_to_LPUART0);

boards/nxp/frdm_mcxa153/frdm_mcxa153-pinctrl.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
};
2626
};
2727

28+
pinmux_lpcmp0: pinmux_lpcmp0 {
29+
group0 {
30+
pinmux = <CMP0_IN0_P2_2>;
31+
drive-strength = "low";
32+
slew-rate = "fast";
33+
bias-pull-up;
34+
};
35+
};
36+
2837
pinmux_lpuart0: pinmux_lpuart0 {
2938
group0 {
3039
pinmux = <LPUART0_RXD_P0_2>,

boards/nxp/frdm_mcxa153/frdm_mcxa153.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@
122122
pinctrl-names = "default";
123123
};
124124

125+
&lpcmp0 {
126+
status = "okay";
127+
pinctrl-0 = <&pinmux_lpcmp0>;
128+
pinctrl-names = "default";
129+
};
130+
125131
&lpuart0 {
126132
status = "okay";
127133
current-speed = <115200>;

0 commit comments

Comments
 (0)