请教Cypress CyUsb.sys用DirectIOCtrl方式

[复制链接]
4396|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
kyle2009 发表于 2009-12-26 21:35 | 显示全部楼层
不知道LZ用的上位机用的是那个软件开发的,我正在用labview开发上位机,想对CYAPI进行二次封装得到dll,
lz可有这方面的经验,参考参考。。
wbj8886 发表于 2010-12-24 10:42 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

4

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部