Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. static const uint16_t hidReportMap[] = {
  2. 0x05, 0x01, // Usage Page (Generic Desktop)
  3. 0x09, 0x02, // Usage (Mouse)
  4. 0xA1, 0x01, // Collection (Application)
  5. 0x85, 0x01, // Report Id (1)
  6. 0x09, 0x01, // Usage (Pointer)
  7. 0xA1, 0x00, // Collection (Physical)
  8. 0x05, 0x09, // Usage Page (Buttons)
  9. 0x19, 0x01, // Usage Minimum (01) - Button 1
  10. 0x29, 0x03, // Usage Maximum (03) - Button 3
  11. 0x15, 0x00, // Logical Minimum (0)
  12. 0x25, 0x01, // Logical Maximum (1)
  13. 0x75, 0x01, // Report Size (1)
  14. 0x95, 0x03, // Report Count (3)
  15. 0x81, 0x02, // Input (Data, Variable, Absolute) - Button states
  16. 0x75, 0x05, // Report Size (5)
  17. 0x95, 0x01, // Report Count (1)
  18. 0x81, 0x01, // Input (Constant) - Padding or Reserved bits
  19. 0x05, 0x01, // Usage Page (Generic Desktop)
  20. 0x09, 0x30, // Usage (X)
  21. 0x09, 0x31, // Usage (Y)
  22. 0x09, 0x38, // Usage (Wheel)
  23. 0x15, 0x81, // Logical Minimum (-127)
  24. 0x25, 0x7F, // Logical Maximum (127)
  25. 0x75, 0x0F, // Report Size (8)
  26. 0x95, 0x03, // Report Count (3)
  27. 0x81, 0x06, // Input (Data, Variable, Relative) - X & Y coordinate
  28. 0xC0, // End Collection
  29. 0xC0, // End Collection
  30.  
  31. 0x05, 0x01, // Usage Pg (Generic Desktop)
  32. 0x09, 0x06, // Usage (Keyboard)
  33. 0xA1, 0x01, // Collection: (Application)
  34. 0x85, 0x02, // Report Id (2)
  35. //
  36. 0x05, 0x07, // Usage Pg (Key Codes)
  37. 0x19, 0xE0, // Usage Min (224)
  38. 0x29, 0xE7, // Usage Max (231)
  39. 0x15, 0x00, // Log Min (0)
  40. 0x25, 0x01, // Log Max (1)
  41. //
  42. // Modifier byte
  43. 0x75, 0x01, // Report Size (1)
  44. 0x95, 0x08, // Report Count (8)
  45. 0x81, 0x02, // Input: (Data, Variable, Absolute)
  46. //
  47. // Reserved byte
  48. 0x95, 0x01, // Report Count (1)
  49. 0x75, 0x0F, // Report Size (8)
  50. 0x81, 0x01, // Input: (Constant)
  51. //
  52. // LED report
  53. 0x95, 0x05, // Report Count (5)
  54. 0x75, 0x01, // Report Size (1)
  55. 0x05, 0x08, // Usage Pg (LEDs)
  56. 0x19, 0x01, // Usage Min (1)
  57. 0x29, 0x05, // Usage Max (5)
  58. 0x91, 0x02, // Output: (Data, Variable, Absolute)
  59. //
  60. // LED report padding
  61. 0x95, 0x01, // Report Count (1)
  62. 0x75, 0x03, // Report Size (3)
  63. 0x91, 0x01, // Output: (Constant)
  64. //
  65. // Key arrays (6 bytes)
  66. 0x95, 0x06, // Report Count (6)
  67. 0x75, 0x0F, // Report Size (8)
  68. 0x15, 0x00, // Log Min (0)
  69. 0x25, 0x65, // Log Max (101)
  70. 0x05, 0x0E, // Usage Pg (Key Codes)
  71. 0x19, 0x00, // Usage Min (0)
  72. 0x29, 0x65, // Usage Max (101)
  73. 0x81, 0x00, // Input: (Data, Array)
  74. //
  75. 0xC0, // End Collection
  76. //
  77. 0x05, 0x0C, // Usage Pg (Consumer Devices)
  78. 0x09, 0x01, // Usage (Consumer Control)
  79. 0xA1, 0x01, // Collection (Application)
  80. 0x85, 0x03, // Report Id (3)
  81. 0x09, 0x02, // Usage (Numeric Key Pad)
  82. 0xA1, 0x02, // Collection (Logical)
  83. 0x05, 0x09, // Usage Pg (Button)
  84. 0x19, 0x01, // Usage Min (Button 1)
  85. 0x29, 0x0A, // Usage Max (Button 10)
  86. 0x15, 0x01, // Logical Min (1)
  87. 0x25, 0x0A, // Logical Max (10)
  88. 0x75, 0x04, // Report Size (4)
  89. 0x95, 0x01, // Report Count (1)
  90. 0x81, 0x00, // Input (Data, Ary, Abs)
  91. 0xC0, // End Collection
  92. 0x05, 0x0C, // Usage Pg (Consumer Devices)
  93. 0x09, 0x86, // Usage (Channel)
  94. 0x15, 0xFF, // Logical Min (-1)
  95. 0x25, 0x01, // Logical Max (1)
  96. 0x75, 0x02, // Report Size (2)
  97. 0x95, 0x01, // Report Count (1)
  98. 0x81, 0x46, // Input (Data, Var, Rel, Null)
  99. 0x09, 0xE9, // Usage (Volume Up)
  100. 0x09, 0xEA, // Usage (Volume Down)
  101. 0x15, 0x00, // Logical Min (0)
  102. 0x75, 0x01, // Report Size (1)
  103. 0x95, 0x02, // Report Count (2)
  104. 0x81, 0x02, // Input (Data, Var, Abs)
  105. 0x09, 0xE2, // Usage (Mute)
  106. 0x09, 0x30, // Usage (Power)
  107. 0x09, 0x83, // Usage (Recall Last)
  108. 0x09, 0x81, // Usage (Assign Selection)
  109. 0x09, 0xB0, // Usage (Play)
  110. 0x09, 0xB1, // Usage (Pause)
  111. 0x09, 0xB2, // Usage (Record)
  112. 0x09, 0xB3, // Usage (Fast Forward)
  113. 0x09, 0xB4, // Usage (Rewind)
  114. 0x09, 0xB5, // Usage (Scan Next)
  115. 0x09, 0xB6, // Usage (Scan Prev)
  116. 0x09, 0xB7, // Usage (Stop)
  117. 0x15, 0x01, // Logical Min (1)
  118. 0x25, 0x0C, // Logical Max (12)
  119. 0x75, 0x04, // Report Size (4)
  120. 0x95, 0x01, // Report Count (1)
  121. 0x81, 0x00, // Input (Data, Ary, Abs)
  122. 0x09, 0x80, // Usage (Selection)
  123. 0xA1, 0x02, // Collection (Logical)
  124. 0x05, 0x09, // Usage Pg (Button)
  125. 0x19, 0x01, // Usage Min (Button 1)
  126. 0x29, 0x03, // Usage Max (Button 3)
  127. 0x15, 0x01, // Logical Min (1)
  128. 0x25, 0x03, // Logical Max (3)
  129. 0x75, 0x02, // Report Size (2)
  130. 0x81, 0x00, // Input (Data, Ary, Abs)
  131. 0xC0, // End Collection
  132. 0x81, 0x03, // Input (Const, Var, Abs)
  133. 0xC0, // End Collectionq
  134.  
  135. #if (SUPPORT_REPORT_VENDOR == true)
  136. 0x06, 0xFF, 0xFF, // Usage Page(Vendor defined)
  137. 0x09, 0xA5, // Usage(Vendor Defined)
  138. 0xA1, 0x01, // Collection(Application)
  139. 0x85, 0x04, // Report Id (4)
  140. 0x09, 0xA6, // Usage(Vendor defined)
  141. 0x09, 0xA9, // Usage(Vendor defined)
  142. 0x75, 0x08, // Report Size
  143. 0x95, 0x7F, // Report Count = 127 Btyes
  144. 0x91, 0x02, // Output(Data, Variable, Absolute)
  145. 0xC0, // End Collection
  146. #endif
  147.  
  148. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement