Simplest HID Report?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Talib
Posts: 10
Joined: Fri Oct 22, 2010 12:10 pm

Simplest HID Report?

Post by Talib » Mon Oct 25, 2010 11:03 am

Referring to the following page:

http://vusb.wikidot.com/examples

especially the following lines:

Descriptors can be provided in one of four ways:

1 You can decide to use V-USB's default descriptor (with eventually resides in flash memory).
2 In flash memory.
3 In RAM.
4 By means of a function which returns the descriptor.


I would like to know how to use the first option. Basically I modified the HID-Mouse for my test application. I will basically just be sending data from the Host to the device via Control endpoint 0 as per first example on: http://vusb.wikidot.com/driver-api The problem I am having is that when I comment out the following in the HID-Mouse example:

PROGRAM char usbHidReportDescriptor[52] ....... etc

it does not want to compile. I thus want to use the default descriptor instead of that one. How do I do it or am I missing the bus completely. All this is new to me and all the USB settings is a bit overwhelming.
Last edited by Talib on Mon Oct 25, 2010 2:25 pm, edited 1 time in total.

Talib
Posts: 10
Joined: Fri Oct 22, 2010 12:10 pm

Re: WIKI Clarification ... default descriptor

Post by Talib » Mon Oct 25, 2010 1:09 pm

Basically, what i am also asking, what is the settings to make the simplest HID device (as not to require drivers)?

Talib
Posts: 10
Joined: Fri Oct 22, 2010 12:10 pm

Re: WIKI Clarification ... default descriptor

Post by Talib » Mon Oct 25, 2010 2:25 pm

Ok, from what I can determine, is that I can't make a HID device without a Report. So what I am trying to do now is as described in the wiki:

Vendor type requests sent to custom HID class device

The advantages of a custom class and a HID device can be (kind of) combined. Libusb can access endpoint 0 of all devices, even those which already have a driver attached to them such as HID devices.

You can therefore create an HID class device with a simple report structure which is never used. This prevents the "New Device" dialog on Windows. Then access it with libusb or libusb-win32 as if it were a custom class device.

Advantages:

Complexity of HID can be avoided.
Same API can be used on Unix and Windows.
Prevents the "New Device" dialog on Windows.
Disadvantages:

On Windows, you still must ship libusb-win32 with your code. However, it's sufficient to have it in the same directory as your application.


I found this document:http://www.devasys.com/PD11x/JHWP.pdf

In there there is an example,Example 2 – Buttons and Lights, with the report that I have tried to modify to:

Code: Select all

const byte ReportDescriptor[] = {
6, 0, 255, // Usage_Page (Vendor Defined)
9, 1, // Usage (I/O Device)
0x19, 1, // Usage_Minimum (LED 1)
0x29, 1, // Usage_Maximum (LED 1)
0x91, 2, // Output (Data,Var,Abs) = LEDs (5 bits)
0xC0 // End_Collection
};


It is not working, any help would be appreciated.

Post Reply