AN249 Silicon_Laboratories, AN249 Datasheet - Page 8

no-image

AN249

Manufacturer Part Number
AN249
Description
Human Interface Device Tutorial
Manufacturer
Silicon_Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2490NFHP
Manufacturer:
PANASONIC/松下
Quantity:
20 000
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
AN249
4.4.1. Report Descriptors
All data transferred to and from an HID device must be structured in the form of reports. The Report Descriptor
defines the report structure, which contains all the information a host needs to determine the data format and how
the data should be processed. See Figure 3 for a Report Descriptor's example structure.
4.4.1.1. Report Structure Overview
Although the report structure must follow a few constraints and guidelines, the HID specification purposefully
allows for a high degree of customization. This potential for customization gives HID device designers freedom to
create a wide variety of HID-class devices.
4.4.1.2. Usage Page and Usage Items
A Report Descriptor begins with a Usage Page item that describes the general function of all of the reports that
follow. For instance, in a Report Descriptor describing reports for a USB Keyboard or a USB Mouse (such as the
one found in the USB Mouse example in this document), designers would use the “Generic Desktop” Usage Page.
Reports contained in defined Usage Pages have defined Usages, which provide more specific information about
the Report contents. For example, a keyboard would use the “Keyboard” Usage for its “Generic Desktop” Usage
Page.
For a complete list of defined Usage Pages, check the “HID Usage Tables” document found at USB.org.
4.4.1.3. Collections
“Collections” group similar data. Every Report Descriptor must have at least one top-level Collection in which the
data is contained, but the descriptor can define more than one top-level collection. A keyboard with an attached
mouse would have two top-level collections, one describing mouse reports and one describing keyboard reports.
Each Collection must have a Usage tag. For example, the “Keyboard” Usage can tag a collection of USB
Keyboard-related data. Also, collections can be nested.
The HID Specification defines three types of collections:
4.4.1.4. Data Types
Report Descriptors also contain extensive information describing the characteristics of each data item. Logical
Minimum and Logical Maximum items describe the boundary conditions the data contained in reports can reach.
The Report Size item describes how many bits each data item uses, and Report Count describes how many data
items are contained inside the report. A report of Size 8 and Count 2 would contain 16 bits, or 2 bytes of data.
Data values are further described by designating each data item as Input, Output, or Feature. Input items travel
from device to host, Output Items travel from host to device, and Feature items can travel in either direction.
Data items can also be designated as Variable, meaning that the values can be read and written, or Constant,
meaning that the values are read-only. Another often-used designation indicates whether the value is Absolute,
meaning that the value contained in a report is measured from a fixed origin, or Relative, meaning that the value
has no fixed reference and instead describes the change of value since the last report.
Systems using more than one defined report structure also need to give each report a unique Report ID tag. This
Report ID precedes reports during transfer and signals to the receiver which report is being transmitted. For an
example of a USB system that uses more than one Report Structure, see the HID Blinky Firmware and Software
example. For a more detailed discussion on the items in a Report Descriptor, see the latest revision of the HID
specification.
8
Application Collections group variables that carry out a common purpose. All report items must be contained
inside an Application Collection.
Logical Collections group variables of different types that form a composite data structure. Think of Logical
Collections as a collection designator for “struct” data types, such as a struct that groups a buffer with index
variables for that buffer.
Physical Collections group data describing a single data point. For instance, a physical collection of data could
contain readings from a temperature sensor.
Rev. 0.2

Related parts for AN249