Wish I had found this thread sooner! I was trying to wrap my head around exactly this. My case is a bit different, since I’m trying to use the onboard DAC, but it’s mostly the same.
I had managed to cobble together a “Hello DMA” project based on the small handful of tutorials I was able to find that fit the bill, and then went about wrapping up the DMA/DAC parts similar to the Clouds’ Codec class.
One key difference is I have been trying to use the DMA’s circular mode, though it appears to me that there’s no way to tell which address the DMA is currently reading from. DMA_GetCurrDataCounter() always returns 64 for me, which is the same as the buffer size I have set. Am I missing something, or am I simply better off using a double buffer instead?
Also, is there a reason for the codec Init() and Start() being separate functions? They seem to be called in direct succession.
Thanks for opening up all this code and packaging up the build environment, it’s really proving to be a valuable learning resource!