FX3 Programmers Manual, Doc. # 001-64707 Rev. *C
95
FX3 Application Structure
/* Enabling the callback for produce event. */
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);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code =
%d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Create a DMA MANUAL channel for P2U transfer. */
dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET;
dmaCfg.cb = CyFxSlFifoPtoUDmaCallback;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
CY_U3P_DMA_TYPE_MANUAL, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code =
%d\n", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
■
The DMA channel transfers are enabled
/* Set DMA Channel transfer size */
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoUtoP,
CY_FX_SLFIFO_DMA_TX_SIZE);
/* Set DMA Channel transfer size */
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoPtoU,
CY_FX_SLFIFO_DMA_TX_SIZE);
8.1.2.8
DMA Callback
In this example, there are two data paths
■
U to P
■
P to U
A DMA callback is registered for the DMA Produce Events on each path. This event will occur when
a DMA buffer is available (with data) from
■
The USB OUT endpoint
■
The GPIF-II socket
In the DMA callback, this buffer is committed, passing on the data to the
Summary of Contents for EX-USB FX3
Page 8: ...8 FX3 Programmers Manual Doc 001 64707 Rev C Contents...
Page 12: ...12 FX3 Programmers Manual Doc 001 64707 Rev C Introduction...
Page 48: ...48 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Overview...
Page 74: ...74 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Firmware...
Page 76: ...76 FX3 Programmers Manual Doc 001 64707 Rev C FX3 APIs...
Page 84: ...84 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Examples...
Page 98: ...98 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Structure...
Page 148: ...148 FX3 Programmers Manual Doc 001 64707 Rev C FX3 P Port Register Access...
Page 165: ...FX3 Programmers Manual Doc 001 64707 Rev C 165 FX3 Development Tools Click next...
Page 178: ...178 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools Click on Apply...
Page 180: ...180 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools d Start the GDB server...
Page 185: ...FX3 Programmers Manual Doc 001 64707 Rev C 185 FX3 Development Tools...
Page 186: ...186 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 187: ...FX3 Programmers Manual Doc 001 64707 Rev C 187 FX3 Development Tools...
Page 188: ...188 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 192: ...192 FX3 Programmers Manual Doc 001 64707 Rev C GPIF II Designer...