windows - 需要为USB外围设备编写驱动程序?

标签 windows usb driver device-driver

我正在设计一个 USB 外围设备,它偶尔会连接到 Windows PC,并在每个方向上传输几 KB 的数据。将有一个自定义 PC 应用程序使用专有协议(protocol)(即用于 USB 有效载荷)控制数据传输。

我在以下链接中看到 Microsoft 描述了如何为 USB 设备编写驱动程序。但是我需要一个吗?

Developing Windows client drivers for USB devices

PC 应用程序是我们打算知道如何与设备通信的唯一应用程序,因此从应用程序共享的角度来看,不需要驱动程序。

我能否直接将自定义协议(protocol)烘焙到应用程序中,让应用程序向设备发送“原始 USB”,而无需单独的驱动程序?

最佳答案

“原始 USB”,不,您不能从应用程序中执行此操作。

但是因为您也控制设备,所以您可以使它显示为 Windows 为其提供足够通用的设备驱动程序的设备类之一,几乎可以执行您想要的任何操作。

这些设备类是 HID(人机接口(interface)设备)和“WinUSB”。其中,HID 是跨平台的但功能更有限,WinUSB 允许高性能数据传输以及中断端点。

设置设备的字符串描述符以便 Windows 自动将其绑定(bind)到 WinUSB 驱动程序的说明是 on MSDN

A WinUSB device is a Universal Serial Bus (USB) device whose firmware defines certain Microsoft operating system (OS) feature descriptors that report the compatible ID as "WINUSB".

The purpose of a WinUSB device is to enable Windows to load Winusb.sys as the device's function driver without a custom INF file. For a WinUSB device, you are not required to distribute INF files for your device, making the driver installation process simple for end users.

关于windows - 需要为USB外围设备编写驱动程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38529675/

相关文章:

linux - 如何在 Linux 内核中使用 bio 请求读取扇区

c - #ifdef KERNEL2x & file_operations(..,..,..,..) , ssize_t 函数,printk()

linux - D可以编译成平台独立代码吗?

windows - git-svn 在 Windows 上忽略 subversion 配置文件 (auto-props)

python - 如何在python中获取文件关闭事件

windows - 启用鼠标阴影的脚本?

c++ - RegisterDeviceNotification 返回 NULL 但仍收到通知

c++ - 如何将具有已知总线地址的 USB 设备映射到挂载路径?

node.js - USB 细节检测问题 |使用带 Angular 和 Electron 的 node-hid

python - Selenium 错误消息 "selenium.webdriver has no attribute execute script"