MentOS  0.8.0
The Mentoring Operating System
Macros | Functions | Variables

Routines for interfacing with the mouse. More...

Macros

#define __DEBUG_HEADER__   "[MOUSE ]"
 Change header.
 
#define __DEBUG_LEVEL__   LOGLEVEL_NOTICE
 Set log level.
 
#define MOUSE_ENABLE_PACKET   0xF4
 The mouse starts sending automatic packets.
 
#define MOUSE_DISABLE_PACKET   0xF5
 The mouse stops sending automatic packets.
 
#define MOUSE_USE_DEFAULT_SETTINGS   0xF6
 Disables streaming, sets the packet rate to 100 per second, and resolution to 4 pixels per mm.
 

Functions

int mouse_initialize (void)
 Initializes the mouse. More...
 
int mouse_finalize (void)
 De-initializes the mouse. More...
 
static void __mouse_waitcmd (unsigned char type)
 Mouse wait for a command. More...
 
static void __mouse_write (unsigned char data)
 Send data to mouse. More...
 
static unsigned char __mouse_read (void)
 Read data from mouse. More...
 
static void __mouse_isr (pt_regs *f)
 The interrupt service routine of the mouse. More...
 
static void __mouse_enable (void)
 Enable the mouse driver.
 
static void __mouse_disable (void)
 Disable the mouse driver.
 

Variables

static uint8_t mouse_cycle = 0
 Mouse ISR cycle.
 
static int8_t mouse_bytes [3]
 Mouse communication data.
 
static int32_t mouse_x = (800 / 2)
 Mouse x position.
 
static int32_t mouse_y = (600 / 2)
 Mouse y position.
 

Detailed Description

Routines for interfacing with the mouse.

Function Documentation

◆ __mouse_isr()

static void __mouse_isr ( pt_regs f)
static

The interrupt service routine of the mouse.

Parameters
fThe interrupt stack frame.

◆ __mouse_read()

static unsigned char __mouse_read ( void  )
static

Read data from mouse.

Returns
The data received from mouse.

◆ __mouse_waitcmd()

static void __mouse_waitcmd ( unsigned char  type)
static

Mouse wait for a command.

Parameters
type1 for sending - 0 for receiving.

◆ __mouse_write()

static void __mouse_write ( unsigned char  data)
static

Send data to mouse.

Parameters
dataThe data to send.

◆ mouse_finalize()

int mouse_finalize ( void  )

De-initializes the mouse.

Returns
0 on success, 1 on error.

◆ mouse_initialize()

int mouse_initialize ( void  )

Initializes the mouse.

Returns
0 on success, 1 on error.