选项框 // More informationWinUSB(libusb)// WinUSB (v6.1.7600.16385)// 包括驱动(仅支持NOT HID) // 驱动支持 libusb// 不包括 DLL
libusb-win32 is a Windows only project which provide libusb-0.1 API compatible library for Windows and the associated kernel driver libusb0.sys.
libusb-win32 // libusb-win32 (v1.2.6.0)// 包括 驱动(支持HID)和DLL
To use libusb-win32 in your own programs include the supplied header file usb.h, and link against the import library(libraries for GCC, BCC, and MSVC 32bit/64bit are available).
To avoid any version conflicts, DO NOT include the DLL libusb0.dll in your application's directory. The DLL is part of the driver and installed automatically to the Windows system directory.
libusbK // libusbK (v3.0.7.0)// 包括 驱动(支持HID) 和DLL
libusbK is a complete driver/library solution for vendor class usb device interfaces. If you are a usb developers or usb device manufacturer seeking a driver solution for a new USB widget then libusbK could be for you.
libusbK encompasses a 100% WinUSB compatible api/funtion set. All WinUSB power/pipe polices are fully supported by the libusbK driver. In Addition, libusbK has full support for isochronous endpoints and an extensive set of additional modules to simplify development.
libusbK is a Windows only project which provides a new set of API forWindows(supporting WinUSB, libusb0.sys and libusbk.sys) and kernel driver libusbK.sys.libusbK(http://libusbk.sourceforge.net/UsbK3/index.html) is the next-generation libusb-win32 kernel driver and associated library. The kernel driver (libusbK.sys) is based on KMDF and it will work with either libusb-win32 API or native libusbK API. The library (libusbK.dll) works with libusb0.sys, libusbK.sys and winusb.sys . It has dual licenses (Modified BSD and GPL).
Currently libusbK is under active development. On the other hand, libusb0.sys and libusb-win32 API will still be supported(bug fix mode) even though no new features will be added.
NO // WinUSB(Microsoft)
WinUSB is a generic driver for USB devices that is included with all versions of Windows since Windows Vista. It includes:
A kernel-mode driver(Winusb.sys)
A user-mode dynamic link library(Winusb.dll) that exposes WinUSB functions described in winusb.h. You can use these functions to manage USB devices with user-mode software.
By default, Winusb.sys is installed in the device's kernel-mode stack as an upper filter driver, and apps communicate with the device's UMDF function driver to issue read, write, or device I/O control requests. In this configuration, Winusb.sys serves as the device stack's Plug and Play and power owner.
Alternatively, you can install Winusb.sys as the function driver for a USB device.
USB Serial(CDC)// NO...
#运行以下脚本进行测试
#usb.core.find(idVendor=0x1908, idProduct=0x0222)中的#idVendor和idProduct改成上面查询到的VID和PID:
import usb.core
import usb.util
dev = usb.core.find(idVendor=0x1908, idProduct=0x0222)if dev is None:
raise ValueError('Device not found')print(dev)#setthe active configuration. With no arguments, the first#configurationwill be the active one
dev.set_configuration()#getan endpoint instance
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]
ep = usb.util.find_descriptor(
intf,#matchthe first OUT endpoint
custom_match = \
lambda e: \
usb.util.endpoint_direction(e.bEndpointAddress)== \
usb.util.ENDPOINT_OUT)print(ep)
assert ep is not None
#writethe data
ep.write('test')
————————————————
版权声明:本文为CSDN博主「老孟(MLY)」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42967006/article/details/108755972