Code: Select all
const char gcn64_usbHidReportDescriptor[] PROGMEM = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x05, // USAGE (Gamepad)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Pointer)
0xa1, 0x00, // COLLECTION (Physical)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
0x09, 0x35, // USAGE (Rz)
0x09, 0x36, // USAGE (Slider)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x06, // REPORT_COUNT (6)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x10, // USAGE_MAXIMUM (Button 14)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x10, // REPORT_COUNT (16)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0
};
I want to add this ( below) to it.. Problem is "this" is some sort of a ForceFeedBack example and its a lot of code for such a simple thing. And for the life of my I dont know what I need to add, I hope not all of it. I tried a few logical approaches but my usb deceive is not happy with them. Can anyone understand this. All I want is a constant force, I think that vibration.
Code: Select all
0x05, 0x0F, /* USAGE_PAGE (Physical Interface) */
0x09, 0x21, /* USAGE (Set Effect Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x09, 0x22, /* USAGE (Effect Block Index) */
0x25, 0x7F, /* LOGICAL_MAXIMUM (127) */
0x75, 0x07, /* REPORT_SIZE (7) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x25, /* USAGE (Effect Type) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x09, 0x26, /* USAGE (ST Constant Force) */
0x15, 0x01, /* LOGICAL_MINIMUM (1 ) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x91, 0x00, /* OUTPUT (Data,Var,Abs) 0x02 ?????*/
0xC0, /* END_COLLECTION */
0x09, 0x50, /* USAGE (Duration) */
0x09, 0x54, /* USAGE (Trigger Repeat Interval) */
0x15, 0x00, /* LOGICAL_MINIMUM (0 ) */
0x26, 0x10, 0x27, /* LOGICAL_MAXIMUM (10000) */
0x46, 0x10, 0x27, /* PHYSICAL_MAXIMUM (10000)*/
0x75, 0x10, /* REPORT_SIZE (16) */
0x66, 0x03, 0x10, /*UNIT (Eng Lin:Time) */
0x55, 0x0D, /* UNIT_EXPONENT (-3) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x55, 0x0A, /* UNIT_EXPONENT (-6) */
0x09, 0x51, /* USAGE (Sample Period) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x45, 0x00, /* PHYSICAL_MAXIMUM (0) */
0x55, 0x00, /* UNIT_EXPONENT (0) */
0x65, 0x00, /* UNIT (None) */
0x09, 0x52, /* USAGE (Gain) */
0x09, 0x53, /* USAGE (Trigger Button) */
0x25, 0x7F, /* LOGICAL_MAXIMUM (127) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x55, /* USAGE (Axes Enable) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop)*/
0x09, 0x01, /* USAGE (Pointer) */
0xA1, 0x00, /* COLLECTION (Physical) */
0x09, 0x30, /* USAGE (X) */
0x09, 0x31, /* USAGE (Y) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /* REPORT_SIZE (1) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0xC0, /* END_COLLECTION */
0xC0, /* END_COLLECTION */
0x95, 0x06, /* REPORT_COUNT (6) 6-bit padding? */
0x91, 0x03, /* OUTPUT (Cnst,Var,Abs) */
0x05, 0x0F, /* USAGE_PAGE (Physical Interface) */
0x09, 0x57, /* USAGE (Direction) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop)*/
0x09, 0x01, /* USAGE (Pointer) */
0xA1, 0x00, /* COLLECTION (Physical) */
0x09, 0x30, /* USAGE (X) */
0x09, 0x31, /* USAGE (Y) */
0x15, 0x00, /* LOGICAL_MINIMUM (0 )*/
0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255)*/
0x46, 0x68, 0x01, /* PHYSICAL_MAXIMUM (360)*/
0x66, 0x14, 0x00, /*UNIT (Eng Rot:Angular Pos)*/
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x65, 0x00, /* UNIT (None) */
0x45, 0x00, /* PHYSICAL_MAXIMUM (0)*/
0xC0, /* END_COLLECTION */
0xC0, /* END_COLLECTION */
0x05, 0x0F, /* USAGE_PAGE (Physical Interface) */
0x09, 0x58, /* USAGE (Type Specific Block Offset) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x0B, 0x01, 0x00, 0x0A, 0x00,/* USAGE (Ordinals: Instance 1) */
0x0B, 0x02, 0x00, 0x0A, 0x00,/* USAGE (Ordinals: Instance 1) */
0x26, 0xFD, 0x7F, /* LOGICAL_MAXIMUM (32765)*/
0x75, 0x10, /* REPORT_SIZE (16) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0xC0, /* END_COLLECTION */
0xC0, /* END_COLLECTION */
0x09, 0x5A, /* USAGE (Set Envelop Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x85, 0x02, /* REPORT_ID (2) */
0x09, 0x23, /* USAGE (Parameter Block Offset) */
0x26, 0xFD, 0x7F, /* LOGICAL_MAXIMUM (32765)*/
0x75, 0x0F, /* REPORT_SIZE (15) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x5B, /* USAGE (Attack Level) */
0x09, 0x5D, /* USAGE (Fade Level) */
0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255)*/
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x02, /* REPORT_COUNT (2) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x5C, /* USAGE (Attack Time) */
0x09, 0x5E, /* USAGE (Fade Time) */
0x26, 0x10, 0x27, /* LOGICAL_MAXIMUM (10000)*/
0x46, 0x10, 0x27, /* PHYSICAL_MAXIMUM (10000)*/
0x66, 0x03, 0x10, /*UNIT (Eng Lin:Time)*/
0x55, 0x0D, /* UNIT_EXPONENT (-3) */
0x75, 0x10, /* REPORT_SIZE (16) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x45, 0x00 , /* PHYSICAL_MAXIMUM (0)*/
0x65, 0x00, /* UNIT (None) */
0x55, 0x00, /* UNIT_EXPONENT (0) */
0xC0, /* END_COLLECTION */
0x09, 0x5F, /* USAGE (Set Condition Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x85, 0x03, /* REPORT_ID (3) */
0x09, 0x23, /* USAGE (Parameter Block Offset) */
0x26, 0xFD, 0x7F, /* LOGICAL_MAXIMUM (32765)*/
0x75, 0x0F, /* REPORT_SIZE (15) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x60, /* USAGE (CP Offset) */
0x09, 0x61, /* USAGE (Positive Coefficient)*/
0x09, 0x62, /* USAGE (Negative Coefficient)*/
0x09, 0x63, /* USAGE (Positive Saturation)*/
0x09, 0x64, /* USAGE (Negative Saturation)*/
0x09, 0x65, /* USAGE (Dead Band) */
0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255)*/
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x06, /* REPORT_COUNT (6) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0xC0, /* END_COLLECTION */
0x09, 0x6E, /* USAGE (Set Periodic Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x85, 0x04, /* REPORT_ID (4) */
0x09, 0x23, /* USAGE (Parameter Block Offset) */
0x26, 0xFD, 0x7F, /* LOGICAL_MAXIMUM (32765)*/
0x75, 0x0F, /* REPORT_SIZE (15) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x70, /* USAGE (Magnitude) */
0x09, 0x6F, /* USAGE (Offset) */
0x09, 0x71, /* USAGE (Phase) */
0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255)*/
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x03, /* REPORT_COUNT (3) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x72, /* USAGE (Period) */
0x26, 0x10, 0x27, /* LOGICAL_MAXIMUM (10000)*/
0x46, 0x10, 0x27, /* PHYSICAL_MAXIMUM (10000)*/
0x66, 0x03, 0x10, /*UNIT (Eng Lin:Time)*/
0x55, 0x0D, /* UNIT_EXPONENT (-3) */
0x75, 0x10, /* REPORT_SIZE (16) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x45, 0x00 , /* PHYSICAL_MAXIMUM (0)*/
0x65, 0x00, /* UNIT (None) */
0x55, 0x00, /* UNIT_EXPONENT (0) */
0xC0, /* END_COLLECTION */
0x09, 0x73, /* USAGE (Set Constant Force Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x85, 0x05, /* REPORT_ID (5) */
0x09, 0x23, /* USAGE (Parameter Block Offset) */
0x26, 0xFD, 0x7F, /* LOGICAL_MAXIMUM (32765)*/
0x75, 0x0F, /* REPORT_SIZE (15) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x70, /* USAGE (Magnitude) */
0x26, 0xFF, 0x00, /* LOGICAL_MAXIMUM (255)*/
0x75, 0x08, /* REPORT_SIZE (8) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0xC0, /* END_COLLECTION */
0xC0, /* END_COLLECTION */
for example I tried this
Code: Select all
const char gcn64_usbHidReportDescriptor[] PROGMEM = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x05, // USAGE (Gamepad)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Pointer)
0xa1, 0x00, // COLLECTION (Physical)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
0x09, 0x35, // USAGE (Rz)
0x09, 0x36, // USAGE (Slider)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x06, // REPORT_COUNT (6)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x10, // USAGE_MAXIMUM (Button 14)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x10, // REPORT_COUNT (16)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0,
0x05, 0x0F, /* USAGE_PAGE (Physical Interface) */
0x09, 0x21, /* USAGE (Set Effect Report) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x09, 0x22, /* USAGE (Effect Block Index) */
0x25, 0x7F, /* LOGICAL_MAXIMUM (127) */
0x75, 0x07, /* REPORT_SIZE (7) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x24, /* USAGE (ROM Flag) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x09, 0x25, /* USAGE (Effect Type) */
0xA1, 0x02, /* COLLECTION (Logical) */
0x09, 0x26, /* USAGE (ST Constant Force) */
0x15, 0x01, /* LOGICAL_MINIMUM (1 ) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x91, 0x00, /* OUTPUT (Data,Var,Abs) 0x02 ?????*/
0xC0 /* END_COLLECTION */
};
Hmm, I was just thinking do I need to change my REPORT_SIZE ? currently #define GCN64_REPORT_SIZE 8
Anyone know if Grendel's 3dpro.htm code is available? I cant seem to find any way to contact him but the forums here. I tlooks like he added FFB in his project.
Grendel, any chance I can see a FFB example?