This simple example shows how to use the new scan feature found in the XMEGA-...U devices.
The ADC driver API can be found here.
All AVR XMEGA U devices with an ADC can be used or devices that have the scan register on ADCA channel 0.
ADC A is configured for signed, 12-bit conversions using the internal 1 V voltage reference. The conversions are configured to be triggered from the event system. Channel 0 of the ADC is configured for differential measurement of all ADCA pins (PA0-PA7) with internal ground.
An ADC interrupt callback function is used to handle the conversion results, each result is stored into an array at the position corresponding to the pin number, e.g. PA0 result is stored in adc_scan_results[0].
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.