forked from felis/lightweight-usb-host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHID.h
51 lines (47 loc) · 1.25 KB
/
HID.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* HID support header */
#ifndef _HID_h_
#define _HID_h
/* HID device structure */
typedef struct {
BYTE addr;
BYTE interface;
} HID_DEVICE;
/* Boot mouse report 8 bytes */
typedef struct {
// struct {
// unsigned one:1;
// unsigned two:1;
// unsigned three:1;
// unsigned :5;
// } button;
BYTE button;
BYTE Xdispl;
BYTE Ydispl;
BYTE bytes3to7[ 5 ] ; //optional bytes
} BOOT_MOUSE_REPORT;
/* boot keyboard report 8 bytes */
typedef struct {
// BYTE mod;
struct {
unsigned LCtrl:1;
unsigned LShift:1;
unsigned LAlt:1;
unsigned LWin:1;
/**/
unsigned RCtrl:1;
unsigned RShift:1;
unsigned RAlt:1;
unsigned RWin:1;
} mod;
BYTE reserved;
BYTE keycode[ 6 ];
} BOOT_KBD_REPORT;
/* Function prototypes */
BOOL HIDMProbe( BYTE address, DWORD flags );
BOOL HIDKProbe( BYTE address, DWORD flags );
void HID_init( void );
BYTE mousePoll( BOOT_MOUSE_REPORT* buf );
BYTE kbdPoll( BOOT_KBD_REPORT* buf );
BOOL HIDMEventHandler( BYTE addr, BYTE event, void *data, DWORD size );
BOOL HIDKEventHandler( BYTE addr, BYTE event, void *data, DWORD size );
#endif // _HID_h_