samples: drivers: adc: add ADC example

This sample shows how to use the ADC API. Depending on the support of
sequential reads in the driver, 1 or 2 channels are read and printed.

A devicetree overlay is necessary to specify the used ADC channel(s).

Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2020-05-10 10:38:18 +02:00 committed by Anas Nashif
commit 0520ec814b
6 changed files with 216 additions and 0 deletions

View file

@ -0,0 +1,12 @@
sample:
name: ADC driver sample
tests:
sample.drivers.adc:
tags: ADC
depends_on: adc
platform_allow: nucleo_l073rz
harness: console
harness_config:
type: single_line
regex:
- "ADC reading(s): (.*)"