USBD ROM API with custom class

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USBD ROM API with custom class

950 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Wed Jul 17 17:08:00 MST 2013
The documentation for the USB ROM APIs does not go in much detail on the implementation of custom classes. There in an FAQ How to implement custom class device? but it is empty. Other parts of the documentation make brief mention of the general steps without much detail. The usb_csc.c example does override the data endpoint handlers with USBD_API->core->RegisterEpHandler() but doesn't override the control ep0 endpoint handler with USBD_API->core->RegisterClassHandler(). Is there a working example of a custom class with the USBD ROM API that overrides the ep0 handler?

Thanks.
Labels (1)
0 Kudos
3 Replies

753 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kikaxa on Thu Aug 08 06:53:13 MST 2013
I got working bulk communications by using init code from usb class examples, custom descriptors and by registering endpoint in/out handlers, same way as rom_cdc support code from lpcusblib does in usbd_cdc.c

<50 LOC total, pretty simple.

still need to figure out how to detect usb cable reconnect.
0 Kudos

753 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Mon Jul 29 05:58:04 MST 2013
NXP Tech Support sent me an example of a custom class using the ROM API. It was quite useful. I am reposting it here in case it is of use to others.

Note that the example writes directly to the DMA structures (pDTD). With the current USB ROM API, those writes could be substituted by ReadEP() in the OUT handler, WriteEP() in the IN handler and ReadReqEP() in the OUT NAK handler.
0 Kudos

753 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fcarlo on Thu Jul 25 03:11:28 MST 2013
It's a shame that NXP provides such great features like USB ROM API without putting a little effort on documentation.
0 Kudos