AVR USB, two IN Endpoints, two devices & two Report Desc
Posted: Tue Apr 29, 2008 10:07 pm
Hello everyone.
Firstly - AVR USB is great thing!
So. My problem is that i build a Keyboard, that must to know a boot protcol and also it has a Multimedia keys, such as Vol Up, Dn, Mute oan so on. 18 Buttons at all. All this buttons are in Consumer device section. also i need one annother endpoint to create.
I have expanded usbDescriptorConfiguration[]
for one endpoint. Now it looks like this:
What schould i do next?
How to send second Hid Report Decriptor to the host. I have seen, that the actualy Hid descriptor is send on request from host. Where can i see info, what Report Descriptor is requested? Or do i have to expand the old one with Consumer Devices Page too?
Thanks in advance,
Alexei
PS. thouse number in comment are offsets, for better to find it in documentation.
Firstly - AVR USB is great thing!
So. My problem is that i build a Keyboard, that must to know a boot protcol and also it has a Multimedia keys, such as Vol Up, Dn, Mute oan so on. 18 Buttons at all. All this buttons are in Consumer device section. also i need one annother endpoint to create.
I have expanded usbDescriptorConfiguration[]
for one endpoint. Now it looks like this:
Code: Select all
PROGMEM char usbDescriptorConfiguration[] = { // USB configuration descriptor
9, // 0 // sizeof(usbDescriptorConfiguration): length of descriptor in bytes
USBDESCR_CONFIG, // 1 // descriptor type
18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + (USB_CFG_DESCR_PROPS_HID & 0xff), 0, // 2 // total length of data returned (including inlined descriptors)
1, // 4 // number of interfaces in this configuration
1, // 5 // index of this configuration
0, // 6 // configuration name string index
(char)USBATTR_BUSPOWER, // 7 // attributes
USB_CFG_MAX_BUS_POWER / 2, // 8 // max USB current in 2mA units
// interface descriptor Keyboard:
9, // 0 // sizeof(usbDescrInterface): length of descriptor in bytes
USBDESCR_INTERFACE, // 1 // descriptor type
0, // 2 // index of this interface
0, // 3 // alternate setting for this interface
USB_CFG_HAVE_INTRIN_ENDPOINT, // 4 // endpoints excl 0: number of endpoint descriptors to follow
USB_CFG_INTERFACE_CLASS, // 5
USB_CFG_INTERFACE_SUBCLASS, // 6
USB_CFG_INTERFACE_PROTOCOL, // 7
0, // 8 // string index for interface
9, // 0 // sizeof(usbDescrHID): length of descriptor in bytes
USBDESCR_HID, // 1 // descriptor type: HID
0x01, 0x01, // 2 // BCD representation of HID version
0x00, // 4 // target country code
0x01, // 5 // number of HID Report (or other HID class) Descriptor infos to follow
0x22, // 6 // descriptor type: report
USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0, // 7 // total length of report descriptor
7, // 0 // sizeof(usbDescrEndpoint)
USBDESCR_ENDPOINT, // 1 // descriptor type = endpoint
(char)0x81, // 2 // IN endpoint number 1
0x03, // 4 // attrib: Interrupt endpoint
8, 0, // 5 // maximum packet size
USB_CFG_INTR_POLL_INTERVAL, // 6 // in ms
// interface descriptor Consumer Device:
9, // 0 // sizeof(usbDescrInterface): length of descriptor in bytes
USBDESCR_INTERFACE, // 1 // descriptor type
1, // 2 // index of this interface
0, // 3 // alternate setting for this interface
USB_CFG_HAVE_INTRIN_ENDPOINT3, // 4 // endpoints excl 0: number of endpoint descriptors to follow
USB_CFG_INTERFACE_CLASS_1, // 5
USB_CFG_INTERFACE_SUBCLASS_1, // 6
USB_CFG_INTERFACE_PROTOCOL_1, // 7
0, // 8 // string index for interface
9, // 0 // sizeof(usbDescrHID): length of descriptor in bytes
USBDESCR_HID, // 1 // descriptor type: HID
0x01, 0x01, // 2 // BCD representation of HID version
0x00, // 4 // target country code
0x01, // 5 // number of HID Report (or other HID class) Descriptor infos to follow
0x22, // 6 // descriptor type: report
USB_CFG_HID_REPORT_DESCRIPTOR_1_LENGTH, 0, // 7 // total length of report descriptor
7, // 0 // sizeof(usbDescrEndpoint)
USBDESCR_ENDPOINT, // 1 // descriptor type = endpoint
(char)0x82, // 2 // IN endpoint number 1
0x03, // 4 // attrib: Interrupt endpoint
8, 0, // 5 // maximum packet size
USB_CFG_INTR_POLL_INTERVAL, // 6 // in ms
};
What schould i do next?
How to send second Hid Report Decriptor to the host. I have seen, that the actualy Hid descriptor is send on request from host. Where can i see info, what Report Descriptor is requested? Or do i have to expand the old one with Consumer Devices Page too?
Thanks in advance,
Alexei
PS. thouse number in comment are offsets, for better to find it in documentation.