完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我已经获得了CyAPI.LIB接口,用于两个方向的数据传输。现在,似乎知道如果数据已经从USB外设收到的唯一方式是民意调查的端点使用xferdata然后检查返回值。我想有一个中断或Windows的消息让我知道当数据到达了这样的代码不会浪费时间轮询。有办法做到这一点吗?
以上来自于百度翻译 以下为原文 I have gotten the CyAPI.lib interface working for data transfers in both directions. Right now, it seems that the only way to know if data has been received from the USB peripheral is to poll the IN endpoint using XferData and then check the return value. I would like to have an interrupt or windows message to let me know when data has arrived so that the code doesn't waste time polling. Is there a way to do this? |
|
相关推荐
4个回答
|
|
你好,
当数据准备就绪时,设备无法关闭主机。由于USB协议是主机控制的,所以主机必须请求数据。如果缓冲区中有数据,设备将通过发送数据做出响应,XFEDATA将返回true,否则为false。所以,轮询是唯一的出路。USB2.0就是这样。 这个轮询功能在USB 3上得到了改进。在USB 3设备中,可以向主机发送异步通知,而不是主机轮询。 当做, 加亚特里 以上来自于百度翻译 以下为原文 Hi, There is no way the device can intimate the host when the data is ready. Since the USB protocol is host controlled, it is the host that has to request for data. If there is data in the buffer, device will respond by sending the data and Xferdata will return TRUE, else FALSE. So, polling is the only way out. This is so in USB2.0. This polling feature has been improved upon in USB 3.0. In USB 3.0 device can send Asynchronous notifications to the device, instead of host polling. Regards, Gayathri |
|
|
|
有可能使用中断端点来解决这个问题吗?在这种情况下,PC服务器中的主机控制器将在不加载用户应用程序的情况下查询EndoPoT。有人有这样做的经验吗?CYPRESSprovode是否有一个示例代码(比如BukLoad示例),用于演示中断传递功能和配置FX2、用户应用程序和CyApi使用Windows消息通知数据可访问性?
以上来自于百度翻译 以下为原文 Is it possible to solve this problem using INTERRUPT endpoint? Is this case the host controller in PC iself will poll the endopint without loading of user app. Does anybody have the experience of doing so? Does CYPRESS provode an example code (like BUKLOOP example) for demonstration of interrupt transfer functionality and configuring FX2, user application and CyApi to use windows messages for notification of data availiability? |
|
|
|
你好,
即使对于中断端点,应用程序也必须对端点中断中的数据进行轮询,如果您使用的是某些厂商专用的绑定到CysB.SIS的SPE。但是如果设备像鼠标/键盘一样绑定到Windows HID驱动程序,那么轮询将被处理。但在另一种情况下,应用程序本身必须继续调用XFEDATA以固定间隔读取数据。 当做, 加亚特里 以上来自于百度翻译 以下为原文 Hi, Even for INTERRUPT endpoints, the application will have to poll for the data from INTERRUPT IN endpoint, if you are using some vendor ecific spdevice bound to CyUSB.sys. But if the device is something like a mouse/keyboard that is bound to the Windows HID driver, then the polling will be taken care of by that. But in the other case, the application itself has to keep calling the XferData for reading the data in fixed intervals. Regards, Gayathri |
|
|
|
你好,
虽然USB协议定义了中断端点的轮询间隔,但主机将不进行轮询,除非它有缓冲区来存储所接收的数据,即应用程序或驱动程序必须设置缓冲器,然后将请求发送到中断端点。 对于类特定设备,如HID设备,主机有一个本地驱动程序,知道如何处理数据,因此默认情况下进行轮询,并处理数据。在自定义类设备中,我们定义了如何使用数据以及需要什么,因此主机不会默认进行查询。因此,您必须在应用程序中排队请求,或者如果您希望定期轮询,则可以通过编写自定义驱动程序来将轮询移动到驱动程序。 当做, 阿南德 以上来自于百度翻译 以下为原文 Hi, Though USB protocol defines the polling interval for interrupt endpoint the host won't poll unless it has buffer to store the received data i.e. the application or driver has to setup the buffer and then send reqeust to interrupt endpoint. For class specific devices like HID devices the host has a native driver and knows what to do with the data so it polls by default and processes the data. In custom class devices we define how the data is being used and what it is needed so host won't poll by default. So you either have to queue up requests in the application or move the polling to the driver by writing a custom driver if you want the polling at regular intervals. Regards, Anand |
|
|
|
只有小组成员才能发言,加入小组>>
740个成员聚集在这个小组
加入小组1980 浏览 1 评论
1742 浏览 1 评论
3514 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1672 浏览 6 评论
1449 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
227浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
134浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
327浏览 2评论
274浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
458浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-23 23:30 , Processed in 0.823251 second(s), Total 84, Slave 67 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191