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>
This commit is contained in:
Neil Chen 2024-11-26 17:43:00 +08:00 committed by Benjamin Cabé
commit 3f389d5b86
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1 @@
CONFIG_LPADC_DO_OFFSET_CALIBRATION=y

View file

@ -0,0 +1,30 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/adc/adc.h>
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&lpadc0 0>;
};
};
&lpadc0 {
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_EXTERNAL0";
zephyr,vref-mv = <3300>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <16>;
zephyr,input-positive = <MCUX_LPADC_CH0A>;
};
};