1
2
Universal Serial Bus (USB) is a communications architecture that gives a personal
computer (PC) the ability to interconnect a variety of devices using a simple four
wire cable. The USB is actually a two-wire serial communication link that runs at
either 1.5 or 12 megabits per second (Mbps) for a full speed device. Higher data
transfer rates are available for devices that support 480 Mbps high speed. USB
protocols can configure devices at startup or when they are plugged in at run time.
These devices are broken into various device classes. Each device class defines
the common behavior and protocols for devices that serve similar functions
the
common
behavior
and
protocols
for
devices
that
serve
similar
functions
.
The HID class consists primarily of devices that are used by humans to control the
operation of computer systems like a mouse, keyboard or touch screen. HID also
provides provisions for output directed to the user.
3
To completely understand the HID class users should be familiar with the
USB specification. The USB specification defines the protocol the host
controller uses to identify and learn how to communicate with devices on the
bus. The USB Core Specification defines the HID class code. The
bInterfaceClass member of an interface descriptor is always 3 for HID class
devices. Using this definition the host knows to ask for additional descriptor
information from the device. The specification defines the transfer methods
a connected device must support From the diagram it can be seen that the
a
connected
device
must
support
.
From
the
diagram
it
can
be
seen
that
the
HID class device is required to support control pipe and interrupt transfers.
The control pipe is typically used for enumeration and device configuration
whereas the interrupt pipe is used for the data transfer. The devices
descriptors tell the host what endpoints and transfer types it supports, which
must be the control pipe and at least one interrupt IN endpoint. The USB
specification defines the differences between the transfer types and the HID
class specifications defines the data structures called “reports.” These
reports get passed over any of the transfer methods described.
4
Once enumeration is complete, HID devices can communicate across the control
pipe to exchange information stored in reports. This is typically reserved for either
configuration information or device status such as application version numbers. The
control pipe has a defined transfer sequence defined in the USB specification that
has a higher level of error checking than the other transfer methods. In addition, the
host API calls to send data via the control pipe are different than those for the
interrupt pipe.
5