DMA current memory location: twiddle this on-the-fly ?
I have an STM32F405, with circular i2s DMA set up and working fine. Interrupts fire perfectly, on every half and full completion (which is every 30ms, in my case).
I want to keep the interrupts firing every 30 ms, but shift when that happens, in order for the interrupts to roughly coincide (±100usec) with some external event.
NDTR is the counter which increments DMA memory, so I figured I could do a quick calculation of the needed shift, directly write that calculated value to NDTR, and the 30ms interrupts would continue, except shifted. Writing NDTR required disabling the stream first (from datasheet).
Unfortunately, writing to NDTR means that NDTR will forever henceforth be reloaded with that value (I suspect when the stream is re-enabled, the silicon latches NDTR into some inaccessible register. The datasheet says NDTR is "reloaded automatically with the previously programmed value"). So writing my calculated value to NDTR means the 30ms is not 30ms anymore.
So the question: How can I directly write to the DMA memory position counter?