add pawpaw user_hid_ctrl api

This commit is contained in:
Virgil_lai
2023-12-11 15:03:16 +08:00
parent 487ab06213
commit 791c142c94

View File

@@ -18,6 +18,7 @@ unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0U};
#endif
#ifdef PAWPAW_INOUTHID
#include "user_hid_ctrl.h"
#include "stdio.h"
unsigned char g_hidData_in[PAWPAW_CFG_HID_IN_BUFSIZE] = {0};
unsigned char g_hidData_out[PAWPAW_CFG_HID_OUT_BUFSIZE] = {0};
@@ -946,14 +947,8 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
case XUD_SetData_Select(c_hid, ep_hid, result):
{
// debug_printf("HID IN\n");
g_hidData_in[0]=0x01;
g_hidData_in[1]=0xc1;
g_hidData_in[2]=0xd2;
g_hidData_in[3]=0xe3;
g_hidData_in[4]=0xf4;
g_hidData_in[5]=0x05;
g_hidData_in[6]=0x06;
g_hidData_in[7]=0x07;
hid_Buffer_exchange(BUF_XMOS_PC,g_hidData_in);
XUD_SetReady_In(ep_hid, g_hidData_in, PAWPAW_CFG_HID_IN_BUFSIZE);
}
@@ -963,7 +958,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
case XUD_GetData_Select(c_hid_out, ep_hid_out,length, result):
{
XUD_SetReady_Out(ep_hid_out,g_hidData_out);
hid_Buffer_exchange(BUF_PC_XMOS,g_hidData_out);
// XMOS 获取到的HID数据
// g_hidData_out[0]...g_hidData_out[7]
// printf("g_hidData_out %d\n",length);