是否需要为USB外围设备编写驱动程序? [英] Need to write driver for USB peripheral device?

查看:116
本文介绍了是否需要为USB外围设备编写驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm working on designing a USB peripheral which will occasionally connect to a Windows PC, and transfer a few KB of data in each direction. There will be a custom PC application that controls the data transfers, using a proprietary protocol (i.e. for the USB payloads).

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

I see at the following link that Microsoft describes how to write a driver for a USB device. But do I need one?

为USB设备开发Windows客户端驱动程序

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

The PC application is the only application that we intend to know how to communicate with the device, so there's no need for a driver from an application sharing standpoint.

我可以直接将自定义协议烘焙到应用程序中,

Can I just bake the custom protocol directly into the application, have the application speak "raw USB" to the device, and do without a separate driver?

推荐答案

原始USB,不,

但是由于还可以控制设备,因此可以使它显示为Windows提供足够通用的设备驱动程序的设备类之一。

But because you control the device also, you can make it appear as one of the device classes for which Windows provides a device driver that's generic enough to do just about anything you want.

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

Those device classes are HID (Human Interface Device) and "WinUSB". Of these, HID is cross-platform but more limited in capability, WinUSB allows high performance data transfers as well as interrupt endpoints.

用于设置设备的字符串描述符的指令,以便Windows自动绑定到WinUSB驱动程序 MSDN

Instructions for setting up your device's string descriptors so that Windows automatically binds it to the WinUSB driver are on MSDN


WinUSB设备是通用串行总线(USB)设备,其固件定义了某些Microsoft操作系统(OS)功能描述符,这些描述符报告了兼容的ID为 WINUSB

WinUSB设备的目的是使Windows能够将Winusb.sys加载为该设备的没有自定义INF文件的功能驱动程序。对于WinUSB设备,不需要为设备分发INF文件,从而使最终用户的驱动程序安装过程变得简单。

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.

这篇关于是否需要为USB外围设备编写驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆