MentOS  0.8.0
The Mentoring Operating System
Functions
ps2.h File Reference

PS/2 drivers. More...

Go to the source code of this file.

Functions

int ps2_initialize (void)
 Initializes ps2 devices. More...
 
void ps2_write_data (unsigned char data)
 Writes a byte of data to the PS/2 device. More...
 
void ps2_write_command (unsigned char command)
 Sends a command to the PS/2 controller. More...
 
unsigned char ps2_read_data (void)
 Reads a byte of data from the PS/2 device. More...
 

Detailed Description

PS/2 drivers.

Function Documentation

◆ ps2_initialize()

int ps2_initialize ( void  )

Initializes ps2 devices.

Returns
0 on success, 1 on failure.

◆ ps2_read_data()

unsigned char ps2_read_data ( void  )

Reads a byte of data from the PS/2 device.

This function waits until data is available in the output buffer of the PS/2 controller. Once data is available, it reads and returns the byte from the PS/2 data register.

Returns
The byte of data read from the PS/2 device.

◆ ps2_write_command()

void ps2_write_command ( unsigned char  command)

Sends a command to the PS/2 controller.

This function waits until the input buffer of the PS/2 controller is empty before writing the specified command to the PS/2 command register.

Parameters
commandThe command byte to be sent to the PS/2 controller.

◆ ps2_write_data()

void ps2_write_data ( unsigned char  data)

Writes a byte of data to the PS/2 device.

This function waits until the input buffer of the PS/2 controller is empty before sending the specified data byte to the PS/2 data register.

Parameters
dataThe byte of data to be sent to the PS/2 device.