Skip to content
Permalink
Browse files

tests: drivers: adc: Add SAM0 support

This adds generic support for any board using the SAM0 ADC driver.
The test selects the internal input from the scaled I/O voltage,
which is always available on the ADC.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
  • Loading branch information...
Sizurka authored and nashif committed Apr 3, 2019
1 parent 1d64a46 commit 26693830e61a2eb8a9f380538f91e30be6b9909a
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/drivers/adc/adc_api/src/test_adc.c
@@ -121,6 +121,16 @@
#define ADC_1ST_CHANNEL_ID 3
#define ADC_2ND_CHANNEL_ID 4

#elif defined(CONFIG_SOC_FAMILY_SAM0)
#include <soc.h>
#define ADC_DEVICE_NAME DT_ATMEL_SAM0_ADC_0_LABEL
#define ADC_RESOLUTION 12
#define ADC_GAIN ADC_GAIN_1
#define ADC_REFERENCE ADC_REF_INTERNAL
#define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT
#define ADC_1ST_CHANNEL_ID 0
#define ADC_1ST_CHANNEL_INPUT ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC_Val

#else
#error "Unsupported board."
#endif

0 comments on commit 2669383

Please sign in to comment.
You can’t perform that action at this time.