Rockbox

Tasklist

FS#10326 - USB HID sample application

Attached to Project: Rockbox
Opened by Tomer Shalev (tomers) - Saturday, 13 June 2009, 13:13 GMT
Last edited by Frank Gevaerts (fg) - Saturday, 18 July 2009, 12:58 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This patch adds a USB HID sample application (remote_control) which enable the user to send HID messages in charging only mode.

The remote control application has three modes:

- Desktop:
* Escape
* Alt-Tab
* Shift Alt-Tab
* Windows
* F10
* Page Up
* Page Down

- Presentation
* Next Slide
* Prev Slide
* Start Slideshow
* Stop Slideshow
* Leave Slideshow
* Black Screen
* White Screen

- Media Player
* Play
* Stop
* Next
* Previous
* Volume Up
* Volume Down
* Mute

Note: This is a work in progress and major parts of the code does not work yet.
It is submitted in order to share my work and receive feedback, as well as helping me debug the application.

The patch contains the following changes:

- Add HID keyboard enumeration, and allow sending keyboard key codes (Status: enumerates, but Windows does not respond to sent keys).
- Add usb_hid_send command to the plugin's API
- Fix #include issue
- Modify signature of usb_hid_send to allow passing usage page
- Move large enum structure into a list of #define's
- Use BIT_N macro when possible
- Add buf_dump to dump a buffer into log (please consider using it in other places for debugging. I don't know where is the appropriate place to put it)
- Make coding convention in usb_hid.c consistent in the entire file
- Fix endpoints allocation bug in firmware/target/arm/usb-drv-arc.c
This task depends upon

Closed by  Frank Gevaerts (fg)
Saturday, 18 July 2009, 12:58 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed as r21953
Comment by Frank Gevaerts (fg) - Saturday, 13 June 2009, 16:00 GMT
I've traced what happens when I connect and then try to send the "desktop" keys one by one. You need the GraphicUSB software from http://www.mqp.com/dnld.htm to view this
   HID.mqu (221.2 KiB)
Comment by Frank Gevaerts (fg) - Saturday, 13 June 2009, 17:28 GMT
Here are the others. Presentation separately in presentation.mqu, and all items in all.mqu
Comment by Tomer Shalev (tomers) - Saturday, 20 June 2009, 21:04 GMT
The attached patch is a working HID sample application. Enjoy!
Comment by Taylore (trailblaze) - Sunday, 21 June 2009, 20:33 GMT
hmm.. this looks cool :) but when im building it it stops with an error 1 with usb.o .. then it goes to "rm" some pictures(bitmaps). ive you need more help diagnosing ill give you more, info... thank you in advance..
Comment by Tomer Shalev (tomers) - Monday, 22 June 2009, 05:04 GMT
> hmm.. this looks cool :) but when im building it it stops with an error 1 with usb.o .. then it goes to "rm" some pictures(bitmaps). ive you need more help diagnosing ill give you more, info... thank you in advance..

Please try:
$ rm -rf build && mkdir build && cd build/ && printf "50\na\nl\n\n" | ../tools/configure && make

Let me know if it works for you. If so, try to build for your own platworm (passing "50" to ../tools/configure means Sansa e200, change it accordingly).

If you still encounter any errors, please provide the output, and additional information, such as 'uname -a'.
Comment by Tomer Shalev (tomers) - Thursday, 16 July 2009, 12:23 GMT
Updated patch.
Removed irrelevant change to API (control max packet size).
Add 'HID_' prefix to #defines in usb_hid_usage_tables.h

Loading...