What's a DMA TransferAllocatedPort?
I'm still working my way around the DMA learning curve. Having found the IOC approach to DMA configuration too confusing, I'm configuring the structs and calling the HAL_DMA_Init(...) method myself.
Something I haven't been able to find clearly described is the "TransferAllocatedPort" field of the DMA_InitTypeDef struct. I understand that it's there to specify source/destination port0/port1, but I don't understand the significance of that selection.
One blog post I found seems to say that having two ports allows the DMA peripheral to assemble or disassemble transfers when source and destination have differing alignments. Okay, I understand that explanation, but is that a correct explanation?
If my source and destination have the same alignment, can (or should) I assign the same port to both? Is there any advantage or disadvantage? Since a "channel" is devoted to a particular path and direction, I wouldn't think the unused port would be useful for anything else at the same time.
Put in terms of code, right now I've naively written:
dma_handle.Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0 | DMA_DEST_ALLOCATED_PORT1;Should I (or should I definitely not) do this instead:
dma_handle.Init.TransferAllocatedPort = DMA_SRC_ALLOCATED_PORT0 | DMA_DEST_ALLOCATED_PORT0;