hid report descriptor help

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
thelorax
Posts: 3
Joined: Thu Mar 12, 2009 6:07 am

hid report descriptor help

Post by thelorax » Wed Oct 14, 2009 3:00 am

Hello,
I'm trying to create a hid report descriptor for a joystick with an X and Y axis and around 4 buttons. I've searched the web and I haven't been able to find any concise reading on how to build up a report descriptor. I've tried HID Tool under windows, but it seems really buggy and crashes frequently. Is there any alternative?
If anybody has a good tutorial/hidtool replacement/joystick + button report descriptor I'd really appreciate it.

thanks.

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

Re: hid report descriptor help

Post by ulao » Wed Oct 14, 2009 4:52 am

Here is a generic 8 button x,y hid. I never have a single bit of trouble with it.

Code: Select all

const char generic_usbHidReportDescriptor[] PROGMEM = {
    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x09, 0x05,                    // USAGE (Game Pad)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x09, 0x01,                    //   USAGE (Pointer)
    0xa1, 0x00,                    //   COLLECTION (Physical)
    0x09, 0x30,                    //     USAGE (X)
    0x09, 0x31,                    //     USAGE (Y)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x02,                    //   REPORT_COUNT (2)
    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0xc0,                          // END_COLLECTION
    0x05, 0x09,                    // USAGE_PAGE (Button)
    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)
    0x29, 0x08,                    //   USAGE_MAXIMUM (Button 8)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
    0x75, 0x01,                    // REPORT_SIZE (1)
    0x95, 0x08,                    // REPORT_COUNT (8)
    0x81, 0x02,                    // INPUT (Data,Var,Abs)
    0xc0
};


Are you sure its the descriptor that is the trouble?

Post Reply