Skip to content

Commit c1a1108

Browse files
gmarullcarlescufi
authored andcommitted
boards: arm: nrf5340_audio_dk_nrf5340: add board id description
nRF5340 Audio DK embeds a voltage divider to identify the "board ID". Use the existing 'voltage-divider' binding to describe it. Also configure the ADC channel 0 to read the voltage divider value. Configuration from https://github.com/nrfconnect/sdk-nrf/blob/main/applications/ nrf5340_audio/src/utils/board_version.c has been taken. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 65512e9 commit c1a1108

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp_common.dtsi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
nordic,iset-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
6060
};
6161

62+
board_id: board_id {
63+
compatible = "voltage-divider";
64+
io-channels = <&adc 0>;
65+
output-ohms = <20000>;
66+
full-ohms = <47000>;
67+
power-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
68+
};
69+
6270
pwmleds {
6371
compatible = "pwm-leds";
6472
rgb1_red_pwm_led: pwm_led_0 {
@@ -84,6 +92,18 @@
8492

8593
&adc {
8694
status = "okay";
95+
#address-cells = <1>;
96+
#size-cells = <0>;
97+
98+
channel@0 {
99+
reg = <0>;
100+
zephyr,gain = "ADC_GAIN_1_4";
101+
zephyr,reference = "ADC_REF_VDD_1_4";
102+
zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 40)>;
103+
zephyr,input-positive = <NRF_SAADC_AIN6>;
104+
zephyr,resolution = <12>;
105+
zephyr,oversampling = <8>;
106+
};
87107
};
88108

89109
&gpiote {

0 commit comments

Comments
 (0)