经过大量的反复试验后,我终于开始工作了。这是一个完整的INF文件,供将来参考:
; WinUSB installation file for USB device
[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile = WinUSBInstallation.cat
DriverVer=09/04/2012,13.54.20.543
; ========== Manufacturer/Models sections ===========
[Manufacturer]
%ManufacturerName%=Standard,NTarm
[Standard.NTarm]
%DeviceName% =USB_Install, USB\VID_1234&PID_ABCD
; ========== Class definition ===========
[ClassInstall32]
AddReg = ClassInstall_AddReg
[ClassInstall_AddReg]
HKR,,,,%ClassName%
HKR,,NoInstallClass,,1
HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
HKR,,LowerLogoVersion,,5.2
; =================== Installation ===================
[USB_Install]
Include = winusb.inf
Needs = WINUSB.NT
[USB_Install.Services]
Include =winusb.inf
Needs = WINUSB.NT.Services
[USB_Install.HW]
AddReg=Dev_AddReg
[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{ec55ee47-5758-4378-926b-68ed0aec8170}"
; =================== Strings ===================
[Strings]
ManufacturerName="The name of the company producing your device"
ClassName="Universal Serial Bus devices"
DeviceName="The name of your device"
REG_MULTI_SZ = 0x00010000
将[Standard.NTarm]中的供应商ID(VID)和产品ID(PID)替换为您要添加的USB的相应VID和PID。最后,使用设备的正确信息替换底部附近的ManufacturerName和DeviceName。
使用SMB或FTP将此文件放在Raspberry Pi 2上的某个位置。
SSH或PowerShell到Raspberry Pi 2并转到放置INF文件的文件夹。运行以下命令:devcon dp_add .\<name of your INF file>
您应该看到以下结果: Driver package 'oem0.inf' added.
最后重启RP2(shutdown -r -t 0
来自SSH / PowerShell)。
当RP2重新启动时,您的设备应列在默认启动应用程序的“已连接设备”下,您现在应该可以使用其中的功能Windows.Devices.Usb
与USB设备进行通信。