2009-10-27 02:18 PM
HID device with multiple interfaces
2011-05-17 04:27 AM
Hi,
I am working with the demo board STM32F10X-128K-EVAL. I am making the HID device with multiple intefaces (based on the Custom HID project for the demo board). I changed the usb_desc.c by adding one more interface and also, set up the endpoint 2 ENDP2 for the second interface. When I run the code, only the first interface is enumerated successfully. I dont know what is the problem? Could somebody help? Thanks.2011-05-17 04:27 AM
Have you changed the decriptors to indicate a composite device?
Chris.2011-05-17 04:27 AM
Thank you for your replying.
I added one more interface and report descriptor in usb_desc.c. Also, I changed the CustomHID_Data_Setup function like this: RESULT CustomHID_Data_Setup(u8 RequestNo) { u8 *(*CopyRoutine)(u16); CopyRoutine = NULL; if ((RequestNo == GET_DESCRIPTOR) && (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) ) { if (pInformation->USBwValue1 == REPORT_DESCRIPTOR) { if( pInformation->USBwIndex0 == 0 ) { CopyRoutine = CustomHID_GetReportDescriptor; }else if( pInformation->USBwIndex0 == 1 ) { CopyRoutine = RFID_GetReportDescriptor; } } } if (CopyRoutine == NULL) { return USB_UNSUPPORT; } pInformation->Ctrl_Info.CopyData = CopyRoutine; pInformation->Ctrl_Info.Usb_wOffset = 0; (*CopyRoutine)(0); return USB_SUCCESS; } With my code now, the device appears as 2 HID devices with 2 interfaces in PC like this: -HID device -HID device -USB human interface device -USB human interface device I attach a figure for this. Did you experience this problem?2011-05-17 04:27 AM
Actually, my code works well. That is a stupid question.