00001 00002 00003 00004 00005 #ifndef _MOUSE_H_ 00006 #define _MOUSE_H 00007 00009 enum _mouse_commands { 00010 MOUSE_RESET = 0xff, 00011 MOUSE_RESEND = 0xfe, 00012 MOUSE_SETDEFAULTS = 0xf6, 00013 MOUSE_DDR = 0xf5, 00014 MOUSE_EDR = 0xf4, 00015 MOUSE_SSR = 0xf3, 00016 MOUSE_GETID = 0xf2, 00017 MOUSE_SETREMOTE = 0xf0, 00018 MOUSE_SETWRAP = 0xee, 00019 MOUSE_RESETWRAP = 0xec, 00020 MOUSE_READDATA = 0xeb, 00021 MOUSE_SETSTREAM = 0xea, 00022 MOUSE_STATUSRQ = 0xe9, 00023 MOUSE_SETRES = 0xe8, 00024 MOUSE_SETSCALE21 = 0xe7, 00025 MOUSE_SETSCALE11 = 0xe6, 00026 }; 00027 00029 enum _mouse_response { 00030 MOUSE_ACK = 0xfa, 00031 MOUSE_NAK = 0xfe, 00032 MOUSE_ERROR = 0xfc, 00033 MOUSE_RESETOK = 0xaa, 00034 }; 00035 00037 #define YOVERFLOW 7 00038 #define XOVERFLOW 6 00039 #define YSIGN 5 00040 #define XSIGN 4 00041 #define BUTTON3 2 00042 #define BUTTON2 1 00043 #define BUTTON1 0 00044 00046 typedef union _mouse_movt { 00047 struct { 00048 uint8_t bits; 00049 uint8_t dx; 00050 uint8_t dy; 00051 } fields; 00052 00053 uint8_t byte[3]; 00054 } MouseMovt; 00055 00057 typedef struct _decoded_movt { 00058 int16_t dx; 00059 int16_t dy; 00060 uint8_t buttons; 00061 } DecodedMovt; 00062 00065 uint8_t mouse_boot(); 00066 00073 void mouse_setres(uint8_t res); 00074 00075 #endif