minor corrections by M.Taguchi
[reactos.git] / reactos / drivers / input / psaux / mouse.h
1 // All or parts of this file are from CHAOS (http://www.se.chaosdev.org/).
2 // CHAOS is also under the GNU General Public License.
3
4 #define WHEEL_DELTA (120)
5
6 #define PSMOUSE_CMD_SETSCALE11 0x00e6
7 #define PSMOUSE_CMD_SETRES 0x10e8
8 #define PSMOUSE_CMD_GETINFO 0x03e9
9 #define PSMOUSE_CMD_SETSTREAM 0x00ea
10 #define PSMOUSE_CMD_POLL 0x03eb
11 #define PSMOUSE_CMD_GETID 0x02f2
12 #define PSMOUSE_CMD_SETRATE 0x10f3
13 #define PSMOUSE_CMD_ENABLE 0x00f4
14 #define PSMOUSE_CMD_RESET_DIS 0x00f6
15 #define PSMOUSE_CMD_RESET_BAT 0x02ff
16
17 #define PSMOUSE_RET_BAT 0xaa
18 #define PSMOUSE_RET_ACK 0xfa
19 #define PSMOUSE_RET_NAK 0xfe
20
21 #define MOUSE_INTERRUPTS_OFF (CONTROLLER_MODE_KCC | \
22 CONTROLLER_MODE_DISABLE_MOUSE | \
23 CONTROLLER_MODE_SYS | \
24 CONTROLLER_MODE_KEYBOARD_INTERRUPT)
25
26 #define MOUSE_INTERRUPTS_ON (CONTROLLER_MODE_KCC | \
27 CONTROLLER_MODE_SYS | \
28 CONTROLLER_MODE_MOUSE_INTERRUPT | \
29 CONTROLLER_MODE_KEYBOARD_INTERRUPT)
30
31 // Used with mouse buttons
32 #define GPM_B_LEFT 0x01
33 #define GPM_B_RIGHT 0x02
34 #define GPM_B_MIDDLE 0x04
35 #define GPM_B_FOURTH 0x10
36 #define GPM_B_FIFTH 0x20
37
38 // Mouse types
39 #define PSMOUSE_PS2 1
40 #define PSMOUSE_PS2PP 2
41 #define PSMOUSE_PS2TPP 3
42 #define PSMOUSE_GENPS 4
43 #define PSMOUSE_IMPS 5
44 #define PSMOUSE_IMEX 6
45 #define PSMOUSE_SYNAPTICS 7
46
47 // Some aux operations take long time
48 #define MAX_RETRIES 60
49
50 // Hardware defines
51 #define MOUSE_IRQ 12
52 #define MOUSE_WRAP_MASK 0x1F
53
54 #define MOUSE_ISINTELLIMOUSE 0x03
55 #define MOUSE_ISINTELLIMOUSE5BUTTONS 0x04
56
57 BOOLEAN DetectPS2Port(void);
58 BOOLEAN SetupMouse(PDEVICE_OBJECT DeviceObject, PUNICODE_STRING RegistryPath);
59 void controller_wait(void);