How does the ping-pong buffer transfer data in the ' ADC_DAC-Playback ' example of SC589?
Ping-Pong buffering is a programming technique that uses two buffers to speed up a processor that can overlap I/O with processing. Data in one buffer is being processed while the next set of data is read into the other one. The driver internally takes care of switching when a buffer is filled.
In the audio example code, initially we submit Ping-Pong buffer. But in the SPORT driver, DMA is not configured as chain of descriptors for ping-pong buffers submitted by application. In this case, every time a buffer transmission done, we have to resubmit that buffer again by collecting the processed buffer address in the callback function.
Please find the attached image which will help you understand how the buffers are processed by DMA controller.