0
votes

I am working on creating a custom HID descriptor for my device. It only transmits from the device and only has one report.

The data is:

  • 64 bit unsigned int
  • 16 bit unsigned int
  • 16 bit unsigned int
  • 16 bit unsigned int
  • 16 bit unsigned int

The device is "Vendor specific"

I have been pulling hairs out for a few hours now! Any help would be appreciated!

1

1 Answers

0
votes

As far as I am aware there is no support for encoding 64-bit values in HID report descriptors. You may well be able to define a REPORT_SIZE(64) and REPORT_COUNT(1), but the maximum LOGICAL_MAXIMUM() that can be encoded in a descriptor is LOGICAL_MAXIMUM(2147483647) which is only 32-bits.

You may have to break the 64-bit item into 2 x 32-bit items (or 8 x 8-bit items), or see if you can get it to work without specifying LOGICAL_MAXIMUM. For example:

//--------------------------------------------------------------------------------
// Decoded Application Collection
//--------------------------------------------------------------------------------

/*
06 00FF      (GLOBAL) USAGE_PAGE         0xFF00 Vendor-defined 
09 AC        (LOCAL)  USAGE              0xFF0000AC  
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0xFF0000AC: Page=Vendor-defined, Usage=, Type=)
09 01          (LOCAL)  USAGE              0xFF000001  
15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0
27 FFFFFF7F    (GLOBAL) LOGICAL_MAXIMUM    0x7FFFFFFF (2147483647) 
75 20          (GLOBAL) REPORT_SIZE        0x20 (32) Number of bits per field 
95 02          (GLOBAL) REPORT_COUNT       0x02 (2) Number of fields 
81 02          (MAIN)   INPUT              0x00000002 (2 fields x 32 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
27 FFFF0000    (GLOBAL) LOGICAL_MAXIMUM    0x0000FFFF (65535) 
09 02          (LOCAL)  USAGE              0xFF000002  
75 10          (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field 
95 04          (GLOBAL) REPORT_COUNT       0x04 (4) Number of fields 
81 02          (MAIN)   INPUT              0x00000002 (4 fields x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0           (MAIN)   END_COLLECTION     Application
*/

//--------------------------------------------------------------------------------
// Vendor-defined inputReport (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
                                                     // No REPORT ID byte
  uint32_t VEN_VendorDefined0001[2];                 // Usage 0xFF000001: , Value = 0 to 2147483647
  uint16_t VEN_VendorDefined0002[4];                 // Usage 0xFF000002: , Value = 0 to 65535
} inputReport_t;