|
Hi Sai Krishna,
The DMA Configuration is same as used in the Application example slave async fifo. I have not done any change in that.
In the function CyFxSlFifoApplnInit(), the DMA channels are created as follows.
/* Create a MANUAL channel for UtoP transfer */
dmaCfg.count = 64 ; /* 64 for FS,512 for HS and 1024 for SS */
dmaCfg.ProdSckId = 0x0401 ;
dmaCfg.ConsSckId = 0x0103 ;
dmaCfg.dmaMode = 0 ;
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT ;
dmaCfg.cb = CyFxSlFifoUtoPDmaCallback ;
dmaCfg.ProdHeader = 0 ;
dmaCfg.ProdFooter = 0 ;
dmaCfg.ConsHeader = 0 ;
dmaCfg.ProdAvailCount = 0 ;
apiRetStatus = CyU3PDmaChannelCreate(&glChHandleSlFifoUtoP, CY_U3P_DMA_TYPE_MANUAL,&dmaCfg) ;
/* Create a MANUAL channel for PtoU transfer */
dmaCfg.ProdSckId = 0x0100 ;
dmaCfg.ConsSckId = 0x0301 ;
dmaCfg.cb =CyFxSlFifoPtoUDmaCallback ;
apiRetStatus = CyU3PDmaChannelCreate(&glChHandleSlFifoPtoU, CY_U3P_DMA_TYPE_MANUAL,&dmaCfg) ;
/* Flush the endpoint memory */
CyU3PUsbFlushEp (CY_FX_EP_PRODUCER) ;
CyU3PUsbFlushEp (CY_FX_EP_CONSUMER) ;
/* Set DMA channel transfer size */
apiRetStatus = CyU3PDmaChannelSetXfer(&glChHandleSlFifoUtoP, 0) ;
apiRetStatus = CyU3PDmaChannelSetXfer(&glChHandleSlFifoPtoU, 0) ;
In both UtoP and PtoU call back functions, commit is performed if type == CY_U3P_DMA_CB_PROD_EVENT
Other Informations
1) Fast enumeration is used.
2) The function CyU3PRegisterSetupCallback() is called from the function CyFxSlFifoApplnInit()
3) The function CyU3PRegisterEventCallback() is called from the function CyFxSlFifoApplnInit()
4) The function CyU3PRegisterLPMRequestCallback() is called from the function CyFxSlFifoApplnInit()
5) FLAGA is dedicated for UtoP transfer status
6) FLAGB is dedicated for PtoU transfer status
7) The type of DMA channel is MANUAL for both P to U and U to P transfers
regards,
Sajeevan.K
|