Creating a consumer device?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Guest

Creating a consumer device?

Post by Guest » Sun Jun 01, 2008 3:08 pm

Hello.

I want to kinda of mod/ redo HIDkeys to send the Multimedia keys to the pc instead.

It seems these aren't part of the USB keyboard spec, but the consumer device one (play/pause,next, volume up/down etc).

I would need to change usbHidReportDescriptor wouldn't it? and then keyReport to send the differnet data?.

Is there anywhere explaining how i should start to create this?

Guest

Post by Guest » Mon Jun 02, 2008 6:06 am

Code: Select all

PROGMEM char usbHidReportDescriptor[33] = { /* USB report descriptor */
    0x05, 0x0c,                    // USAGE_PAGE (Consumer Devices)
    0x09, 0x01,                    // USAGE (Consumer Control)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x85, 0x4c,                    //   REPORT_ID (76)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
    0x09, 0xe9,                    //   USAGE (Volume Up)
    0x09, 0xea,                    //   USAGE (Volume Down)
    0x75, 0x01,                    //   REPORT_SIZE (1)
    0x95, 0x02,                    //   REPORT_COUNT (2)
    0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0x09, 0xe2,                    //   USAGE (Mute)
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x81, 0x06,                    //   INPUT (Data,Var,Rel)
    0x95, 0x05,                    //   REPORT_COUNT (5)
    0x81, 0x01,                    //   INPUT (Cnst,Ary,Abs)
    0xc0                           // END_COLLECTION
};



Here's what i;ve kinda tried to make myself, though it doesnt work, I get the device cannot start error message.

I believe that would be caused by the HidDescriptor here correct?.

Guest

Post by Guest » Mon Jun 02, 2008 9:53 am

i've tried turning on debuggin by setting

#define DEBUG_LEVEL 2 (or 1)

however when i run make i get.

Code: Select all

main.c:<.text+0x9c>:undefined reference to 'odDebug'


this doesn't happen with debug level undefined, i even managed to compile the standard HIDkeys (with the buttons changed to a different characeter) like this.

Post Reply