|
PatchworkOS
d0b3021
A non-POSIX operating system.
|
IBM Personal Computer/2 ports. More...
IBM Personal Computer/2 ports.
Modules | |
| PS/2 Keyboard Driver | |
| PS/2 Keyboard Driver. | |
| PS/2 Mouse Driver | |
| PS/2 Mouse Driver. | |
| PS/2 Scanmap | |
| PS/2 Scanmap. | |
Data Structures | |
| struct | ps2_known_device_t |
| Known PS/2 device structure. More... | |
| struct | ps2_device_info_t |
| PS/2 device information structure. More... | |
Macros | |
| #define | PS2_WAIT_TIMEOUT (CLOCKS_PER_SEC / 2) |
| Wait timeout for PS/2 controller. | |
| #define | PS2_SMALL_DELAY (CLOCKS_PER_SEC / 100) |
| Small delay for various operations. | |
| #define | PS2_LARGE_DELAY (CLOCKS_PER_SEC / 5) |
| Large delay for various operations. | |
| #define | PS2_COMMAND_RETRIES 10 |
| Number of retries for commands. | |
| #define | PS2_KEYBOARD_PNP_IDS |
| All known PS/2 keyboard PNP IDs. | |
| #define | PS2_MOUSE_PNP_IDS |
| All known PS/2 mouse PNP IDs. | |
Functions | |
| void | ps2_drain (void) |
| Drain the PS/2 output buffer. | |
| uint64_t | ps2_wait_until_set (ps2_status_bits_t status) |
| Wait until status bit(s) are set. | |
| uint64_t | ps2_wait_until_clear (ps2_status_bits_t status) |
| Wait until status bit(s) are clear. | |
| uint64_t | ps2_read (void) |
| Read from the PS/2 controllers data port. | |
| uint64_t | ps2_read_no_wait (void) |
| Read from the PS/2 controllers data port without waiting. | |
| uint64_t | ps2_write (uint8_t data) |
| Write to the PS/2 controllers data port. | |
| uint64_t | ps2_cmd (ps2_cmd_t command) |
| Send a command to the PS/2 controller without reading response. | |
| uint64_t | ps2_cmd_and_read (ps2_cmd_t command) |
| Send a command to the PS/2 controller and read response. | |
| uint64_t | ps2_cmd_and_write (ps2_cmd_t command, uint8_t data) |
| Send a command to the PS/2 controller and write data. | |
| uint64_t | ps2_device_cmd (ps2_device_t device, ps2_device_cmd_t command) |
| Send a command to a PS/2 device without reading response. | |
| uint64_t | ps2_device_cmd_and_read (ps2_device_t device, ps2_device_cmd_t command) |
| Send a command to a PS/2 device and read response. | |
| uint64_t | ps2_device_sub_cmd (ps2_device_t device, ps2_device_cmd_t command, uint8_t subCommand) |
| Send a command and a subcommand to a PS/2 device. | |
| #define PS2_WAIT_TIMEOUT (CLOCKS_PER_SEC / 2) |
| #define PS2_SMALL_DELAY (CLOCKS_PER_SEC / 100) |
| #define PS2_LARGE_DELAY (CLOCKS_PER_SEC / 5) |
| #define PS2_KEYBOARD_PNP_IDS |
All known PS/2 keyboard PNP IDs.
| #define PS2_MOUSE_PNP_IDS |
All known PS/2 mouse PNP IDs.
PS/2 controller configuration bits.
| uint64_t ps2_wait_until_set | ( | ps2_status_bits_t | status | ) |
| uint64_t ps2_wait_until_clear | ( | ps2_status_bits_t | status | ) |
Read from the PS/2 controllers data port.
Waits for the output buffer to be full, then reads a byte from the data port.
ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting for data. Definition at line 365 of file ps2.c.
Write to the PS/2 controllers data port.
Waits for the input buffer to be empty, then writes a byte to the data port.
| data | Byte to write. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to write. Definition at line 386 of file ps2.c.
Send a command to the PS/2 controller without reading response.
| command | Command to send. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command. Definition at line 397 of file ps2.c.
Send a command to the PS/2 controller and read response.
| command | Command to send. |
ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command or read data. Definition at line 408 of file ps2.c.
Send a command to the PS/2 controller and write data.
| command | Command to send. |
| data | Data to write. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command or write data. Definition at line 417 of file ps2.c.
| uint64_t ps2_device_cmd | ( | ps2_device_t | device, |
| ps2_device_cmd_t | command | ||
| ) |
Send a command to a PS/2 device without reading response.
| device | Device to send command to. |
| command | Command to send. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command. Definition at line 488 of file ps2.c.
| uint64_t ps2_device_cmd_and_read | ( | ps2_device_t | device, |
| ps2_device_cmd_t | command | ||
| ) |
Send a command to a PS/2 device and read response.
| device | Device to send command to, specified by its port. |
| command | Command to send. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command or read data. Definition at line 530 of file ps2.c.
| uint64_t ps2_device_sub_cmd | ( | ps2_device_t | device, |
| ps2_device_cmd_t | command, | ||
| uint8_t | subCommand | ||
| ) |
Send a command and a subcommand to a PS/2 device.
| device | Device to send command to, specified by its port. |
| command | Command to send. |
| subCommand | Subcommand to send. |
0. On failure, ERR and errno is set to:ETIMEOUT: Timeout occurred while waiting to send command or subcommand. Definition at line 539 of file ps2.c.