Commit 9024ffa0 authored by Benjamin Björnsson's avatar Benjamin Björnsson Committed by Carles Cufi
Browse files

tests: drivers: adc: adc_api: Move compat atmel,sam-adc to DT



Move channel description to devicetree for atmel,sam-adc
compatible to make the test more readable.

Signed-off-by: default avatarBenjamin Björnsson <benjamin.bjornsson@gmail.com>
parent b09423fc
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright (c) 2023 Benjamin Björnsson <benjamin.bjornsson@gmail.com>
 */

#include <zephyr/dt-bindings/adc/adc.h>

/ {
	zephyr,user {
		io-channels = <&adc0 15>;
	};
};

&adc0 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	channel@f {
		reg = <15>;
		zephyr,gain = "ADC_GAIN_1";
		zephyr,reference = "ADC_REF_EXTERNAL0";
		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
		zephyr,resolution = <12>;
		zephyr,input-positive = <15>;
	};
};
+0 −10
Original line number Diff line number Diff line
@@ -29,16 +29,6 @@
#define ADC_ACQUISITION_TIME	ADC_ACQ_TIME_DEFAULT
#define ADC_1ST_CHANNEL_ID	0

#elif defined(CONFIG_BOARD_SAM4S_XPLAINED)

#define ADC_DEVICE_NODE		DT_INST(0, atmel_sam_adc)
#define ADC_RESOLUTION		12
#define ADC_GAIN		ADC_GAIN_1
#define ADC_REFERENCE		ADC_REF_EXTERNAL0
#define ADC_ACQUISITION_TIME	ADC_ACQ_TIME_DEFAULT
#define ADC_1ST_CHANNEL_ID	15
#define ADC_1ST_CHANNEL_INPUT	15

#elif defined(CONFIG_SOC_FAMILY_SAM0)
#include <soc.h>
#define ADC_DEVICE_NODE         DT_INST(0, atmel_sam0_adc)