forked from PAWPAW-Mirror/lib_xua
改成得胜使用的hid描述
This commit is contained in:
@@ -393,10 +393,10 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PAWPAW_INOUTHID
|
#ifdef PAWPAW_INOUTHID
|
||||||
XUD_SetReady_In(ep_hid, g_hidData_in, PAWPAW_CFG_HID_IN_BUFSIZE);// 上行
|
XUD_SetReady_In(ep_hid, g_hidData_in, 5);// 上行
|
||||||
XUD_SetReady_Out(ep_hid_out,g_hidData_out);// 下行
|
XUD_SetReady_Out(ep_hid_out,g_hidData_out);// 下行
|
||||||
#endif //#ifdef PAWPAW_INOUTHID
|
|
||||||
|
|
||||||
|
#endif //#ifdef d
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
XUD_Result_t result;
|
XUD_Result_t result;
|
||||||
@@ -946,11 +946,14 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
|
|||||||
#ifdef PAWPAW_INOUTHID
|
#ifdef PAWPAW_INOUTHID
|
||||||
case XUD_SetData_Select(c_hid, ep_hid, result):
|
case XUD_SetData_Select(c_hid, ep_hid, result):
|
||||||
{
|
{
|
||||||
// debug_printf("HID IN\n");
|
// printf("HID IN\n");
|
||||||
hid_Buffer_exchange(BUF_XMOS_PC,g_hidData_in);
|
if( hid_Buffer_exchange(BUF_XMOS_PC,g_hidData_in)){
|
||||||
|
}
|
||||||
|
XUD_SetReady_In(ep_hid, g_hidData_in, 5);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
XUD_SetReady_In(ep_hid, g_hidData_in, PAWPAW_CFG_HID_IN_BUFSIZE);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -453,24 +453,20 @@ static unsigned char hidReportDescriptorPtr[] = {
|
|||||||
#ifdef PAWPAW_INOUTHID
|
#ifdef PAWPAW_INOUTHID
|
||||||
#define hidReportDescriptorLength (sizeof(hidReportDescriptorPtr))
|
#define hidReportDescriptorLength (sizeof(hidReportDescriptorPtr))
|
||||||
static unsigned char hidReportDescriptorPtr[] = {
|
static unsigned char hidReportDescriptorPtr[] = {
|
||||||
0x05, 0x0c, // HID_USAGE_PAGE (Vendor Defined)
|
0x05, 0x01, // USAGE_PAGE (Generic Desktop) //dwj cp 长沙西鲸
|
||||||
0x09, 0x01, // USAGE (Undefined)
|
0x09, 0x00, // USAGE (0)
|
||||||
0xa1, 0x01, // COLLECTION (Application)
|
0xa1, 0x01, // COLLECTION (Application)
|
||||||
// Report ID if any
|
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
||||||
0x09, 0x02, // USAGE (Undefined)
|
0x25, 0xff, // LOGICAL_MAXIMUM (255)
|
||||||
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
0x19, 0x01, // USAGE_MINIMUM (1)
|
||||||
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
|
0x29, 0x05, // USAGE_MAXIMUM (8) -dwj
|
||||||
0x75, 0x08, // REPORT_SIZE (8)
|
0x95, 0x05, // REPORT_COUNT (8) -dwj
|
||||||
0x95, PAWPAW_CFG_HID_IN_BUFSIZE, // REPORT_COUNT (report_size)
|
0x75, 0x08, // REPORT_SIZE (8)
|
||||||
0x81, 0x02, // INPUT (Data,Var,Abs)
|
0x81, 0x02, // INPUT (Data,Var,Abs)
|
||||||
// Output
|
0x19, 0x01, // USAGE_MINIMUM (1)
|
||||||
0x09, 0x03, // USAGE (Undefined)
|
0x29, 0x05, // USAGE_MAXIMUM (8) -dwj
|
||||||
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
0x91, 0x02, // OUTPUT (Data,Var,Abs)
|
||||||
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
|
0xc0 // END_COLLECTION
|
||||||
0x75, 0x08, // REPORT_SIZE (8)
|
|
||||||
0x95, PAWPAW_CFG_HID_OUT_BUFSIZE, // REPORT_COUNT (report_size)
|
|
||||||
0x91, 0x02, // OUTPUT (Data,Var,Abs)
|
|
||||||
0xc0 // END_COLLECTION
|
|
||||||
};
|
};
|
||||||
#endif //#ifdef PAWPAW_INOUTHID
|
#endif //#ifdef PAWPAW_INOUTHID
|
||||||
|
|
||||||
@@ -902,6 +898,16 @@ void XUA_Endpoint0_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0
|
|||||||
result = HidInterfaceClassRequests(ep0_out, ep0_in, &sp);
|
result = HidInterfaceClassRequests(ep0_out, ep0_in, &sp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PAWPAW_INOUTHID
|
||||||
|
if (interfaceNum == INTERFACE_NUMBER_HID)
|
||||||
|
{
|
||||||
|
debug_printf("INTERFACE_NUMBER_HID");
|
||||||
|
extern XUD_Result_t HidInterfaceClassRequests_PAWPAW(XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_SetupPacket_t sp);
|
||||||
|
HidInterfaceClassRequests_PAWPAW(ep0_out, ep0_in, sp);
|
||||||
|
}
|
||||||
|
#endif//#ifdef PAWPAW_INOUTHID
|
||||||
|
|
||||||
/* Check for: - Audio CONTROL interface request - always 0, note we check for DFU first
|
/* Check for: - Audio CONTROL interface request - always 0, note we check for DFU first
|
||||||
* - Audio STREAMING interface request (In or Out)
|
* - Audio STREAMING interface request (In or Out)
|
||||||
* - Audio endpoint request (Audio 1.0 Sampling freq requests are sent to the endpoint)
|
* - Audio endpoint request (Audio 1.0 Sampling freq requests are sent to the endpoint)
|
||||||
|
|||||||
Reference in New Issue
Block a user