1#include <kernel/drivers/ps2/ps2_mouse.h>
29 LOG_WARN(
"failed to scan PS/2 mouse\n");
33 switch (context->
index)
91 LOG_ERR(
"failed to create PS/2 mouse\n");
99 LOG_ERR(
"failed to allocate memory for PS/2 mouse IRQ context\n");
106 LOG_ERR(
"failed to set default PS/2 mouse settings\n");
void irq_install(irq_t irq, irq_callback_func_t func, void *data)
Install an IRQ handler.
mouse_t * mouse_new(const char *name)
Allocate and initialize a mouse structure.
void mouse_free(mouse_t *mouse)
Free and deinitialize a mouse structure.
void mouse_push(mouse_t *mouse, mouse_buttons_t buttons, int64_t deltaX, int64_t deltaY)
Push a new mouse event to the mouse event queue.
uint64_t ps2_mouse_init(ps2_device_info_t *info)
Initialize a PS/2 mouse device.
@ PS2_PACKET_BUTTON_RIGHT
@ PS2_PACKET_BUTTON_MIDDLE
#define PS2_DEV_CMD(device, command)
Send a command to a PS/2 device without reading response.
#define PS2_READ(data)
Read data from PS/2 controller.
@ PS2_DEV_FIRST
First PS/2 port.
@ PS2_DEV_CMD_SET_DEFAULTS
#define LOG_ERR(format,...)
#define LOG_WARN(format,...)
mouse_buttons_t
Mouse buttons enum.
@ MOUSE_RIGHT
Right mouse button.
@ MOUSE_MIDDLE
Middle mouse button.
@ MOUSE_LEFT
Left mouse button.
#define NULL
Pointer error value.
#define ERR
Integer error value.
static void ps2_mouse_irq(irq_t irq, void *data)
static void ps2_mouse_handle_packet(const ps2_mouse_packet_t *packet)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
PS/2 device information structure.
ps2_mouse_packet_index_t index
Current packet byte index.
ps2_mouse_packet_t packet
Current packet being assembled.
PS/2 mouse packet structure.
ps2_mouse_packet_flags_t flags
Packet flags.
int16_t deltaY
Y-axis movement.
int16_t deltaX
X-axis movement.