Skip to content

Commit f0c872f

Browse files
authored
Update ArduinoDS4_USBDesc.cpp
1 parent e01fe08 commit f0c872f

File tree

1 file changed

+34
-62
lines changed

1 file changed

+34
-62
lines changed

cores/arduino/ArduinoDS4/ArduinoDS4_USBDesc.cpp

Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ const DeviceDescriptor USB_DeviceDescriptor = {
3636
0x00, // bDeviceSubClass
3737
0x00, // bDeviceProtocol
3838
0x40, // bMaxPacketSize0
39-
0x1532, // idEVendor
40-
0x0401, // idProduct
41-
0x0100, // bcdDevice
42-
0x01, // iManufacturer
43-
0x02, // iProduct
44-
0x00, // iSerialNumber
39+
0x054C, // idVendor
40+
0x05C4, // idProduct
41+
0x0100, // bcdDevice
42+
0x01, // iManufacturer
43+
0x02, // iProduct
44+
0x00, // iSerialNumber
4545
0x01, // bNumConfigurations
4646
};
4747

@@ -75,12 +75,12 @@ const u8 USB_ConfigDescriptor[] = {
7575
0x00, // bCountryCode
7676
0x01, // bNumDescriptors
7777
0x22, // bDescriptorType
78-
0xE1, 0x01, // DescriptorLength
78+
0xD3, 0x01, // DescriptorLength
7979

8080
// Endpoint 1: Control Surface Send
8181
0x07, // bLength
8282
0x05, // bDescriptorType (ENDPOINT)
83-
0x81, // bEndpointAddress (IN, 1)
83+
0x84, // bEndpointAddress (IN, 1)
8484
0x03, // bmAttributes
8585
0x40, 0x00, // wMaxPacketSize
8686
0x05, // bInterval
@@ -100,7 +100,7 @@ const u8 STRING_SERIAL[] = "Arduino DS4 AVR";
100100
const u8 STRING_SECURITY[] = "PS4 protocol";
101101

102102
const u8 hidDescriptor[] = {
103-
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
103+
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
104104
0x09, 0x05, // Usage (Game Pad)
105105
0xA1, 0x01, // Collection (Application)
106106
0x85, 0x01, // Report ID (1)
@@ -113,7 +113,6 @@ const u8 hidDescriptor[] = {
113113
0x75, 0x08, // Report Size (8)
114114
0x95, 0x04, // Report Count (4)
115115
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
116-
117116
0x09, 0x39, // Usage (Hat switch)
118117
0x15, 0x00, // Logical Minimum (0)
119118
0x25, 0x07, // Logical Maximum (7)
@@ -123,7 +122,6 @@ const u8 hidDescriptor[] = {
123122
0x75, 0x04, // Report Size (4)
124123
0x95, 0x01, // Report Count (1)
125124
0x81, 0x42, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)
126-
127125
0x65, 0x00, // Unit (None)
128126
0x05, 0x09, // Usage Page (Button)
129127
0x19, 0x01, // Usage Minimum (0x01)
@@ -133,13 +131,13 @@ const u8 hidDescriptor[] = {
133131
0x75, 0x01, // Report Size (1)
134132
0x95, 0x0E, // Report Count (14)
135133
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
136-
137134
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
138135
0x09, 0x20, // Usage (0x20)
139136
0x75, 0x06, // Report Size (6)
140137
0x95, 0x01, // Report Count (1)
138+
0x15, 0x00, // Logical Minimum (0)
139+
0x25, 0x7F, // Logical Maximum (127)
141140
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
142-
143141
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
144142
0x09, 0x33, // Usage (Rx)
145143
0x09, 0x34, // Usage (Ry)
@@ -148,22 +146,18 @@ const u8 hidDescriptor[] = {
148146
0x75, 0x08, // Report Size (8)
149147
0x95, 0x02, // Report Count (2)
150148
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
151-
152149
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
153150
0x09, 0x21, // Usage (0x21)
154151
0x95, 0x36, // Report Count (54)
155152
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
156-
157153
0x85, 0x05, // Report ID (5)
158154
0x09, 0x22, // Usage (0x22)
159155
0x95, 0x1F, // Report Count (31)
160156
0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
161-
162-
0x85, 0x03, // Report ID (3)
163-
0x0A, 0x21, 0x27, // Usage (0x2721)
164-
0x95, 0x2F, // Report Count (47)
157+
0x85, 0x04, // Report ID (4)
158+
0x09, 0x23, // Usage (0x23)
159+
0x95, 0x24, // Report Count (36)
165160
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
166-
167161
0x85, 0x02, // Report ID (2)
168162
0x09, 0x24, // Usage (0x24)
169163
0x95, 0x24, // Report Count (36)
@@ -283,35 +277,47 @@ const u8 hidDescriptor[] = {
283277
0x09, 0x46, // Usage (0x46)
284278
0x95, 0x15, // Report Count (21)
285279
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
286-
0x85, 0xA7, // Report ID (247)
280+
0x85, 0xF0, // Report ID (240)
281+
0x09, 0x47, // Usage (0x47)
282+
0x95, 0x3F, // Report Count (63)
283+
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
284+
0x85, 0xF1, // Report ID (241)
285+
0x09, 0x48, // Usage (0x48)
286+
0x95, 0x3F, // Report Count (63)
287+
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
288+
0x85, 0xF2, // Report ID (242)
289+
0x09, 0x49, // Usage (0x49)
290+
0x95, 0x0F, // Report Count (15)
291+
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
292+
0x85, 0xA7, // Report ID (167)
287293
0x09, 0x4A, // Usage (0x4A)
288294
0x95, 0x01, // Report Count (1)
289295
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
290-
0x85, 0xA8, // Report ID (250)
296+
0x85, 0xA8, // Report ID (168)
291297
0x09, 0x4B, // Usage (0x4B)
292298
0x95, 0x01, // Report Count (1)
293299
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
294-
0x85, 0xA9, // Report ID (251)
300+
0x85, 0xA9, // Report ID (169)
295301
0x09, 0x4C, // Usage (0x4C)
296302
0x95, 0x08, // Report Count (8)
297303
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
298-
0x85, 0xAA, // Report ID (252)
304+
0x85, 0xAA, // Report ID (170)
299305
0x09, 0x4E, // Usage (0x4E)
300306
0x95, 0x01, // Report Count (1)
301307
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
302-
0x85, 0xAB, // Report ID (253)
308+
0x85, 0xAB, // Report ID (171)
303309
0x09, 0x4F, // Usage (0x4F)
304310
0x95, 0x39, // Report Count (57)
305311
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
306-
0x85, 0xAC, // Report ID (254)
312+
0x85, 0xAC, // Report ID (172)
307313
0x09, 0x50, // Usage (0x50)
308314
0x95, 0x39, // Report Count (57)
309315
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
310-
0x85, 0xAD, // Report ID (255)
316+
0x85, 0xAD, // Report ID (173)
311317
0x09, 0x51, // Usage (0x51)
312318
0x95, 0x0B, // Report Count (11)
313319
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
314-
0x85, 0xAE, // Report ID (256)
320+
0x85, 0xAE, // Report ID (174)
315321
0x09, 0x52, // Usage (0x52)
316322
0x95, 0x01, // Report Count (1)
317323
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
@@ -324,44 +330,10 @@ const u8 hidDescriptor[] = {
324330
0x95, 0x3F, // Report Count (63)
325331
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
326332
0xC0, // End Collection
327-
328-
0x06, 0xF0, 0xFF, // Usage Page (Vendor Defined 0xFFF0)
329-
0x09, 0x40, // Usage (0x40)
330-
0xA1, 0x01, // Collection (Application)
331-
0x85, 0xF0, // Report ID (-16) AUTH F0
332-
0x09, 0x47, // Usage (0x47)
333-
0x95, 0x3F, // Report Count (63)
334-
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
335-
0x85, 0xF1, // Report ID (-15) AUTH F1
336-
0x09, 0x48, // Usage (0x48)
337-
0x95, 0x3F, // Report Count (63)
338-
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
339-
0x85, 0xF2, // Report ID (-14) AUTH F2
340-
0x09, 0x49, // Usage (0x49)
341-
0x95, 0x0F, // Report Count (15)
342-
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
343-
0x85, 0xF3, // Report ID (-13) Auth F3 (Reset)
344-
0x0A, 0x01, 0x47, // Usage (0x4701)
345-
0x95, 0x07, // Report Count (7)
346-
0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
347-
0xC0, // End Collection
348333
};
349334

350335
const u16 hidDescriptorSize = sizeof(hidDescriptor);
351336

352-
const u8 hidClassDescriptor[] = {
353-
0x09, // bLength
354-
0x21, // bDescriptorType (HID)
355-
0x11, 0x01, // bcdHID = 1.11
356-
0x00, // bCountryCode
357-
0x01, // bNumDescriptors
358-
0x22, // bDescriptorType[0] = Report
359-
(uint8_t)(hidDescriptorSize & 0xFF), // wDescriptorLength (LSB)
360-
(uint8_t)((hidDescriptorSize >> 8) & 0xFF) // wDescriptorLength (MSB)
361-
};
362-
363-
const u16 hidClassDescriptorSize = sizeof(hidClassDescriptor);
364-
365337
const u8 output_0x02[] = {
366338
0xfe, 0xff, 0x0e, 0x00, 0x04, 0x00, 0xd4, 0x22,
367339
0x2a, 0xdd, 0xbb, 0x22, 0x5e, 0xdd, 0x81, 0x22,

0 commit comments

Comments
 (0)