-
-
Notifications
You must be signed in to change notification settings - Fork 2
HID Basics
An HID-Device only needs one Interface containing the communication endpoints. The descriptor itself is also very concise, but the following HID-Descriptor, which is fetched separately, is a bit more complex and flexible.
The documentation for the class definition can be found here, a documentation on all the possible HID-functionality can be found here.
No specific class or subclass required here. Should be set to 0x00
, as the interface defines what the capabilities are.
The class of an HID-Interface is 0x03
, a subclass and protocol is only required for BIOS-support.
Field | Value | Meaning |
---|---|---|
Class | 0x03 | HID-Interface |
SubClass | 0x00 | No BIOS-Support required |
Protocol | 0x00 | Unused when SubClass 0x00 |
Source: HID1_11, Chapter 6.2.1
Following the Interface is an HID-Descriptor. This summary only defines how many functional descriptors there are, not the functionality of the device. The functionality is given through a Report-Descriptor. A Physical-Descriptor can be used to define which body parts actuate the inputs. Not necessary if you don't know what that information does.
Field | Size | Value | Meaning |
---|---|---|---|
Length | 1 | 9 | Size of this descriptor |
Descriptor Type | 1 | 0x21 | Type of this descriptor is HID-Descriptor |
HID-Version | 2 | 0x0110 | Version of the HID-Specification |
Country Code | 1 | 0x00 | A country code for localized hardware |
Number of Descriptors | 1 | 1 | We'll only add one Report-Descriptor |
Descriptor 0 Type | 1 | 0x22 | The first Descriptor is of type Report |
Descriptor 0 Length | 2 | n | The size of the Report-Descriptor |