Skip to content

Commit 9b532e3

Browse files
NeilChen93MaureenHelm
authored andcommitted
boards: nxp/frdm_mcxn236: Support LPCMP for NXP frdm_mcxn236 board
Support LPCMP for NXP frdm_mcxn236 board Signed-off-by: Neil Chen <[email protected]>
1 parent e7743db commit 9b532e3

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

boards/nxp/frdm_mcxn236/board.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ static int frdm_mcxn236_init(void)
180180
CLOCK_AttachClk(kFRO_HF_to_ADC0);
181181
#endif
182182

183+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpcmp0))
184+
CLOCK_SetClkDiv(kCLOCK_DivCmp0FClk, 1U);
185+
CLOCK_AttachClk(kFRO12M_to_CMP0F);
186+
SPC_EnableActiveModeAnalogModules(SPC0, (kSPC_controlCmp0 | kSPC_controlCmp0Dac));
187+
#endif
188+
183189
/* Set SystemCoreClock variable. */
184190
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
185191

boards/nxp/frdm_mcxn236/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ The FRDM-MCXN236 board configuration supports the following hardware features:
7272
+-----------+------------+-------------------------------------+
7373
| ADC | on-chip | adc |
7474
+-----------+------------+-------------------------------------+
75+
| LPCMP | on-chip | sensor(comparator) |
76+
+-----------+------------+-------------------------------------+
7577

7678
Targets available
7779
==================

boards/nxp/frdm_mcxn236/frdm_mcxn236-pinctrl.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,13 @@
100100
drive-strength = "low";
101101
};
102102
};
103+
104+
pinmux_lpcmp0: pinmux_lpcmp0 {
105+
group0 {
106+
pinmux = <CMP0_IN0_PIO1_0>;
107+
drive-strength = "low";
108+
slew-rate = "fast";
109+
bias-pull-up;
110+
};
111+
};
103112
};

boards/nxp/frdm_mcxn236/frdm_mcxn236.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,7 @@
121121
&lpadc0 {
122122
status = "okay";
123123
};
124+
125+
&lpcmp0 {
126+
status = "okay";
127+
};

boards/nxp/frdm_mcxn236/frdm_mcxn236.dtsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,8 @@
123123
pinctrl-0 = <&pinmux_lpadc0>;
124124
pinctrl-names = "default";
125125
};
126+
127+
&lpcmp0 {
128+
pinctrl-0 = <&pinmux_lpcmp0>;
129+
pinctrl-names = "default";
130+
};

0 commit comments

Comments
 (0)