diff options
author | tomaszduda23 <[email protected]> | 2022-07-10 04:43:54 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2022-07-09 22:43:54 +0300 |
commit | 38fae01cc01a0e984f52c004ade79256d8c90e17 (patch) | |
tree | fca48f9a0208aa5c0d79ed7f1da012b285d18025 /hid/src/ps2/hid.h | |
parent | 793edf8203ec7ea5aba934558ea26054628a5618 (diff) |
add keyboard interface (#95)
Diffstat (limited to 'hid/src/ps2/hid.h')
-rw-r--r-- | hid/src/ps2/hid.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hid/src/ps2/hid.h b/hid/src/ps2/hid.h index 6fce88b6..809f9d2d 100644 --- a/hid/src/ps2/hid.h +++ b/hid/src/ps2/hid.h @@ -32,21 +32,21 @@ // #define HID_PS2_KBD_DATA_PIN 5 -class Ps2Keyboard { +class Ps2Keyboard : public DRIVERS::Keyboard { // https://wiki.osdev.org/PS/2_Keyboard public: - Ps2Keyboard() : _dev(HID_PS2_KBD_CLOCK_PIN, HID_PS2_KBD_DATA_PIN) {} + Ps2Keyboard() : DRIVERS::Keyboard(DRIVERS::PS2_KEYBOARD), _dev(HID_PS2_KBD_CLOCK_PIN, HID_PS2_KBD_DATA_PIN) {} - void begin() { + void begin() override { _dev.keyboard_init(); } - void periodic() { + void periodic() override { _dev.keyboard_handle(&_leds); } - void sendKey(uint8_t code, bool state) { + void sendKey(uint8_t code, bool state) override { Ps2KeyType ps2_type; uint8_t ps2_code; @@ -75,11 +75,11 @@ class Ps2Keyboard { } } - bool isOffline() { + bool isOffline() override { return false; } - KeyboardLedsState getLeds() { + KeyboardLedsState getLeds() override { periodic(); KeyboardLedsState result = { .caps = _leds & 0b00000100, |