comparison Output/pjrcUSB/arm/usb_desc.c @ 376:47f89f1bfdb7

Prep for mouse support
author Jacob Alexander <haata@kiibohd.com>
date Sun, 20 Sep 2015 18:47:10 -0700
parents 06a54d582bf8
children fc2c2a1e9615
comparison
equal deleted inserted replaced
375:3e5a95c196f8 376:47f89f1bfdb7
265 0xc0, // End Collection - Keyboard 265 0xc0, // End Collection - Keyboard
266 }; 266 };
267 267
268 // System Control and Consumer Control 268 // System Control and Consumer Control
269 static uint8_t sys_ctrl_report_desc[] = { 269 static uint8_t sys_ctrl_report_desc[] = {
270 // System Control Collection 270 // System Control Collection (8 bits)
271 // 271 //
272 // NOTES: 272 // NOTES:
273 // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa 273 // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa
274 // Using a 1KRO scheme 274 // Using a 1KRO scheme
275 0x05, 0x01, // Usage Page (Generic Desktop), 275 0x05, 0x01, // Usage Page (Generic Desktop),
283 0x19, 0x81, // Usage Minimum (129), 283 0x19, 0x81, // Usage Minimum (129),
284 0x29, 0xB7, // Usage Maximum (183), 284 0x29, 0xB7, // Usage Maximum (183),
285 0x81, 0x00, // Input (Data, Array), 285 0x81, 0x00, // Input (Data, Array),
286 0xc0, // End Collection - System Control 286 0xc0, // End Collection - System Control
287 287
288 // Consumer Control Collection - Media Keys 288 // Consumer Control Collection - Media Keys (16 bits)
289 // 289 //
290 // NOTES: 290 // NOTES:
291 // Not bothering with NKRO for this table. If there's a need, I can implement it. -HaaTa 291 // Not bothering with NKRO for this table. If there's a need, I can implement it. -HaaTa
292 // Using a 1KRO scheme 292 // Using a 1KRO scheme
293 0x05, 0x0c, // Usage Page (Consumer), 293 0x05, 0x0c, // Usage Page (Consumer),
305 0xc0, // End Collection - Consumer Control 305 0xc0, // End Collection - Consumer Control
306 }; 306 };
307 307
308 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension 308 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
309 static uint8_t mouse_report_desc[] = { 309 static uint8_t mouse_report_desc[] = {
310 0x05, 0x01, // Usage Page (Generic Desktop) 310 0x05, 0x01, // Usage Page (Generic Desktop)
311 0x09, 0x02, // Usage (Mouse) 311 0x09, 0x02, // Usage (Mouse)
312 0xA1, 0x01, // Collection (Application) 312 0xa1, 0x01, // Collection (Application)
313 0x05, 0x09, // Usage Page (Button) 313 0x09, 0x02, // Usage (Mouse)
314 0x19, 0x01, // Usage Minimum (Button #1) 314 0xa1, 0x02, // Collection (Logical)
315 0x29, 0x03, // Usage Maximum (Button #3) 315 0x09, 0x01, // Usage (Pointer)
316 0x15, 0x00, // Logical Minimum (0) 316
317 0x25, 0x01, // Logical Maximum (1) 317 // Buttons (5 bits)
318 0x95, 0x03, // Report Count (3) 318 0xa1, 0x00, // Collection (Physical) - Buttons
319 0x75, 0x01, // Report Size (1) 319 0x05, 0x09, // Usage Page (Button)
320 0x81, 0x02, // Input (Data, Variable, Absolute) 320 0x19, 0x01, // Usage Minimum (Button 1)
321 0x95, 0x01, // Report Count (1) 321 0x29, 0x05, // Usage Maximum (Button 5)
322 0x75, 0x05, // Report Size (5) 322 0x15, 0x00, // Logical Minimum (0)
323 0x81, 0x03, // Input (Constant) 323 0x25, 0x01, // Logical Maximum (1)
324 0x05, 0x01, // Usage Page (Generic Desktop) 324 0x75, 0x01, // Report Size (1)
325 0x09, 0x30, // Usage (X) 325 0x95, 0x05, // Report Count (5)
326 0x09, 0x31, // Usage (Y) 326 0x81, 0x02, // Input (Data,Var,Abs)
327 0x15, 0x00, // Logical Minimum (0) 327
328 0x26, 0xFF, 0x7F, // Logical Maximum (32767) 328 // Padding (3 bits)
329 0x75, 0x10, // Report Size (16), 329 0x75, 0x03, // Report Size (3)
330 0x95, 0x02, // Report Count (2), 330 0x95, 0x01, // Report Count (1)
331 0x81, 0x02, // Input (Data, Variable, Absolute) 331 0x81, 0x03, // Input (Cnst,Var,Abs)
332 0x09, 0x38, // Usage (Wheel) 332
333 0x15, 0x81, // Logical Minimum (-127) 333 // Pointer (16 bits)
334 0x25, 0x7F, // Logical Maximum (127) 334 0x05, 0x01, // Usage PAGE (Generic Desktop)
335 0x75, 0x08, // Report Size (8), 335 0x09, 0x30, // Usage (X)
336 0x95, 0x01, // Report Count (1), 336 0x09, 0x31, // Usage (Y)
337 0x81, 0x06, // Input (Data, Variable, Relative) 337 0x15, 0x81, // Logical Minimum (-127)
338 0xC0 // End Collection 338 0x25, 0x7f, // Logical Maximum (127)
339 0x75, 0x08, // Report Size (8)
340 0x95, 0x02, // Report Count (2)
341 0x81, 0x06, // Input (Data,Var,Rel)
342
343 // Vertical Wheel
344 // - Multiplier (2 bits)
345 0xa1, 0x02, // Collection (Logical)
346 0x09, 0x48, // Usage (Resolution Multiplier)
347 0x15, 0x00, // Logical Minimum (0)
348 0x25, 0x01, // Logical Maximum (1)
349 0x35, 0x01, // Physical Minimum (1)
350 0x45, 0x04, // Physical Maximum (4)
351 0x75, 0x02, // Report Size (2)
352 0x95, 0x01, // Report Count (1)
353 0xa4, // Push
354 0xb1, 0x02, // Feature (Data,Var,Abs)
355 // - Device (8 bits)
356 0x09, 0x38, // Usage (Wheel)
357 0x15, 0x81, // Logical Minimum (-127)
358 0x25, 0x7f, // Logical Maximum (127)
359 0x35, 0x00, // Physical Minimum (0) - reset physical
360 0x45, 0x00, // Physical Maximum (0)
361 0x75, 0x08, // Report Size (8)
362 0x81, 0x06, // Input (Data,Var,Rel)
363 0xc0, // End Collection - Vertical Wheel
364
365 // Horizontal Wheel
366 // - Multiplier (2 bits)
367 0xa1, 0x02, // Collection (Logical)
368 0x09, 0x48, // Usage (Resolution Multiplier)
369 0xb4, // Pop
370 0xb1, 0x02, // Feature (Data,Var,Abs)
371 // - Padding (4 bits)
372 0x35, 0x00, // Physical Minimum (0) - reset physical
373 0x45, 0x00, // Physical Maximum (0)
374 0x75, 0x04, // Report Size (4)
375 0xb1, 0x03, // Feature (Cnst,Var,Abs)
376 // - Device (8 bits)
377 0x05, 0x0c, // Usage Page (Consumer Devices)
378 0x0a, 0x38, 0x02, // Usage (AC Pan)
379 0x15, 0x81, // Logical Minimum (-127)
380 0x25, 0x7f, // Logical Maximum (127)
381 0x75, 0x08, // Report Size (8)
382 0x81, 0x06, // Input (Data,Var,Rel)
383 0xc0, // End Collection - Horizontal Wheel
384
385 0xc0, // End Collection - Buttons
386 0xc0, // End Collection - Mouse Logical
387 0xc0 // End Collection - Mouse Application
339 }; 388 };
340 389
341 // Joystick Protocol, HID 1.11 spec, Apendix D, page 64-65 390 // Joystick Protocol, HID 1.11 spec, Apendix D, page 64-65
342 static uint8_t joystick_report_desc[] = { 391 static uint8_t joystick_report_desc[] = {
343 0x05, 0x01, // Usage Page (Generic Desktop) 392 0x05, 0x01, // Usage Page (Generic Desktop)