31.08.2013 Views

HID Sensor Usage Tables - USB.org

HID Sensor Usage Tables - USB.org

HID Sensor Usage Tables - USB.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

78 <strong>HID</strong> <strong>Sensor</strong> <strong>Usage</strong>s<br />

////////////////////////////////////////////////////////////////////////////////////<br />

//<br />

// Other <strong>HID</strong> definitions<br />

//<br />

////////////////////////////////////////////////////////////////////////////////////<br />

//NOTE: These definitions are designed to permit compiling the <strong>HID</strong> report descriptors<br />

// with somewhat self-explanatory information to help readability and reduce errors<br />

//input,output,feature flags<br />

#define Data_Arr_Abs 0x00<br />

#define Const_Arr_Abs 0x01<br />

#define Data_Var_Abs 0x02<br />

#define Const_Var_Abs 0x03<br />

#define Data_Var_Rel 0x06<br />

//collection flags<br />

#define Physical 0x00<br />

#define Application 0x01<br />

#define Logical 0x02<br />

#define NamedArray 0x04<br />

#define <strong>Usage</strong>Switch 0x05<br />

//other<br />

#define Undefined 0x00<br />

#define <strong>HID</strong>_USAGE_PAGE(a) 0x05,a<br />

#define <strong>HID</strong>_USAGE(a) 0x09,a<br />

#define <strong>HID</strong>_USAGE16(a,b) 0x0A,a,b<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA(a,b) a|b //This or-s the mod into usage<br />

#define <strong>HID</strong>_COLLECTION(a) 0xA1,a<br />

#define <strong>HID</strong>_REPORT_ID(a) 0x85,a<br />

#define <strong>HID</strong>_REPORT_SIZE(a) 0x75,a<br />

#define <strong>HID</strong>_REPORT_COUNT(a) 0x95,a<br />

#define <strong>HID</strong>_USAGE_MIN_8(a) 0x19,a<br />

#define <strong>HID</strong>_USAGE_MIN_16(a,b) 0x1A,a,b<br />

#define <strong>HID</strong>_USAGE_MAX_8(a) 0x29,a<br />

#define <strong>HID</strong>_USAGE_MAX_16(a,b) 0x2A,a,b<br />

#define <strong>HID</strong>_LOGICAL_MIN_8(a) 0x15,a<br />

#define <strong>HID</strong>_LOGICAL_MIN_16(a,b) 0x16,a,b<br />

#define <strong>HID</strong>_LOGICAL_MIN_32(a,b,c,d) 0x17,a,b,c,d<br />

#define <strong>HID</strong>_LOGICAL_MAX_8(a) 0x25,a<br />

#define <strong>HID</strong>_LOGICAL_MAX_16(a,b) 0x26,a,b<br />

#define <strong>HID</strong>_LOGICAL_MAX_32(a,b,c,d) 0x27,a,b,c,d<br />

#define <strong>HID</strong>_UNIT_EXPONENT(a) 0x55,a<br />

#define <strong>HID</strong>_INPUT(a) 0x81,a<br />

#define <strong>HID</strong>_OUTPUT(a) 0x91,a<br />

#define <strong>HID</strong>_FEATURE(a) 0xB1,a<br />

#define <strong>HID</strong>_END_COLLECTION 0xC0<br />

#endif<br />

4.2 Special Constructions<br />

4.2.1 Values, Types, and Unit Exponents<br />

The <strong>HID</strong> Report Descriptors in this section use the following definitions for values, units and unit<br />

exponents.<br />

The value communicated as part of a Report Descriptor is in terms of the Report Size and Report Count<br />

attributes, combined with the Logical Minimum, Logical Maximum, and Units for data values associated<br />

with that Report Item.<br />

The value is treated in one of three ways:<br />

As a bitfield<br />

As a signed or unsigned integer value<br />

As a float value<br />

Bitfield<br />

A value is identified as a bitfield when the Report Size field = 1. In this section, this is expressed<br />

as <strong>HID</strong>_REPORT_SIZE(1). In this case, Logical Maximum, Logical Minimum, Units and Units<br />

Exponent are not used.<br />

Unsigned Integer

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!