Extra fields of CyU3PDmaChannel | Cypress Semiconductor
Extra fields of CyU3PDmaChannel
The CyU3PDmaChannel structure has a lot of extra fields that are not configured when a CyU3PDmaChannel is created. The code below shows a typical CyU3PDmaChannel setup
dmaCfg.size = bulksize;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaCfg.prodSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_PROD_0 | CY_FX_EP_PRODUCER_SOCKET);
dmaCfg.consSckId = (CyU3PDmaSocketId_t)(CY_FX_EP_CONSUMER_PPORT_SOCKET);
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = CyFxSlFifoUtoPDmaCallback;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
But there are a lot more parts to this structure than shown above . For example according to the FX3APIGuide there are two fields called currentProdIndex and currentConsIndex which point to the descriptor of the active DMA buffer.
Can I read the value of these two fields to find out more information about the status of the DMA buffers? I have tried reading these but they don't change during DMA transfers. What I hope to do with this information is determine whether a DMA buffer is empty or full. If anyone else has a way of doing this I would be grateful to find out how.