请问哪位大侠有使用STM32的USB?小弟有一个问题请问: RESULT Joystick_Data_Setup(u8 RequestNo) { u8 *(*CopyRoutine)(u16);
CopyRoutine = NULL; if ((RequestNo == GET_DESCRIPTOR) && (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) && (pInformation->USBwIndex0 == 0)) {
if (pInformation->USBwValue1 == REPORT_DESCRIPTOR) { CopyRoutine = Joystick_GetReportDescriptor; } else if (pInformation->USBwValue1 == HID_DESCRIPTOR_TYPE) { CopyRoutine = Joystick_GetHIDDescriptor; }
} /* End of GET_DESCRIPTOR */
/*** GET_PROTOCOL ***/ else if ((Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT)) && RequestNo == GET_PROTOCOL) { CopyRoutine = Joystick_GetProtocolValue; }
if (CopyRoutine == NULL) { return USB_UNSUPPORT; }
pInformation->Ctrl_Info.CopyData = CopyRoutine; pInformation->Ctrl_Info.Usb_wOffset = 0; (*CopyRoutine)(0); return USB_SUCCESS; } 在ST提供的代码里只有,GET_DESCRIPTOR 与GET_PROTOCOL 的处理,请问SET_REPORT与GET_REPORT怎么处理呢? |