RIOT
RIOT copied to clipboard
periph/adc: add adc_sample_multi()
Contribution description
This adds an API to sample multiple ADC samples into a into a buffer. Multiple ADC lines can be sampled in a round-robin fashion or in parallel if the hardware supports it.
Testing procedure
No integration in the test app yet, but I can produce some nice graphs of the sample data with Gnuplot:
two lines on a single ADC
two lines on different ADCs
Issues/PRs references
alternative to #20619
Have you tried to implement it for another board as well? Just to see if the proposed API is not over-fitted for the SAM (unlikely).
@maribu suggested to make the memory layout of the samples implementation defined and provide an accessor function for individual elements.
I'm not a huge fan, since this hurts the ergonomics of the result, but if this turns out to be necessary to reach full performance on some platforms I'm willing to do it - but I'd like to avoid uglifying the API 'just in case'.
Murdock results
:heavy_check_mark: PASSED
08698668154b3c52e0bc829415f41379a8e73b85 cpu/sam0_common: make ADC input resistance configurable per channel
| Success | Failures | Total | Runtime |
|---|---|---|---|
| 10218 | 0 | 10218 | 13m:52s |
Artifacts
@benpicco is this ready for another review?