kernel/inc/drivers/builtin/ps2/controller.h

24 lines
873 B
C
Raw Normal View History

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_CONTROLLER_H
#define NOX_CONTROLLER_H
#include "utils/stdtypes.h"
#define PS2_CONTROLLER_DATA_PORT 0x60
#define PS2_CONTROLLER_STATUS_PORT 0x64
#define PS2_CONTROLLER_COMMAND_PORT 0x64
#define PS2_CONTROLLER_TIMEOUT 0xFFFFF
void ps2_controller_init ();
uint8_t ps2_controller_command (uint8_t command);
uint8_t ps2_controller_command_with_data (uint8_t command, uint8_t data);
bool ps2_controller_command_has_response (uint8_t command);
bool ps2_controller_wait_until_ready_for_input ();
bool ps2_controller_wait_until_ready_for_output ();
uint8_t ps2_controller_read_data ();
void ps2_controller_write_data (uint8_t data);
#endif //NOX_CONTROLLER_H