获得Enpoint address

[复制链接]
 楼主| houcs 发表于 2018-4-30 19:38 | 显示全部楼层 |阅读模式
Cypress CyUsb.sys用DirectIOCtrl方式
获得Enpoint address
zwll 发表于 2018-4-30 19:39 | 显示全部楼层
然后呢?你是怎么应对这个的呢
kangzj 发表于 2018-4-30 19:44 | 显示全部楼层
CyUsb.chm上没有介绍吗?
chuxh 发表于 2018-4-30 19:46 | 显示全部楼层

貌视没有啊
stly 发表于 2018-4-30 19:48 | 显示全部楼层
在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;
   }
llljh 发表于 2018-4-30 19:49 | 显示全部楼层

也可以到CY网站下载CY USB的技术参考手册EZ-USB(R): Technical Reference Manual (TRM)
http://www.cypress.com/?rID=14667
dingy 发表于 2018-4-30 19:51 | 显示全部楼层
嗯,也有EndpointAddress和MaxPacketSize的详细介绍。
renyaq 发表于 2018-4-30 19:52 | 显示全部楼层
资料我有,不过这是Cypress封装好的api
xxrs 发表于 2018-4-30 19:56 | 显示全部楼层
我需要在内核模式下访问驱动,顾不能采用这种api。
liuzaiy 发表于 2018-4-30 19:57 | 显示全部楼层
通过CrpressConsole查看
yinxiangh 发表于 2018-4-30 19:58 | 显示全部楼层

通过CrpressConsole查看获得了endpoints后直接使用的
in endpoint 是0x82
out endpoint是0x02
chenjunt 发表于 2018-4-30 19:59 | 显示全部楼层

不知道LZ用的上位机用的是那个软件开发的,我正在用labview开发上位机,想对CYAPI进行二次封装得到dll,
lz可有这方面的经验,参考参考。。
 楼主| houcs 发表于 2018-4-30 20:01 | 显示全部楼层

嗯,找到同路人了,一起学习,呵呵
您需要登录后才可以回帖 登录 | 注册

本版积分规则

743

主题

8382

帖子

5

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