如何为Windows实现USB设备驱动程序?
我应该如何实现 Windows 的 USB 设备驱动程序?我应该如何考虑不同版本的Windows,例如: - Windows XP - Windows Vista - Windows 7
是否有可以作为起点的开源解决方案?我是 Windows 驱动程序开发的新手。
我们有一个带有 USB 设备端口的嵌入式设备,我们希望在不牺牲数据吞吐量的情况下,从应用程序级到设备的通信延迟尽可能低。实际传输的数据是ADC/DAC数据。基本上,我们需要尽快将大量数据传输到 Windows 计算机。
How should I approach implementing a USB device driver for Windows? How should I take into account different versions of windows e.g:
- Windows XP
- Windows Vista
- Windows 7
Is there open source solutions which could be used as a starting point? I'm a total newbie to windows driver development.
We have an embedded device with USB device port and we would like to have as low latency communication from the application level to the device as possible without sacrificing the data throughput. The actual data transferred is ADC/DAC data. Basically there is a lot of data which we need to transfer to a Windows machine as fast as possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我们需要有关设备的更多信息来为您指明正确的方向,但这里有一些帮助您入门的步骤:
为了回答您有关版本的问题,驱动程序工具包提供了可帮助您管理创建不同驱动程序的工具。如果您编写了一个好的驱动程序,它应该可以毫无问题地在所有三个操作系统上运行,并且差异仅在配置区域(而不是二进制文件)
基本上,这取决于您的设备的复杂程度。您想编写什么类型的驱动程序?文件系统? MP3播放器?相机?调制解调器?
如果您最终不得不编写内核模式驱动程序,请告诉我,我可以为您推荐一些好文章以及其他文章。
我还应该补充一点,您可以花费大约 5,000 美元购买 WinDriver 的许可证,工具可以消除驱动程序开发中的所有困难。您可以使用 C++ 或 C# 用户模式代码与为您的设备自定义生成的驱动程序进行通信。如果你的截止日期很紧,这就是你要走的路。
We need more information about the device to point you in the right direction, but here are a few steps to get you started:
To answer your question on versions, the Driver Kit has tools that will help you manage creating different drivers. If you write a good driver, it should run on all three OS with no problems, and the differences will just be in the config area (not the binary)
Basically, it depends on how complex your device is. What type of driver are you trying to write? File system? MP3 player? Camera? Modem?
If you end up having to write a kernel mode driver, let me know and I can point you to some good articles and what not.
I should also add that for around US $5,000, you can buy a license for WinDriver, a tool that takes all of the hard stuff out of driver development. You can use C++ or C# user-mode code to communicate with their driver that is custom generated for your device. This is the way to go if you have a tight deadline.
您可以查看 libusb 的 Windows 变体 *这里*。 libusb 官方网站和网络上有许多编程语言的包装器。
You can take a look at windows variant of libusb *here*. There are wrappers for many programming languages on official libusb site and on the web.
从这里开始:Windows 驱动程序工具包简介
Start here: Windows Driver Kit Introduction
如果您对设备端有某种形式的控制,请让它实现 Windows 已为其提供驱动程序的接口。例如,USB HID 类(字面意思是“人类输入设备”,但“人类”和“输入”都不是强制性的)已经具有 Windows 驱动程序,并且顶部有一个合理的 Win32 API。不过,您不会获得接近 480 Mbps 的数据速率。
If you have some form of control over the device side, have it implement an interface for which Windows already provides drivers. E.g. the USB HID class (literally Human Input Device, but neither the Human nor the Input is mandatory) already has Windows drivers, and there is a reasonable Win32 API on top. You're not going to get data rates anywhere near 480 Mbps, though.