diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-16 17:45:44 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-09-17 12:15:04 -0600 |
commit | d58be71b5bf640a117b301d74f4e82110a689561 (patch) | |
tree | 990a3af524df6fbf2c462ac426e9353bd6662135 /usb_keyboard.h | |
parent | 82634b3b8eabcc966c5480c4a58b81dbcb49d022 (diff) |
copyright notices, coroutines
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_ */ |