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.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h
index 4529ce113..305a9bdba 100644
--- a/protocol/ps2_mouse.h
+++ b/protocol/ps2_mouse.h
@@ -20,6 +20,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21#include <stdbool.h> 21#include <stdbool.h>
22 22
23#define PS2_MOUSE_READ_DATA 0xEB
24
25/*
26 * Data format:
27 * byte|7 6 5 4 3 2 1 0
28 * ----+--------------------------------------------------------------
29 * 0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left
30 * 1| X movement(0-255)
31 * 2| Y movement(0-255)
32 */
23#define PS2_MOUSE_BTN_MASK 0x07 33#define PS2_MOUSE_BTN_MASK 0x07
24#define PS2_MOUSE_BTN_LEFT 0 34#define PS2_MOUSE_BTN_LEFT 0
25#define PS2_MOUSE_BTN_RIGHT 1 35#define PS2_MOUSE_BTN_RIGHT 1
@@ -29,16 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#define PS2_MOUSE_X_OVFLW 6 39#define PS2_MOUSE_X_OVFLW 6
30#define PS2_MOUSE_Y_OVFLW 7 40#define PS2_MOUSE_Y_OVFLW 7
31 41
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); 42uint8_t ps2_mouse_init(void);
39uint8_t ps2_mouse_read(void); 43void ps2_mouse_task(void);
40bool ps2_mouse_changed(void);
41void ps2_mouse_usb_send(void);
42void ps2_mouse_print(void);
43 44
44#endif 45#endif