77范文网 - 专业文章范例文档资料分享平台

Cypress CyUsb3.sys Programmer\\'s Reference(8)

来源:网络收集 时间:2019-04-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

36Cypress CyUsb3.sys Programmer's Reference5.15IOCTL_ADAPT_RESET_PARENT_PORT

Description

This command resets the upstream port of the device it manages. After a successful reset, the busdriver reselects the configuration and any alternative interface settings that the device had before thereset occurred. All pipe handles, configuration handles and interface handles remain valid.

A null pointer is passed as both the lpInBuffer and lpOutBuffer parameters to the DeviceIoControl( )function.

Example

DWORD dwBytes;

DeviceIoControl(hDevice, IOCTL_ADAPT_RESET_PARENT_PORT, NULL, 0, NULL, 0,

&dwBytes, NULL);

? 2012 Cypress Semiconductor

The IOCTL Interface375.16IOCTL_ADAPT_RESET_PIPE

Description

This command resets an endpoint of the device, clearing any error or stall conditions on that endpoint.Pending data transfers are not cancelled by this command.

The address of a single byte is passed as the lpInBuffer parameter to the DeviceIoControl( ) function.

A null pointer is passed as the lpOutBuffer parameter.

Example

DWORD dwBytes;

UCHAR Address = 0x82;

DeviceIoControl(hDevice, IOCTL_ADAPT_RESET_PIPE, &Address, sizeof (Address) NULL, 0,

&dwBytes, NULL);

? 2012 Cypress Semiconductor

38Cypress CyUsb3.sys Programmer's Reference5.17IOCTL_ADAPT_SELECT_INTERFACE

Description

This command sets the alternate interface setting for the primary interface of the attached device.

A pointer to a byte indicating the alternate interface setting is passed as both the lpInBuffer andlpOutBuffer parameters to the DeviceIoControl( ) function.

The length of the variable (1) is passed in the nInBufferSize and nOutBufferSize parameters.

Example

DWORD dwBytes = 0;UCHAR alt = 2;

DeviceIoControl (hDevice, IOCTL_ADAPT_SELECT_INTERFACE, &alt, sizeof (alt), &alt, sizeof (alt), &dwBytes, NULL);

? 2012 Cypress Semiconductor

The IOCTL Interface395.18IOCTL_ADAPT_SEND_EP0_CONTROL_TRANSFER

IOCTL_ADAPT_SEND_EP0_CONTROL_TRANSFERPrevious Top Next Description This command sends a control request to the default Control endpoint, endpoint zero. DeviceIoControl( ) is passed a pointer to a two-part structure as both the lpInBuffer and lpOutBufferparameters. This two-part structure contains a SINGLE_TRANSFER structure followed by a data buffer. The SINGLE_TRANSFER structure contains all the parameters for the control request. The buffer contains the transfer data. NOTE : Please note that this IOCTL return device configuration inclusive of both interface for USB3.0composite device. This is the limitation due to the USBDI bus interface. The USBDI doesn't supportUSB3.0 specific device configuration. Example union {struct {UCHAR Recipient:5;UCHAR Type:2;UCHAR Direction:1;} bmRequest; UCHAR bmReq;}; bmRequest.Recipient = 0; // DevicebmRequest.Type = 2; // VendorbmRequest.Direction = 1; // IN command (from Device to Host) int iXmitBufSize = sizeof(SINGLE_TRANSFER) + bufLen; // The size of the two-partstructureUCHAR *pXmitBuf = new UCHAR[iXmitBufSize]; // Allocate the memoryZeroMemory(pXmitBuf, iXmitBufSize); PSINGLE_TRANSFER pTransfer = (PSINGLE_TRANSFER)pXmitBuf; // The SINGLE_TRANSFER comesfirstpTransfer->SetupPacket.bmRequest = bmReq;pTransfer->SetupPacket.bRequest = ReqCode;pTransfer->SetupPacket.wValue = Value;pTransfer->SetupPacket.wIndex = Index;pTransfer->SetupPacket.wLength = bufLen;pTransfer->SetupPacket.ulTimeOut = TimeOut / 1000;pTransfer->Reserved = 0;pTransfer->ucEndpointAddress = 0x00; // Control pipepTransfer->IsoPacketLength = 0;pTransfer->BufferOffset = sizeof (SINGLE_TRANSFER);pTransfer->BufferLength = bufLen;? 2012 Cypress Semiconductor

40Cypress CyUsb3.sys Programmer's ReferenceDWORD dwReturnBytes;

DeviceIoControl (hDevice, IOCTL_ADAPT_SEND_EP0_CONTROL_TRANSFER, pXmitBuf, iXmitBufSize, pXmitBuf, iXmitBufSize, &dwReturnBytes, NULL);

// Copy data into buf

UCHAR *ptr = pXmitBuf + sizeof (SINGLE_TRANSFER);memcpy(buf, ptr, dwReturnBytes);

? 2012 Cypress Semiconductor

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库Cypress CyUsb3.sys Programmer\\'s Reference(8)在线全文阅读。

Cypress CyUsb3.sys Programmer\\'s Reference(8).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/606757.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: