1#include <kernel/drivers/ps2/ps2_kbd.h>
21 LOG_WARN(
"failed to read PS/2 keyboard response\n");
30 LOG_ERR(
"unexpected PS/2 keyboard response: %d\n", response);
56 LOG_ERR(
"failed to set PS/2 keyboard scan code set\n");
63 LOG_ERR(
"failed to create PS/2 keyboard\n");
71 LOG_ERR(
"failed to allocate memory for PS/2 keyboard IRQ context\n");
void irq_install(irq_t irq, irq_callback_func_t func, void *data)
Install an IRQ handler.
void kbd_push(kbd_t *kbd, kbd_event_type_t type, keycode_t code)
Push a keyboard event to the keyboard event queue.
void kbd_free(kbd_t *kbd)
Free and deinitialize a keyboard structure.
kbd_t * kbd_new(const char *name)
Allocate and initialize a keyboard structure.
uint64_t ps2_kbd_init(ps2_device_info_t *info)
Initialize a PS/2 keyboard device.
#define PS2_SCAN_CODE_SET
PS/2 scan code set to use.
keycode_t ps2_scancode_to_keycode(ps2_scancode_t scancode, bool isExtended)
Convert a PS/2 scancode to a generic keycode.
uint8_t ps2_scancode_t
PS/2 scancode.
#define PS2_DEV_SUB_CMD(device, command, subCommand)
Send a command and a subcommand to a PS/2 device.
#define PS2_READ(data)
Read data from PS/2 controller.
ps2_device_response_t
PS/2 device command responses.
@ PS2_DEV_FIRST
First PS/2 port.
@ PS2_DEV_CMD_SET_SCANCODE_SET
@ PS2_DEV_RESPONSE_RESEND
@ PS2_DEV_RESPONSE_BAT_OK
@ PS2_DEV_RESPONSE_KBD_EXTENDED
Indicates that the following byte is an extended scancode.
@ PS2_DEV_RESPONSE_KBD_RELEASE
Indicates that the following byte is a key release code.
#define LOG_ERR(format,...)
#define LOG_WARN(format,...)
keycode_t
Keyboard keycode type.
kbd_event_type_t
Keyboard event type.
@ KBD_RELEASE
Key release event.
@ KBD_PRESS
Key press event.
#define NULL
Pointer error value.
#define ERR
Integer error value.
static void ps2_kbd_irq(irq_t irq, void *data)
_PUBLIC void * malloc(size_t size)
PS/2 device information structure.
State for the PS/2 keyboard interrupt handler.