@@ -141,6 +141,8 @@ extern "C" {
141
141
#define HID_USAGE_GEN_LEDS 0x08
142
142
/** HID Button Usage page */
143
143
#define HID_USAGE_GEN_BUTTON 0x09
144
+ /** HID Sensors Usage page */
145
+ #define HID_USAGE_SENSORS 0x20
144
146
145
147
/** HID Generic Desktop Undefined Usage ID */
146
148
#define HID_USAGE_GEN_DESKTOP_UNDEFINED 0x00
@@ -163,6 +165,19 @@ extern "C" {
163
165
/** HID Generic Desktop Wheel Usage ID */
164
166
#define HID_USAGE_GEN_DESKTOP_WHEEL 0x38
165
167
168
+ /** HID Sensors Collection Usage ID */
169
+ #define HID_USAGE_SENSOR_TYPE_COLLECTION 0x001
170
+ /** HID Sensors Environmental Temperature Type Usage ID */
171
+ #define HID_USAGE_SENSORS_TYPE_ENVIRONMENTAL_TEMPERATURE 0x033
172
+ /** HID Sensors Event Sensor State Usage ID */
173
+ #define HID_USAGE_SENSORS_EVENT_SENSOR_STATE 0x201
174
+ /** HID Sensors Friendly Name Property Usage ID */
175
+ #define HID_USAGE_SENSORS_PROPERTY_FRIENDLY_NAME 0x301
176
+ /** HID Sensors Enviromental Temperature Data Usage ID */
177
+ #define HID_USAGE_SENSORS_DATA_ENVIRONMENTAL_TEMPERATURE 0x434
178
+ /** HID Sensors Timestamp Property Usage ID */
179
+ #define HID_USAGE_SENSORS_PROPERTY_TIMESTAMP 0x529
180
+
166
181
/**
167
182
* @}
168
183
*/
@@ -357,12 +372,21 @@ extern "C" {
357
372
* For usage examples, see @ref HID_MOUSE_REPORT_DESC(),
358
373
* @ref HID_KEYBOARD_REPORT_DESC()
359
374
*
360
- * @param idx Number of data fields included in the report
375
+ * @param idx HID Usage ID per the HID Usage Table
361
376
* @return HID Usage Index item
362
377
*/
363
378
#define HID_USAGE (idx ) \
364
379
HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 1), idx
365
380
381
+ /**
382
+ * @brief Define HID Usage Index item with the data length of two bytes.
383
+ *
384
+ * @param idx HID Usage ID per the HID Usage Table
385
+ * @return HID Usage Index item
386
+ */
387
+ #define HID_USAGE16 (idx ) \
388
+ HID_ITEM(HID_ITEM_TAG_USAGE, HID_ITEM_TYPE_LOCAL, 2), ((0xFF) & idx), ((0xFF) & (idx >> 8))
389
+
366
390
/**
367
391
* @brief Define HID Usage Minimum item with the data length of one byte.
368
392
*
@@ -413,6 +437,16 @@ extern "C" {
413
437
#define HID_USAGE_MAX16 (a , b ) \
414
438
HID_ITEM(HID_ITEM_TAG_USAGE_MAX, HID_ITEM_TYPE_LOCAL, 2), a, b
415
439
440
+ /**
441
+ * @brief Define HID Unit Exponent item.
442
+ *
443
+ * @param exp Unit exponent, refer to the HID Unit Exponent table
444
+ * in the specification for usage
445
+ * @return HID Unit Exponent item
446
+ */
447
+ #define HID_UNIT_EXPONENT (exp ) \
448
+ HID_ITEM(HID_ITEM_TAG_UNIT_EXPONENT, HID_ITEM_TYPE_GLOBAL, 1), exp
449
+
416
450
/**
417
451
* @}
418
452
*/
0 commit comments