打印

请教Cypress CyUsb.sys用DirectIOCtrl方式

[复制链接]
3078|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
katawz|  楼主 | 2009-6-25 11:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
(1)获得Enpoint address
(2)MaxPktSize

CyUsb.chm上没有介绍
沙发
ni_labview| | 2009-6-29 11:19 | 只看该作者

已经给AE哥哥发信,帮你

使用特权

评论回复
板凳
小工程师| | 2009-6-30 18:03 | 只看该作者

LZ,可以参考CyAPI.chm



在CyAPI.chm中的CCyUSBEndPoint有关于Endpoint Address和MaxPacketSize说明

Description 

Address contains the value of the bEndpointAddress field of the endpoint descriptor returned by the device. 

Addresses with the high-order bit set (0x8_) are IN endpoints. 

Addresses with the high-order bit cleared (0x0_) are OUT endpoints. 

The default control endpoint (ControlEndPt) has Address = 0. 


Example 

  //  Find a second bulk IN endpoint in the EndPoints[] array 

  CCyUSBDevice  *USBDevice = new  CCyUSBDevice(Handle); 

  CCyBulkEndPoint *BulkIn2 = NULL; 

  int eptCount = USBDevice->EndPointCount(); 

  for  (int  i=1; i<eptCount;  i++) { 
      bool  bIn = USBDevice->EndPoints->Address & 0x80; 
      bool  bBulk = (USBDevice->EndPoints->Attributes == 2); 

      if (bBulk  && bIn) BulkIn2 = (CCyBulkEndPoint *) USBDevice->EndPoints
      if (BulkIn2 == BulkInEndPt) BulkIn2 = NULL; 
   } 


楼主也可以到CY网站下载CY USB的技术参考手册EZ-USB(R): Technical Reference Manual (TRM)
http://www.cypress.com/?rID=14667
也有EndpointAddress和MaxPacketSize的详细介绍。
呵呵,希望有所帮助!
相关链接:https://bbs.21ic.com/upfiles/img/20096/200963018025758.zip

使用特权

评论回复
地板
katawz|  楼主 | 2009-7-2 10:25 | 只看该作者

回复

3楼的资料我有,不过这是Cypress封装好的api,我需要在内核模式下访问驱动,顾不能采用这种api。

目前的办法是通过CrpressConsole查看获得了endpoints后直接使用的
in endpoint 是0x82
out endpoint是0x02

使用特权

评论回复
5
kyle2009| | 2009-12-26 21:35 | 只看该作者
不知道LZ用的上位机用的是那个软件开发的,我正在用labview开发上位机,想对CYAPI进行二次封装得到dll,
lz可有这方面的经验,参考参考。。

使用特权

评论回复
6
wbj8886| | 2010-12-24 10:42 | 只看该作者
学习

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

4

帖子

0

粉丝