I am attempting to halt, reconfigure, and then restart the SPORT DMA and SPORT controller during a sample rate change. I am running the SPORTs in multichannel mode on a 21469. I assume the procedure is as follows:
1. Mask the SPORT DMA interrupts
2. Disable SPORT DMA (Clear the SDEN_A/B bits in the SPCTLx reigesters)
3. Disable SPORT interface (Clear the MCEN_A/B bits in the SPMCTLx reigesters)
4. Reconfigure the DMA TCBs
5. Clear the DMA ping/pong memory
6. Clear the SPORT FIFOs (?)
7. Enable DMA
8. Enable SPORT interface
Is the above procedure correct?
The main questions is how to accomplish step 6. I can't find documentation that describes how to flush the SPORT FIFOs. Is there a way to shift out the stale elements in the FIFO while watching the DXS0_A/B status bits to know when the FIFO is empty?
Any help would be appreciated.