#include <stdint.h>#include "port_io.h"#include "keycode.h"#include "ps2_keyboard.h"#include "keyboard.h"Functions | |
| static int | keyboard_available (void) |
| read from ps2 status port to see if data is available | |
| static uint8_t | keyboard_read (void) |
| read from ps2 data port | |
| static bool | ps2_set1_scancode_pressed (uint8_t scancode) |
| checks whether scancode indicates a key was pressed or released | |
| static struct keyboard_event | keyboard_parse (uint8_t scancode) |
| parse ps2 scancode into struct keyboard_event | |
| bool | ps2_poll (void) |
| poll ps/2 port for available events. If event available, push to keyboard subsystem | |
Variables | |
| static enum KEYCODE | ps2_set1_scancode_to_keycode [] |
| table of ps2 set1 scancodes to keycodes. | |
|
static |
read from ps2 status port to see if data is available
|
static |
parse ps2 scancode into struct keyboard_event
| scancode | ps/2 set1 scancode to parse |
|
static |
read from ps2 data port
| bool ps2_poll | ( | void | ) |
poll ps/2 port for available events. If event available, push to keyboard subsystem
poll the ps/2 keyboard for data
|
static |
checks whether scancode indicates a key was pressed or released
| scancode | set1 scancode |
the current implenetation is really crude and should be rewritten. It depends on a simple check whether the scancode is < 0x59. This works for the most part, as the majority of ps/2 set1 keypress scancodes are less than 0x59, however it's not always the case. Try pressing delete on your keyboard in the os and you will see. This should be rewritten to properly handle all keys.
|
static |
table of ps2 set1 scancodes to keycodes.