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.

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

It is up to the device to expose these as required by the particular application in which the device is used.<br />

Note that many of these are strings, and their over-use can result in the need for very large bufffers to<br />

handle the information represented by these report descriptors; these very large buffers may be a problem<br />

for devices with very small amounts of internal memory.<br />

4.2.3 Modifiers: Per-datafield Properties<br />

A number of Properties (transferred in Feature Reports) that can be applied to Data Fields (transferred in<br />

Input Reports) are on a per-datafield basis. This presents some options in how these per-datafield<br />

Properties can be expressed using the definitions in this document.<br />

One way to do so assumes there is only a single type of Data Field, and that the Property applies to all Data<br />

Fields of that type.<br />

.<br />

.<br />

.<br />

<strong>HID</strong>_USAGE_SENSOR_PROPERTY_CHANGE_SENSITIVITY_ABS,<br />

<strong>HID</strong>_USAGE_SENSOR_PROPERTY_MAXIMUM,<br />

<strong>HID</strong>_USAGE_SENSOR_PROPERTY_MINIMUM,<br />

<strong>HID</strong>_USAGE_SENSOR_PROPERTY_ACCURACY,<br />

<strong>HID</strong>_USAGE_SENSOR_PROPERTY_RESOLUTION,<br />

.<br />

.<br />

.<br />

Even though the Data Field is not stated, it is assumed that there is only one type supported and that the<br />

Property specified applies in the same way to all examples of that type. For example, if this were a single<br />

Data Field for a thermometer:<br />

<strong>HID</strong>_USAGE_SENSOR_DATA_EVNIRONMENTAL_TEMPERATURE,<br />

then the Properties specified would apply only to that Data Field. If instead this were a tuple of Data Fields<br />

for an accelerometer:<br />

<strong>HID</strong>_USAGE_SENSOR_DATA_MOTION_ACCELERATION_X,<br />

<strong>HID</strong>_USAGE_SENSOR_DATA_MOTION_ACCELERATION_Y,<br />

<strong>HID</strong>_USAGE_SENSOR_DATA_MOTION_ACCELERATION_Z,<br />

Then the Properties specified would apply to all the Data Fields in the same way.<br />

A more explicit construction has been provided that is semantically equivalent. Data Fields are expressed<br />

by means of a Data Field type and a Modifier <strong>Usage</strong> Switch.<br />

The per-datafield properties expressed as Data Field Modifiers are defined elsewhere in the document.<br />

Those defined in this document are repeated below for convenience:<br />

//data type usages modifiers<br />

//NOTE: the usage tables actually define these as two bytes, but in order<br />

//to get the define macros to work so these are ‘or-ed’ these are defined<br />

//here as only one byte.<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_NONE 0x00 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x10 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_MAX 0x20 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_MIN 0x30 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_ACCURACY 0x40 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_RESOLUTION 0x50 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_THRESHOLD_HIGH 0x60 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_THRESHOLD_LOW 0x70 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_CALIBRATION_OFFSET 0x80 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_CALIBRATION_MULTIPLIER 0x90 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_REPORT_INTERVAL 0xA0 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_FREQUENCY_MAX 0xB0 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_PERIOD_MAX 0xC0 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_RANGE_PCT 0xD0 //US<br />

#define <strong>HID</strong>_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_REL_PCT 0xE0 //US

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

Saved successfully!

Ooh no, something went wrong!