View previous topic :: View next topic |
Author |
Message |
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
CCS USB support problem |
Posted: Wed Aug 18, 2004 4:36 am |
|
|
I have been using CCS with single interface, multiple endpoint HID devices with great success.
It seems that CCS is unable to support HID combination devices properly.
I am unable to get USB.C to understand 2 defferent Report descriptors associated with 2 different Interface descriptors.
Has anybody gotten combination devices such as i.e. joystick / mouse to work using CCS
Here is the code in USB.C that seems to cause the problem
void usb_copy_desc_seg_to_ep(PID_TOGGLE tgl) {
int i=0;
char c;
while ((usb_getdesc_len)&&(i<USB_MAX_EP0_PACKET_LENGTH))
{
switch(USB_stack_status.getdesc_type) {
case USB_GETDESC_CONFIG_TYPE:
c=USB_CONFIG_DESC[usb_getdesc_ptr];
break;
#IF USB_HID_DEVICE
case USB_GETDESC_HIDREPORT_TYPE:
/////////
/// this bit of code in USB.C seems to be the problem
//////
c=USB_HID_DESC[usb_getdesc_ptr];
///////////
break;
#endif |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Wed Aug 18, 2004 6:09 am |
|
|
You will have to add that yourself. |
|
|
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Ok great... |
Posted: Wed Aug 18, 2004 6:46 am |
|
|
Thank you for your help.....
Ok, is there anybody out there that has already 'Added it themselves'? |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Wed Aug 18, 2004 10:42 am |
|
|
What I meant is:
CCS does not support that feature. If you desire this feature the user will have to add it themselves. CCS provides the basic chapter 9 layer for USB. After that all additions are application specific and must be added by the user. |
|
|
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Ok fair enough, but maybe you can help me with the following |
Posted: Wed Aug 18, 2004 12:10 pm |
|
|
I have managed to create a composite HID device that has the same report descriptor (for the moment) I can pass information up and down from my dev kit to the PC and back.
I am still a bit unclear about the following issues:
1. Does an endpoint link directly to a interface descriptor, what I mean is this:
Say I have 2 Interfaces with 2 endpoints each i.e. one incoming and one outgoing:
If I am to speak to the first endpoint of the second interface, would I refer to Interface 2 endpoint 1, or would I refer or would I refer to endpoint 3.
2. Can the CCS driver determine which interface endpoint data came from:
i.e will USBkbhit(2) refer to the second incoming endpoint.
---
The reason that I am going this route is because my USB device currently sports a RS232 line for configuration purposes (which is a real pain) |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Wed Aug 18, 2004 1:47 pm |
|
|
I believe (I may be wrong) that if you have 2 interfaces and 2 endpoints for each endpoint, they would look something like this:
interface 0
endpoint 01 (endpoint 1, out)
endpoint 81 (endpoint 1, in)
interface 1
endpoint 02
endpoint 82
out and in are in reference to the PC, not the PIC.
See, all four endpoints have a different address. I think if more than one endpoint has the same endpoint bad things will happen (unless they are on different configurations).
usb_kbhit(x) works for any OUT endpoints. That would be 01 or 02 in this example.
I could be wrong. Check with the discussion forum on USB.org. |
|
|
|