The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
ps2_mouse.h File Reference

the PS/2 mouse on the i8042 controller's second (aux) port. More...

#include "common/stdint.h"

Go to the source code of this file.

Functions

bool ps2_mouse_init (void)
 find and turn on a PS/2 mouse.
void ps2_mouse_byte (uint8_t byte)
 one byte from the mouse.

Detailed Description

the PS/2 mouse on the i8042 controller's second (aux) port.

the mouse sends 3-byte packets (4 with a scroll wheel) on IRQ 12. the driver turns them into /dev/input events: BTN_LEFT, BTN_RIGHT and BTN_MIDDLE, REL_X, REL_Y and REL_WHEEL.

Function Documentation

◆ ps2_mouse_init()

bool ps2_mouse_init ( void )

find and turn on a PS/2 mouse.

call with interrupts off, after the keyboard driver and the interrupt controllers are set up.

Returns
true if a mouse answered.

◆ ps2_mouse_byte()

void ps2_mouse_byte ( uint8_t byte)

one byte from the mouse.

the keyboard interrupt hands over a mouse byte it finds in the data port (the i8042 status says which device sent it).