如何为Windows实现USB设备驱动程序?

发布于 2024-08-07 20:52:23 字数 268 浏览 4 评论 0原文

我应该如何实现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

茶底世界 2024-08-14 20:52:23

我们需要有关设备的更多信息来为您指明正确的方向,但这里有一些帮助您入门的步骤:

  • 注册 Microsoft Connect,以便您可以下载 Windows 驱动程序工具
  • 包 注册 osr-online,因为您会发现精彩的文章、大量信息以及专门针对 Windows 驱动程序的新闻组 - 这个地方是一个金矿
  • 使用 WDF 开发驱动程序,这将帮助您了解 Windows 上的驱动程序开发并为您提供阅读 OSR 和 Microsoft 文章的良好基础
  • 希望您可以使用 UMDF(用户模式驱动程序),就像您可以使用 C++ 并编写 COM 代码一样。如果您正在使用 USB 做任何需要内核空间的事情...您明年需要大量阅读和学习!

为了回答您有关版本的问题,驱动程序工具包提供了可帮助您管理创建不同驱动程序的工具。如果您编写了一个好的驱动程序,它应该可以毫无问题地在所有三个操作系统上运行,并且差异仅在配置区域(而不是二进制文件)

基本上,这取决于您的设备的复杂程度。您想编写什么类型的驱动程序?文件系统? 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:

  • register with Microsoft Connect so you can download the Windows Driver Kit
  • register with osr-online as you'll find great articles, plenty of information, and a newsgroup dediciated just to Windows drivers -- this place is a goldmine
  • buy Developing Drivers with WDF, which will help you make sense of driver development on Windows and give you a good foundation to read articles from OSR and Microsoft
  • Hope that you can use UMDF (user-mode drivers) as you can use C++ and just write COM code. If you're doing anything with USB that requires kernel-space....you've got a lot of reading and learning to do for the next year!

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.

仙女 2024-08-14 20:52:23

您可以查看 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.

旧城烟雨 2024-08-14 20:52:23

如果您对设备端有某种形式的控制,请让它实现 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文