aboutsummaryrefslogtreecommitdiff
path: root/protocol/ps2_mouse.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/ps2_mouse.h')
-rw-r--r--protocol/ps2_mouse.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h
new file mode 100644
index 000000000..4529ce113
--- /dev/null
+++ b/protocol/ps2_mouse.h
@@ -0,0 +1,44 @@
1/*
2Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef PS2_MOUSE_H
19#define PS2_MOUSE_H
20
21#include <stdbool.h>
22
23#define PS2_MOUSE_BTN_MASK 0x07
24#define PS2_MOUSE_BTN_LEFT 0
25#define PS2_MOUSE_BTN_RIGHT 1
26#define PS2_MOUSE_BTN_MIDDLE 2
27#define PS2_MOUSE_X_SIGN 4
28#define PS2_MOUSE_Y_SIGN 5
29#define PS2_MOUSE_X_OVFLW 6
30#define PS2_MOUSE_Y_OVFLW 7
31
32bool ps2_mouse_enable;
33extern uint8_t ps2_mouse_x;
34extern uint8_t ps2_mouse_y;
35extern uint8_t ps2_mouse_btn;
36extern uint8_t ps2_mouse_error_count;
37
38uint8_t ps2_mouse_init(void);
39uint8_t ps2_mouse_read(void);
40bool ps2_mouse_changed(void);
41void ps2_mouse_usb_send(void);
42void ps2_mouse_print(void);
43
44#endif