Okay wow i forgot to commit a bunch of stuff
I added some work on a keyboard driver here also changed the emulation system, since bochs was giving me headaches when it came to keyboard input added some todo stuff.. probably some cleanup, idk
This commit is contained in:
@ -3,9 +3,37 @@
|
||||
#ifndef ARCH_KEYB_H
|
||||
#define ARCH_KEYB_H
|
||||
|
||||
#define KEYB_DATA_PORT (0x60)
|
||||
#define KEYB_STATUS_PORT (0x64)
|
||||
#define KEYB_COMMAND_PORT (0x64)
|
||||
#define KEYB_PORT (0x60)
|
||||
|
||||
#define KEYB_CMD_RETRIES 3
|
||||
|
||||
#define KEYB_CMD_SET_LEDS (0xED)
|
||||
#define KEYB_CMD_ECHO (0xEE)
|
||||
#define KEYB_CMD_DO_SCAN_CODE (0xF0)
|
||||
#define KEYB_CMD_IDENTIFY_KEYB (0xF2)
|
||||
#define KEYB_CMD_SET_TYPEMATIC (0xF3)
|
||||
#define KEYB_CMD_ENABLE_SCANNING (0xF4)
|
||||
#define KEYB_CMD_DISABLE_SCANNING (0xF5)
|
||||
#define KEYB_CMD_SET_DEFAULT_PARAMS (0xF6)
|
||||
#define KEYB_CMD_TYPEMATIC_AUTOREPEAT_3 (0xF7)
|
||||
#define KEYB_CMD_ALL_MAKE_RELEASE_3 (0xF8)
|
||||
#define KEYB_CMD_MAKE_ONLY_3 (0xF9)
|
||||
#define KEYB_CMD_TYPE_AUTOREPEAT_MAKE_RELEASE_3 (0xFA)
|
||||
#define KEYB_CMD_KEY_TYPEMATIC_AUTOREPEAT_3 (0xFB)
|
||||
#define KEYB_CMD_KEY_MAKE_RELEASE_3 (0xFC)
|
||||
#define KEYB_CMD_KEY_MAKE_3 (0xFD)
|
||||
#define KEYB_RESEND_LAST_BYTE (0xFE)
|
||||
#define KEYB_RESET_SELF_TEST (0xFF)
|
||||
|
||||
|
||||
#define KEYB_LED_SCRL_LCK (1 << 0)
|
||||
#define KEYB_LED_NUM_LCK (1 << 1)
|
||||
#define KEYB_LED_CAP_LCK (1 << 2)
|
||||
|
||||
#define KEYB_GET_SCAN_SET (0x00)
|
||||
#define KEYB_SET_SCAN_1 (0x01)
|
||||
#define KEYB_SET_SCAN_2 (0x02)
|
||||
#define KEYB_SET_SCAN_3 (0x03)
|
||||
|
||||
|
||||
#define KEYB_RESP_ERR (0x00)
|
||||
@ -72,7 +100,20 @@ typedef enum {
|
||||
KEY_F12_R,
|
||||
} kb_key_press_t;
|
||||
|
||||
struct keypress {
|
||||
kb_key_press_t key_code;
|
||||
uint8_t
|
||||
};
|
||||
|
||||
struct keyboard_state {
|
||||
uint8_t leds;
|
||||
};
|
||||
|
||||
|
||||
void init_kb(void);
|
||||
|
||||
void send_kb_commands(void);
|
||||
void queue_kb_command(uint8_t command);
|
||||
|
||||
|
||||
kb_key_press_t decode_scancode(uint8_t scancode);
|
||||
|
Reference in New Issue
Block a user