Hello,
I'm completely new to the RT600 ecosystem, and I'm still trying to get a feel for how to make best use of the API. I noticed that when it comes to DMA, there seem to be at least 3 ways of accomplishing a similar function, at least according to the SDK examples.
The simplest example, called dma_memory_to_memory uses the DMA_PrepareChannelTransfer and DMA_SubmitChannelTransfer to perform a one-time memory to memory transfer.
The next two examples, called dma_interleave_transfer and dma_linked_transfer, use the DMA_SetupDescriptor and DMA_SubmitChannelDescriptor functions.
The final example in my sdk archive is called dma_channel_chain, and uses the DMA_SetChannelConfig, DMA_SetupDescriptor, and DMA_SubmitChannelTransferParameter functions.
Can anyone provide some insight on when to use which set of functions? I'm assuming the behavior is slightly different among these functions; is there a set of functions that expose the maximum functionality that I can use in all cases?
Thanks a lot
-Mike
Thanks for your advice. For now I ended up using 2 combinations of functions:
If the head descriptor (i.e. the channel descriptor) does not need to be unique, I use DMA_SetupDescriptor to create my chain of reload descriptors, and then use DMA_LoadChannelDescriptor to copy the first reload descriptor into the head descriptor defined in the DMA driver. This keeps things clean by avoiding having duplicate code for the channel descriptor and the first reload descriptor.
If the head descriptor must be unique for some reason, I again use DMA_SetupDescriptor to create the chain of reload descriptors, and then use DMA_SubmitChannelTransferParameter to create and submit the unique head descriptor. I like SubmitChannelTransferParameter because unlike some of the other API functions, it takes exactly the same parameters as SetupDescriptor (besides the first one), which means I can just copy the parameters of the first SetupDescriptor call and do the minor modifications I need.
Best,
-Mike
Hi Mike
The DMA driver provide detail description for each function, I suggest you read it first.
The DMA_PrepareChannelTransfer/DMA_SubmitChannelTransfer expose the maximum functionality of DMA