"Generic HID" demo ?

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

"Generic HID" demo ?

778 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Mon Jun 06 00:55:25 MST 2011
Hi Everyone!

I'm using LPC1769 with CodeRed Eclipse IDE.

The examples comes with the software includes the hid joystick example but , i wonder how a generic hid class application can be written?

Thanks.
0 Kudos
Reply
12 Replies

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Fri Jul 01 00:34:29 MST 2011

Quote: jharwood
What operating system and HID library are you using on the host?

Windows uses control transfers if the HID interface doesn't have an interrupt OUT endpoint.



Hi!

I solved the problem and updated the example code you submit.

You can look here: http://knowledgebase.nxp.com/showthread.php?p=9819#post9819

Thanks a lot for initial help!
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Fri Jun 17 12:26:31 MST 2011
What operating system and HID library are you using on the host?

Windows uses control transfers if the HID interface doesn't have an interrupt OUT endpoint.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Fri Jun 17 01:49:16 MST 2011

Quote: jharwood
The attached project may do what you want. I'm no USB expert, but it seems to test out ok.

For an IN_REPORT (device --> host) see the function HandleFrame().
For an OUT_REPORT (host --> device) see the function HandleClassRequest(), case HID_SET_REPORT

You will need RDB1768cmsis_usbstack and CMSISv1p30_LPC17xx libraries to be present in your workspace.



Hi,

Thank you in advance. For, IN report this code is working. But, i couldn't manage to work with OUT report properly.

I'm sending messages from the computer but the code doesn't even go in to the HandleClassRequest function. ( I'm testing with breakpoints. )

Also, i couldn't find where does the out endpoint initializes. There is, USBHwRegisterEPIntHandler for IN enpoint but there is no such init. for OUT endpoint.

Please clearify me if i'm missing something.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Fri Jun 10 17:49:03 MST 2011

Quote: behzat_c
I just wanted to have two endpoints with 64 byte per length.

And also, a interrupt driven function calls for "Read" and "Send" inquiries.




The attached project may do what you want. I'm no USB expert, but it seems to test out ok.

For an IN_REPORT (device --> host) see the function HandleFrame().
For an OUT_REPORT (host --> device) see the function HandleClassRequest(), case HID_SET_REPORT

You will need RDB1768cmsis_usbstack and CMSISv1p30_LPC17xx libraries to be present in your workspace.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Jun 10 12:11:52 MST 2011

Quote: behzat_c

USB is way over complicated to understand by reading a book. It is doable of course but coding and making it work for spesific hardware is pain!

Microchip does excellent job for that manner. They have many examples for USB with different classes. I wish NXP would do that also.



USB is way too complicated to understand without reading a book.
It is doable of course but coding is then more like a hack & pray session :D

Using the examples is possible but you do need the knowledge about the physical and other lower layers before you really understand what is going is.
I prefer to spend some time now learning USB. If you just hack & pray one of the USB examples into your own application there is a fair chance you will end up with a problem and then you're really nailed (or scewed ;))

I don't trust the NXP examples, nor the Microchip examples, to such a level that I would blindly copy them into my application.

Check out the usbmadesimple.co.uk site and go get a good book on USB. That way you will understand what is going on in the examples and then it's easy (ehh... less hard) to convert an example into your functional app.

I spent some time reading "USB Complete" and also had a good look at the USB specs before I performed some hands on. Creating a USB keyboard with the NXP examples at hand what really easy. Yes I made some mistakes on the way but I could identify and fix them without much problems.

Rob
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 10 09:30:24 MST 2011
I know, I'm working with this stuff :eek:

And therefore it's easier to start / read / understand...
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Fri Jun 10 09:24:42 MST 2011
I just wanted to have two endpoints with 64 byte per length.

And also, a interrupt driven function calls for "Read" and "Send" inquiries.

I want those :)

@Zero

That project make use of LPC13xx 's ROM embedded HID library features. Not applicable to 17xx series.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 10 02:12:56 MST 2011

Quote: behzat_c
...USB is way over complicated...



A good point to start is usbhid_rom sample (LPC1343). Easy to understand and a PC demonstration program is included :)
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Thu Jun 09 21:28:00 MST 2011
Yes, I agree that USB is somewhat complicated. NXP provides good examples for all of the major USB device classes.

Your original request was for an example of a generic HID class. I can provide you with a sample, if you would like. But, for it to be meaningful, you do at least need to understand the basics of the HID report descriptor definition. Without that knowledge, you would be stuck with whatever I concocted to serve as a demo.

You could take a look at this tutorial on the subject.

If you could describe in detail how you want your generic Human Interface Device to interact with the host, I can provide you with some sample code.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Thu Jun 09 10:10:36 MST 2011
If i would manage to do that, i will share it with no doubt!

But,

USB is way over complicated to understand by reading a book. It is doable of course but coding and making it work for spesific hardware is pain!

Microchip does excellent job for that manner. They have many examples for USB with different classes. I wish NXP would do that also.
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed Jun 08 22:56:49 MST 2011

Quote: behzat_c
Hey!

Am i the only one tries to make a Generic HID application but fails because of lack of documentation / lack of sample code ?

If there is anyone managed to do that, can please explain me or direct to the right source of information?

Thanks anyway.



There are a lot of good books that you can read. Jan Axelson seems to be an expert on the subject.

Also, http://www.usbmadesimple.co.uk/ may be a good starting point for understanding USB.

When you get it working, can we ask you for the sample code? :)
0 Kudos
Reply

743 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by behzat_c on Wed Jun 08 00:30:49 MST 2011
Hey!

Am i the only one tries to make a Generic HID application but fails because of lack of documentation / lack of sample code ?

If there is anyone managed to do that, can please explain me or direct to the right source of information?

Thanks anyway.
0 Kudos
Reply