Who own the memory when calling CyU3PDmaChannelSetupSendBuffer? | Cypress Semiconductor
Who own the memory when calling CyU3PDmaChannelSetupSendBuffer?
If I receive a DMA buffer from the GPIF (that is I get a callback) can I use the DMA buffer by passing it to CyU3PDmaChannelSetupSendBuffer?
Can I create a "fake" CyU3PDmaBuffer_t where the buffer field points at a location in memory that another DMA channel is using?
For example can I call CyU3PDmaChannelGetBuffer to get a CyU3PDmaBuffer_t for a DMA transfer that just completed, and then pass that to CyU3PDmaChannelSetupSendBuffer to commit the same buffer with no memory copying to the outgoing DMA channel?
Likewise can I allocate my own CyU3PDmaBuffer_t by using a CyU3PMemAlloc and then populate the fields to make it looks like a CyU3PDmaBuffer_t?
CyU3PDmaBuffer_t *my_dma = (CyU3PDmaBuffer_t *)CyU3PMemAlloc(sizeof(CyU3PMemAlloc));
my_dma.buffer = p; /* some location in memory that is part of a dma memory on another channel */
my_dma.count = 1;
my_dma.size = length_to_transfer; /* amount of memory to transfer */
my_dma.status = ???; /* not sure what should go here, maybe CyU3PDmaMode_t */