I'm checking out a few DMA ADC examples for the Arduino MKR with SAMD21 mcu.
Both examples I reviewed (1 and 2) set the destination buffer's end as the destination address:
#define SAMPLE_NO 8 // Define the number of ADC samples uint16_t adcResult[SAMPLE_NO] = {}; // Store ADC values // .. descriptor.dstaddr = (uint32_t)&adcResult[0] + sizeof(uint16_t) * SAMPLE_NO; // Place it in the adcResult array
Most controllers I work with expect the start of the buffer. I'm reading the datasheet's DMA section, haven't found the explanation yet.
Anyone here in the know?