Skip to content

Commit 3f389d5

Browse files
NeilChen93kartben
authored andcommitted
samples: drivers/adc: Support adc example for NXP frdm_mcxa156
Support adc example for NXP frdm_mcxa156 Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
1 parent a609467 commit 3f389d5

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_LPADC_DO_OFFSET_CALIBRATION=y
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/adc/adc.h>
8+
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
9+
10+
/ {
11+
zephyr,user {
12+
/* adjust channel number according to pinmux in board.dts */
13+
io-channels = <&lpadc0 0>;
14+
};
15+
};
16+
17+
&lpadc0 {
18+
#address-cells = <1>;
19+
#size-cells = <0>;
20+
21+
channel@0 {
22+
reg = <0>;
23+
zephyr,gain = "ADC_GAIN_1";
24+
zephyr,reference = "ADC_REF_EXTERNAL0";
25+
zephyr,vref-mv = <3300>;
26+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
27+
zephyr,resolution = <16>;
28+
zephyr,input-positive = <MCUX_LPADC_CH0A>;
29+
};
30+
};

0 commit comments

Comments
 (0)