I am trying to create an example with both a Mic and a speaker, using tje LPC open (1.03) USB lib. Using the support for the built in USB drivers. I have succeeded in geting microphone axample to work, and the speaker example works. But i am now trying to merge them into a combined device. The enumeration fails when I try to connect to a PC.
I am unsure if I just do something wrong with the descripotrs, or if there is something more "devious" with the code. I am unsure about how to handle the structure: USB class info. In the mic example it cintains the In endpoint number, in the speaker example it contains the out endpoint number (same?) and by looking at the initi code where the structure is referenced, it seems not to be possible to finn in both endpoint variables.
Hope someone has an example to share.
/Skyle
Assign different endpoint number to the endpoints, each other.
LPCOpen (and nxpUSBlib) has specific restriction on the endpoints assignment: just one endpoint, IN or OUT, on single endpoint number. Neither USB on-chip driver nor hardware have such a restriction.
Anyway, why do you need LPCOpen over the USB on-chip driver?
Tsuneo
This suggestion is close to what I was already testing, I have now managed to get it enumerated as a combined device with speaker and mic.
But the transfer does not work, if i look at the function UsbdAdc_Init it seems to be made to work with either one out endpoint or one in endpoint, the same goes for several of the other functions that are being used from the usbd_adcuser.c file.
Maybe I should try with the non rommed version of the stack?
Skyle
You will need to create descriptors defining your product as a composite device. You will find an app note on this subject at: <a href="http://www.lpcware.com/content/nxpfile/an11018-usb-composite-device-lpc134x-software-v20">http://www.lpcware.com/content/nxpfile/an11018-usb-composite-device-lpc134x-software-v20</a>
Although the app note is written for a different device, and different classes, the process is the same.
If you do a search for composite devices on the LPCware forum, and other places on web, you will find lots of information about composite USB devices.
-Paul