emUSB-Device Add-Ons - HID Class
- Handling of vendor-specific Usage Pages
- Ready to use code examples for keyboard, mouse and vendor-specific HID
- No host driver required for Windows / Linux /
- Small footprint
About the Human Interface Class
The Human Interface Device class (HID) is an abstract USB class protocol defined by the USB Implementers Forum. This protocol was defined for the handling of devices which are used by humans to control the operation of computer systems.
An installation of a custom-host USB driver is not necessary, because the USB Human Interface Device class is standardized and every major OS already provides host drivers for it. Most notable usage of the HID class is the PC mouse and keyboard, but the class is also often used for pure data communication between a device and the PC even if the data is not directly created through user input (e.g. Uninterruptible Power Supply).
Application Samples emUSB-Device HID
Keyboard & Mouse
Uninterruptible Power Supply
Devices which are in the HID class basically fall into one of two categories:
"True HIDs" and vendor specific HIDs, explained in the following paragraphs. One or more examples for both categories are provided.
HID devices communicating with the host operating system. Devices which are used by a human being to input / output data, but do not directly exchange data with an application program running on the host.
Vendor Specific HIDs
These are HID devices communicating with an application program. The host OS loads the same driver it loads for any "true HID" and will automatically enumerate the device, but it can not communicate with the device. When analyzing the report descriptor, the host finds out that it can not exchange information with the device; the device uses a protocol which is meaningless to the HID driver of the host. The Host will therefore not exchange information with the device. A host recognizes a vendor specific HID by its vendor defined usage page in the report descriptor: The numerical value of the usage page is between 0xFF00 and 0xFFFF. An application has the chance to communicate with the particular device using API functions offered by the host. This allows an application program to communicate with the device without having to load a driver. HID does not take advantage of the full USB bus bandwidth; bulk communication can be much faster, but requires a driver. Therefore it can be a good choice to select HID as device class, especially if easy-of use is important and achieving the best communication speed is not a requirement.
Components required to use the HID class:
- emUSB HID
- emUSB-Device core
- emUSB target driver