blob: 4c5908998c90c5c6e6b3ee86b83ad0e06c159b7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef PS2MOUSE_H
#define PS2MOUSE_H
#include "string.h"
#include "interrupts.h"
#include "port.h"
#include "mouse.h"
#define MAX_NOF_MOUSE_PACKETS 5
typedef struct {
mouse_t base;
port8_t command_port;
port8_t data_port;
int nof_packets; // 3 or more mouse packets
uint8_t buf[MAX_NOF_MOUSE_PACKETS];
uint8_t buttons;
uint8_t offset;
interrupt_handler_t interrupt_handler;
} ps2mouse_t;
typedef struct {
mouse_vtable_t base;
} ps2mouse_vtable_t;
void ps2mouse_init( ps2mouse_t *mouse, mouse_event_handler_t handler, interrupt_t *interrupt, void *context );
void ps2mouse_activate( void *obj );
void ps2mouse_deactivate( void *obj );
void ps2mouse_print_info( void *obj );
uint32_t ps2mouse_handle_interrupt( interrupt_handler_t *handler, uint32_t esp );
#endif // PS2MOUSE_H
|