96 FX3 Programmers Manual, Doc. # 001-64707 Rev. *C
FX3 Application Structure
■ The GPIF-II socket
■ USB In Endpoint
The two call back functions are shown below
/* DMA callback function to handle the produce events for U to P trans-
fers. */
void
CyFxSlFifoUtoPDmaCallback (
CyU3PDmaChannel *chHandle,
CyU3PDmaCbType_t type,
CyU3PDmaCBInput_t *input
)
{
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
if (type == CY_U3P_DMA_CB_PROD_EVENT)
{
/* This is a produce event notification to the CPU. This notifica-
tion is
* received upon reception of every buffer. The buffer will not be
sent
* out unless it is explicitly committed. The call shall fail if
there
* is a bus reset / usb disconnect or if there is any application
error. */
status = CyU3PDmaChannelCommitBuffer (chHandle, input-
>buffer_p.count, 0);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer failed, Error
code = %d\n", status);
}
/* Increment the counter. */
glDMARxCount++;
}
}
/* DMA callback function to handle the produce events for P to U trans-
fers. */
void
CyFxSlFifoPtoUDmaCallback (
CyU3PDmaChannel *chHandle,
CyU3PDmaCbType_t type,
CyU3PDmaCBInput_t *input
)
{
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
if (type == CY_U3P_DMA_CB_PROD_EVENT)
{