tests: drivers/regulator/voltage: Add regulator test for NXP frdm_mcxn236
Support regulator(vref) output vt oltage test for NXP frdm_mcxn236 Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
This commit is contained in:
parent
a6b414d46b
commit
0fa766c8ea
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright 2024 NXP
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/dt-bindings/adc/adc.h>
|
||||
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
|
||||
#include <zephyr/dt-bindings/regulator/nxp_vref.h>
|
||||
|
||||
/* To do this test, connect LPADC0 channel 2A(J8 pin 12) to VREF_OUT (J2 pin 19) */
|
||||
|
||||
/ {
|
||||
resources: resources {
|
||||
compatible = "test-regulator-voltage";
|
||||
regulators = <&vref>;
|
||||
tolerance-microvolt = <10000>;
|
||||
set-read-delay-ms = <1>;
|
||||
adc-avg-count = <10>;
|
||||
io-channels = <&lpadc0 0>;
|
||||
min-microvolt = <1000000>;
|
||||
max-microvolt = <2100000>;
|
||||
};
|
||||
};
|
||||
|
||||
&vref {
|
||||
regulator-initial-mode = <NXP_VREF_MODE_INTERNAL_REGULATOR>;
|
||||
};
|
||||
|
||||
&lpadc0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
/* In this case, the LPADC reference source cannot be set to VREFO,
|
||||
* switch the reference source to VDD_ANA.
|
||||
*/
|
||||
voltage-ref= <2>;
|
||||
|
||||
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 = <12>;
|
||||
zephyr,input-positive = <MCUX_LPADC_CH2A>;
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue