kbd.h File Reference

Keyboard driver (interface). More...

#include <kbd_map.h>
#include <cfg/compiler.h>
#include <mware/list.h>
#include <appconfig.h>

Go to the source code of this file.


Data Structures

struct  KbdHandler
 Keyboard handler descriptor. More...

Defines

#define KHF_RAWKEYS   BV(0)
 Handler gets raw key events.
Keyboard polling modes.
Define CONFIG_KBD_POLL to one of these.

#define KBD_POLL_SOFTINT   1
#define KBD_POLL_FREERTOS   2

Functions

void kbd_init (void)
 Initialize keyboard ports and softtimer.
keymask_t kbd_peek (void)
 Read a key from the keyboard buffer.
keymask_t kbd_get (void)
 Wait for a keypress and return the mask of depressed keys.
keymask_t kbd_get_timeout (mtime_t timeout)
 Wait up to timeout ms for a keypress and return the mask of depressed keys, or K_TIMEOUT if the timeout was reacked.
keymask_t kbd_setRepeatMask (keymask_t mask)
 Set current mask of repeatable keys.

Detailed Description

Keyboard driver (interface).

Version:
Id
kbd.h 1052 2008-01-16 16:40:57Z asterix
Author:
Bernardo Innocenti <bernie@develer.com>

Stefano Fedrigo <aleph@develer.com>

Francesco Sacchi <batt@develer.com>

Definition in file kbd.h.


Function Documentation

keymask_t kbd_get ( void   ) 

Wait for a keypress and return the mask of depressed keys.

Note:
This function is not interrupt safe!

Definition at line 211 of file kbd.c.

keymask_t kbd_peek ( void   ) 

Read a key from the keyboard buffer.

When a key is kept depressed between calls of this function a value is returned only after the time specified with KBD_REPAT_DELAY to avoid too fast keyboard repeat.

Note:
Calls schedule() internally.

This function is not interrupt safe!

Returns:
The mask of depressed keys or 0 if no keys are depressed.

Definition at line 185 of file kbd.c.