Close

Skimming the HID surface

A project log for Aerospace Control Interface

Controls and displays for Aerospace simulation control interaction

Gavin169Gavin169 03/28/2014 at 14:130 Comments

This last week, I have thrown myself into understanding how a host device captures data from a human input device through USB. 

Note this is from my understanding, there may be inaccuracies and will be edited at future dates as my knowledge grows.

First shall we start with what a USB Descriptor is and how it is used to tell the host device what driver to use and what information to act on. 

When you plug a USB device into a host USB port, the host will request information about the device, information it needs to be able to install the correct drivers and configure the device for how it was designed to be used. The USB Descriptor tells the host, What the device is, what data to expect, how much to expect and what to do with it once it is collected.  

Here is what happens when you connect a device to a host machine. When the device is plugged in, there is a pullup resistor on the data line which causes the host to register a connected device, the host then proceeds to send a reset signal to the device, that resets the device address back to a default of zero.

Once the device has and address it is now reachable by the host but only by standard requests, Get descriptor, Get configuration descriptor, Get string descriptor. Once the host has received enough information it is then ready to load a driver, the driver will then send a Set configuration request to the device. The device is now set up and can be used as designed. The device will now respond to more specific and standard requests that are supported.

The next post will be how to write a USB descriptor, soon you will be able to create a device all of your own and world domination will be yours. (cough) :)

Discussions