Skip to content

Commit 43be17a

Browse files
nixwardcarlescufi
authored andcommitted
tests: drivers: build all: sensor: add current_amp
Add current sense amplifier driver to tests. Signed-off-by: Nick Ward <[email protected]>
1 parent 17f2046 commit 43be17a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/drivers/build_all/sensor/adc.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ test_adc_mcp9700a: mcp9700a {
1414
io-channels = <&test_adc 0>;
1515
};
1616

17+
test_current: current_amp {
18+
status = "okay";
19+
compatible = "current-sense-amplifier";
20+
io-channels = <&test_adc 2>;
21+
io-channel-names = "CURRENT_AMP";
22+
sense-resistor-micro-ohms = <10>;
23+
sense-gain-mult = <1>;
24+
sense-gain-div = <1>;
25+
};
26+
1727
test_adc_emul: adc {
1828
compatible = "zephyr,adc-emul";
1929
nchannels = <2>;

tests/drivers/build_all/sensor/app.overlay

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232
zephyr,resolution = <12>;
3333
};
3434

35+
channel@2 {
36+
reg = <2>;
37+
zephyr,gain = "ADC_GAIN_1_6";
38+
zephyr,reference = "ADC_REF_INTERNAL";
39+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
40+
zephyr,input-positive = <0>;
41+
zephyr,resolution = <12>;
42+
};
43+
3544
#include "adc.dtsi"
3645
};
3746

0 commit comments

Comments
 (0)