View previous topic :: View next topic |
Author |
Message |
SuperDave
Joined: 22 May 2008 Posts: 63 Location: Madison, TN
|
A useful USB descriptor |
Posted: Thu Oct 23, 2014 1:25 pm |
|
|
Virtually all the USB descriptor examples either assume a mouse (Is anybody here developing a mouse?) or require a separate driver be modified/installed. Which is to say they aren't terribly useful.
Does anyone know of a simple data transmission example that
1. Uses USB HID (thus no extra driver needed)
2. Uses bulk or interrupt transfer.
3. Supports two IN endpoints of at least 60 bytes each.
4. Just puts the data in the host endpoints as two arrays of bytes. (i.e. no or very simple report descriptor)
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Fri Oct 24, 2014 12:21 am |
|
|
Line 1, is false.....
HID does _not_ imply that no further driver is needed. This is only true for devices is certain standard classes, such as 'keyboard', and 'mouse'.....
However you can just do this as a generic HID, and use report. 64bytes max in one transfer (HID interrupt endpoint limit). |
|
|
SuperDave
Joined: 22 May 2008 Posts: 63 Location: Madison, TN
|
|
Posted: Fri Oct 24, 2014 9:11 am |
|
|
Perhaps the line should have been more elegantly stated as uses HID in a way that no custom operating system driver is required. I use Delphi 2010 and a TJvHidDeviceController which appears to give me easy access to data in defined endpoints.
So using usb_desc_mouse.h as a template and ignoring the trivial vid, pid, strings, config length changes it looks like I can
1. Duplicate the EP1_TX info to EP2_TX (line 54)
2. Change the interface descriptor (line 160)
a. number of endpoints to 2 (line 165)
b. subclass to 0 (line 167)
c. protocol to 0 (line 168)
3. Duplicate the endpoint descriptor for the added endpoint2. (line 180)
But, what do I do with the
1. Class descriptor (line 171)
2. Report descriptor (line 60)
I can find nothing that clarifies those items or if they are even necessary. I'm assuming here that one interface can have two essentially identical endpoints. I suppose it's equally possible or equally impossible to have two interfaces with one endpoint each.
Thanks for the help |
|
|
|