Advertisement
garyng

Report descriptor in C

Oct 25th, 2020
2,216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 34.11 KB | None | 0 0
  1.  
  2. //--------------------------------------------------------------------------------
  3. // Decoded Application Collection
  4. //--------------------------------------------------------------------------------
  5.  
  6. /*
  7. 06 00FF      (GLOBAL) USAGE_PAGE         0xFF00 Vendor-defined
  8. 09 01        (LOCAL)  USAGE              0xFF000001 <-- Warning: Undocumented usage (document it by inserting 0001 into file FF00.conf)
  9. A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0xFF000001: Page=Vendor-defined, Usage=, Type=) <-- Error: COLLECTION must be preceded by a USAGE
  10. 85 05          (GLOBAL) REPORT_ID          0x05 (5)  
  11. 15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
  12. 25 01          (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)  
  13. 35 00          (GLOBAL) PHYSICAL_MINIMUM   0x00 (0)  <-- Info: Consider replacing 35 00 with 34
  14. 45 01          (GLOBAL) PHYSICAL_MAXIMUM   0x01 (1)  
  15. 65 00          (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
  16. 55 00          (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰) <-- Redundant: UNIT_EXPONENT is already 0 <-- Info: Consider replacing 55 00 with 54
  17. 75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field  
  18. 95 28          (GLOBAL) REPORT_COUNT       0x28 (40) Number of fields  
  19. B1 03          (MAIN)   FEATURE            0x00000003 (40 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  20. C1 00        (MAIN)   END_COLLECTION     Application <-- Error: Data (00) is not applicable to END_COLLECTION items <-- Warning: Physical units are still in effect PHYSICAL(MIN=0,MAX=1) UNIT(0x,EXP=0)
  21. */
  22.  
  23. //--------------------------------------------------------------------------------
  24. // Vendor-defined featureReport 05 (Device <-> Host)
  25. //--------------------------------------------------------------------------------
  26.  
  27. typedef struct
  28. {
  29.   uint8_t  reportId;                                 // Report ID = 0x05 (5)
  30.                                                      // Collection: CA:
  31.   uint8_t  : 1;                                      // Pad
  32.   uint8_t  : 1;                                      // Pad
  33.   uint8_t  : 1;                                      // Pad
  34.   uint8_t  : 1;                                      // Pad
  35.   uint8_t  : 1;                                      // Pad
  36.   uint8_t  : 1;                                      // Pad
  37.   uint8_t  : 1;                                      // Pad
  38.   uint8_t  : 1;                                      // Pad
  39.   uint8_t  : 1;                                      // Pad
  40.   uint8_t  : 1;                                      // Pad
  41.   uint8_t  : 1;                                      // Pad
  42.   uint8_t  : 1;                                      // Pad
  43.   uint8_t  : 1;                                      // Pad
  44.   uint8_t  : 1;                                      // Pad
  45.   uint8_t  : 1;                                      // Pad
  46.   uint8_t  : 1;                                      // Pad
  47.   uint8_t  : 1;                                      // Pad
  48.   uint8_t  : 1;                                      // Pad
  49.   uint8_t  : 1;                                      // Pad
  50.   uint8_t  : 1;                                      // Pad
  51.   uint8_t  : 1;                                      // Pad
  52.   uint8_t  : 1;                                      // Pad
  53.   uint8_t  : 1;                                      // Pad
  54.   uint8_t  : 1;                                      // Pad
  55.   uint8_t  : 1;                                      // Pad
  56.   uint8_t  : 1;                                      // Pad
  57.   uint8_t  : 1;                                      // Pad
  58.   uint8_t  : 1;                                      // Pad
  59.   uint8_t  : 1;                                      // Pad
  60.   uint8_t  : 1;                                      // Pad
  61.   uint8_t  : 1;                                      // Pad
  62.   uint8_t  : 1;                                      // Pad
  63.   uint8_t  : 1;                                      // Pad
  64.   uint8_t  : 1;                                      // Pad
  65.   uint8_t  : 1;                                      // Pad
  66.   uint8_t  : 1;                                      // Pad
  67.   uint8_t  : 1;                                      // Pad
  68.   uint8_t  : 1;                                      // Pad
  69.   uint8_t  : 1;                                      // Pad
  70.   uint8_t  : 1;                                      // Pad
  71. } featureReport05_t;
  72.  
  73.  
  74. //--------------------------------------------------------------------------------
  75. // Decoded Application Collection
  76. //--------------------------------------------------------------------------------
  77.  
  78. /*
  79. 05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
  80. 09 80        (LOCAL)  USAGE              0x00010080 System Control (Application Collection)  
  81. A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010080: Page=Generic Desktop Page, Usage=System Control, Type=Application Collection)
  82. 85 02          (GLOBAL) REPORT_ID          0x02 (2)  
  83. 09 81          (LOCAL)  USAGE              0x00010081 System Power Down (One Shot Control)  
  84. 15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
  85. 25 01          (GLOBAL) LOGICAL_MAXIMUM    0x01 (1) <-- Redundant: LOGICAL_MAXIMUM is already 1
  86. 35 00          (GLOBAL) PHYSICAL_MINIMUM   0x00 (0) <-- Redundant: PHYSICAL_MINIMUM is already 0 <-- Info: Consider replacing 35 00 with 34
  87. 45 01          (GLOBAL) PHYSICAL_MAXIMUM   0x01 (1) <-- Redundant: PHYSICAL_MAXIMUM is already 1
  88. 65 00          (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
  89. 55 00          (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰) <-- Redundant: UNIT_EXPONENT is already 0 <-- Info: Consider replacing 55 00 with 54
  90. 75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field <-- Redundant: REPORT_SIZE is already 1
  91. 95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
  92. 81 06          (MAIN)   INPUT              0x00000006 (1 field x 1 bit) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  93. 09 82          (LOCAL)  USAGE              0x00010082 System Sleep (One Shot Control)  
  94. 81 06          (MAIN)   INPUT              0x00000006 (1 field x 1 bit) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  95. 09 83          (LOCAL)  USAGE              0x00010083 System Wake Up (One Shot Control)  
  96. 81 06          (MAIN)   INPUT              0x00000006 (1 field x 1 bit) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  97. 95 05          (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields  
  98. 81 03          (MAIN)   INPUT              0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  99. C1 00        (MAIN)   END_COLLECTION     Application <-- Error: Data (00) is not applicable to END_COLLECTION items <-- Warning: Physical units are still in effect PHYSICAL(MIN=0,MAX=1) UNIT(0x,EXP=0)
  100. */
  101.  
  102. //--------------------------------------------------------------------------------
  103. // Generic Desktop Page inputReport 02 (Device --> Host)
  104. //--------------------------------------------------------------------------------
  105.  
  106. typedef struct
  107. {
  108.   uint8_t  reportId;                                 // Report ID = 0x02 (2)
  109.                                                      // Collection: CA:SystemControl
  110.   uint8_t  GD_SystemControlSystemPowerDown : 1;      // Usage 0x00010081: System Power Down, Value = 0 to 1, Physical = Value
  111.   uint8_t  GD_SystemControlSystemSleep : 1;          // Usage 0x00010082: System Sleep, Value = 0 to 1, Physical = Value
  112.   uint8_t  GD_SystemControlSystemWakeUp : 1;         // Usage 0x00010083: System Wake Up, Value = 0 to 1, Physical = Value
  113.   uint8_t  : 1;                                      // Pad
  114.   uint8_t  : 1;                                      // Pad
  115.   uint8_t  : 1;                                      // Pad
  116.   uint8_t  : 1;                                      // Pad
  117.   uint8_t  : 1;                                      // Pad
  118. } inputReport02_t;
  119.  
  120.  
  121. //--------------------------------------------------------------------------------
  122. // Decoded Application Collection
  123. //--------------------------------------------------------------------------------
  124.  
  125. /*
  126. 05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page <-- Redundant: USAGE_PAGE is already 0x0001
  127. 09 06        (LOCAL)  USAGE              0x00010006 Keyboard (Application Collection)  
  128. A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010006: Page=Generic Desktop Page, Usage=Keyboard, Type=Application Collection)
  129. 05 07          (GLOBAL) USAGE_PAGE         0x0007 Keyboard/Keypad Page
  130. 19 E0          (LOCAL)  USAGE_MINIMUM      0x000700E0 Keyboard Left Control (Dynamic Value)  
  131. 29 E7          (LOCAL)  USAGE_MAXIMUM      0x000700E7 Keyboard Right GUI (Dynamic Value)  
  132. 15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
  133. 25 01          (GLOBAL) LOGICAL_MAXIMUM    0x01 (1) <-- Redundant: LOGICAL_MAXIMUM is already 1
  134. 35 00          (GLOBAL) PHYSICAL_MINIMUM   0x00 (0) <-- Redundant: PHYSICAL_MINIMUM is already 0 <-- Info: Consider replacing 35 00 with 34
  135. 45 01          (GLOBAL) PHYSICAL_MAXIMUM   0x01 (1) <-- Redundant: PHYSICAL_MAXIMUM is already 1
  136. 65 00          (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
  137. 55 00          (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰) <-- Redundant: UNIT_EXPONENT is already 0 <-- Info: Consider replacing 55 00 with 54
  138. 75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field <-- Redundant: REPORT_SIZE is already 1
  139. 95 08          (GLOBAL) REPORT_COUNT       0x08 (8) Number of fields  
  140. 81 02          (MAIN)   INPUT              0x00000002 (8 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  141. 95 38          (GLOBAL) REPORT_COUNT       0x38 (56) Number of fields  
  142. 81 03          (MAIN)   INPUT              0x00000003 (56 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  143. 05 08          (GLOBAL) USAGE_PAGE         0x0008 LED Indicator Page
  144. 19 01          (LOCAL)  USAGE_MINIMUM      0x00080001 Num Lock (On/Off Control)  
  145. 29 03          (LOCAL)  USAGE_MAXIMUM      0x00080003 Scroll Lock (On/Off Control)  
  146. 95 03          (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields  
  147. 91 02          (MAIN)   OUTPUT             0x00000002 (3 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  148. 95 05          (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields  
  149. 91 03          (MAIN)   OUTPUT             0x00000003 (5 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  150. C1 00        (MAIN)   END_COLLECTION     Application <-- Error: Data (00) is not applicable to END_COLLECTION items <-- Warning: Physical units are still in effect PHYSICAL(MIN=0,MAX=1) UNIT(0x,EXP=0)
  151. */
  152.  
  153. //--------------------------------------------------------------------------------
  154. // Keyboard/Keypad Page inputReport 02 (Device --> Host)
  155. //--------------------------------------------------------------------------------
  156.  
  157. typedef struct
  158. {
  159.   uint8_t  reportId;                                 // Report ID = 0x02 (2)
  160.                                                      // Collection: CA:Keyboard
  161.   uint8_t  KB_KeyboardKeyboardLeftControl : 1;       // Usage 0x000700E0: Keyboard Left Control, Value = 0 to 1, Physical = Value
  162.   uint8_t  KB_KeyboardKeyboardLeftShift : 1;         // Usage 0x000700E1: Keyboard Left Shift, Value = 0 to 1, Physical = Value
  163.   uint8_t  KB_KeyboardKeyboardLeftAlt : 1;           // Usage 0x000700E2: Keyboard Left Alt, Value = 0 to 1, Physical = Value
  164.   uint8_t  KB_KeyboardKeyboardLeftGui : 1;           // Usage 0x000700E3: Keyboard Left GUI, Value = 0 to 1, Physical = Value
  165.   uint8_t  KB_KeyboardKeyboardRightControl : 1;      // Usage 0x000700E4: Keyboard Right Control, Value = 0 to 1, Physical = Value
  166.   uint8_t  KB_KeyboardKeyboardRightShift : 1;        // Usage 0x000700E5: Keyboard Right Shift, Value = 0 to 1, Physical = Value
  167.   uint8_t  KB_KeyboardKeyboardRightAlt : 1;          // Usage 0x000700E6: Keyboard Right Alt, Value = 0 to 1, Physical = Value
  168.   uint8_t  KB_KeyboardKeyboardRightGui : 1;          // Usage 0x000700E7: Keyboard Right GUI, Value = 0 to 1, Physical = Value
  169.   uint8_t  : 1;                                      // Pad
  170.   uint8_t  : 1;                                      // Pad
  171.   uint8_t  : 1;                                      // Pad
  172.   uint8_t  : 1;                                      // Pad
  173.   uint8_t  : 1;                                      // Pad
  174.   uint8_t  : 1;                                      // Pad
  175.   uint8_t  : 1;                                      // Pad
  176.   uint8_t  : 1;                                      // Pad
  177.   uint8_t  : 1;                                      // Pad
  178.   uint8_t  : 1;                                      // Pad
  179.   uint8_t  : 1;                                      // Pad
  180.   uint8_t  : 1;                                      // Pad
  181.   uint8_t  : 1;                                      // Pad
  182.   uint8_t  : 1;                                      // Pad
  183.   uint8_t  : 1;                                      // Pad
  184.   uint8_t  : 1;                                      // Pad
  185.   uint8_t  : 1;                                      // Pad
  186.   uint8_t  : 1;                                      // Pad
  187.   uint8_t  : 1;                                      // Pad
  188.   uint8_t  : 1;                                      // Pad
  189.   uint8_t  : 1;                                      // Pad
  190.   uint8_t  : 1;                                      // Pad
  191.   uint8_t  : 1;                                      // Pad
  192.   uint8_t  : 1;                                      // Pad
  193.   uint8_t  : 1;                                      // Pad
  194.   uint8_t  : 1;                                      // Pad
  195.   uint8_t  : 1;                                      // Pad
  196.   uint8_t  : 1;                                      // Pad
  197.   uint8_t  : 1;                                      // Pad
  198.   uint8_t  : 1;                                      // Pad
  199.   uint8_t  : 1;                                      // Pad
  200.   uint8_t  : 1;                                      // Pad
  201.   uint8_t  : 1;                                      // Pad
  202.   uint8_t  : 1;                                      // Pad
  203.   uint8_t  : 1;                                      // Pad
  204.   uint8_t  : 1;                                      // Pad
  205.   uint8_t  : 1;                                      // Pad
  206.   uint8_t  : 1;                                      // Pad
  207.   uint8_t  : 1;                                      // Pad
  208.   uint8_t  : 1;                                      // Pad
  209.   uint8_t  : 1;                                      // Pad
  210.   uint8_t  : 1;                                      // Pad
  211.   uint8_t  : 1;                                      // Pad
  212.   uint8_t  : 1;                                      // Pad
  213.   uint8_t  : 1;                                      // Pad
  214.   uint8_t  : 1;                                      // Pad
  215.   uint8_t  : 1;                                      // Pad
  216.   uint8_t  : 1;                                      // Pad
  217.   uint8_t  : 1;                                      // Pad
  218.   uint8_t  : 1;                                      // Pad
  219.   uint8_t  : 1;                                      // Pad
  220.   uint8_t  : 1;                                      // Pad
  221.   uint8_t  : 1;                                      // Pad
  222.   uint8_t  : 1;                                      // Pad
  223.   uint8_t  : 1;                                      // Pad
  224.   uint8_t  : 1;                                      // Pad
  225. } inputReport02_1_t;
  226.  
  227.  
  228. //--------------------------------------------------------------------------------
  229. // LED Indicator Page outputReport 02 (Device <-- Host)
  230. //--------------------------------------------------------------------------------
  231.  
  232. typedef struct
  233. {
  234.   uint8_t  reportId;                                 // Report ID = 0x02 (2)
  235.                                                      // Collection: CA:Keyboard
  236.   uint8_t  LED_KeyboardNumLock : 1;                  // Usage 0x00080001: Num Lock, Value = 0 to 1, Physical = Value
  237.   uint8_t  LED_KeyboardCapsLock : 1;                 // Usage 0x00080002: Caps Lock, Value = 0 to 1, Physical = Value
  238.   uint8_t  LED_KeyboardScrollLock : 1;               // Usage 0x00080003: Scroll Lock, Value = 0 to 1, Physical = Value
  239.   uint8_t  : 1;                                      // Pad
  240.   uint8_t  : 1;                                      // Pad
  241.   uint8_t  : 1;                                      // Pad
  242.   uint8_t  : 1;                                      // Pad
  243.   uint8_t  : 1;                                      // Pad
  244. } outputReport02_t;
  245.  
  246.  
  247. //--------------------------------------------------------------------------------
  248. // Decoded Application Collection
  249. //--------------------------------------------------------------------------------
  250.  
  251. /*
  252. 05 01        (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
  253. 09 02        (LOCAL)  USAGE              0x00010002 Mouse (Application Collection)  
  254. A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00010002: Page=Generic Desktop Page, Usage=Mouse, Type=Application Collection)
  255. 85 01          (GLOBAL) REPORT_ID          0x01 (1)  
  256. 09 01          (LOCAL)  USAGE              0x00010001 Pointer (Physical Collection)  
  257. A1 00          (MAIN)   COLLECTION         0x00 Physical (Usage=0x00010001: Page=Generic Desktop Page, Usage=Pointer, Type=Physical Collection)
  258. 05 09            (GLOBAL) USAGE_PAGE         0x0009 Button Page
  259. 19 01            (LOCAL)  USAGE_MINIMUM      0x00090001 Button 1 Primary/trigger (Selector, On/Off Control, Momentary Control, or One Shot Control)  
  260. 29 05            (LOCAL)  USAGE_MAXIMUM      0x00090005 Button 5 (Selector, On/Off Control, Momentary Control, or One Shot Control)  
  261. 15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
  262. 25 01            (GLOBAL) LOGICAL_MAXIMUM    0x01 (1) <-- Redundant: LOGICAL_MAXIMUM is already 1
  263. 35 00            (GLOBAL) PHYSICAL_MINIMUM   0x00 (0) <-- Redundant: PHYSICAL_MINIMUM is already 0 <-- Info: Consider replacing 35 00 with 34
  264. 45 01            (GLOBAL) PHYSICAL_MAXIMUM   0x01 (1) <-- Redundant: PHYSICAL_MAXIMUM is already 1
  265. 65 00            (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
  266. 55 00            (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰) <-- Redundant: UNIT_EXPONENT is already 0 <-- Info: Consider replacing 55 00 with 54
  267. 75 01            (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field <-- Redundant: REPORT_SIZE is already 1
  268. 95 05            (GLOBAL) REPORT_COUNT       0x05 (5) Number of fields <-- Redundant: REPORT_COUNT is already 5
  269. 81 02            (MAIN)   INPUT              0x00000002 (5 fields x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  270. 95 03            (GLOBAL) REPORT_COUNT       0x03 (3) Number of fields  
  271. 81 03            (MAIN)   INPUT              0x00000003 (3 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  272. 05 01            (GLOBAL) USAGE_PAGE         0x0001 Generic Desktop Page
  273. 09 30            (LOCAL)  USAGE              0x00010030 X (Dynamic Value)  
  274. 26 FF7F          (GLOBAL) LOGICAL_MAXIMUM    0x7FFF (32767)  
  275. 45 00            (GLOBAL) PHYSICAL_MAXIMUM   0x00 (0)  <-- Info: Consider replacing 45 00 with 44
  276. 75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
  277. 95 01            (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
  278. 81 06            (MAIN)   INPUT              0x00000006 (1 field x 16 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  279. 09 31            (LOCAL)  USAGE              0x00010031 Y (Dynamic Value)  
  280. 81 06            (MAIN)   INPUT              0x00000006 (1 field x 16 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  281. 09 38            (LOCAL)  USAGE              0x00010038 Wheel (Dynamic Value)  
  282. 25 7F            (GLOBAL) LOGICAL_MAXIMUM    0x7F (127)  
  283. 75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
  284. 81 06            (MAIN)   INPUT              0x00000006 (1 field x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  285. 05 0C            (GLOBAL) USAGE_PAGE         0x000C Consumer Device Page
  286. 0A 3802          (LOCAL)  USAGE              0x000C0238 AC Pan (Linear Control)  
  287. 81 06            (MAIN)   INPUT              0x00000006 (1 field x 8 bits) 0=Data 1=Variable 1=Relative 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  288. C1 00          (MAIN)   END_COLLECTION     Physical <-- Error: Data (00) is not applicable to END_COLLECTION items
  289. C1 00        (MAIN)   END_COLLECTION     Application <-- Error: Data (00) is not applicable to END_COLLECTION items
  290. */
  291.  
  292. //--------------------------------------------------------------------------------
  293. // Button Page inputReport 01 (Device --> Host)
  294. //--------------------------------------------------------------------------------
  295.  
  296. typedef struct
  297. {
  298.   uint8_t  reportId;                                 // Report ID = 0x01 (1)
  299.                                                      // Collection: CA:Mouse CP:Pointer
  300.   uint8_t  BTN_MousePointerButton1 : 1;              // Usage 0x00090001: Button 1 Primary/trigger, Value = 0 to 1, Physical = Value
  301.   uint8_t  BTN_MousePointerButton2 : 1;              // Usage 0x00090002: Button 2 Secondary, Value = 0 to 1, Physical = Value
  302.   uint8_t  BTN_MousePointerButton3 : 1;              // Usage 0x00090003: Button 3 Tertiary, Value = 0 to 1, Physical = Value
  303.   uint8_t  BTN_MousePointerButton4 : 1;              // Usage 0x00090004: Button 4, Value = 0 to 1, Physical = Value
  304.   uint8_t  BTN_MousePointerButton5 : 1;              // Usage 0x00090005: Button 5, Value = 0 to 1, Physical = Value
  305.   uint8_t  : 1;                                      // Pad
  306.   uint8_t  : 1;                                      // Pad
  307.   uint8_t  : 1;                                      // Pad
  308.   uint16_t GD_MousePointerX;                         // Usage 0x00010030: X, Value = 0 to 32767
  309.   uint16_t GD_MousePointerY;                         // Usage 0x00010031: Y, Value = 0 to 32767
  310.   uint8_t  GD_MousePointerWheel;                     // Usage 0x00010038: Wheel, Value = 0 to 127
  311.   uint8_t  CD_MousePointerAcPan;                     // Usage 0x000C0238: AC Pan, Value = 0 to 127
  312. } inputReport01_t;
  313.  
  314.  
  315. //--------------------------------------------------------------------------------
  316. // Decoded Application Collection
  317. //--------------------------------------------------------------------------------
  318.  
  319. /*
  320. 05 0C        (GLOBAL) USAGE_PAGE         0x000C Consumer Device Page <-- Redundant: USAGE_PAGE is already 0x000C
  321. 09 01        (LOCAL)  USAGE              0x000C0001 Consumer Control (Application Collection)  
  322. A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x000C0001: Page=Consumer Device Page, Usage=Consumer Control, Type=Application Collection)
  323. 85 03          (GLOBAL) REPORT_ID          0x03 (3)  
  324. 09 B5          (LOCAL)  USAGE              0x000C00B5 Scan Next Track (One Shot Control)  
  325. 15 00          (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
  326. 25 01          (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)  
  327. 35 00          (GLOBAL) PHYSICAL_MINIMUM   0x00 (0) <-- Redundant: PHYSICAL_MINIMUM is already 0 <-- Info: Consider replacing 35 00 with 34
  328. 45 01          (GLOBAL) PHYSICAL_MAXIMUM   0x01 (1)  
  329. 65 00          (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
  330. 55 00          (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰) <-- Redundant: UNIT_EXPONENT is already 0 <-- Info: Consider replacing 55 00 with 54
  331. 75 01          (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field  
  332. 95 01          (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields <-- Redundant: REPORT_COUNT is already 1
  333. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  334. 09 B6          (LOCAL)  USAGE              0x000C00B6 Scan Previous Track (One Shot Control)  
  335. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  336. 09 B7          (LOCAL)  USAGE              0x000C00B7 Stop (One Shot Control)  
  337. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  338. 09 CD          (LOCAL)  USAGE              0x000C00CD Play/Pause (One Shot Control)  
  339. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  340. 09 E2          (LOCAL)  USAGE              0x000C00E2 Mute (On/Off Control)  
  341. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  342. 09 A2          (LOCAL)  USAGE              0x000C00A2 Daily (One Shot Control)  
  343. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  344. 09 E9          (LOCAL)  USAGE              0x000C00E9 Volume Increment (Re-trigger Control)  
  345. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  346. 09 EA          (LOCAL)  USAGE              0x000C00EA Volume Decrement (Re-trigger Control)  
  347. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  348. 0A 8301        (LOCAL)  USAGE              0x000C0183 AL Consumer Control Configuration (Selector)  
  349. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  350. 0A 9401        (LOCAL)  USAGE              0x000C0194 AL Local Machine Browser (Selector)  
  351. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  352. 0A 8601        (LOCAL)  USAGE              0x000C0186 AL Spreadsheet (Selector)  
  353. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  354. 0A 8801        (LOCAL)  USAGE              0x000C0188 AL Presentation App (Selector)  
  355. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  356. 0A 8A01        (LOCAL)  USAGE              0x000C018A AL Email Reader (Selector)  
  357. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  358. 09 6F          (LOCAL)  USAGE              0x000C006F Display Brightness Increment (Re-trigger Control)  
  359. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  360. 09 70          (LOCAL)  USAGE              0x000C0070 Display Brightness Decrement (Re-trigger Control)  
  361. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  362. 0A 9601        (LOCAL)  USAGE              0x000C0196 AL Internet Browser (Selector)  
  363. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  364. 0A 2102        (LOCAL)  USAGE              0x000C0221 AC Search (Selector)  
  365. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  366. 0A 2302        (LOCAL)  USAGE              0x000C0223 AC Home (Selector)  
  367. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  368. 0A 2402        (LOCAL)  USAGE              0x000C0224 AC Back (Selector)  
  369. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  370. 0A 2502        (LOCAL)  USAGE              0x000C0225 AC Forward (Selector)  
  371. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  372. 0A 9201        (LOCAL)  USAGE              0x000C0192 AL Calculator (Selector)  
  373. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  374. 0A 2702        (LOCAL)  USAGE              0x000C0227 AC Refresh (Selector)  
  375. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  376. 0A 2A02        (LOCAL)  USAGE              0x000C022A AC Bookmarks (Selector)  
  377. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  378. 09 30          (LOCAL)  USAGE              0x000C0030 Power (On/Off Control)  
  379. 81 02          (MAIN)   INPUT              0x00000002 (1 field x 1 bit) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap
  380. C1 00        (MAIN)   END_COLLECTION     Application <-- Error: Data (00) is not applicable to END_COLLECTION items <-- Warning: Physical units are still in effect PHYSICAL(MIN=0,MAX=1) UNIT(0x,EXP=0)
  381. */
  382.  
  383. //--------------------------------------------------------------------------------
  384. // Consumer Device Page inputReport 03 (Device --> Host)
  385. //--------------------------------------------------------------------------------
  386.  
  387. typedef struct
  388. {
  389.   uint8_t  reportId;                                 // Report ID = 0x03 (3)
  390.                                                      // Collection: CA:ConsumerControl
  391.   uint8_t  CD_ConsumerControlScanNextTrack : 1;      // Usage 0x000C00B5: Scan Next Track, Value = 0 to 1, Physical = Value
  392.   uint8_t  CD_ConsumerControlScanPreviousTrack : 1;  // Usage 0x000C00B6: Scan Previous Track, Value = 0 to 1, Physical = Value
  393.   uint8_t  CD_ConsumerControlStop : 1;               // Usage 0x000C00B7: Stop, Value = 0 to 1, Physical = Value
  394.   uint8_t  CD_ConsumerControlPlayPause : 1;          // Usage 0x000C00CD: Play/Pause, Value = 0 to 1, Physical = Value
  395.   uint8_t  CD_ConsumerControlMute : 1;               // Usage 0x000C00E2: Mute, Value = 0 to 1, Physical = Value
  396.   uint8_t  CD_ConsumerControlDaily : 1;              // Usage 0x000C00A2: Daily, Value = 0 to 1, Physical = Value
  397.   uint8_t  CD_ConsumerControlVolumeIncrement : 1;    // Usage 0x000C00E9: Volume Increment, Value = 0 to 1, Physical = Value
  398.   uint8_t  CD_ConsumerControlVolumeDecrement : 1;    // Usage 0x000C00EA: Volume Decrement, Value = 0 to 1, Physical = Value
  399.   uint8_t  CD_ConsumerControlAlConsumerControlConfiguration : 1; // Usage 0x000C0183: AL Consumer Control Configuration, Value = 0 to 1, Physical = Value
  400.   uint8_t  CD_ConsumerControlAlLocalMachineBrowser : 1; // Usage 0x000C0194: AL Local Machine Browser, Value = 0 to 1, Physical = Value
  401.   uint8_t  CD_ConsumerControlAlSpreadsheet : 1;      // Usage 0x000C0186: AL Spreadsheet, Value = 0 to 1, Physical = Value
  402.   uint8_t  CD_ConsumerControlAlPresentationApp : 1;  // Usage 0x000C0188: AL Presentation App, Value = 0 to 1, Physical = Value
  403.   uint8_t  CD_ConsumerControlAlEmailReader : 1;      // Usage 0x000C018A: AL Email Reader, Value = 0 to 1, Physical = Value
  404.   uint8_t  CD_ConsumerControlDisplayBrightnessIncrement : 1; // Usage 0x000C006F: Display Brightness Increment, Value = 0 to 1, Physical = Value
  405.   uint8_t  CD_ConsumerControlDisplayBrightnessDecrement : 1; // Usage 0x000C0070: Display Brightness Decrement, Value = 0 to 1, Physical = Value
  406.   uint8_t  CD_ConsumerControlAlInternetBrowser : 1;  // Usage 0x000C0196: AL Internet Browser, Value = 0 to 1, Physical = Value
  407.   uint8_t  CD_ConsumerControlAcSearch : 1;           // Usage 0x000C0221: AC Search, Value = 0 to 1, Physical = Value
  408.   uint8_t  CD_ConsumerControlAcHome : 1;             // Usage 0x000C0223: AC Home, Value = 0 to 1, Physical = Value
  409.   uint8_t  CD_ConsumerControlAcBack : 1;             // Usage 0x000C0224: AC Back, Value = 0 to 1, Physical = Value
  410.   uint8_t  CD_ConsumerControlAcForward : 1;          // Usage 0x000C0225: AC Forward, Value = 0 to 1, Physical = Value
  411.   uint8_t  CD_ConsumerControlAlCalculator : 1;       // Usage 0x000C0192: AL Calculator, Value = 0 to 1, Physical = Value
  412.   uint8_t  CD_ConsumerControlAcRefresh : 1;          // Usage 0x000C0227: AC Refresh, Value = 0 to 1, Physical = Value
  413.   uint8_t  CD_ConsumerControlAcBookmarks : 1;        // Usage 0x000C022A: AC Bookmarks, Value = 0 to 1, Physical = Value
  414.   uint8_t  CD_ConsumerControlPower : 1;              // Usage 0x000C0030: Power, Value = 0 to 1, Physical = Value
  415. } inputReport03_t;
  416.  
  417.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement