
//--------------------------------------------------------------------------------
// Report descriptor data in hex (length 59 bytes)
//--------------------------------------------------------------------------------


// 05010905 A1010509 1901290A 950A7501 81027506 95018103 05010939 15012508
// 3500463B 10660E00 75049501 81427504 95018103 75089501 8103C0 


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

/*
05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page 
09 05        (LOCAL)  USAGE              0x00010005 Game Pad (Application Collection)  
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010005: Page=Generic Desktop Page, Usage=Game Pad, Type=Application Collection)
05 09          (GLOBAL) USAGE_PAGE         0x0009 Button Page 
19 01          (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (Selector, On/Off Control, Momentary Control, or One Shot Control)  
29 0A          (LOCAL)  USAGE_MAXIMUM      0x0009000A Button 10 (Selector, On/Off Control, Momentary Control, or One Shot Control)  
95 0A          (GLOBAL) REPORT_COUNT       0x0A (10) Number of fields  
75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field  
81 02          (MAIN)   INPUT              0x00000002 (10 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap  <-- Error: LOGICAL_MINIMUM is undefined <-- Error: LOGICAL_MAXIMUM is undefined
75 06          (GLOBAL) REPORT_SIZE        0x06 (6) Number of bits per field  
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
81 03          (MAIN)   INPUT              0x00000003 (1 field x 6 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
05 01          (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page 
09 39          (LOCAL)  USAGE              0x00010039 Hat switch (Dynamic Value)  
15 01          (GLOBAL) LOGICAL_MINIMUM    0x01 (1)  
25 08          (GLOBAL) LOGICAL_MAXIMUM    0x08 (8)  
35 00          (GLOBAL) PHYSICAL_MINIMUM   0x00 (0)  <-- Info: Consider replacing 35 00 with 34
46 3B10        (GLOBAL) PHYSICAL_MAXIMUM   0x103B (4155)  
66 0E00        (GLOBAL) UNIT               0x000E  (E=Reserved <-- Error: Measurement system type (E) is reserved)  <-- Info: Consider replacing 66 0E00 with 65 0E
75 04          (GLOBAL) REPORT_SIZE        0x04 (4) Number of bits per field  
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields <-- Redundant: REPORT_COUNT is already 1 
81 42          (MAIN)   INPUT              0x00000042 (1 field x 4 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 1=Null 0=NonVolatile 0=Bitmap 
75 04          (GLOBAL) REPORT_SIZE        0x04 (4) Number of bits per field <-- Redundant: REPORT_SIZE is already 4 
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields <-- Redundant: REPORT_COUNT is already 1 
81 03          (MAIN)   INPUT              0x00000003 (1 field x 4 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
75 08          (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields <-- Redundant: REPORT_COUNT is already 1 
81 03          (MAIN)   INPUT              0x00000003 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0           (MAIN)   END_COLLECTION     Application  <-- Warning: Physical units are still in effect PHYSICAL(MIN=0,MAX=4155) UNIT(0x0000000E,EXP=0)
*/

//--------------------------------------------------------------------------------
// Button Page inputReport (Device --> Host)
//--------------------------------------------------------------------------------

typedef struct
{
                                                     // No REPORT ID byte
                                                     // Collection: CA:GamePad
  int8_t   BTN_GamePadButton1 : 1;                   // Usage 0x00090001: Button 1 Primary/trigger, Value =  to 
  int8_t   BTN_GamePadButton2 : 1;                   // Usage 0x00090002: Button 2 Secondary, Value =  to 
  int8_t   BTN_GamePadButton3 : 1;                   // Usage 0x00090003: Button 3 Tertiary, Value =  to 
  int8_t   BTN_GamePadButton4 : 1;                   // Usage 0x00090004: Button 4, Value =  to 
  int8_t   BTN_GamePadButton5 : 1;                   // Usage 0x00090005: Button 5, Value =  to 
  int8_t   BTN_GamePadButton6 : 1;                   // Usage 0x00090006: Button 6, Value =  to 
  int8_t   BTN_GamePadButton7 : 1;                   // Usage 0x00090007: Button 7, Value =  to 
  int8_t   BTN_GamePadButton8 : 1;                   // Usage 0x00090008: Button 8, Value =  to 
  int8_t   BTN_GamePadButton9 : 1;                   // Usage 0x00090009: Button 9, Value =  to 
  int8_t   BTN_GamePadButton10 : 1;                  // Usage 0x0009000A: Button 10, Value =  to 
  int8_t   : 6;                                      // Pad
  uint8_t  GD_GamePadHatSwitch : 4;                  // Usage 0x00010039: Hat switch, Value = 1 to 8, Physical = (Value - 1) x 4155 / 7 in 
  uint8_t  : 4;                                      // Pad
  uint8_t  pad_5;                                    // Pad
} inputReport_t;

