4 * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 1999, 2003 Bernardo Innocenti
6 * This file is part of DevLib - See README.devlib for information.
9 * \brief Keyboard driver (interface)
12 * \author Bernardo Innocenti <bernie@develer.com>
13 * \author Stefano Fedrigo <aleph@develer.com>
14 * \author Francesco Sacchi <batt@develer.com>
19 *#* Revision 1.2 2006/02/10 12:38:16 bernie
20 *#* Add preliminary FreeRTOS support; Enforce CONFIG_* definitions.
22 *#* Revision 1.1 2005/06/27 21:28:45 bernie
23 *#* Import generic keyboard driver.
30 #include <cfg/compiler.h>
31 #include <mware/list.h>
33 #define KBD_POLL_SOFTINT 1
34 #define KBD_POLL_FREERTOS 2
37 * Keyboard handler descriptor
39 typedef struct KbdHandler
42 keymask_t (*hook)(keymask_t); /*!< Hook function */
43 int8_t pri; /*!< Priority in input queue */
44 uint8_t flags; /*!< See below for definitions */
47 #define KHF_RAWKEYS BV(0) /*!< Handler gets raw key events */
50 extern void kbd_init(void);
51 extern keymask_t kbd_peek(void);
52 extern keymask_t kbd_get(void);
53 extern keymask_t kbd_get_timeout(mtime_t timeout);
54 extern void kbd_addHandler(struct KbdHandler *handler);
55 extern void kbd_remHandler(struct KbdHandler *handler);
57 #endif /* DRV_KBD_H */