How to create two HID interfaces by using hid-generic sample codes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create two HID interfaces by using hid-generic sample codes

949 Views
samchen_tw
Contributor III

Hi 

I want to create two HID interfaces and refer to hid-generic sample codes.

I have no idea how to do.

Could someone give me a hand.

Thanks.

Sam

Labels (3)
0 Kudos
3 Replies

721 Views
samchen_tw
Contributor III

I am following this composite device sample to create 2 hid interface.

LPCOpen-keil-lpc43xx/main.c at master · micromint/LPCOpen-keil-lpc43xx · GitHub 

Hope it works.

Thanks.

Sam

0 Kudos

721 Views
jeremyzhou
NXP Employee
NXP Employee

Hi  Sam Chen,

How is going on about this issue?
Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

721 Views
samchen_tw
Contributor III

It works for me to invoke usb_hid_init twice with difffer interface description like this.

  ret = usb_hid_init(g_hUsb,
         (USB_INTERFACE_DESCRIPTOR *) &USB_FsConfigDescriptor[sizeof(USB_CONFIGURATION_DESCRIPTOR)],
         &usb_param.mem_base,
         &usb_param.mem_size);

  ret = usb_hid_btn_init(g_hUsb,
    &USB_FsConfigDescriptor[sizeof(USB_CONFIGURATION_DESCRIPTOR) + USB_INTERFACE_DESC_SIZE + HID_DESC_SIZE + 2*USB_ENDPOINT_DESC_SIZE ],
         &usb_param.mem_base,
         &usb_param.mem_size);

Thanks

Sam

0 Kudos