]> git.gir.st - tmk_keyboard.git/blob - protocol/ps2_mouse.h
Merge branch 'overlays'
[tmk_keyboard.git] / protocol / ps2_mouse.h
1 /*
2 Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along 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
32 bool ps2_mouse_enable;
33 extern uint8_t ps2_mouse_x;
34 extern uint8_t ps2_mouse_y;
35 extern uint8_t ps2_mouse_btn;
36 extern uint8_t ps2_mouse_error_count;
37
38 uint8_t ps2_mouse_init(void);
39 uint8_t ps2_mouse_read(void);
40 bool ps2_mouse_changed(void);
41 void ps2_mouse_usb_send(void);
42 void ps2_mouse_print(void);
43
44 #endif
Imprint / Impressum