完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好
除了添加2个线程(EP2/OUT/IN),在您的FieldWord的基础上实现四个线程,尽管FPGA & lt;=& ft3gpIF2& lt;=& gt;fx3EP1/OUT/IN,EP2/Out/In & lt;=& PC;我知道如何配置EPS的描述符,但是我不知道在C文件中应该做什么。在EP2和GPIF2之间的MMA管道,我们使用DMAYAutoType,可以复制关于EP1的DMA配置代码,只配置端点和DMAChanas,AS CYU3PAPCONtiONT EPCFG1;CYU3PDMACHANNEL CONTICONT DMACFGG1;CYU3PAPCONTIONT EPFCFG2;CYU3PDMACHANNEL CONTICONT DMACFGG2; 配置PIB和UIB套接字2 以上来自于百度翻译 以下为原文 Hello In addition to add 2 threads (ep2 out/in) on the basis of fireware of your provided to achieve four threads though the FPGA <=> FX3 GPIF2 <=> FX3 EP1 OUT/ IN, EP2 OUT/IN <=> PC ,I know how to configure the descriptor about eps, but I don't know what should i do in .c file to configure DMA pipe between ep2 and gpif2, we use DMA_AUTO_TYPE, can i copy the DMA configuration code about ep1, just configuring endpoints and dma channel, as CyU3PEpConfig_t epCfg_1;CyU3PDmaChannelConfig_t dmaCfg_1;CyU3PEpConfig_t epCfg_2;CyU3PDmaChannelConfig_t dmaCfg_2; configure PIB and UIB socket 2 |
|
相关推荐
1个回答
|
|
你好,
对。你需要重复同样的代码来增加额外的数据路径。 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. |
|
|
|
只有小组成员才能发言,加入小组>>
750个成员聚集在这个小组
加入小组2054 浏览 1 评论
1809 浏览 1 评论
3621 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1746 浏览 6 评论
1499 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
484浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
337浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
400浏览 2评论
341浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
834浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-9 00:28 , Processed in 0.800103 second(s), Total 47, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号