From d58be71b5bf640a117b301d74f4e82110a689561 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 16 Sep 2024 17:45:44 -0600 Subject: copyright notices, coroutines --- usb_keyboard.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'usb_keyboard.h') 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 + * 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_ */ -- cgit v1.2.3-2-g168b