你好,
对。你需要重复同样的代码来增加额外的数据路径。
EpCF.Eng= Cytru.
EpCFE.EpType=CYU-U3PUS;
EpCF.BurSTLLN=1;
EFCFG流=0;
PCKTSIZE=大小;
/*生产者端点配置*/
ApItReStase= CYU3PSEPTECOFIG(CyfxxEppEuthor,and EpCFG);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CyU3pStEtEnCOFIGG失败,错误代码= %DN”,ApIrTestStand;
CyFxAppErrorHandler(ApRestStand);
}
*消费端点配置*/
ApItReStase= CYU3PSEPTECOFIG(CyfxxEppEpple Euffor and EpCFG);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CyU3pStEtEnCOFIGG失败,错误代码= %DN”,ApIrTestStand;
CyFxAppErrorHandler(ApRestStand);
}
*为U2P传输创建DMA手动通道。
*基于USB速度设置DMA大小。*/
大小=大小;
DCMACFG计数=CyfxxSLFIFOX-DMAY-Buffl计数;
DMACFG.PRODSCKID = CyfxFxPultReuleSubSoCult;
DCMAFG.COXSCHAVE=CyfxFuxEuffer-PpPosiSosik;
DMACGF.DMAMODE=CYU-U3PY-DMAYMODEEY字节;
/*启用产品事件的回调。*/
DMACFG通知= CYU-U3PYDMABCBYPRODYL事件;
DCMAFG.CB=0;
DMACG.PRODHead=0;
DMACGF.PRODHOPETER=0;
DMACGF.CONSEADADER=0;
DMACFG。
ApIdReStase= CUU3PDMACHANNEL CREATE(和GLCHANDACLE LIFOUDOP)
CYU-U3PYDMAX型汽车,DMACFG;
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL CREATION失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
/*为DU传输创建DMA手动通道。*/
DMACGF.PRODSCKID = CyfxxPuxelyPpPosiSosik;
DCMAFG.CascSKID= CyfxfxCuffier-U***SoCult;
DCMAFG.CB=0;
ApIdReStase= CYU3PDMACHANNEL CREATION(和GLCHANDACLE LIFOPPOTHOP)
CYU-U3PYDMAX型汽车,DMACFG;
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL CREATION失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
/*刷新端点内存*/
CYU3PUBFLUSSHEP(CyfxxEpEl生产者);
CYU3PUBFLUESHEP(CYFXFX EPLE消费者);
*设置DMA通道传输大小。*/
ApItReStase= CYU3PDMACHANNEL SETXFER(&GLCHANDACLE LIFOUTOP,CyfxFxSLIFOFIO-DMAY-TXX大小);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL SETXFER失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
ApItReStase= CYU3PDMACHANNEL SETXFER(&GLCHANDACLE LIFOPPOTH,CYFXFSLIFFIOXDMAYRXX大小);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL SETXFER失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
红色中突出显示的代码应根据新的数据路径要求更改。
请让我知道,如果你需要更多的帮助,我在创建新的数据路径。
谢谢,
西克里希纳。
以上来自于百度翻译
以下为原文
Hi,
Yes. You need to repeat the same peice of code for additional data paths.
epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_BULK;
epCfg.burstLen = 1;
epCfg.streams = 0;
epCfg.pcktSize = size;
/* Producer endpoint configuration */
apiRetStatus = CyU3PSetEpConfig(CY_FX_EP_PRODUCER, &epCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
/* Consumer endpoint configuration */
apiRetStatus = CyU3PSetEpConfig(CY_FX_EP_CONSUMER, &epCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
/* Create a DMA MANUAL channel for U2P transfer.
* DMA size is set based on the USB speed. */
dmaCfg.size = size;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
/* Enabling the callback for produce event. */
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = 0;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP,
CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %dn", 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 = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Flush the Endpoint memory */
CyU3PU***FlushEp(CY_FX_EP_PRODUCER);
CyU3PU***FlushEp(CY_FX_EP_CONSUMER);
/* Set DMA channel transfer size. */
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoUtoP, CY_FX_SLFIFO_DMA_TX_SIZE);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer Failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoPtoU, CY_FX_SLFIFO_DMA_RX_SIZE);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer Failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
The code highlighted in Red should be changed as per your new data path requirement.
Please let me know if you need any more help from me in creating the new data paths.
Thanks,
sai krishna.
你好,
对。你需要重复同样的代码来增加额外的数据路径。
EpCF.Eng= Cytru.
EpCFE.EpType=CYU-U3PUS;
EpCF.BurSTLLN=1;
EFCFG流=0;
PCKTSIZE=大小;
/*生产者端点配置*/
ApItReStase= CYU3PSEPTECOFIG(CyfxxEppEuthor,and EpCFG);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CyU3pStEtEnCOFIGG失败,错误代码= %DN”,ApIrTestStand;
CyFxAppErrorHandler(ApRestStand);
}
*消费端点配置*/
ApItReStase= CYU3PSEPTECOFIG(CyfxxEppEpple Euffor and EpCFG);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CyU3pStEtEnCOFIGG失败,错误代码= %DN”,ApIrTestStand;
CyFxAppErrorHandler(ApRestStand);
}
*为U2P传输创建DMA手动通道。
*基于USB速度设置DMA大小。*/
大小=大小;
DCMACFG计数=CyfxxSLFIFOX-DMAY-Buffl计数;
DMACFG.PRODSCKID = CyfxFxPultReuleSubSoCult;
DCMAFG.COXSCHAVE=CyfxFuxEuffer-PpPosiSosik;
DMACGF.DMAMODE=CYU-U3PY-DMAYMODEEY字节;
/*启用产品事件的回调。*/
DMACFG通知= CYU-U3PYDMABCBYPRODYL事件;
DCMAFG.CB=0;
DMACG.PRODHead=0;
DMACGF.PRODHOPETER=0;
DMACGF.CONSEADADER=0;
DMACFG。
ApIdReStase= CUU3PDMACHANNEL CREATE(和GLCHANDACLE LIFOUDOP)
CYU-U3PYDMAX型汽车,DMACFG;
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL CREATION失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
/*为DU传输创建DMA手动通道。*/
DMACGF.PRODSCKID = CyfxxPuxelyPpPosiSosik;
DCMAFG.CascSKID= CyfxfxCuffier-U***SoCult;
DCMAFG.CB=0;
ApIdReStase= CYU3PDMACHANNEL CREATION(和GLCHANDACLE LIFOPPOTHOP)
CYU-U3PYDMAX型汽车,DMACFG;
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL CREATION失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
/*刷新端点内存*/
CYU3PUBFLUSSHEP(CyfxxEpEl生产者);
CYU3PUBFLUESHEP(CYFXFX EPLE消费者);
*设置DMA通道传输大小。*/
ApItReStase= CYU3PDMACHANNEL SETXFER(&GLCHANDACLE LIFOUTOP,CyfxFxSLIFOFIO-DMAY-TXX大小);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL SETXFER失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
ApItReStase= CYU3PDMACHANNEL SETXFER(&GLCHANDACLE LIFOPPOTH,CYFXFSLIFFIOXDMAYRXX大小);
如果(ApRestStand)!= CYU-U3PY成功
{
CYU3pDebug(4),“CYU3PDMACHANNEL SETXFER失败,错误代码= %DN”,APIRSTATION;
CyFxAppErrorHandler(ApRestStand);
}
红色中突出显示的代码应根据新的数据路径要求更改。
请让我知道,如果你需要更多的帮助,我在创建新的数据路径。
谢谢,
西克里希纳。
以上来自于百度翻译
以下为原文
Hi,
Yes. You need to repeat the same peice of code for additional data paths.
epCfg.enable = CyTrue;
epCfg.epType = CY_U3P_USB_EP_BULK;
epCfg.burstLen = 1;
epCfg.streams = 0;
epCfg.pcktSize = size;
/* Producer endpoint configuration */
apiRetStatus = CyU3PSetEpConfig(CY_FX_EP_PRODUCER, &epCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
/* Consumer endpoint configuration */
apiRetStatus = CyU3PSetEpConfig(CY_FX_EP_CONSUMER, &epCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PSetEpConfig failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler (apiRetStatus);
}
/* Create a DMA MANUAL channel for U2P transfer.
* DMA size is set based on the USB speed. */
dmaCfg.size = size;
dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT;
dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET;
dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
/* Enabling the callback for produce event. */
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = 0;
dmaCfg.prodHeader = 0;
dmaCfg.prodFooter = 0;
dmaCfg.consHeader = 0;
dmaCfg.prodAvailCount = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP,
CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %dn", 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 = 0;
apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU,
CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Flush the Endpoint memory */
CyU3PU***FlushEp(CY_FX_EP_PRODUCER);
CyU3PU***FlushEp(CY_FX_EP_CONSUMER);
/* Set DMA channel transfer size. */
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoUtoP, CY_FX_SLFIFO_DMA_TX_SIZE);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer Failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleSlFifoPtoU, CY_FX_SLFIFO_DMA_RX_SIZE);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PDmaChannelSetXfer Failed, Error code = %dn", apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
The code highlighted in Red should be changed as per your new data path requirement.
Please let me know if you need any more help from me in creating the new data paths.
Thanks,
sai krishna.
举报