X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fkbd.h;h=801b77a1978067bb67c03c0abc47e074dd959c3d;hb=9c6545aacf8bb77445e7c19e41117d2318d752cc;hp=6b7e0cbdf3c62200e1b3ef63e62c958c6d9e1564;hpb=b92829994618e41c2b1bc9e48d5ce37797e175c7;p=bertos.git diff --git a/drv/kbd.h b/drv/kbd.h old mode 100755 new mode 100644 index 6b7e0cbd..801b77a1 --- a/drv/kbd.h +++ b/drv/kbd.h @@ -1,9 +1,34 @@ -/*! +/** * \file * * * \brief Keyboard driver (interface) @@ -16,6 +41,15 @@ /*#* *#* $Log$ + *#* Revision 1.6 2006/07/19 12:56:25 bernie + *#* Convert to new Doxygen style. + *#* + *#* Revision 1.5 2006/06/03 13:57:36 bernie + *#* Make keyboard repeat mask run-time configurable. + *#* + *#* Revision 1.4 2006/03/20 17:50:17 bernie + *#* Add FreeRTOS and Observers support. + *#* *#* Revision 1.3 2006/02/27 22:39:45 bernie *#* Misc build and doc fixes from project_grl. *#* @@ -32,6 +66,7 @@ #include #include #include +#include // CONFIG_KBD_OBSERVER /** * \name Keyboard polling modes. @@ -44,25 +79,39 @@ #define KBD_POLL_FREERTOS 2 /* \} */ -/*! +/** * Keyboard handler descriptor */ typedef struct KbdHandler { Node link; - keymask_t (*hook)(keymask_t); /*!< Hook function */ - int8_t pri; /*!< Priority in input queue */ - uint8_t flags; /*!< See below for definitions */ + keymask_t (*hook)(keymask_t); /**< Hook function */ + int8_t pri; /**< Priority in input queue */ + uint8_t flags; /**< See below for definitions */ } KbdHandler; -#define KHF_RAWKEYS BV(0) /*!< Handler gets raw key events */ +#define KHF_RAWKEYS BV(0) /**< Handler gets raw key events */ + + +void kbd_init(void); +keymask_t kbd_peek(void); +keymask_t kbd_get(void); +keymask_t kbd_get_timeout(mtime_t timeout); +void kbd_addHandler(struct KbdHandler *handler); +void kbd_remHandler(struct KbdHandler *handler); +keymask_t kbd_setRepeatMask(keymask_t mask); + +#if CONFIG_KBD_OBSERVER + struct Subject; + /** Subject structure for keyboard observers. */ + extern struct Subject kbd_subject; -extern void kbd_init(void); -extern keymask_t kbd_peek(void); -extern keymask_t kbd_get(void); -extern keymask_t kbd_get_timeout(mtime_t timeout); -extern void kbd_addHandler(struct KbdHandler *handler); -extern void kbd_remHandler(struct KbdHandler *handler); + enum + { + /* Event for key presses. */ + KBD_EVENT_KEY = 0x100 + }; +#endif #endif /* DRV_KBD_H */