forked from PAWPAW-Mirror/lib_xua
add pawpaw user_hid_ctrl api
This commit is contained in:
@@ -18,6 +18,7 @@ unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0U};
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PAWPAW_INOUTHID
|
#ifdef PAWPAW_INOUTHID
|
||||||
|
#include "user_hid_ctrl.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
unsigned char g_hidData_in[PAWPAW_CFG_HID_IN_BUFSIZE] = {0};
|
unsigned char g_hidData_in[PAWPAW_CFG_HID_IN_BUFSIZE] = {0};
|
||||||
unsigned char g_hidData_out[PAWPAW_CFG_HID_OUT_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):
|
case XUD_SetData_Select(c_hid, ep_hid, result):
|
||||||
{
|
{
|
||||||
// debug_printf("HID IN\n");
|
// debug_printf("HID IN\n");
|
||||||
g_hidData_in[0]=0x01;
|
hid_Buffer_exchange(BUF_XMOS_PC,g_hidData_in);
|
||||||
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;
|
|
||||||
|
|
||||||
XUD_SetReady_In(ep_hid, g_hidData_in, PAWPAW_CFG_HID_IN_BUFSIZE);
|
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):
|
case XUD_GetData_Select(c_hid_out, ep_hid_out,length, result):
|
||||||
{
|
{
|
||||||
XUD_SetReady_Out(ep_hid_out,g_hidData_out);
|
XUD_SetReady_Out(ep_hid_out,g_hidData_out);
|
||||||
|
hid_Buffer_exchange(BUF_PC_XMOS,g_hidData_out);
|
||||||
// XMOS 获取到的HID数据
|
// XMOS 获取到的HID数据
|
||||||
// g_hidData_out[0]...g_hidData_out[7]
|
// g_hidData_out[0]...g_hidData_out[7]
|
||||||
// printf("g_hidData_out %d\n",length);
|
// printf("g_hidData_out %d\n",length);
|
||||||
|
|||||||
Reference in New Issue
Block a user