Skip to content

Instantly share code, notes, and snippets.

@tmk
Last active August 6, 2021 15:04
Show Gist options
  • Save tmk/51fa7f70e9131c7bca541d13957b438c to your computer and use it in GitHub Desktop.
Save tmk/51fa7f70e9131c7bca541d13957b438c to your computer and use it in GitHub Desktop.
Matrix Vita - 4d58:6500
//////////////////////////////////////////////////////////////////////
// USB_desc_dump
// Address: 01
// Lowspeed: 00
// Devicer dump:
12 01 10 02 00 00 00 40 58 4D 00 65 01 00 01 02
03 01
// Device:
bLength: 12
bDescriptorType: 01
bcdUSB: 0210
bDeviceClass: 00
bDeviceSubClass: 00
bDeviceProtocol: 00
bMaxPacketSize0: 40
idVendor: 4D58
idProduct: 6500
bcdDevice: 0001
iManufacturer: 01
iProduct: 02
iSerialNumber: 03
bNumConfigurations: 01
// String Zero: len: 04
// 04 03 09 04
// LangId: 0409
// iManufacturer: String1(0409): len: 16
// 16 03 4D 00 61 00 74 00 72 00 69 00 78 00 20 00
// 4C 00 61 00 62 00
// Matrix Lab
// iProduct: String2(0409): len: 18
// 18 03 4D 00 61 00 74 00 72 00 69 00 78 00 20 00
// 56 00 69 00 74 00 61 00
// Matrix Vita
// iSerialNumber: String3(0409): len: 1C
// 1C 03 76 00 69 00 61 00 6C 00 3A 00 66 00 36 00
// 34 00 63 00 32 00 62 00 33 00 63 00
// vial:f64c2b3c
// Config0 dump: len: 0052
09 02 52 00 03 01 00 A0 FA 09 04 00 00 01 03 01
01 00 09 21 11 01 00 01 22 3F 00 07 05 81 03 10
00 0A 09 04 01 00 01 03 00 00 00 09 21 11 01 00
01 22 85 00 07 05 82 03 10 00 0A 09 04 02 00 02
FF 00 00 00 07 05 03 02 40 00 00 07 05 83 02 40
00 00
// Config:
bLength: 09
bDescriptorType: 02
wTotalLength: 0052
bNumInterfaces: 03
bConfigurationValue: 01
iConfiguration: 00
bmAttributes: A0
bMaxPower: FA
// Interface0.0:
bLength: 09
bDescriptorType: 04
bInterfaceNumber: 00
bAlternateSetting: 00
bNumEndpoints: 01
bInterfaceClass: 03
bInterfaceSubClass: 01
bInterfaceProtocol: 01
iInterface: 00
// HID:
bLength: 09
bDescriptorType: 21
bcdHID: 0111
bCountryCode: 00
bNumDescriptors: 01
bDescrType: 22
wDescriptorLength: 003F
// Report0 dump: len: 003F
05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
95 08 75 01 81 02 95 01 75 08 81 01 05 07 19 00
29 FF 15 00 25 FF 95 06 75 08 81 00 05 08 19 01
29 05 95 05 75 01 91 02 95 01 75 03 91 01 C0
// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 81
bmAttributes: 03
wMaxPacketSize: 0010
bInterval: 0A
// Interface1.0:
bLength: 09
bDescriptorType: 04
bInterfaceNumber: 01
bAlternateSetting: 00
bNumEndpoints: 01
bInterfaceClass: 03
bInterfaceSubClass: 00
bInterfaceProtocol: 00
iInterface: 00
// HID:
bLength: 09
bDescriptorType: 21
bcdHID: 0111
bCountryCode: 00
bNumDescriptors: 01
bDescrType: 22
wDescriptorLength: 0085
// Report0 dump: len: 0085
05 01 09 02 A1 01 85 01 09 01 A1 00 05 09 19 01
29 05 15 00 25 01 95 05 75 01 81 02 95 01 75 03
81 01 05 01 09 30 09 31 15 81 25 7F 95 02 75 08
81 06 09 38 15 81 25 7F 95 01 75 08 81 06 05 0C
0A 38 02 15 81 25 7F 95 01 75 08 81 06 C0 C0 05
01 09 80 A1 01 85 02 16 01 00 26 37 00 1A 81 00
2A B7 00 95 01 75 10 81 00 C0 05 0C 09 01 A1 01
85 03 16 01 00 26 9C 02 1A 01 00 2A 9C 02 95 01
75 10 81 00 C0
// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 82
bmAttributes: 03
wMaxPacketSize: 0010
bInterval: 0A
// Interface2.0:
bLength: 09
bDescriptorType: 04
bInterfaceNumber: 02
bAlternateSetting: 00
bNumEndpoints: 02
bInterfaceClass: FF
bInterfaceSubClass: 00
bInterfaceProtocol: 00
iInterface: 00
// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 03
bmAttributes: 02
wMaxPacketSize: 0040
bInterval: 00
// Endpoint:
bLength: 07
bDescriptorType: 05
bEndpointAddress: 83
bmAttributes: 02
wMaxPacketSize: 0040
bInterval: 00
// Parse data here: http://eleccelerator.com/usbdescreqparser/
0x12, // bLength
0x01, // bDescriptorType (Device)
0x10, 0x02, // bcdUSB 2.10
0x00, // bDeviceClass (Use class information in the Interface Descriptors)
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
0x40, // bMaxPacketSize0 64
0x58, 0x4D, // idVendor 0x4D58
0x00, 0x65, // idProduct 0x6500
0x01, 0x00, // bcdDevice 0.01
0x01, // iManufacturer (String Index)
0x02, // iProduct (String Index)
0x03, // iSerialNumber (String Index)
0x01, // bNumConfigurations 1
0x09, // bLength
0x02, // bDescriptorType (Configuration)
0x52, 0x00, // wTotalLength 82
0x03, // bNumInterfaces 3
0x01, // bConfigurationValue
0x00, // iConfiguration (String Index)
0xA0, // bmAttributes Remote Wakeup
0xFA, // bMaxPower 500mA
0x09, // bLength
0x04, // bDescriptorType (Interface)
0x00, // bInterfaceNumber 0
0x00, // bAlternateSetting
0x01, // bNumEndpoints 1
0x03, // bInterfaceClass
0x01, // bInterfaceSubClass
0x01, // bInterfaceProtocol
0x00, // iInterface (String Index)
0x09, // bLength
0x21, // bDescriptorType (HID)
0x11, 0x01, // bcdHID 1.11
0x00, // bCountryCode
0x01, // bNumDescriptors
0x22, // bDescriptorType[0] (HID)
0x3F, 0x00, // wDescriptorLength[0] 63
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x06, // Usage (Keyboard)
0xA1, 0x01, // Collection (Application)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0xE0, // Usage Minimum (0xE0)
0x29, 0xE7, // Usage Maximum (0xE7)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x08, // Report Count (8)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x01, // Report Count (1)
0x75, 0x08, // Report Size (8)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x07, // Usage Page (Kbrd/Keypad)
0x19, 0x00, // Usage Minimum (0x00)
0x29, 0xFF, // Usage Maximum (0xFF)
0x15, 0x00, // Logical Minimum (0)
0x25, 0xFF, // Logical Maximum (-1)
0x95, 0x06, // Report Count (6)
0x75, 0x08, // Report Size (8)
0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x08, // Usage Page (LEDs)
0x19, 0x01, // Usage Minimum (Num Lock)
0x29, 0x05, // Usage Maximum (Kana)
0x95, 0x05, // Report Count (5)
0x75, 0x01, // Report Size (1)
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x95, 0x01, // Report Count (1)
0x75, 0x03, // Report Size (3)
0x91, 0x01, // Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0, // End Collection
// 63 bytes
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x81, // bEndpointAddress (IN/D2H)
0x03, // bmAttributes (Interrupt)
0x10, 0x00, // wMaxPacketSize 16
0x0A, // bInterval 10 (unit depends on device speed)
0x09, // bLength
0x04, // bDescriptorType (Interface)
0x01, // bInterfaceNumber 1
0x00, // bAlternateSetting
0x01, // bNumEndpoints 1
0x03, // bInterfaceClass
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0x00, // iInterface (String Index)
0x09, // bLength
0x21, // bDescriptorType (HID)
0x11, 0x01, // bcdHID 1.11
0x00, // bCountryCode
0x01, // bNumDescriptors
0x22, // bDescriptorType[0] (HID)
0x85, 0x00, // wDescriptorLength[0] 133
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x02, // Usage (Mouse)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // Report ID (1)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x05, // Usage Maximum (0x05)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x05, // Report Count (5)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x95, 0x01, // Report Count (1)
0x75, 0x03, // Report Size (3)
0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x95, 0x02, // Report Count (2)
0x75, 0x08, // Report Size (8)
0x81, 0x06, // Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x38, // Usage (Wheel)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x95, 0x01, // Report Count (1)
0x75, 0x08, // Report Size (8)
0x81, 0x06, // Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x0C, // Usage Page (Consumer)
0x0A, 0x38, 0x02, // Usage (AC Pan)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x95, 0x01, // Report Count (1)
0x75, 0x08, // Report Size (8)
0x81, 0x06, // Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x80, // Usage (Sys Control)
0xA1, 0x01, // Collection (Application)
0x85, 0x02, // Report ID (2)
0x16, 0x01, 0x00, // Logical Minimum (1)
0x26, 0x37, 0x00, // Logical Maximum (55)
0x1A, 0x81, 0x00, // Usage Minimum (Sys Power Down)
0x2A, 0xB7, 0x00, // Usage Maximum (Sys Display LCD Autoscale)
0x95, 0x01, // Report Count (1)
0x75, 0x10, // Report Size (16)
0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
0x05, 0x0C, // Usage Page (Consumer)
0x09, 0x01, // Usage (Consumer Control)
0xA1, 0x01, // Collection (Application)
0x85, 0x03, // Report ID (3)
0x16, 0x01, 0x00, // Logical Minimum (1)
0x26, 0x9C, 0x02, // Logical Maximum (668)
0x1A, 0x01, 0x00, // Usage Minimum (Consumer Control)
0x2A, 0x9C, 0x02, // Usage Maximum (AC Distribute Vertically)
0x95, 0x01, // Report Count (1)
0x75, 0x10, // Report Size (16)
0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
// 133 bytes
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x82, // bEndpointAddress (IN/D2H)
0x03, // bmAttributes (Interrupt)
0x10, 0x00, // wMaxPacketSize 16
0x0A, // bInterval 10 (unit depends on device speed)
0x09, // bLength
0x04, // bDescriptorType (Interface)
0x02, // bInterfaceNumber 2
0x00, // bAlternateSetting
0x02, // bNumEndpoints 2
0xFF, // bInterfaceClass
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0x00, // iInterface (String Index)
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x03, // bEndpointAddress (OUT/H2D)
0x02, // bmAttributes (Bulk)
0x40, 0x00, // wMaxPacketSize 64
0x00, // bInterval 0 (unit depends on device speed)
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x83, // bEndpointAddress (IN/D2H)
0x02, // bmAttributes (Bulk)
0x40, 0x00, // wMaxPacketSize 64
0x00, // bInterval 0 (unit depends on device speed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment