AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
i8042.h File Reference
#include <core/types.h>

Go to the source code of this file.

Functions

void i8042_handler_register (int port, void(*fun)(int))
 Registers the function that gets each byte a port receives.
int i8042_aux_write (uint8_t byte)
 Sends a byte to the device on the second port (the mouse).
void i8042_reboot (void)
 Resets the CPU, through the controller's output line: this reboots the PC.

Function Documentation

◆ i8042_aux_write()

int i8042_aux_write ( uint8_t byte)

Sends a byte to the device on the second port (the mouse).

Its replies come as that port's interrupts.

Parameters
bytethe byte
Returns
0, -ENODEV if there is no controller, or -ETIMEDOUT if it didn't take the byte in time

Definition at line 100 of file i8042.c.

References COMMAND_PORT, DATA_PORT, i8042_aux_write(), i8042_found, i8042_ioaddr, io_out8(), and write_wait().

Referenced by i8042_aux_write(), ps2mouse_file_open(), ps2mouse_probe(), and ps2mouse_write().

◆ i8042_handler_register()

void i8042_handler_register ( int port,
void(* fun )(int) )

Registers the function that gets each byte a port receives.

Parameters
portthe port: 1 (the keyboard) or 2 (the mouse)
funthe function, called with each byte, from the interrupt

Definition at line 75 of file i8042.c.

References i8042_handler_register(), and port_handler.

Referenced by i8042_handler_register(), ps2kbd_probe(), and ps2mouse_register().

◆ i8042_reboot()

void i8042_reboot ( void )

Resets the CPU, through the controller's output line: this reboots the PC.

Without a controller, it does nothing.

Definition at line 123 of file i8042.c.

References COMMAND_PORT, i8042_found, i8042_ioaddr, i8042_reboot(), and io_out8().

Referenced by i8042_reboot(), and platform_reboot().