谁能说说DirectIOCtrl方式

[复制链接]
 楼主| huanghuac 发表于 2012-10-2 15:59 | 显示全部楼层 |阅读模式
Cypress CyUsb.sys用DirectIOCtrl方式
获得Enpoint address
 楼主| huanghuac 发表于 2012-10-2 16:01 | 显示全部楼层
还有MaxPktSize
happy_10 发表于 2012-10-2 16:01 | 显示全部楼层
CyUsb.chm上没有介绍吗?
 楼主| huanghuac 发表于 2012-10-2 16:01 | 显示全部楼层
貌视没有啊
wenfen 发表于 2012-10-2 16:03 | 显示全部楼层
在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;
   }
zhuhuis 发表于 2012-10-2 16:05 | 显示全部楼层
也可以到CY网站下载CY USB的技术参考手册EZ-USB(R): Technical Reference Manual (TRM)
http://www.cypress.com/?rID=14667
wenfen 发表于 2012-10-2 16:07 | 显示全部楼层
嗯,也有EndpointAddress和MaxPacketSize的详细介绍。
 楼主| huanghuac 发表于 2012-10-2 16:10 | 显示全部楼层
资料我有,不过这是Cypress封装好的api
 楼主| huanghuac 发表于 2012-10-2 16:12 | 显示全部楼层
我需要在内核模式下访问驱动,顾不能采用这种api。
tian111 发表于 2012-10-2 16:14 | 显示全部楼层
通过CrpressConsole查看
 楼主| huanghuac 发表于 2012-10-2 16:16 | 显示全部楼层
通过CrpressConsole查看获得了endpoints后直接使用的
in endpoint 是0x82
out endpoint是0x02
wenfen 发表于 2012-10-2 16:18 | 显示全部楼层
不知道LZ用的上位机用的是那个软件开发的,我正在用labview开发上位机,想对CYAPI进行二次封装得到dll,
lz可有这方面的经验,参考参考。。
 楼主| huanghuac 发表于 2012-10-2 16:20 | 显示全部楼层
嗯,找到同路人了,一起学习,呵呵
 楼主| huanghuac 发表于 2012-10-2 16:21 | 显示全部楼层
结贴了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

772

主题

8473

帖子

6

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

772

主题

8473

帖子

6

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