Content originally posted in LPCWare by ECamino on Mon Sep 24 14:00:32 MST 2012
Hi,
Is it possible to create a composite HID + HID?
I want to do that before I try to add the CDC.
I changed the USB descriptors in the project to add another HID interface adding a single in endpoint at address x82. I created a keyboard report descriptor and in my code I'm calling it HID_ReportDescriptor2[].
I changed the hid_param.max reports to 2, and I added this code:
[LEFT][FONT=Arial][SIZE=2][/SIZE][/FONT]
[FONT=Arial][SIZE=2]reports_data[1].[COLOR=#0000c0][COLOR=#0000c0]len[/COLOR][/COLOR] = HID_ReportDescSize2;[/SIZE][/FONT]
[FONT=Arial][SIZE=2]reports_data[1].[COLOR=#0000c0][COLOR=#0000c0]idle_time[/COLOR][/COLOR] = 0;[/SIZE][/FONT][/LEFT]
[FONT=Arial][SIZE=2]reports_data[1].[COLOR=#0000c0][COLOR=#0000c0]desc[/COLOR][/COLOR] = ([COLOR=#005032][COLOR=#005032]uint8_t[/COLOR][/COLOR] *)&HID_ReportDescriptor2[0];[/SIZE][/FONT]
[SIZE=2][/SIZE]
I build and run, and I get LPC_OK on return from :
[SIZE=2][/SIZE]
[LEFT][SIZE=2][FONT=Arial]ret = usb_hid_init(hUsb, ([COLOR=#005032][COLOR=#005032]USB_INTERFACE_DESCRIPTOR[/COLOR][/COLOR] *)&USB_FsConfigDescriptor[[B][COLOR=#7f0055][COLOR=#7f0055]sizeof[/COLOR][/COLOR][/B][/FONT][/SIZE][FONT=Arial][SIZE=2]([COLOR=#005032][COLOR=#005032]USB_CONFIGURATION_DESCRIPTOR[/COLOR][/COLOR])], [/SIZE][/FONT][/LEFT]
[FONT=Arial][SIZE=2]&usb_param.[COLOR=#0000c0][COLOR=#0000c0]mem_base[/COLOR][/COLOR], &usb_param.[COLOR=#0000c0][COLOR=#0000c0]mem_size[/COLOR][/COLOR]);[/SIZE][/FONT]
[SIZE=2][/SIZE]
I see in my USB protocol analyzer, there is a get request for interface 1 report descriptor, but it doesn't seem to be sent out to the PC. Here are the descriptors from the analyzer:
[B][SIZE=2][/SIZE][/B]
[B][SIZE=2][B]Connection Status[/B]Device connected[B]Current Configuration[/B]1[B]Speed[/B]Full[B]Device Address[/B]1[B]Number Of Open Pipes[/B]3
[B]Device Descriptor[/B] LPC11Uxx HID
Offset
FieldSizeValueDescription0bLength112h1bDescriptorType101hDevice2bcdUSB20200hUSB Spec 2.04bDeviceClass100hClass info in Ifc Descriptors5bDeviceSubClass100h6bDeviceProtocol100h7bMaxPacketSize0140h64 bytes8idVendor21FC9h10idProduct20107h12bcdDevice20100h1.0014iManufacturer101h"NXP Semiconductors"15iProduct102h"LPC11Uxx HID"16iSerialNumber103h"ABCD123456789"17bNumConfigurations101h
[B]Configuration Descriptor 1[/B] Self Powered
OffsetFieldSizeValueDescription0bLength109h1bDescriptorType102hConfiguration2wTotalLength20042h4bNumInterfaces102h5bConfigurationValue101h6iConfiguration100h7bmAttributes1C0hSelf Powered4..0: Reserved...00000 5: Remote Wakeup..0..... No6: Self Powered.1...... Yes7: Reserved (set to one)
(bus-powered for 1.0)1....... 8bMaxPower132h100 mA
[B]Interface Descriptor 0/0[/B] HID, 2 Endpoints
OffsetFieldSizeValueDescription0bLength109h1bDescriptorType104hInterface2bInterfaceNumber100h3bAlternateSetting100h4bNumEndpoints102h5bInterfaceClass103hHID6bInterfaceSubClass100h7bInterfaceProtocol100h8iInterface104h"HID"
[B]HID Descriptor[/B]
OffsetFieldSizeValueDescription0bLength109h1bDescriptorType121hHID2bcdHID20100h1.004bCountryCode100h5bNumDescriptors101h6bDescriptorType122hReport7wDescriptorLength20021h33 bytes
[B]Endpoint Descriptor 81[/B] 1 In, Interrupt, 32 ms
OffsetFieldSizeValueDescription0bLength107h1bDescriptorType105hEndpoint2bEndpointAddress181h1 In3bmAttributes103hInterrupt1..0: Transfer Type......11 Interrupt7..2: Reserved000000.. 4wMaxPacketSize20004h4 bytes6bInterval120h32 ms
[B]Endpoint Descriptor 01[/B] 1 Out, Interrupt, 32 ms
OffsetFieldSizeValueDescription0bLength107h1bDescriptorType105hEndpoint2bEndpointAddress101h1 Out3bmAttributes103hInterrupt1..0: Transfer Type......11 Interrupt7..2: Reserved000000.. 4wMaxPacketSize20004h4 bytes6bInterval120h32 ms
[B]Interface Descriptor 1/0[/B] HID, 1 Endpoint
OffsetFieldSizeValueDescription0bLength109h1bDescriptorType104hInterface2bInterfaceNumber101h3bAlternateSetting100h4bNumEndpoints101h5bInterfaceClass103hHID6bInterfaceSubClass101hBoot Interface7bInterfaceProtocol101hKeyboard8iInterface100h
[B]HID Descriptor[/B]
OffsetFieldSizeValueDescription0bLength109h1bDescriptorType121hHID2bcdHID20100h1.004bCountryCode100h5bNumDescriptors101h6bDescriptorType122hReport7wDescriptorLength2003Fh63 bytes
[B]Endpoint Descriptor 82[/B] 2 In, Interrupt, 32 ms
OffsetFieldSizeValueDescription0bLength107h1bDescriptorType105hEndpoint2bEndpointAddress182h2 In3bmAttributes103hInterrupt1..0: Transfer Type......11 Interrupt7..2: Reserved000000.. 4wMaxPacketSize20008h8 bytes6bInterval120h32 ms
[B]Interface 0 HID Report Descriptor[/B] Vendor-Defined 1
Item Tag (Value)Raw DataUsage Page (Vendor-Defined 1)06 00 FF Usage (Vendor-Defined 1)09 01 Collection (Application)A1 01 Logical Minimum (0)15 00 Logical Maximum (255)26 FF 00 Report Size (8)75 08 Report Count (1)95 01 Usage (Vendor-Defined 1)09 01 [B]Input[/B] (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit)81 02 Report Count (1)95 01 Usage (Vendor-Defined 1)09 01 [B]Output[/B] (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)91 02 Report Count (1)95 01 Usage (Vendor-Defined 1)09 01 [B]Feature[/B] (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit)B1 02 End CollectionC0 [/SIZE][/B]
[B][SIZE=2][/SIZE][/B]
Is there something else I have to do to get the second report descriptor to get through?