HID & Force Feedback
HID & Force Feedback
It is possible to create a force feedback device using V-Usb? All HID-Report-Descriptors I found for FF are rather ..insane .. and didn't work. What is the simplest way of showing Windows a FF device? (Rumble on/off is enough)
Re: HID & Force Feedback
Yes, I have just about got it working, but there are a few unanswered questions. Two ways to do it..
1) a driver: If your up for that let me know how it goes...
2) the Hid defined physical layer: Been working on this for a year on and off and finally got the descriptor finished. There are a few issues to get around one being a bug in the V-usb code. See this post. ( I'm shocked Christian has not replied )
viewtopic.php?f=8&t=4042
Currently I'm stuck here.
viewtopic.php?f=8&t=4231
but I ran in to one other issue with the Fedit tool. Let me know how much effort you'd like to put in to this, love to have a second par of eyes on this.
1) a driver: If your up for that let me know how it goes...
2) the Hid defined physical layer: Been working on this for a year on and off and finally got the descriptor finished. There are a few issues to get around one being a bug in the V-usb code. See this post. ( I'm shocked Christian has not replied )
viewtopic.php?f=8&t=4042
Currently I'm stuck here.
viewtopic.php?f=8&t=4231
but I ran in to one other issue with the Fedit tool. Let me know how much effort you'd like to put in to this, love to have a second par of eyes on this.
Re: HID & Force Feedback
Well..
1.) A driver is something I would rather like to avoid, ... would be better if it would work out of the box
2.) Force feedback: Looks like there is no easy way to implement it. Would be the best supported way though, but a 1200 byte hid report descriptor isn't exactly what I had in mind. Isn't there a simple way to realize a boolean force-feedback?
Currently I managed to "solve" my problem by using a simple Output 1-Byte report. Its not detected natively by windows though, but a small app can set the rumble state without a problem.
Small tool to toggle the value (C#, using some USB Lib I found somewhere):
Even though this works fine, I would rather like to add real force-feedback support as so more games would be supported - But unless one knows the minimal descriptor required for this to work (and don't tell me you need all those 200 effect types and ,....?), I guess there is "no way" to do this
1.) A driver is something I would rather like to avoid, ... would be better if it would work out of the box
2.) Force feedback: Looks like there is no easy way to implement it. Would be the best supported way though, but a 1200 byte hid report descriptor isn't exactly what I had in mind. Isn't there a simple way to realize a boolean force-feedback?
Currently I managed to "solve" my problem by using a simple Output 1-Byte report. Its not detected natively by windows though, but a small app can set the rumble state without a problem.
Code: Select all
0xa1, 0x00, // COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (LEDs)
0x09, 0x0F, // USAGE (Generic Indicator)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x01, // REPORT_COUNT (1)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x92, 0x02, 0x01, // OUTPUT (Data,Var,Abs,Buf)
0xc0, // END_COLLECTION
Code: Select all
in usbFunctionSetup():
else if (rq->bRequest == USBRQ_HID_SET_REPORT)
{
_awaitReport = 1;
return USB_NO_MSG;
}
Code: Select all
uchar usbFunctionWrite(uchar *data, uchar len)
{
if (!_awaitReport || len < 1)
return 1;
curGamepad->rumble(data[len-1]);
_awaitReport = 0;
return 1;
}
Small tool to toggle the value (C#, using some USB Lib I found somewhere):
Code: Select all
public static bool SetRumble(bool on)
{
return _usb.write(new[] {on ? (byte) 0xFF : (byte) 0x00});
}
Even though this works fine, I would rather like to add real force-feedback support as so more games would be supported - But unless one knows the minimal descriptor required for this to work (and don't tell me you need all those 200 effect types and ,....?), I guess there is "no way" to do this
Re: HID & Force Feedback
completely agree1.) A driver is something I would rather like to avoid, ... would be better if it would work out of the box
Well maybe you can help me with the out put from host functions.. But if you want the HID FFB to work you better get typing because you have a long way to go.
I'd first off get fedit. Its a tool written for DirectX and it will tell you when you have a FFB device. It allows you to send FFB code and what not.
If you look at the USB docs for the physical layer you will see a lot more is needed to get FFB working, even just the rumble part of it. I'm only interested in rumble as well ( AKA constant force ). To do this you need at a minimum this.
Code: Select all
/// force feed back...
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x21, // USAGE (Set Effect Report)
0xA1, 0x02, // COLLECTION (effect)
0x09,0x22, // USAGE (Effect Block Index)
0x25,0x7F, // Logical Maximum 127
0x75,0x07, // Report Size 7 (( should be a 7 ))?
0x95,0x01, // Report Count 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09,0x24,// USAGE (ROM Flag)
0x25,0x01,// LOGICAL_MAXIMUM
0x75,0x01,// Report Size 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09, 0x25, /* USAGE (Effect Type) */
0xA1, 0x02, /* COLLECTION (Logical2) */
0x09,0x26, // Usage ET Constant Force
0x15,0x01, // Logical Minimum 1
0x25,0x01, // Logical Maximum 1
0x75,0x08, // Report Size 8
0x91,0x00, // Output
0xC0, // END_COLLECTION (Logical2)
//other needed info
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) 91 02
0x45,0x00, // Physical Maximum 0
0x55,0x00, // Unit Exponent 0
0x65,0x00, // Unit 0
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 (Variable)
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 (Variable)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection(Logical)
0x95,0x06, // 6-bit pad 95 06
0x91,0x03, // OUTPUT (Cnst,Var,Abs)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09,0x57, // USAGE (Direction))
0xA1,0x02, // Collection logical 3
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 (Variable)
0x65,0x00, // Unit 0
0x45,0x00, // PHYSICAL_MAXIMUM (0)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection (logical 3)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x58, // USAGE (Type Specific Block Offset)
0xA1,0x02, // Collection 1
0x0B, 0x01, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 1)
0x0B, 0x02, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 2)
0x26,0xFD, 0x7F, //Logical Maximum LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max.
0x75,0x10, // Report Size 8
0x95,0x02, // Report Count 2
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection 1
0xc0, // END_COLLECTION effect
//and a few more settings out side of effect
0x09,0x5A, // Usage Set Envelope Report
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x5B, // Usage Attack Level
0x09,0x5D, // Usage Fade Level
0x26,0xFF,0x00, // Logical Maximum FFh (255d)
0x75,0x08, // Report size 8
0x95,0x02, // Report Count 2
0x91,0x02, // Output (Variable)
0x09,0x5C, // Usage Attack Time
0x09,0x5E, // Usage Fade Time
0x26,0x10,0x27, // Logical Maximum 7FFFh (32767d)
0x46,0x10,0x27, // Physical Maximum 7FFFh (32767d)
0x66,0x03,0x10, // Unit 1003h (4099d)
0x55,0x0D, // Unit Exponent FDh (253d)
0x75,0x10, // Report Size 10h (16d)
0x91,0x02, // Output (Variable)
0x45,0x00, // Physical Maximum 0
0x65,0x00, // Unit 0
0x55,0x00, // Unit Exponent 0
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Condition Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
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 (Variable)
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Periodic Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // (Parameter Block Offset)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x70, // USAGE (Magnitude)
0x09,0x6F, // USAGE 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 (Variable)
0x09,0x72, // USAGE (Phase)
0x26,0x10, 0x27, // LOGICAL_MAXIMUM
0x46,0x10, 0x27, // PHYSICAL_MAXIMUM
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 (Variable)
0x45,0x00, // PHYSICAL_MAXIMUM
0x65,0x00, // UNIT (None)
0x55,0x00, // UNIT_EXPONENT (0)
0xC0 , // End Collection
0x09,0x73, // Usage Set Constant Force Rep...
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block Index
0x26,0xFD, 0x7F, // Logical Maximum 32765)
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size
0x91,0x02, // Output (Variable)
0x09,0x70, // Usage magnitude
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // Report Size
0x91,0x02, // Output (Variable)
0xC0 , // End Collection (Datalink)
0x09,0x77, // USAGE (Effect Operation Report)
0xA1,0x02, // Collection Datalink
0x09,0x22, // Usage Effect Block Index
0x25,0x7f, // Logical Maximum 127)
0x75,0x07, // Report Size 7
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size 1
0x91,0x02, // Output (Variable)
0x09,0x78, // USAGE (Effect Operation)
0xA1,0x02, // Collection Datalink
0x09,0x79, // USAGE (Op Effect Start)
0x09,0x7A, // USAGE (Op Effect Start SOLO)
0x09,0x7B, // USAGE (Op Effect STOP)
0x15,0x01, // LOGICAL_MINIMUM 1
0x25,0x03, // LOGICAL_MAXIMUM 3
0x75,0x08, // Report Size
0x91,0x00, // OUTPUT (Data,Ary,Abs) 91 00
0xC0 , // End Collection (Datalink)
0x09,0x7C, // USAGE (Loop Count)
0x15,0x00, // LOGICAL_MINIMUM 1
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM 3
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x7F, // USAGE (PID Pool Report)
0xA1,0x02, // Collection Datalink
0x09,0x80, // USAGE (RAM Pool Size)
0x09,0x81, // USAGE (RoM Pool Size)
0x09,0x82, // USAGE (ROM Effect Block Count)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765)
0x95,0x03, // REPORT_COUNT (3)
0x75,0x10, // REPORT_SIZE (16)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0x09, 0xA8, //USAGE (Parameter Block Size)
0xA1,0x02, // Collection Datalink
0x09,0x73, // USAGE (Set Constant Force Report)
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // REPORT_SIZE (8)
0x95,0x01, // REPORT_COUNT (1)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x07,//REPORT_SIZE (7)
0x95, 0x01,//REPORT_COUNT (1)
0xB1, 0x03,//FEATURE (Cnst,Var,Abs) ; 7-bit pad
0x09, 0x67,//USAGE (Isoch Custom Force Enable)
0x75, 0x01,//REPORT_SIZE (1)
0xB1, 0x02,//FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x92, // USAGE (PID State Report)
0xA1,0x02, // Collection Datalink
0x09, 0x22, // USAGE (Effect Block Index)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x07, // Report Size 7
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x24,//USAGE (ROM Flag)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x01,//REPORT_COUNT (1)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x09, 0x94, // USAGE (Effect Playing)
0x09, 0xA0, // USAGE (Actuators Enabled)
0x09, 0xA4, // USAGE (Safety Switch)
0x09, 0xA6, // USAGE (Actuator Power)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x04,//REPORT_COUNT (4)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x81, 0x03,// INPUT (Cnst,Var,Abs) ; 4-bit pad
0xC0 , // End Collection (Datalink)
0x09,0x95, // USAGE (PID Device Control Report)
0xA1,0x02, // Collection Datalink
0x09,0x96, // USAGE (PID Device Control)
0xA1,0x02, // Collection Datalink
0x09,0x97, // USAGE (DC Enable Actuators)
0x09,0x98, // USAGE (DC Disable Actuators)
0x09,0x99, // USAGE (DC Stop All Effects)
0x09,0x9A, // USAGE (DC Reset)
0x09,0x9B, // USAGE (DC Pause)
0x09,0x9C, // USAGE (DC Continue)
0x15,0x01, // Logical Maximum 1)
0x25,0x06, // Logical Maximum 6)
0x95,0x08, // Report Count 8 ( wrong in usb pdf )
0x75,0x01, // Report Size 1 ( wrong in usb pdf )
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0xC0 , // End Collection (Datalink)
0x09,0x85, // USAGE (PID Pool Move Report)
0xA1,0x02, // Collection Datalink
0x09,0x86, // USAGE (Move Source)
0x09,0x87, // USAGE (Move Destination)
0x09,0x88, // USAGE (Move Length)
0x26,0xFF, 0x7F, // Logical Maximum 2767)
0x75,0x10, // Report Size 16
0x95,0x03, // Report Count 3
0x92,0x02,0x01, // OUTPUT (Data,Var,Abs,Buf)
0xC0 , // End Collection (Datalink)
0x09,0x7D, // Device Gain Report)
0xA1,0x02, // Collection Datalink
0x09,0x7E, // USAGE (Device Gain)
0x26,0xFF, 0x00, // Logical Maximum 255)
0x75,0x08, // Report Size 8
0x95,0x01, // Report Count 1
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
This is not tested but it will enumerate. And like I mentioned you need to fix the V-usb bug first along with used int for communication not chars. I have the official descriptor by the sidewinder and on another forum I saw people post that they made it work.
Last edited by ulao on Thu Jun 10, 2010 3:59 pm, edited 1 time in total.
Re: HID & Force Feedback
Sure about that excerpt? Cannot get Windows to recognize the device ("Status: Needs troubleshooting")
(Shifting the FF into the application collection doesnt help either)
Code: Select all
PROGMEM char usbDescriptorHidReport[651] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x05, // USAGE (Game Pad)
0xa1, 0x01, // COLLECTION (Application)
//# Inputs
0x09, 0x01, // USAGE (Pointer)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x06, // REPORT_COUNT (6)
//-- Axis
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, 0x36, // USAGE (Slider)
0x09, 0x35, // USAGE (Rz)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
//-- Buttons
0xa1, 0x00, // COLLECTION (Physical)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x0e, // 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, // END_COLLECTION
0xc0, // END_COLLECTION
//# Force feedback
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x21, // USAGE (Set Effect Report)
0xA1, 0x02, // COLLECTION (effect)
0x09,0x22, // USAGE (Effect Block Index)
0x25,0x7F, // Logical Maximum 127
0x75,0x07, // Report Size 7 (( should be a 7 ))?
0x95,0x01, // Report Count 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09,0x24,// USAGE (ROM Flag)
0x25,0x01,// LOGICAL_MAXIMUM
0x75,0x01,// Report Size 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09, 0x25, /* USAGE (Effect Type) */
0xA1, 0x02, /* COLLECTION (Logical2) */
0x09,0x26, // Usage ET Constant Force
0x15,0x01, // Logical Minimum 1
0x25,0x01, // Logical Maximum 1
0x75,0x08, // Report Size 8
0x91,0x00, // Output
0xC0, // END_COLLECTION (Logical2)
//other needed info
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) 91 02
0x45,0x00, // Physical Maximum 0
0x55,0x00, // Unit Exponent 0
0x65,0x00, // Unit 0
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 (Variable)
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 (Variable)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection(Logical)
0x95,0x06, // 6-bit pad 95 06
0x91,0x03, // OUTPUT (Cnst,Var,Abs)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09,0x57, // USAGE (Direction))
0xA1,0x02, // Collection logical 3
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 (Variable)
0x65,0x00, // Unit 0
0x45,0x00, // PHYSICAL_MAXIMUM (0)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection (logical 3)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x58, // USAGE (Type Specific Block Offset)
0xA1,0x02, // Collection 1
0x0B, 0x01, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 1)
0x0B, 0x02, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 2)
0x26,0xFD, 0x7F, //Logical Maximum LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max.
0x75,0x10, // Report Size 8
0x95,0x02, // Report Count 2
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection 1
0xc0, // END_COLLECTION effect
//and a few more settings out side of effect
0x09,0x5A, // Usage Set Envelope Report
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x5B, // Usage Attack Level
0x09,0x5D, // Usage Fade Level
0x26,0xFF,0x00, // Logical Maximum FFh (255d)
0x75,0x08, // Report size 8
0x95,0x02, // Report Count 2
0x91,0x02, // Output (Variable)
0x09,0x5C, // Usage Attack Time
0x09,0x5E, // Usage Fade Time
0x26,0x10,0x27, // Logical Maximum 7FFFh (32767d)
0x46,0x10,0x27, // Physical Maximum 7FFFh (32767d)
0x66,0x03,0x10, // Unit 1003h (4099d)
0x55,0x0D, // Unit Exponent FDh (253d)
0x75,0x10, // Report Size 10h (16d)
0x91,0x02, // Output (Variable)
0x45,0x00, // Physical Maximum 0
0x65,0x00, // Unit 0
0x55,0x00, // Unit Exponent 0
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Condition Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
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 (Variable)
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Periodic Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // (Parameter Block Offset)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x70, // USAGE (Magnitude)
0x09,0x6F, // USAGE 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 (Variable)
0x09,0x72, // USAGE (Phase)
0x26,0x10, 0x27, // LOGICAL_MAXIMUM
0x46,0x10, 0x27, // PHYSICAL_MAXIMUM
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 (Variable)
0x45,0x00, // PHYSICAL_MAXIMUM
0x65,0x00, // UNIT (None)
0x55,0x00, // UNIT_EXPONENT (0)
0xC0 , // End Collection
0x09,0x73, // Usage Set Constant Force Rep...
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block Index
0x26,0xFD, 0x7F, // Logical Maximum 32765)
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size
0x91,0x02, // Output (Variable)
0x09,0x70, // Usage magnitude
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // Report Size
0x91,0x02, // Output (Variable)
0xC0 , // End Collection (Datalink)
0x09,0x77, // USAGE (Effect Operation Report)
0xA1,0x02, // Collection Datalink
0x09,0x22, // Usage Effect Block Index
0x25,0x7f, // Logical Maximum 127)
0x75,0x07, // Report Size 7
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size 1
0x91,0x02, // Output (Variable)
0x09,0x78, // USAGE (Effect Operation)
0xA1,0x02, // Collection Datalink
0x09,0x79, // USAGE (Op Effect Start)
0x09,0x7A, // USAGE (Op Effect Start SOLO)
0x09,0x7B, // USAGE (Op Effect STOP)
0x15,0x01, // LOGICAL_MINIMUM 1
0x25,0x03, // LOGICAL_MAXIMUM 3
0x75,0x08, // Report Size
0x91,0x00, // OUTPUT (Data,Ary,Abs) 91 00
0xC0 , // End Collection (Datalink)
0x09,0x7C, // USAGE (Loop Count)
0x15,0x00, // LOGICAL_MINIMUM 1
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM 3
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x7F, // USAGE (PID Pool Report)
0xA1,0x02, // Collection Datalink
0x09,0x80, // USAGE (RAM Pool Size)
0x09,0x81, // USAGE (RoM Pool Size)
0x09,0x82, // USAGE (ROM Effect Block Count)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765)
0x95,0x03, // REPORT_COUNT (3)
0x75,0x10, // REPORT_SIZE (16)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0x09, 0xA8, //USAGE (Parameter Block Size)
0xA1,0x02, // Collection Datalink
0x09,0x73, // USAGE (Set Constant Force Report)
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // REPORT_SIZE (8)
0x95,0x01, // REPORT_COUNT (1)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x07,//REPORT_SIZE (7)
0x95, 0x01,//REPORT_COUNT (1)
0xB1, 0x03,//FEATURE (Cnst,Var,Abs) ; 7-bit pad
0x09, 0x67,//USAGE (Isoch Custom Force Enable)
0x75, 0x01,//REPORT_SIZE (1)
0xB1, 0x02,//FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x92, // USAGE (PID State Report)
0xA1,0x02, // Collection Datalink
0x09, 0x22, // USAGE (Effect Block Index)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x07, // Report Size 7
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x24,//USAGE (ROM Flag)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x01,//REPORT_COUNT (1)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x09, 0x94, // USAGE (Effect Playing)
0x09, 0xA0, // USAGE (Actuators Enabled)
0x09, 0xA4, // USAGE (Safety Switch)
0x09, 0xA6, // USAGE (Actuator Power)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x04,//REPORT_COUNT (4)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x81, 0x03,// INPUT (Cnst,Var,Abs) ; 4-bit pad
0xC0 , // End Collection (Datalink)
0x09,0x95, // USAGE (PID Device Control Report)
0xA1,0x02, // Collection Datalink
0x09,0x96, // USAGE (PID Device Control)
0xA1,0x02, // Collection Datalink
0x09,0x97, // USAGE (DC Enable Actuators)
0x09,0x98, // USAGE (DC Disable Actuators)
0x09,0x99, // USAGE (DC Stop All Effects)
0x09,0x9A, // USAGE (DC Reset)
0x09,0x9B, // USAGE (DC Pause)
0x09,0x9C, // USAGE (DC Continue)
0x15,0x01, // Logical Maximum 1)
0x25,0x06, // Logical Maximum 6)
0x95,0x08, // Report Count 8 ( wrong in usb pdf )
0x75,0x01, // Report Size 1 ( wrong in usb pdf )
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0xC0 , // End Collection (Datalink)
0x09,0x85, // USAGE (PID Pool Move Report)
0xA1,0x02, // Collection Datalink
0x09,0x86, // USAGE (Move Source)
0x09,0x87, // USAGE (Move Destination)
0x09,0x88, // USAGE (Move Length)
0x26,0xFF, 0x7F, // Logical Maximum 2767)
0x75,0x10, // Report Size 16
0x95,0x03, // Report Count 3
0x92,0x02,0x01, // OUTPUT (Data,Var,Abs,Buf)
0xC0 , // End Collection (Datalink)
0x09,0x7D, // Device Gain Report)
0xA1,0x02, // Collection Datalink
0x09,0x7E, // USAGE (Device Gain)
0x26,0xFF, 0x00, // Logical Maximum 255)
0x75,0x08, // Report Size 8
0x95,0x01, // Report Count 1
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
};
(Shifting the FF into the application collection doesnt help either)
Re: HID & Force Feedback
did you do this..
unsigned usbFunctionSetup(uchar data[8])
not
char usbFunctionSetup(uchar data[8])
unsigned usbFunctionDescriptor(struct usbRequest *rq)
not
char usbFunctionDescriptor(struct usbRequest *rq)
did you add #define USB_CFG_LONG_TRANSFERS 1
Did you apply the bug fix?
This is my full descriptor.
unsigned usbFunctionSetup(uchar data[8])
not
char usbFunctionSetup(uchar data[8])
unsigned usbFunctionDescriptor(struct usbRequest *rq)
not
char usbFunctionDescriptor(struct usbRequest *rq)
did you add #define USB_CFG_LONG_TRANSFERS 1
Did you apply the bug fix?
This is my full descriptor.
Code: Select all
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x09, 0x04, // USAGE (Joystick)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // usage pointer
0xA1, 0x00, // COLLECTION (phys)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x06, // REPORT_COUNT (6)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x35, 0x00, // Physical Minimum (0)
0x46, 0xFF, 0x00, // Physical Minimum (255)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x09, 0x33, // USAGE (Rx)
0x09, 0x34, // USAGE (Ry)
0x09, 0x35, // USAGE (Rz)
0x81, 0x02, // INPUT
0xC0, // COLLECTION (phys)
//could use relitive but I didnt see a change.(0x81, 0x06,)
0x09, 0x01, // usage pointer
0xA1, 0x00, // COLLECTION (phys)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x09, 0x36, // slider
0x09, 0x37, // dial
0x81, 0x02, // INPUT
//0x09, 0x38, // wheel
//0x09, 0x39, // hat
0xC0, // COLLECTION (phys)
0x65, 0x00, //Unit (None)
0x05, 0x09, // USAGE_PAGE (Button)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x18, // REPORT_COUNT (24)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x18, // USAGE_MAXIMUM (Button 24)
0x81, 0x02, // INPUT
/// force feed back...
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x21, // USAGE (Set Effect Report)
0xA1, 0x02, // COLLECTION (effect)
0x09,0x22, // USAGE (Effect Block Index)
0x25,0x7F, // Logical Maximum 127
0x75,0x07, // Report Size 7 (( should be a 7 ))?
0x95,0x01, // Report Count 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09,0x24,// USAGE (ROM Flag)
0x25,0x01,// LOGICAL_MAXIMUM
0x75,0x01,// Report Size 1
0x91,0x02, // OUTPUT (Data,Var,Abs)
0x09, 0x25, /* USAGE (Effect Type) */
0xA1, 0x02, /* COLLECTION (Logical2) */
0x09,0x26, // Usage ET Constant Force
0x15,0x01, // Logical Minimum 1
0x25,0x01, // Logical Maximum 1
0x75,0x08, // Report Size 8
0x91,0x00, // Output
0xC0, // END_COLLECTION (Logical2)
//other needed info
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) 91 02
0x45,0x00, // Physical Maximum 0
0x55,0x00, // Unit Exponent 0
0x65,0x00, // Unit 0
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 (Variable)
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 (Variable)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection(Logical)
0x95,0x06, // 6-bit pad 95 06
0x91,0x03, // OUTPUT (Cnst,Var,Abs)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09,0x57, // USAGE (Direction))
0xA1,0x02, // Collection logical 3
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 (Variable)
0x65,0x00, // Unit 0
0x45,0x00, // PHYSICAL_MAXIMUM (0)
0xC0 , // End Collection (Physical)
0xC0 , // End Collection (logical 3)
0x05, 0x0F, // USAGE_PAGE (Physical Interface)
0x09, 0x58, // USAGE (Type Specific Block Offset)
0xA1,0x02, // Collection 1
0x0B, 0x01, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 1)
0x0B, 0x02, 0x00, 0x0A, 0x00,//USAGE (Ordinals:Instance 2)
0x26,0xFD, 0x7F, //Logical Maximum LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max.
0x75,0x10, // Report Size 8
0x95,0x02, // Report Count 2
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection 1
0xc0, // END_COLLECTION effect
//and a few more settings out side of effect
0x09,0x5A, // Usage Set Envelope Report
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x5B, // Usage Attack Level
0x09,0x5D, // Usage Fade Level
0x26,0xFF,0x00, // Logical Maximum FFh (255d)
0x75,0x08, // Report size 8
0x95,0x02, // Report Count 2
0x91,0x02, // Output (Variable)
0x09,0x5C, // Usage Attack Time
0x09,0x5E, // Usage Fade Time
0x26,0x10,0x27, // Logical Maximum 7FFFh (32767d)
0x46,0x10,0x27, // Physical Maximum 7FFFh (32767d)
0x66,0x03,0x10, // Unit 1003h (4099d)
0x55,0x0D, // Unit Exponent FDh (253d)
0x75,0x10, // Report Size 10h (16d)
0x91,0x02, // Output (Variable)
0x45,0x00, // Physical Maximum 0
0x65,0x00, // Unit 0
0x55,0x00, // Unit Exponent 0
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Condition Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
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 (Variable)
0xC0 , // End Collection
0x09,0x5F, // USAGE (Set Periodic Report)
0xA1,0x02, // Collection Datalink
0x09,0x23, // (Parameter Block Offset)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765) ; 32K RAM or ROM max
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // USAGE (ROM Flag)
0x25,0x01, // LOGICAL_MAXIMUM 1
0x75,0x01, // Report Size 1
0x91,0x02, // Output
0x09,0x70, // USAGE (Magnitude)
0x09,0x6F, // USAGE 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 (Variable)
0x09,0x72, // USAGE (Phase)
0x26,0x10, 0x27, // LOGICAL_MAXIMUM
0x46,0x10, 0x27, // PHYSICAL_MAXIMUM
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 (Variable)
0x45,0x00, // PHYSICAL_MAXIMUM
0x65,0x00, // UNIT (None)
0x55,0x00, // UNIT_EXPONENT (0)
0xC0 , // End Collection
0x09,0x73, // Usage Set Constant Force Rep...
0xA1,0x02, // Collection Datalink
0x09,0x23, // Usage Effect Block Index
0x26,0xFD, 0x7F, // Logical Maximum 32765)
0x75,0x0F, // Report Size 15
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size
0x91,0x02, // Output (Variable)
0x09,0x70, // Usage magnitude
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // Report Size
0x91,0x02, // Output (Variable)
0xC0 , // End Collection (Datalink)
0x09,0x77, // USAGE (Effect Operation Report)
0xA1,0x02, // Collection Datalink
0x09,0x22, // Usage Effect Block Index
0x25,0x7f, // Logical Maximum 127)
0x75,0x07, // Report Size 7
0x95,0x01, // Report Count 1
0x91,0x02, // Output (Variable)
0x09,0x24, // Usage Rom flag
0x25,0x01, // LOGICAL_MAXIMUM (1)
0x75,0x01, // Report Size 1
0x91,0x02, // Output (Variable)
0x09,0x78, // USAGE (Effect Operation)
0xA1,0x02, // Collection Datalink
0x09,0x79, // USAGE (Op Effect Start)
0x09,0x7A, // USAGE (Op Effect Start SOLO)
0x09,0x7B, // USAGE (Op Effect STOP)
0x15,0x01, // LOGICAL_MINIMUM 1
0x25,0x03, // LOGICAL_MAXIMUM 3
0x75,0x08, // Report Size
0x91,0x00, // OUTPUT (Data,Ary,Abs) 91 00
0xC0 , // End Collection (Datalink)
0x09,0x7C, // USAGE (Loop Count)
0x15,0x00, // LOGICAL_MINIMUM 1
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM 3
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x7F, // USAGE (PID Pool Report)
0xA1,0x02, // Collection Datalink
0x09,0x80, // USAGE (RAM Pool Size)
0x09,0x81, // USAGE (RoM Pool Size)
0x09,0x82, // USAGE (ROM Effect Block Count)
0x26,0xFD, 0x7F, // LOGICAL_MAXIMUM (32765)
0x95,0x03, // REPORT_COUNT (3)
0x75,0x10, // REPORT_SIZE (16)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0x09, 0xA8, //USAGE (Parameter Block Size)
0xA1,0x02, // Collection Datalink
0x09,0x73, // USAGE (Set Constant Force Report)
0x26,0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75,0x08, // REPORT_SIZE (8)
0x95,0x01, // REPORT_COUNT (1)
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x07,//REPORT_SIZE (7)
0x95, 0x01,//REPORT_COUNT (1)
0xB1, 0x03,//FEATURE (Cnst,Var,Abs) ; 7-bit pad
0x09, 0x67,//USAGE (Isoch Custom Force Enable)
0x75, 0x01,//REPORT_SIZE (1)
0xB1, 0x02,//FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0x09,0x92, // USAGE (PID State Report)
0xA1,0x02, // Collection Datalink
0x09, 0x22, // USAGE (Effect Block Index)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x07, // Report Size 7
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x24,//USAGE (ROM Flag)
0x25, 0x01,//LOGICAL_MAXIMUM (1)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x01,//REPORT_COUNT (1)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x09, 0x94, // USAGE (Effect Playing)
0x09, 0xA0, // USAGE (Actuators Enabled)
0x09, 0xA4, // USAGE (Safety Switch)
0x09, 0xA6, // USAGE (Actuator Power)
0x75, 0x01,//REPORT_SIZE (1)
0x95, 0x04,//REPORT_COUNT (4)
0x81, 0x02,// INPUT (Data,Var,Abs)
0x81, 0x03,// INPUT (Cnst,Var,Abs) ; 4-bit pad
0xC0 , // End Collection (Datalink)
0x09,0x95, // USAGE (PID Device Control Report)
0xA1,0x02, // Collection Datalink
0x09,0x96, // USAGE (PID Device Control)
0xA1,0x02, // Collection Datalink
0x09,0x97, // USAGE (DC Enable Actuators)
0x09,0x98, // USAGE (DC Disable Actuators)
0x09,0x99, // USAGE (DC Stop All Effects)
0x09,0x9A, // USAGE (DC Reset)
0x09,0x9B, // USAGE (DC Pause)
0x09,0x9C, // USAGE (DC Continue)
0x15,0x01, // Logical Maximum 1)
0x25,0x06, // Logical Maximum 6)
0x95,0x08, // Report Count 8 ( wrong in usb pdf )
0x75,0x01, // Report Size 1 ( wrong in usb pdf )
0x91,0x02, // OUTPUT (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0xC0 , // End Collection (Datalink)
0x09,0x85, // USAGE (PID Pool Move Report)
0xA1,0x02, // Collection Datalink
0x09,0x86, // USAGE (Move Source)
0x09,0x87, // USAGE (Move Destination)
0x09,0x88, // USAGE (Move Length)
0x26,0xFF, 0x7F, // Logical Maximum 2767)
0x75,0x10, // Report Size 16
0x95,0x03, // Report Count 3
0x92,0x02,0x01, // OUTPUT (Data,Var,Abs,Buf)
0xC0 , // End Collection (Datalink)
0x09,0x7D, // Device Gain Report)
0xA1,0x02, // Collection Datalink
0x09,0x7E, // USAGE (Device Gain)
0x26,0xFF, 0x00, // Logical Maximum 255)
0x75,0x08, // Report Size 8
0x95,0x01, // Report Count 1
0xB1,0x02, // FEATURE (Data,Var,Abs)
0xC0 , // End Collection (Datalink)
0xC0 , // End
Last edited by ulao on Fri May 21, 2010 5:18 pm, edited 1 time in total.
Re: HID & Force Feedback
excerpt, not expert
Yeah, changed those things..will test it further sometime in the afternoon
Yeah, changed those things..will test it further sometime in the afternoon
Re: HID & Force Feedback
ok, solved the "not-enumerating-bug" -- indeed I oversaw one of the missing changes
core changes
---------------------
as you said:
-> len has to be changed to usbMsgLen_t
instead of just "USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0"
Still doesn't get recognized as a FF device, though.. hmm
core changes
---------------------
as you said:
Code: Select all
static inline usbMsgLen_t usbDriverSetup(usbRequest_t *rq)
{
usbMsgLen_t len = 0;
uchar *dataPtr = usbTxBuf + 9;
..
Code: Select all
PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor */
...
(USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH & 0xFF), (USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH >> 8), /* total length of report descriptor */
..
}
instead of just "USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0"
Still doesn't get recognized as a FF device, though.. hmm
Re: HID & Force Feedback
Ah!, gotcha.excerpt, not expert
No it wont.. Your now at the point I am. First thing I'd do is jump over here.
http://www.microchip.com/forums/tm.aspx ... y=񹪁
I have not tried that last reply yet.
Also I'd try ( for testing ) this descriptor http://www.microchip.com/forums/tm.aspx ... 25&mpage=2 see post 36.
Re: HID & Force Feedback
yeah, will look into that matter further after I'm done with my exams
Re: HID & Force Feedback
Hey sounds great, I made some good progress this weekend. I'm now back to the fact the V-usb receive data seems to be the hold up.
Re: HID & Force Feedback
and you haven't forgotten to enable the FN_WRITE define, have you?
"Reading" something is the rather easy part
some excerpts using (nearly) latest V-USB:
(doesn't distinguish between different report ids & types)
"Reading" something is the rather easy part
some excerpts using (nearly) latest V-USB:
Code: Select all
static uchar idleRate; /* in 4 ms units */
char _awaitReport;
uchar usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
usbMsgPtr = reportBuffer;
if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){ /* class request type */
if(rq->bRequest == USBRQ_HID_GET_REPORT){ /* wValue: ReportType (highbyte), ReportID (lowbyte) */
/* we only have one report type, so don't look at wValue */
curGamepad->buildReport(reportBuffer);
return curGamepad->report_size;
}else if(rq->bRequest == USBRQ_HID_GET_IDLE){
usbMsgPtr = &idleRate;
return 1;
}else if(rq->bRequest == USBRQ_HID_SET_IDLE){
idleRate = rq->wValue.bytes[1];
}else if (rq->bRequest == USBRQ_HID_SET_REPORT)
{
_awaitReport = 1;
return USB_NO_MSG;
}
}else{
/* no vendor specific requests implemented */
}
return 0;
}
uchar usbFunctionWrite(uchar *data, uchar len)
{
if (!_awaitReport || len < 1)
return 1;
curGamepad->rumble(data[len-1]);
_awaitReport = 0;
return 1;
}
#define USB_CFG_IMPLEMENT_FN_WRITE 1
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
* transfers. Set it to 0 if you don't need it and want to save a couple of
* bytes.
*/
(doesn't distinguish between different report ids & types)
Re: HID & Force Feedback
I will have a look and report back, I bet you I did miss that, cant wait to try it .
------------------
ok
--
I was in fact missing it but Here is what I have so far.
I get my one blink when the Fedit is ran, device is selected, and when the effect is played but I never get blinks 2,3,4.
----
ok I can make the rumble work by doing this
but I know this is not the way to do it.Easty if you have a though let me know, have you been able to get as far as me?
------------------
ok
--
I was in fact missing it but Here is what I have so far.
Code: Select all
unsigned usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
usbMsgPtr = reportBuffer;
if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS)
{ /* class request type */
if(rq->bRequest == USBRQ_HID_GET_REPORT)
{ /* wValue: ReportType (highbyte), ReportID (lowbyte) */
/* we only have one report type, so don't look at wValue */
blinkLed(1);
return 8;
}
}
else if(rq->bRequest == USBRQ_HID_GET_IDLE)
{blinkLed(2);
usbMsgPtr = &idleRate;
return 1;
}
else if(rq->bRequest == USBRQ_HID_SET_IDLE)
{blinkLed(3);
idleRate = rq->wValue.bytes[1];
}
else if (rq->bRequest == USBRQ_HID_SET_REPORT)
{blinkLed(4);
_awaitReport = 1;
return USB_NO_MSG;
}
else
{
/* no vendor specific requests implemented */
}
return 0;
}
I get my one blink when the Fedit is ran, device is selected, and when the effect is played but I never get blinks 2,3,4.
----
ok I can make the rumble work by doing this
Code: Select all
if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS)
{ /* class request type */
if(rq->bRequest == USBRQ_HID_GET_REPORT)
{ /* wValue: ReportType (highbyte), ReportID (lowbyte) */
return USB_NO_MSG;
}
but I know this is not the way to do it.Easty if you have a though let me know, have you been able to get as far as me?
Re: HID & Force Feedback
Hadn't had the time to test anything.
What is your latest descriptor/code? Does it now get recognized as a FF device without manually installing a driver/changing reg keys?
@Rumbles only once: FF only sends the start of the effect and the duration - You'll probably have to count that time manually if you aren't already.
What is your latest descriptor/code? Does it now get recognized as a FF device without manually installing a driver/changing reg keys?
@Rumbles only once: FF only sends the start of the effect and the duration - You'll probably have to count that time manually if you aren't already.
Re: HID & Force Feedback
Yes I have a FFB device with no reg settings. I can receive a FFB command, but I'm not using it right so any thing coming in triggers my motor. I had to use the descriptor from that other forum. I just added a few buttons and analogs. Not sure why my descriptor is not right.
Its by no means perfect but it does work. Going to try to clean it up a bit, but I'd sure wish I could get some V-usb help on the data coming in .
Its by no means perfect but it does work. Going to try to clean it up a bit, but I'd sure wish I could get some V-usb help on the data coming in .