Page 1 of 1

How to add endpoints ?

Posted: Thu Aug 02, 2007 8:19 am
by Backoff
For my device 4 endpoints of type bulk/interrupt are required. How I can add 2 more endpoints?
Thanks!

Posted: Thu Aug 02, 2007 2:29 pm
by christian
More endpoints would require a change in the assembler modules. Since the bits of the endpoint field are scattered over two bytes, we only evaluate one of them.

To distinguish more endpoints, you must reconstruct the full endpoint address, mask it and then compare. There are no spare cycles left in the 12 MHz module. It might be possible to add this feature at 16 MHz, but that's definitely not easy.

Posted: Thu Aug 02, 2007 3:47 pm
by Backoff
Thanks for the answer!
On a site http://www.recursion.jp/avrcdc/ there are source codes from 2007-07-07 in which is present usbdrvasm.S under 12, 16 and 16,5 MHz. It will not suit?

Posted: Thu Aug 02, 2007 3:52 pm
by christian
This is the latest version of our driver. Yes, it supports 4 endpoints: One control endpoint (0), two interrupt- or bulk-in endpoints and one interrupt- or bulk-out endpoint.

The interrupt-out endpoint can have the same number as one of the interrupt-in endpoints, we therefore need only one bit to distinguish them.

I had the impression that you want 4 interrupt/bulk endpoints. This is not easily possible. If you want to enable the endpoints as described above, see AVR-CDC for an example.

Posted: Thu Aug 02, 2007 4:15 pm
by Backoff
I want to make the composite USB device consisting of three parts.
1. Vendor Request Device (1interrupt-in endpoint)
2. Hid-Class (Keyboard)
3. CDC-Class
Now the my the device consist of items 1 and 2.
I wish add item 3 in my device, it is possible with last version of the driver?

Posted: Thu Aug 02, 2007 4:20 pm
by christian
I don't think so, because you need separate endpoints for each function in the composite device.

You can share endpoints if the various functions are mutually exclusive and you choose one of them with a configuration value. But that's probably not what you want.

Posted: Thu Aug 02, 2007 4:22 pm
by christian
Correcting myself: You might be able to share endpoints even if all functions run simultaneously. You can probably use endpoint 0 for all three functions because the function can be distinguished by the request. You can also probably share the interrupt endpoint because CDC does not really require interrupts. Then the two bulk endpoints are free for CDC.

The critical question is whether you can share the interrupt-in endpoint. That's worth an experiment.