USB : USB Classes    A Closer Look at HID Class  

HID class is designed to not waste precious USB bus bandwidth. One way it does this is to allow you to send only the number of bits that are actually meaningful for any given data item. Data item sizes can range from 1 bit to 32 bits, or anywhere in between.

That is, a real HID device (not those free demo programs that you see on the Web) is not limited to sending byte data. You can have 1 bit data items, 7 bit data items, 23 bit data items, or whatever is meaningful to your application.

Think about what that means for a second. If you need to send a number of data items that were measured with a 10-bit A/D converter, why should you have to waste 16 bits to send each data value? With a real HID class device, you only need to send the actual 10 bits that are meaningful, with all of these values packed together tightly at the sending end, and unpacked and separated at the receiving end.

The ability to send a mixture of odd sized data items is not just some obscure concept that nobody uses. This is used all the time in real commercial HID devices, e.g. keyboards, game controllers, mice, digitizer devices, simulation devices, and so on. A real HID device must be able to handle odd sized data items.


6 of 17
Copyright Notice and Author Information