Author Topic: HID vs. WinUSB  (Read 12760 times)

lcpoon

  • Frequent Contributor
  • ****
  • Posts: 58
HID vs. WinUSB
« on: July 14, 2015, 04:15:24 am »
What are the advantages and disadvantages to implement a device as WinUSB/HID? Windows can enumerate HID devices automatically while WinUSB devices need driver.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID vs. WinUSB
« Reply #1 on: July 14, 2015, 12:24:02 pm »
Advantages for WinUSB:

supports bulk and isochronous transfers
supports options such as ignore short packets (yes/no)
supports host-defined timeouts

Advantages for HID:

supported by most OSes

Both WinUSB and HID:

can install without a custom INF file in Windows (WinUSB requires Microsoft OS descriptors for this)
support control and interrupt transfers

lcpoon

  • Frequent Contributor
  • ****
  • Posts: 58
Re: HID vs. WinUSB
« Reply #2 on: July 14, 2015, 09:40:50 pm »
I assumed HID maximum packet size for control and interrupt transfers followed that of WinUSB. For an example, 1024 bytes for interrupt transfer at USB 2.0 HS.

What is the maximum packet size for HID transfer @ USB 2.0 and USB 3.0?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: HID vs. WinUSB
« Reply #3 on: July 14, 2015, 10:25:15 pm »
USB 2.0, 5.7.3 says:

"All high-speed device default interface settings must not include any interrupt endpoints with a data payload
size (specified via wMaxPacketSize in the endpoint descriptor) greater than 64 bytes."

Supporting non-default interfaces for HID would require a vendor-provided, signed driver.

WinUSB has an API to select an alternate interface when bus bandwidth permits.

USB 3.1, 4.4.7.1, says

"The only allowable maximum data payload size for interrupt endpoints is 1024 bytes for interrupt endpoints that support a burst size greater than one and can be any size from 1 to 1024 for an interrupt endpoint with a burst size equal to one."