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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,720 次查看
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

标签 (3)
0 项奖励
回复
3 回复数

1,492 次查看
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 项奖励
回复

1,492 次查看
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 项奖励
回复

1,492 次查看
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 项奖励
回复