2023-04-30 10:07:54 +00:00
|
|
|
// 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
|
|
|
|
|
2023-05-03 20:01:08 +00:00
|
|
|
#define PS2_CONTROLLER_TIMEOUT 0xFFFFF
|
2023-04-30 10:07:54 +00:00
|
|
|
|
|
|
|
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);
|
2023-05-03 20:01:08 +00:00
|
|
|
bool ps2_controller_command_has_response (uint8_t command);
|
2023-04-30 10:07:54 +00:00
|
|
|
bool ps2_controller_wait_until_ready_for_input ();
|
|
|
|
bool ps2_controller_wait_until_ready_for_output ();
|
|
|
|
uint8_t ps2_controller_read_data ();
|
2023-05-03 20:01:08 +00:00
|
|
|
void ps2_controller_write_data (uint8_t data);
|
2023-04-30 10:07:54 +00:00
|
|
|
|
|
|
|
#endif //NOX_CONTROLLER_H
|