-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPS2MouseIncludes.h
30 lines (25 loc) · 1.01 KB
/
PS2MouseIncludes.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
#ifndef PS2MouseIncludes_h
#define PS2MouseIncludes_h
#define _wait(x) while(digitalRead(_clockPin) == x)
#define _trueHiFalseLo(x) ((x)?_gohi(_dataPin):_golo(_dataPin))
#define _writeRead(x) {_write(x); (void)_read();}
#define v_read() (void)_read()
#ifndef HID_H_PRB
#define HID_H_PRB
#include "HID.h"
#endif
#define SET_RESOLUTION 0xE8
#define REQUEST_DATA 0xEB
#define SET_REMOTE_MODE 0xF0
#define GET_DEVICE_ID 0xF2
#define SET_SAMPLE_RATE 0xF3
#define SAMPLE_RATE 0x28
#define RESET 0xFF
#define INTELLI_MOUSE 0x03
#define SET_SCALING_TO_1_TO_1 0xE6
#define RESOLUTION_8_COUNTS_PER_MM 0x03
static const uint8_t mouse_hidReportDescriptor[] PROGMEM = { 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09,
0x01, 0xa1, 0x00, 0x85, 0x01, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03, 0x15, 0x00, 0x25, 0x01, 0x95,
0x03, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x03, 0x05, 0x01, 0x09, 0x30, 0x09,
0x31, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x03, 0x81, 0x06, 0xc0, 0xc0 };
#endif