X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Output%2FpjrcUSB%2Farm%2Fusb_desc.c;h=02ffd5da224bdea56379570425a38a5b5ee18b77;hb=3c9a97d51a2f3b94168e46ff1524ceec63703eff;hp=9616d459f295a4724ef1777234ca96b854896b81;hpb=20b62afb9a05a64b1f15c6329866600913775eea;p=kiibohd-controller.git diff --git a/Output/pjrcUSB/arm/usb_desc.c b/Output/pjrcUSB/arm/usb_desc.c index 9616d45..02ffd5d 100644 --- a/Output/pjrcUSB/arm/usb_desc.c +++ b/Output/pjrcUSB/arm/usb_desc.c @@ -1,7 +1,7 @@ /* Teensyduino Core Library * http://www.pjrc.com/teensy/ * Copyright (c) 2013 PJRC.COM, LLC. - * Modified by Jacob Alexander (2013-2015) + * Modified by Jacob Alexander (2013-2016) * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -97,7 +97,7 @@ static uint8_t usb_debug_descriptor[] = { -// ----- USB HID Report Descriptsors ----- +// ----- USB HID Report Descriptors ----- // Each HID interface needs a special report descriptor that tells // the meaning and format of the data. @@ -267,7 +267,7 @@ static uint8_t nkro_keyboard_report_desc[] = { // System Control and Consumer Control static uint8_t sys_ctrl_report_desc[] = { - // System Control Collection + // System Control Collection (8 bits) // // NOTES: // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa @@ -285,7 +285,7 @@ static uint8_t sys_ctrl_report_desc[] = { 0x81, 0x00, // Input (Data, Array), 0xc0, // End Collection - System Control - // Consumer Control Collection - Media Keys + // Consumer Control Collection - Media Keys (16 bits) // // NOTES: // Not bothering with NKRO for this table. If there's a need, I can implement it. -HaaTa @@ -297,45 +297,89 @@ static uint8_t sys_ctrl_report_desc[] = { 0x75, 0x10, // Report Size (16), 0x95, 0x01, // Report Count (1), 0x16, 0x01, 0x00, // Logical Minimum (1), - 0x26, 0x9C, 0x02, // Logical Maximum (668), + 0x26, 0x9D, 0x02, // Logical Maximum (669), 0x05, 0x0C, // Usage Page (Consumer), 0x19, 0x01, // Usage Minimum (1), - 0x2A, 0x9C, 0x02, // Usage Maximum (668), + 0x2A, 0x9D, 0x02, // Usage Maximum (669), 0x81, 0x00, // Input (Data, Array), 0xc0, // End Collection - Consumer Control }; // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension static uint8_t mouse_report_desc[] = { - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x02, // Usage (Mouse) - 0xA1, 0x01, // Collection (Application) - 0x05, 0x09, // Usage Page (Button) - 0x19, 0x01, // Usage Minimum (Button #1) - 0x29, 0x03, // Usage Maximum (Button #3) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x03, // Report Count (3) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0x95, 0x01, // Report Count (1) - 0x75, 0x05, // Report Size (5) - 0x81, 0x03, // Input (Constant) - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x30, // Usage (X) - 0x09, 0x31, // Usage (Y) - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x7F, // Logical Maximum (32767) - 0x75, 0x10, // Report Size (16), - 0x95, 0x02, // Report Count (2), - 0x81, 0x02, // Input (Data, Variable, Absolute) - 0x09, 0x38, // Usage (Wheel) - 0x15, 0x81, // Logical Minimum (-127) - 0x25, 0x7F, // Logical Maximum (127) - 0x75, 0x08, // Report Size (8), - 0x95, 0x01, // Report Count (1), - 0x81, 0x06, // Input (Data, Variable, Relative) - 0xC0 // End Collection + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x02, // Usage (Mouse) + 0xa1, 0x01, // Collection (Application) + 0x09, 0x02, // Usage (Mouse) + 0xa1, 0x02, // Collection (Logical) + 0x09, 0x01, // Usage (Pointer) + + // Buttons (8 bits) + 0xa1, 0x00, // Collection (Physical) - Buttons + 0x05, 0x09, // Usage Page (Button) + 0x19, 0x01, // Usage Minimum (Button 1) + 0x29, 0x08, // Usage Maximum (Button 8) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x75, 0x01, // Report Size (1) + 0x95, 0x08, // Report Count (8) + 0x81, 0x02, // Input (Data,Var,Abs) + + // Pointer (16 bits) + 0x05, 0x01, // Usage PAGE (Generic Desktop) + 0x09, 0x30, // Usage (X) + 0x09, 0x31, // Usage (Y) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7f, // Logical Maximum (127) + 0x75, 0x08, // Report Size (8) + 0x95, 0x02, // Report Count (2) + 0x81, 0x06, // Input (Data,Var,Rel) + + // Vertical Wheel + // - Multiplier (2 bits) + 0xa1, 0x02, // Collection (Logical) + 0x09, 0x48, // Usage (Resolution Multiplier) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x35, 0x01, // Physical Minimum (1) + 0x45, 0x04, // Physical Maximum (4) + 0x75, 0x02, // Report Size (2) + 0x95, 0x01, // Report Count (1) + 0xa4, // Push + 0xb1, 0x02, // Feature (Data,Var,Abs) + // - Device (8 bits) + 0x09, 0x38, // Usage (Wheel) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7f, // Logical Maximum (127) + 0x35, 0x00, // Physical Minimum (0) - reset physical + 0x45, 0x00, // Physical Maximum (0) + 0x75, 0x08, // Report Size (8) + 0x81, 0x06, // Input (Data,Var,Rel) + 0xc0, // End Collection - Vertical Wheel + + // Horizontal Wheel + // - Multiplier (2 bits) + 0xa1, 0x02, // Collection (Logical) + 0x09, 0x48, // Usage (Resolution Multiplier) + 0xb4, // Pop + 0xb1, 0x02, // Feature (Data,Var,Abs) + // - Padding (4 bits) + 0x35, 0x00, // Physical Minimum (0) - reset physical + 0x45, 0x00, // Physical Maximum (0) + 0x75, 0x04, // Report Size (4) + 0xb1, 0x03, // Feature (Cnst,Var,Abs) + // - Device (8 bits) + 0x05, 0x0c, // Usage Page (Consumer Devices) + 0x0a, 0x38, 0x02, // Usage (AC Pan) + 0x15, 0x81, // Logical Minimum (-127) + 0x25, 0x7f, // Logical Maximum (127) + 0x75, 0x08, // Report Size (8) + 0x81, 0x06, // Input (Data,Var,Rel) + 0xc0, // End Collection - Horizontal Wheel + + 0xc0, // End Collection - Buttons + 0xc0, // End Collection - Mouse Logical + 0xc0 // End Collection - Mouse Application }; // Joystick Protocol, HID 1.11 spec, Apendix D, page 64-65 @@ -402,7 +446,7 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = { 1, // bConfigurationValue 0, // iConfiguration 0xA0, // bmAttributes - 250, // bMaxPower + 250, // bMaxPower - Entry Index 8 // --- Keyboard HID --- Boot Mode Keyboard Interface // - 9 bytes - @@ -646,6 +690,8 @@ static uint8_t config_descriptor[CONFIG_DESC_SIZE] = { SYS_CTRL_INTERVAL, // bInterval }; +uint8_t *usb_bMaxPower = &config_descriptor[8]; + // ----- String Descriptors -----