CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CCS USB support problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

CCS USB support problem
PostPosted: Wed Aug 18, 2004 4:36 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 18, 2004 6:09 am     Reply with quote

You will have to add that yourself.
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

Ok great...
PostPosted: Wed Aug 18, 2004 6:46 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 18, 2004 10:42 am     Reply with quote

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)

View user's profile Send private message Send e-mail Visit poster's website

Ok fair enough, but maybe you can help me with the following
PostPosted: Wed Aug 18, 2004 12:10 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 18, 2004 1:47 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group