You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

665 lines
31 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. /* gc_n64_usb : Gamecube or N64 controller to USB adapter firmware
  2. Copyright (C) 2007-2016 Raphael Assenat <raph@raphnet.net>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /*
  15. * The original file gamepad.c contained this descriptor which was
  16. * adapted from my original reportdesc.c by Sean Green for force
  17. * feedback support. Big thanks to him from sharing back!
  18. *
  19. * The descriptor is intact, except for minor changes such as
  20. * axis types and button quantity.
  21. */
  22. const uint8_t gcn64_usbHidReportDescriptor[] PROGMEM = {
  23. ///// gampad
  24. 0x05,0x01, // Usage Page Generic Desktop
  25. 0x09,0x05, // Usage Joystick
  26. 0xA1,0x01, // Collection Application
  27. //axis
  28. //
  29. 0x09, 0x01, // usage pointer
  30. 0xA1, 0x00, // COLLECTION (phys)
  31. 0x85,0x01, // Report ID 1
  32. 0x05, 0x01, // USAGE_PAGE (Generic desktop)
  33. 0x75, 0x10, // REPORT_SIZE (16)
  34. 0x95, 0x06, // REPORT_COUNT (6)
  35. 0x15, 0x00, // LOGICAL_MINIMUM (0)
  36. 0x26, 0x00, 0x7D, // LOGICAL_MAXIMUM (32000)
  37. // Main analog stick
  38. 0x09, 0x30, // USAGE (X)
  39. 0x09, 0x31, // USAGE (Y)
  40. // Gamecube C-stick
  41. 0x09, 0x33, // USAGE (Rx)
  42. 0x09, 0x34, // USAGE (Ry)
  43. // Triggers
  44. 0x09, 0x35, // USAGE (Rz)
  45. 0x09, 0x32, // USAGE (Z)
  46. 0x81, 0x02, // INPUT
  47. 0xc0, // END COLLECTION
  48. #define NUM_BUTTONS 16
  49. //buttons
  50. 0xA1, 0x00, // COLLECTION (phys)
  51. 0x05, 0x09, // USAGE_PAGE (Button)
  52. 0x15, 0x00, // LOGICAL_MINIMUM (0)
  53. 0x25, 0x01, // LOGICAL_MAXIMUM (1)
  54. 0x75, 0x01, // REPORT_SIZE (1)
  55. 0x95, NUM_BUTTONS, // REPORT_COUNT (14)
  56. 0x19, 0x01, // USAGE_MINIMUM (Button 1)
  57. 0x29, NUM_BUTTONS, // USAGE_MAXIMUM (Button 14)
  58. 0x75, 0x01, // REPORT_SIZE (1)
  59. 0x95, NUM_BUTTONS, // REPORT_COUNT (16)
  60. 0x81, 0x02, // INPUT
  61. 0xc0, // END COLLECTION
  62. 0x05,0x0F, // Usage Page Physical Interface
  63. 0x09,0x92, // Usage ES Playing
  64. 0xA1,0x02, // Collection Datalink
  65. 0x85,0x02, // Report ID 2
  66. 0x09,0x9F, // Usage DS Device is Reset
  67. 0x09,0xA0, // Usage DS Device is Pause
  68. // RA: 2015-08-18: Removed this bit since it gets
  69. // mapped to BTN_DEAD in linux's hid-input.c and this
  70. // makes the adapter appear to have 17 buttons.
  71. //
  72. // 0x09,0xA4, // Usage Actuator Power
  73. 0x09,0xA5, // Usage Undefined
  74. 0x09,0xA6, // Usage Undefined
  75. 0x15,0x00, // Logical Minimum 0
  76. 0x25,0x01, // Logical Maximum 1
  77. 0x35,0x00, // Physical Minimum 0
  78. 0x45,0x01, // Physical Maximum 1
  79. 0x75,0x01, // Report Size 1
  80. 0x95,0x04, // Report Count 4
  81. 0x81,0x02, // Input (Variable)
  82. 0x95,0x04, // Report Count 4
  83. 0x75,0x01, // Report Size 1
  84. 0x81,0x03, // Input (Constant, Variable)
  85. 0x09,0x94, // Usage PID Device Control
  86. 0x15,0x00, // Logical Minimum 0
  87. 0x25,0x01, // Logical Maximum 1
  88. 0x35,0x00, // Physical Minimum 0
  89. 0x45,0x01, // Physical Maximum 1
  90. 0x75,0x01, // Report Size 1
  91. 0x95,0x01, // Report Count 1
  92. 0x81,0x02, // Input (Variable)
  93. 0x09,0x22, // Usage Effect Block Index
  94. 0x15,0x01, // Logical Minimum 1
  95. 0x25,0x28, // Logical Maximum 28h (40d)
  96. 0x35,0x01, // Physical Minimum 1
  97. 0x45,0x28, // Physical Maximum 28h (40d)
  98. 0x75,0x07, // Report Size 7
  99. 0x95,0x01, // Report Count 1
  100. 0x81,0x02, // Input (Variable)
  101. 0xC0 , // End Collection
  102. 0x09,0x21, // Usage Set Effect Report
  103. 0xA1,0x02, // Collection Datalink
  104. 0x85,0x01, // Report ID 1
  105. 0x09,0x22, // Usage Effect Block Index
  106. 0x15,0x01, // Logical Minimum 1
  107. 0x25,0x28, // Logical Maximum 28h (40d)
  108. 0x35,0x01, // Physical Minimum 1
  109. 0x45,0x28, // Physical Maximum 28h (40d)
  110. 0x75,0x08, // Report Size 8
  111. 0x95,0x01, // Report Count 1
  112. 0x91,0x02, // Output (Variable)
  113. 0x09,0x25, // Usage Effect Type
  114. 0xA1,0x02, // Collection Datalink
  115. 0x09,0x26, // Usage ET Constant Force
  116. 0x09,0x27, // Usage ET Ramp
  117. 0x09,0x30, // Usage ET Square
  118. 0x09,0x31, // Usage ET Sine
  119. 0x09,0x32, // Usage ET Triangle
  120. 0x09,0x33, // Usage ET Sawtooth Up
  121. 0x09,0x34, // Usage ET Sawtooth Down
  122. 0x09,0x40, // Usage ET Spring
  123. 0x09,0x41, // Usage ET Damper
  124. 0x09,0x42, // Usage ET Inertia
  125. 0x09,0x43, // Usage ET Friction
  126. 0x09,0x28, // Usage ET Custom Force Data
  127. 0x25,0x0C, // Logical Maximum Ch (12d)
  128. 0x15,0x01, // Logical Minimum 1
  129. 0x35,0x01, // Physical Minimum 1
  130. 0x45,0x0C, // Physical Maximum Ch (12d)
  131. 0x75,0x08, // Report Size 8
  132. 0x95,0x01, // Report Count 1
  133. 0x91,0x00, // Output
  134. 0xC0 , // End Collection
  135. 0x09,0x50, // Usage Duration
  136. 0x09,0x54, // Usage Trigger Repeat Interval
  137. 0x09,0x51, // Usage Sample Period
  138. 0x15,0x00, // Logical Minimum 0
  139. 0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
  140. 0x35,0x00, // Physical Minimum 0
  141. 0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
  142. 0x66,0x03,0x10, // Unit 1003h (4099d)
  143. 0x55,0xFD, // Unit Exponent FDh (253d)
  144. 0x75,0x10, // Report Size 10h (16d)
  145. 0x95,0x03, // Report Count 3
  146. 0x91,0x02, // Output (Variable)
  147. 0x55,0x00, // Unit Exponent 0
  148. 0x66,0x00,0x00, // Unit 0
  149. 0x09,0x52, // Usage Gain
  150. 0x15,0x00, // Logical Minimum 0
  151. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  152. 0x35,0x00, // Physical Minimum 0
  153. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  154. 0x75,0x08, // Report Size 8
  155. 0x95,0x01, // Report Count 1
  156. 0x91,0x02, // Output (Variable)
  157. 0x09,0x53, // Usage Trigger Button
  158. 0x15,0x01, // Logical Minimum 1
  159. 0x25,0x08, // Logical Maximum 8
  160. 0x35,0x01, // Physical Minimum 1
  161. 0x45,0x08, // Physical Maximum 8
  162. 0x75,0x08, // Report Size 8
  163. 0x95,0x01, // Report Count 1
  164. 0x91,0x02, // Output (Variable)
  165. 0x09,0x55, // Usage Axes Enable
  166. 0xA1,0x02, // Collection Datalink
  167. 0x05,0x01, // Usage Page Generic Desktop
  168. 0x09,0x30, // Usage X
  169. 0x09,0x31, // Usage Y
  170. 0x15,0x00, // Logical Minimum 0
  171. 0x25,0x01, // Logical Maximum 1
  172. 0x75,0x01, // Report Size 1
  173. 0x95,0x02, // Report Count 2
  174. 0x91,0x02, // Output (Variable)
  175. 0xC0 , // End Collection
  176. 0x05,0x0F, // Usage Page Physical Interface
  177. 0x09,0x56, // Usage Direction Enable
  178. 0x95,0x01, // Report Count 1
  179. 0x91,0x02, // Output (Variable)
  180. 0x95,0x05, // Report Count 5
  181. 0x91,0x03, // Output (Constant, Variable)
  182. 0x09,0x57, // Usage Direction
  183. 0xA1,0x02, // Collection Datalink
  184. 0x0B,0x01,0x00,0x0A,0x00, // Usage Ordinals: Instance 1
  185. 0x0B,0x02,0x00,0x0A,0x00, // Usage Ordinals: Instance 2
  186. 0x66,0x14,0x00, // Unit 14h (20d)
  187. 0x55,0xFE, // Unit Exponent FEh (254d)
  188. 0x15,0x00, // Logical Minimum 0
  189. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  190. 0x35,0x00, // Physical Minimum 0
  191. 0x47,0xA0,0x8C,0x00,0x00, // Physical Maximum 8CA0h (36000d)
  192. 0x66,0x00,0x00, // Unit 0
  193. 0x75,0x08, // Report Size 8
  194. 0x95,0x02, // Report Count 2
  195. 0x91,0x02, // Output (Variable)
  196. 0x55,0x00, // Unit Exponent 0
  197. 0x66,0x00,0x00, // Unit 0
  198. 0xC0 , // End Collection
  199. 0x05,0x0F, // Usage Page Physical Interface
  200. 0x09,0xA7, // Usage Undefined
  201. 0x66,0x03,0x10, // Unit 1003h (4099d)
  202. 0x55,0xFD, // Unit Exponent FDh (253d)
  203. 0x15,0x00, // Logical Minimum 0
  204. 0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
  205. 0x35,0x00, // Physical Minimum 0
  206. 0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
  207. 0x75,0x10, // Report Size 10h (16d)
  208. 0x95,0x01, // Report Count 1
  209. 0x91,0x02, // Output (Variable)
  210. 0x66,0x00,0x00, // Unit 0
  211. 0x55,0x00, // Unit Exponent 0
  212. 0xC0 , // End Collection
  213. 0x05,0x0F, // Usage Page Physical Interface
  214. 0x09,0x5A, // Usage Set Envelope Report
  215. 0xA1,0x02, // Collection Datalink
  216. 0x85,0x02, // Report ID 2
  217. 0x09,0x22, // Usage Effect Block Index
  218. 0x15,0x01, // Logical Minimum 1
  219. 0x25,0x28, // Logical Maximum 28h (40d)
  220. 0x35,0x01, // Physical Minimum 1
  221. 0x45,0x28, // Physical Maximum 28h (40d)
  222. 0x75,0x08, // Report Size 8
  223. 0x95,0x01, // Report Count 1
  224. 0x91,0x02, // Output (Variable)
  225. 0x09,0x5B, // Usage Attack Level
  226. 0x09,0x5D, // Usage Fade Level
  227. 0x15,0x00, // Logical Minimum 0
  228. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  229. 0x35,0x00, // Physical Minimum 0
  230. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  231. 0x95,0x02, // Report Count 2
  232. 0x91,0x02, // Output (Variable)
  233. 0x09,0x5C, // Usage Attack Time
  234. 0x09,0x5E, // Usage Fade Time
  235. 0x66,0x03,0x10, // Unit 1003h (4099d)
  236. 0x55,0xFD, // Unit Exponent FDh (253d)
  237. 0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
  238. 0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
  239. 0x75,0x10, // Report Size 10h (16d)
  240. 0x91,0x02, // Output (Variable)
  241. 0x45,0x00, // Physical Maximum 0
  242. 0x66,0x00,0x00, // Unit 0
  243. 0x55,0x00, // Unit Exponent 0
  244. 0xC0 , // End Collection
  245. 0x09,0x5F, // Usage Set Condition Report
  246. 0xA1,0x02, // Collection Datalink
  247. 0x85,0x03, // Report ID 3
  248. 0x09,0x22, // Usage Effect Block Index
  249. 0x15,0x01, // Logical Minimum 1
  250. 0x25,0x28, // Logical Maximum 28h (40d)
  251. 0x35,0x01, // Physical Minimum 1
  252. 0x45,0x28, // Physical Maximum 28h (40d)
  253. 0x75,0x08, // Report Size 8
  254. 0x95,0x01, // Report Count 1
  255. 0x91,0x02, // Output (Variable)
  256. 0x09,0x23, // Usage Parameter Block Offset
  257. 0x15,0x00, // Logical Minimum 0
  258. 0x25,0x01, // Logical Maximum 1
  259. 0x35,0x00, // Physical Minimum 0
  260. 0x45,0x01, // Physical Maximum 1
  261. 0x75,0x04, // Report Size 4
  262. 0x95,0x01, // Report Count 1
  263. 0x91,0x02, // Output (Variable)
  264. 0x09,0x58, // Usage Type Specific Block Off...
  265. 0xA1,0x02, // Collection Datalink
  266. 0x0B,0x01,0x00,0x0A,0x00, // Usage Ordinals: Instance 1
  267. 0x0B,0x02,0x00,0x0A,0x00, // Usage Ordinals: Instance 2
  268. 0x75,0x02, // Report Size 2
  269. 0x95,0x02, // Report Count 2
  270. 0x91,0x02, // Output (Variable)
  271. 0xC0 , // End Collection
  272. 0x15,0x80, // Logical Minimum 80h (-128d)
  273. 0x25,0x7F, // Logical Maximum 7Fh (127d)
  274. 0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
  275. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  276. 0x09,0x60, // Usage CP Offset
  277. 0x75,0x08, // Report Size 8
  278. 0x95,0x01, // Report Count 1
  279. 0x91,0x02, // Output (Variable)
  280. 0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
  281. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  282. 0x09,0x61, // Usage Positive Coefficient
  283. 0x09,0x62, // Usage Negative Coefficient
  284. 0x95,0x02, // Report Count 2
  285. 0x91,0x02, // Output (Variable)
  286. 0x15,0x00, // Logical Minimum 0
  287. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  288. 0x35,0x00, // Physical Minimum 0
  289. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  290. 0x09,0x63, // Usage Positive Saturation
  291. 0x09,0x64, // Usage Negative Saturation
  292. 0x75,0x08, // Report Size 8
  293. 0x95,0x02, // Report Count 2
  294. 0x91,0x02, // Output (Variable)
  295. 0x09,0x65, // Usage Dead Band
  296. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  297. 0x95,0x01, // Report Count 1
  298. 0x91,0x02, // Output (Variable)
  299. 0xC0 , // End Collection
  300. 0x09,0x6E, // Usage Set Periodic Report
  301. 0xA1,0x02, // Collection Datalink
  302. 0x85,0x04, // Report ID 4
  303. 0x09,0x22, // Usage Effect Block Index
  304. 0x15,0x01, // Logical Minimum 1
  305. 0x25,0x28, // Logical Maximum 28h (40d)
  306. 0x35,0x01, // Physical Minimum 1
  307. 0x45,0x28, // Physical Maximum 28h (40d)
  308. 0x75,0x08, // Report Size 8
  309. 0x95,0x01, // Report Count 1
  310. 0x91,0x02, // Output (Variable)
  311. 0x09,0x70, // Usage Magnitude
  312. 0x15,0x00, // Logical Minimum 0
  313. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  314. 0x35,0x00, // Physical Minimum 0
  315. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  316. 0x75,0x08, // Report Size 8
  317. 0x95,0x01, // Report Count 1
  318. 0x91,0x02, // Output (Variable)
  319. 0x09,0x6F, // Usage Offset
  320. 0x15,0x80, // Logical Minimum 80h (-128d)
  321. 0x25,0x7F, // Logical Maximum 7Fh (127d)
  322. 0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
  323. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  324. 0x95,0x01, // Report Count 1
  325. 0x91,0x02, // Output (Variable)
  326. 0x09,0x71, // Usage Phase
  327. 0x66,0x14,0x00, // Unit 14h (20d)
  328. 0x55,0xFE, // Unit Exponent FEh (254d)
  329. 0x15,0x00, // Logical Minimum 0
  330. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  331. 0x35,0x00, // Physical Minimum 0
  332. 0x47,0xA0,0x8C,0x00,0x00, // Physical Maximum 8CA0h (36000d)
  333. 0x91,0x02, // Output (Variable)
  334. 0x09,0x72, // Usage Period
  335. 0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
  336. 0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
  337. 0x66,0x03,0x10, // Unit 1003h (4099d)
  338. 0x55,0xFD, // Unit Exponent FDh (253d)
  339. 0x75,0x10, // Report Size 10h (16d)
  340. 0x95,0x01, // Report Count 1
  341. 0x91,0x02, // Output (Variable)
  342. 0x66,0x00,0x00, // Unit 0
  343. 0x55,0x00, // Unit Exponent 0
  344. 0xC0 , // End Collection
  345. 0x09,0x73, // Usage Set Constant Force Rep...
  346. 0xA1,0x02, // Collection Datalink
  347. 0x85,0x05, // Report ID 5
  348. 0x09,0x22, // Usage Effect Block Index
  349. 0x15,0x01, // Logical Minimum 1
  350. 0x25,0x28, // Logical Maximum 28h (40d)
  351. 0x35,0x01, // Physical Minimum 1
  352. 0x45,0x28, // Physical Maximum 28h (40d)
  353. 0x75,0x08, // Report Size 8
  354. 0x95,0x01, // Report Count 1
  355. 0x91,0x02, // Output (Variable)
  356. 0x09,0x70, // Usage Magnitude
  357. 0x16,0x01,0xFF, // Logical Minimum FF01h (-255d)
  358. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  359. 0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
  360. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  361. 0x75,0x10, // Report Size 10h (16d)
  362. 0x95,0x01, // Report Count 1
  363. 0x91,0x02, // Output (Variable)
  364. 0xC0 , // End Collection
  365. 0x09,0x74, // Usage Set Ramp Force Report
  366. 0xA1,0x02, // Collection Datalink
  367. 0x85,0x06, // Report ID 6
  368. 0x09,0x22, // Usage Effect Block Index
  369. 0x15,0x01, // Logical Minimum 1
  370. 0x25,0x28, // Logical Maximum 28h (40d)
  371. 0x35,0x01, // Physical Minimum 1
  372. 0x45,0x28, // Physical Maximum 28h (40d)
  373. 0x75,0x08, // Report Size 8
  374. 0x95,0x01, // Report Count 1
  375. 0x91,0x02, // Output (Variable)
  376. 0x09,0x75, // Usage Ramp Start
  377. 0x09,0x76, // Usage Ramp End
  378. 0x15,0x80, // Logical Minimum 80h (-128d)
  379. 0x25,0x7F, // Logical Maximum 7Fh (127d)
  380. 0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
  381. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  382. 0x75,0x08, // Report Size 8
  383. 0x95,0x02, // Report Count 2
  384. 0x91,0x02, // Output (Variable)
  385. 0xC0 , // End Collection
  386. 0x09,0x68, // Usage Custom Force Data Rep...
  387. 0xA1,0x02, // Collection Datalink
  388. 0x85,0x07, // Report ID 7
  389. 0x09,0x22, // Usage Effect Block Index
  390. 0x15,0x01, // Logical Minimum 1
  391. 0x25,0x28, // Logical Maximum 28h (40d)
  392. 0x35,0x01, // Physical Minimum 1
  393. 0x45,0x28, // Physical Maximum 28h (40d)
  394. 0x75,0x08, // Report Size 8
  395. 0x95,0x01, // Report Count 1
  396. 0x91,0x02, // Output (Variable)
  397. 0x09,0x6C, // Usage Custom Force Data Offset
  398. 0x15,0x00, // Logical Minimum 0
  399. 0x26,0x10,0x27, // Logical Maximum 2710h (10000d)
  400. 0x35,0x00, // Physical Minimum 0
  401. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  402. 0x75,0x10, // Report Size 10h (16d)
  403. 0x95,0x01, // Report Count 1
  404. 0x91,0x02, // Output (Variable)
  405. 0x09,0x69, // Usage Custom Force Data
  406. 0x15,0x81, // Logical Minimum 81h (-127d)
  407. 0x25,0x7F, // Logical Maximum 7Fh (127d)
  408. 0x35,0x00, // Physical Minimum 0
  409. 0x46,0xFF,0x00, // Physical Maximum FFh (255d)
  410. 0x75,0x08, // Report Size 8
  411. 0x95,0x0C, // Report Count Ch (12d)
  412. 0x92,0x02,0x01, // Output (Variable, Buffered)
  413. 0xC0 , // End Collection
  414. 0x09,0x66, // Usage Download Force Sample
  415. 0xA1,0x02, // Collection Datalink
  416. 0x85,0x08, // Report ID 8
  417. 0x05,0x01, // Usage Page Generic Desktop
  418. 0x09,0x30, // Usage X
  419. 0x09,0x31, // Usage Y
  420. 0x15,0x81, // Logical Minimum 81h (-127d)
  421. 0x25,0x7F, // Logical Maximum 7Fh (127d)
  422. 0x35,0x00, // Physical Minimum 0
  423. 0x46,0xFF,0x00, // Physical Maximum FFh (255d)
  424. 0x75,0x08, // Report Size 8
  425. 0x95,0x02, // Report Count 2
  426. 0x91,0x02, // Output (Variable)
  427. 0xC0 , // End Collection
  428. 0x05,0x0F, // Usage Page Physical Interface
  429. 0x09,0x77, // Usage Effect Operation Report
  430. 0xA1,0x02, // Collection Datalink
  431. 0x85,0x0A, // Report ID Ah (10d)
  432. 0x09,0x22, // Usage Effect Block Index
  433. 0x15,0x01, // Logical Minimum 1
  434. 0x25,0x28, // Logical Maximum 28h (40d)
  435. 0x35,0x01, // Physical Minimum 1
  436. 0x45,0x28, // Physical Maximum 28h (40d)
  437. 0x75,0x08, // Report Size 8
  438. 0x95,0x01, // Report Count 1
  439. 0x91,0x02, // Output (Variable)
  440. 0x09,0x78, // Usage Operation
  441. 0xA1,0x02, // Collection Datalink
  442. 0x09,0x79, // Usage Op Effect Start
  443. 0x09,0x7A, // Usage Op Effect Start Solo
  444. 0x09,0x7B, // Usage Op Effect Stop
  445. 0x15,0x01, // Logical Minimum 1
  446. 0x25,0x03, // Logical Maximum 3
  447. 0x75,0x08, // Report Size 8
  448. 0x95,0x01, // Report Count 1
  449. 0x91,0x00, // Output
  450. 0xC0 , // End Collection
  451. 0x09,0x7C, // Usage Loop Count
  452. 0x15,0x00, // Logical Minimum 0
  453. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  454. 0x35,0x00, // Physical Minimum 0
  455. 0x46,0xFF,0x00, // Physical Maximum FFh (255d)
  456. 0x91,0x02, // Output (Variable)
  457. 0xC0 , // End Collection
  458. 0x09,0x90, // Usage PID State Report
  459. 0xA1,0x02, // Collection Datalink
  460. 0x85,0x0B, // Report ID Bh (11d)
  461. 0x09,0x22, // Usage Effect Block Index
  462. 0x25,0x28, // Logical Maximum 28h (40d)
  463. 0x15,0x01, // Logical Minimum 1
  464. 0x35,0x01, // Physical Minimum 1
  465. 0x45,0x28, // Physical Maximum 28h (40d)
  466. 0x75,0x08, // Report Size 8
  467. 0x95,0x01, // Report Count 1
  468. 0x91,0x02, // Output (Variable)
  469. 0xC0 , // End Collection
  470. 0x09,0x96, // Usage DC Disable Actuators
  471. 0xA1,0x02, // Collection Datalink
  472. 0x85,0x0C, // Report ID Ch (12d)
  473. 0x09,0x97, // Usage DC Stop All Effects
  474. 0x09,0x98, // Usage DC Device Reset
  475. 0x09,0x99, // Usage DC Device Pause
  476. 0x09,0x9A, // Usage DC Device Continue
  477. 0x09,0x9B, // Usage PID Device State
  478. 0x09,0x9C, // Usage DS Actuators Enabled
  479. 0x15,0x01, // Logical Minimum 1
  480. 0x25,0x06, // Logical Maximum 6
  481. 0x75,0x08, // Report Size 8
  482. 0x95,0x01, // Report Count 1
  483. 0x91,0x00, // Output
  484. 0xC0 , // End Collection
  485. 0x09,0x7D, // Usage PID Pool Report
  486. 0xA1,0x02, // Collection Datalink
  487. 0x85,0x0D, // Report ID Dh (13d)
  488. 0x09,0x7E, // Usage RAM Pool Size
  489. 0x15,0x00, // Logical Minimum 0
  490. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  491. 0x35,0x00, // Physical Minimum 0
  492. 0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
  493. 0x75,0x08, // Report Size 8
  494. 0x95,0x01, // Report Count 1
  495. 0x91,0x02, // Output (Variable)
  496. 0xC0 , // End Collection
  497. 0x09,0x6B, // Usage Set Custom Force Report
  498. 0xA1,0x02, // Collection Datalink
  499. 0x85,0x0E, // Report ID Eh (14d)
  500. 0x09,0x22, // Usage Effect Block Index
  501. 0x15,0x01, // Logical Minimum 1
  502. 0x25,0x28, // Logical Maximum 28h (40d)
  503. 0x35,0x01, // Physical Minimum 1
  504. 0x45,0x28, // Physical Maximum 28h (40d)
  505. 0x75,0x08, // Report Size 8
  506. 0x95,0x01, // Report Count 1
  507. 0x91,0x02, // Output (Variable)
  508. 0x09,0x6D, // Usage Sample Count
  509. 0x15,0x00, // Logical Minimum 0
  510. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  511. 0x35,0x00, // Physical Minimum 0
  512. 0x46,0xFF,0x00, // Physical Maximum FFh (255d)
  513. 0x75,0x08, // Report Size 8
  514. 0x95,0x01, // Report Count 1
  515. 0x91,0x02, // Output (Variable)
  516. 0x09,0x51, // Usage Sample Period
  517. 0x66,0x03,0x10, // Unit 1003h (4099d)
  518. 0x55,0xFD, // Unit Exponent FDh (253d)
  519. 0x15,0x00, // Logical Minimum 0
  520. 0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
  521. 0x35,0x00, // Physical Minimum 0
  522. 0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
  523. 0x75,0x10, // Report Size 10h (16d)
  524. 0x95,0x01, // Report Count 1
  525. 0x91,0x02, // Output (Variable)
  526. 0x55,0x00, // Unit Exponent 0
  527. 0x66,0x00,0x00, // Unit 0
  528. 0xC0 , // End Collection
  529. 0x09,0xAB, // Usage Undefined << Create New Effect Report
  530. 0xA1,0x02, // Collection Datalink
  531. 0x85,0x09, // Report ID 9
  532. 0x09,0x25, // Usage Effect Type
  533. 0xA1,0x02, // Collection Datalink
  534. 0x09,0x26, // Usage ET Constant Force
  535. 0x09,0x27, // Usage ET Ramp
  536. 0x09,0x30, // Usage ET Square
  537. 0x09,0x31, // Usage ET Sine
  538. 0x09,0x32, // Usage ET Triangle
  539. 0x09,0x33, // Usage ET Sawtooth Up
  540. 0x09,0x34, // Usage ET Sawtooth Down
  541. 0x09,0x40, // Usage ET Spring
  542. 0x09,0x41, // Usage ET Damper
  543. 0x09,0x42, // Usage ET Inertia
  544. 0x09,0x43, // Usage ET Friction
  545. 0x09,0x28, // Usage ET Custom Force Data
  546. 0x25,0x0C, // Logical Maximum Ch (12d)
  547. 0x15,0x01, // Logical Minimum 1
  548. 0x35,0x01, // Physical Minimum 1
  549. 0x45,0x0C, // Physical Maximum Ch (12d)
  550. 0x75,0x08, // Report Size 8
  551. 0x95,0x01, // Report Count 1
  552. 0xB1,0x00, // Feature
  553. 0xC0 , // End Collection
  554. 0x05,0x01, // Usage Page Generic Desktop
  555. 0x09,0x3B, // Usage Byte Count
  556. 0x15,0x00, // Logical Minimum 0
  557. 0x26,0xFF,0x01, // Logical Maximum 1FFh (511d)
  558. 0x35,0x00, // Physical Minimum 0
  559. 0x46,0xFF,0x01, // Physical Maximum 1FFh (511d)
  560. 0x75,0x0A, // Report Size Ah (10d)
  561. 0x95,0x01, // Report Count 1
  562. 0xB1,0x02, // Feature (Variable)
  563. 0x75,0x06, // Report Size 6
  564. 0xB1,0x01, // Feature (Constant)
  565. 0xC0 , // End Collection
  566. 0x05,0x0F, // Usage Page Physical Interface
  567. 0x09,0x89, // Usage Block Load Status
  568. 0xA1,0x02, // Collection Datalink
  569. 0x85,0x02, // Report ID 2
  570. 0x09,0x22, // Usage Effect Block Index
  571. 0x25,0x28, // Logical Maximum 28h (40d)
  572. 0x15,0x01, // Logical Minimum 1
  573. 0x35,0x01, // Physical Minimum 1
  574. 0x45,0x28, // Physical Maximum 28h (40d)
  575. 0x75,0x08, // Report Size 8
  576. 0x95,0x01, // Report Count 1
  577. 0xB1,0x02, // Feature (Variable)
  578. 0x09,0x8B, // Usage Block Load Full
  579. 0xA1,0x02, // Collection Datalink
  580. 0x09,0x8C, // Usage Block Load Error
  581. 0x09,0x8D, // Usage Block Handle
  582. 0x09,0x8E, // Usage PID Block Free Report
  583. 0x25,0x03, // Logical Maximum 3
  584. 0x15,0x01, // Logical Minimum 1
  585. 0x35,0x01, // Physical Minimum 1
  586. 0x45,0x03, // Physical Maximum 3
  587. 0x75,0x08, // Report Size 8
  588. 0x95,0x01, // Report Count 1
  589. 0xB1,0x00, // Feature
  590. 0xC0 , // End Collection
  591. 0x09,0xAC, // Usage Undefined
  592. 0x15,0x00, // Logical Minimum 0
  593. 0x27,0xFF,0xFF,0x00,0x00, // Logical Maximum FFFFh (65535d)
  594. 0x35,0x00, // Physical Minimum 0
  595. 0x47,0xFF,0xFF,0x00,0x00, // Physical Maximum FFFFh (65535d)
  596. 0x75,0x10, // Report Size 10h (16d)
  597. 0x95,0x01, // Report Count 1
  598. 0xB1,0x00, // Feature
  599. 0xC0 , // End Collection
  600. 0x09,0x7F, // Usage ROM Pool Size
  601. 0xA1,0x02, // Collection Datalink
  602. 0x85,0x03, // Report ID 3
  603. 0x09,0x80, // Usage ROM Effect Block Count
  604. 0x75,0x10, // Report Size 10h (16d)
  605. 0x95,0x01, // Report Count 1
  606. 0x15,0x00, // Logical Minimum 0
  607. 0x35,0x00, // Physical Minimum 0
  608. 0x27,0xFF,0xFF,0x00,0x00, // Logical Maximum FFFFh (65535d)
  609. 0x47,0xFF,0xFF,0x00,0x00, // Physical Maximum FFFFh (65535d)
  610. 0xB1,0x02, // Feature (Variable)
  611. 0x09,0x83, // Usage PID Pool Move Report
  612. 0x26,0xFF,0x00, // Logical Maximum FFh (255d)
  613. 0x46,0xFF,0x00, // Physical Maximum FFh (255d)
  614. 0x75,0x08, // Report Size 8
  615. 0x95,0x01, // Report Count 1
  616. 0xB1,0x02, // Feature (Variable)
  617. 0x09,0xA9, // Usage Undefined
  618. 0x09,0xAA, // Usage Undefined
  619. 0x75,0x01, // Report Size 1
  620. 0x95,0x02, // Report Count 2
  621. 0x15,0x00, // Logical Minimum 0
  622. 0x25,0x01, // Logical Maximum 1
  623. 0x35,0x00, // Physical Minimum 0
  624. 0x45,0x01, // Physical Maximum 1
  625. 0xB1,0x02, // Feature (Variable)
  626. 0x75,0x06, // Report Size 6
  627. 0x95,0x01, // Report Count 1
  628. 0xB1,0x03, // Feature (Constant, Variable)
  629. 0xC0, // End Collection
  630. 0xC0, // End Collection
  631. };
  632. static const unsigned char gcKeyboardReport[] PROGMEM = {
  633. 0x05, 0x01, // Usage page : Generic Desktop
  634. 0x09, 0x06, // Usage (Keyboard)
  635. 0xA1, 0x01, // Collection (Application)
  636. 0x05, 0x07, // Usage Page (Key Codes)
  637. 0x95, 0x03, // Report Count(3)
  638. 0x75, 0x08, // Report Size(8)
  639. 0x15, 0x00, // Logical Minimum (0)
  640. 0x25, 0xE7, // Logical maximum (231)
  641. 0x19, 0x00, // Usage Minimum(0)
  642. 0x29, 0xE7, // Usage Maximum(231)
  643. 0x81, 0x00, // Input (Data, Array)
  644. 0xc0, // END_COLLECTION
  645. };