CyU3PMemSet((uint8_t *) dmaConfig,0,sizeof(CyU3PDmaChannelConfig_t));
dmaConfig.size = CY_FX_UVC_STREAM_BUF_SIZE;
dmaConfig.count = CY_FX_UVC_STREAM_BUF_COUNT;
dmaConfig.prodSckId = (CyU3PDmaSocke
tid_t)CY_U3P_PIB_SOCKET_0;
dmaConfig.consSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 |CY_FX_EP_VIDEO_CONS_SOCKET);
dmaConfig.prodAvailCount = 0;
dmaConfig.prodHeader = 12; /* 要添加的 12 字节 UVC 标头。 */
dmaConfig.prodFooter = 4; /* 4 字节页脚以补偿 12 字节标头。 */
dmaConfig.consHeader = 0;
dmaConfig.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaConfig.notification = CY_U3P_DMA_CB_PROD_EVENT;//CY_U3P_DMA_CB_PROD_EVENT ;;
dmaConfig.cb = CyFxUvcApplnDmaCallback;
apiRetStatus = CyU3PDmaChannelCreate ( glChHandleUVCStream,/*CY_U3P_DMA_TYPE_AUTO_SIGNAL*/ CY_U3P_DMA_TYPE_MANUAL,
dmaConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
{
/* 错误处理 */
CyU3PDebugPrint (4, “DMA 通道创建失败, 错误代码 = %dn”, apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}