Initial implementation of HID.

This commit is contained in:
Michael Banther
2019-09-23 17:29:39 +01:00
parent 8ff44c553c
commit bb5757e099
3 changed files with 16 additions and 2 deletions

View File

@@ -880,7 +880,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out,
case XUD_SetData_Select(c_hid, ep_hid, result):
{
g_hidData[0]=0;
UserReadHIDButtons(g_hidData);
UserReadHIDData(g_hidData);
XUD_SetReady_In(ep_hid, g_hidData, 1);
}
break;

View File

@@ -9,5 +9,7 @@
#define HID_CONTROL_VOLDN_SHIFT 0x04
#define HID_CONTROL_MUTE_SHIFT 0x05
void UserReadHIDButtons(unsigned char hidData[]);
#define HID_DATA_SIZE 1
void UserReadHIDData(unsigned char hidData[HID_DATA_SIZE]);

View File

@@ -0,0 +1,12 @@
// Copyright (c) 2019, XMOS Ltd, All rights reserved
#include <stdint.h>
#include <limits.h>
#include <xs1.h>
#include "user_hid.h"
void UserReadHIDData( unsigned char hidData[ HID_DATA_SIZE ])
{
for( unsigned idx = 0; idx < HID_DATA_SIZE; ++idx ) {
hidData[ idx ] = 1;
}
}