You can make use of DmaMultiChannel. Please refer to the AN 75779. It makes use of DMA multi channel.
Here is the code snippet for your reference:
dmaMultiConfig.size = CY_FX_UVC_STREAM_BUF_SIZE;
dmaMultiConfig.count = CY_FX_UVC_STREAM_BUF_COUNT;
dmaMultiConfig.validSckCount = 2;
dmaMultiConfig.prodSckId  = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_0;
dmaMultiConfig.prodSckId  = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_1;
dmaMultiConfig.consSckId  = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_VIDEO_CONS_SOCKET);
dmaMultiConfig.prodAvailCount = 0;
dmaMultiConfig.prodHeader = 12; /* 12 byte UVC header to be added. */
dmaMultiConfig.prodFooter = 4; /* 4 byte footer to compensate for the 12 byte header. */
dmaMultiConfig.consHeader = 0;
dmaMultiConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaMultiConfig.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;
dmaMultiConfig.cb = CyFxUvcApplnDmaCallback;
apiRetStatus = CyU3PDmaMultiChannelCreate (&glChHandleUVCStream, CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE,
if (apiRetStatus != CY_U3P_SUCCESS)
/* Error handling */
CyU3PDebugPrint (4, "DMA Channel Creation Failed, Error Code = %d\n", apiRetStatus);
Thanks & regards
But this sounds like a forced ping-pong buffer application. The API Guide says this: "The producer sockets needs to be updated in the required order of operation. The first buffer shall be taken from the prodSckId, second from prodSckId and so on."
In my application, packets might come all from socket0, or all from socket1, or any mix of the two.
I've got the app working with manual buffer management so it may not matter at this point.
Could you please tell me how are you going to send data on GPIF sockets randomly?
I think you can make use of address lines to select appropriate thread to write data into it. I suggest you to go through AN 65974 in which we use 1:1 channel but address lines are used to select a particular thread. You can modify it to perform DMA Multi channel (as in AN 75779).
Thanks & Regards