HID Report for custom hardware

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Phunkafizer
Posts: 1
Joined: Thu May 16, 2013 11:54 am

HID Report for custom hardware

Post by Phunkafizer » Thu May 16, 2013 12:49 pm

Hello,

I build a hardware with:

- 4 LEDs
- 4 Buttons
- 1 Rot Encoder

I already tried some of the examples and it worked well. But I have difficulties to understand the HID Report thing. Is it possible to handle input and output at the same time?
- What is the best way to build a HID Report for my hardware?
- What is the advantage using usbFunctionRead? Did I understand right that this is an alternative to sending data with usbSetInterrupt?
- I frequently call usbPoll(), and checking usbInterruptIsReady. Is it correct that usbInterruptIsReady returns true only one time when I do not call usbSetInterrupt after it?

Stefan

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: HID Report for custom hardware

Post by ulao » Tue Jun 25, 2013 3:31 pm

1) guessing the buttons and Encoder are input you want to send to the host and you need the host to turn on your device leds? Normally to commune from host to device you need to use the vender specific feature. I never used that before but it requires a driver. For the descriptor I'd use the HID gamepad. Lots of examples out there on that. Any DX app can inquire that device easily.

2)Sorry I can not for the life of me recall the difference from usbSetInterrupt to usbFunctionRead but I'm certain you wont need it.

3 here is the best way to think of it

Code: Select all

while (   !usbInterruptIsReady() ) //when not ready you must poll
{
   usbPoll();
}
//pulling has stopped time to send
usbSetInterrupt( reportBuffer, 8);

Post Reply