Author Topic: Composite CDC/HID - IADs and need for INF files  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Composite CDC/HID - IADs and need for INF files
« on: August 10, 2021, 10:30:55 am »
My aim is to create a PIC-based composite CDC/HID device.

Given that HID and CDC are well-known devices and also that (as individual USB devices) no custom driver (INF etc) is asked for - can I use the IAD mechanism to create a composite device that needs no custom driver?

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Composite CDC/HID - IADs and need for INF files
« Reply #1 on: August 11, 2021, 08:26:41 am »
Not sure what IAD is, it seems to be something for grouping logically related interfaces together? :-//

I'm not exactly world class expert on writing USB descriptors, but isn't it the case that you only need a device descriptor with bDeviceClass=0 (per-interface) and a configuration descriptor specifying two interfaces and two interface descriptors, one each for CDC and HID? Host drivers should bind to each interface separately.

LUFA has a demo which includes CDC and a mouse. It's AVR, but descriptors are universal.

As for Windows and its USB detection and INF files, :-//
I think you could look at the descriptors of any commercial device which works on Windows sans drivers.

Chances are you could get more respnose if you moved this to "microcontrollers".
« Last Edit: August 11, 2021, 08:31:48 am by magic »
 

Offline ReneK

  • Contributor
  • Posts: 15
  • Country: de
Re: Composite CDC/HID - IADs and need for INF files
« Reply #2 on: August 11, 2021, 11:10:03 am »
As of Windows 10, you don't need a custom INF, regardless if you're using IAD or not.
 

Offline ReneK

  • Contributor
  • Posts: 15
  • Country: de
Re: Composite CDC/HID - IADs and need for INF files
« Reply #3 on: August 11, 2021, 11:12:34 am »
Not sure what IAD is, it seems to be something for grouping logically related interfaces together? :-//
Exactly.

I'm not exactly world class expert on writing USB descriptors, but isn't it the case that you only need a device descriptor with bDeviceClass=0 (per-interface) and a configuration descriptor specifying two interfaces and two interface descriptors, one each for CDC and HID? Host drivers should bind to each interface separately.
bDeviceClass = 0xEF (Miscellaneous)
bDeviceSubClass = 2 (Common)
bDeviceProtocol = 1 (Interface Association Descriptor protocol)
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Composite CDC/HID - IADs and need for INF files
« Reply #4 on: August 11, 2021, 05:53:58 pm »
Not sure what IAD is, it seems to be something for grouping logically related interfaces together? :-//

"Interface Association Descriptor." And yep, it's a way to group logically-related interfaces together.

Many USB device classes require multiple Interfaces to implement one "Device." Consider audio: it requires a USB Audio Control interface as well as one or more USB Audio Streaming interfaces. All of these interfaces belong to one USB Audio Device.

USB CDC also uses more than one Interface. And here is where IADs are important: Say you wanted to implement a Device that had two USB CDC instances. Without IADs, all of the various interfaces for your two CDC things would get combined into one device, so the host wouldn't enumerate it as two devices. The IAD lets you specify basically "these interfaces belong to instance 1 of the device class and those interfaces there belong to instance 2 of that same device class in the same device."
 
The following users thanked this post: magic


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf