3.2 Performing an AD Scan
Last updated
Was this helpful?
Last updated
Was this helpful?
An A/D scan is similar to an A/D sample except that it performs several conversions on a specified range of input channels with each function call. SAMD51 function for performing an A/D scan is .
Create and initialize an A/D settings structure ().
Call and pass it a pointer to this structure in order to setup the driver for A/D operations.
Create and initialize a sample buffer of type .
Call and pass it a pointer to your scan buffer - this will generate an A/D conversion for each channel in your scan range and the results will be stored in the buffer you passed as argument to .
NOTE: You must always remember to allocate enough memory for your sample buffer (in this case, sample_values). The driver assumes that your application has allocated at least the amount of memory given in the following formula:
Memory = sizeof() * ( high_channel - low_channel + 1 )