Skip to content

Commit a609467

Browse files
NeilChen93kartben
authored andcommitted
boards: nxp: frdm_mcxa156: Support adc for NXP frdm_mcxa156 board
Support adc for NXP frdm_mcxa156 board. Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
1 parent fed6345 commit a609467

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

boards/nxp/frdm_mcxa156/board.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ static int frdm_mcxa156_init(void)
124124
CLOCK_EnableClock(kCLOCK_GateDAC0);
125125
#endif
126126

127+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpadc0))
128+
CLOCK_SetClockDiv(kCLOCK_DivADC0, 1u);
129+
CLOCK_AttachClk(kFRO12M_to_ADC0);
130+
131+
CLOCK_EnableClock(kCLOCK_GateADC0);
132+
#endif
133+
127134
/* Set SystemCoreClock variable. */
128135
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
129136

boards/nxp/frdm_mcxa156/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
5454
+-----------+------------+-------------------------------------+
5555
| FLASH | on-chip | soc flash |
5656
+-----------+------------+-------------------------------------+
57+
| ADC | on-chip | adc |
58+
+-----------+------------+-------------------------------------+
5759
| DAC | on-chip | dac |
5860
+-----------+------------+-------------------------------------+
5961
| PWM | on-chip | pwm |

boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,12 @@
3131
drive-strength = "low";
3232
};
3333
};
34+
pinmux_lpadc0: pinmux_lpadc0 {
35+
group0 {
36+
pinmux = <ADC0_A0_P2_0>,
37+
<ADC0_A1_P2_1>;
38+
slew-rate = "fast";
39+
drive-strength = "low";
40+
};
41+
};
3442
};

boards/nxp/frdm_mcxa156/frdm_mcxa156.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,9 @@
101101
pinctrl-0 = <&pinmux_flexpwm0_pwm0>;
102102
pinctrl-names = "default";
103103
};
104+
105+
&lpadc0 {
106+
status = "okay";
107+
pinctrl-0 = <&pinmux_lpadc0>;
108+
pinctrl-names = "default";
109+
};

boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ toolchain:
1515
- gnuarmemb
1616
- xtools
1717
supported:
18+
- adc
1819
- flash
1920
- gpio
2021
- dac

0 commit comments

Comments
 (0)