diff options
Diffstat (limited to 'usb_keyboard.h')
-rw-r--r-- | usb_keyboard.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/usb_keyboard.h b/usb_keyboard.h index 9460feb..e989700 100644 --- a/usb_keyboard.h +++ b/usb_keyboard.h @@ -1,10 +1,25 @@ +/* usb_keyboard.h - Implementation of a USB keyboard device + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + #ifndef _USB_KEYBOARD_H_ #define _USB_KEYBOARD_H_ -void usb_keyboard_init(void); -void usb_keyboard_task(void); +#include "coroutine.h" + +typedef cr_chan_t(uint32_t, int) usb_keyboard_chan_t; -bool usb_keyboard_send_char(uint32_t ch); -bool usb_keyboard_is_flushed(void); +typedef struct { + usb_keyboard_chan_t *chan; + uint32_t rune; + uint8_t report_id; + uint8_t modifier; + uint8_t keycodes[0]; +} usb_keyboard_stack_t; + +void usb_keyboard_init(void); +void usb_keyboard_cr(void *stack); #endif /* _USB_KEYBOARD_H_ */ |