keyboard.h File Reference

Header file for keyboard.c. More...

#include "typedefs.h"
#include "sys.h"
#include "thread.h"
#include "mutex.h"
#include "condvar.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  kbd_buffer_t

Defines

#define KEYBOARD_PHYSICAL_ADDRESS   0x01000008
#define KEYBOARD_ADDRESS   (KEYBOARD_PHYSICAL_ADDRESS | OM_KSEG1)
#define KEYBOARD_BUFFER_SIZE   80
#define def_getc()   *((volatile char *) KEYBOARD_ADDRESS)

Functions

void kbd_buffer_init ()
 Initializes the keyboard buffer.
int kbd_buffer_empty ()
 Keyboard buffer state.
int kbd_buffer_count ()
 Count of characters in buffer.
int kbd_buffer_putc (char ch)
 push one key (character) into the keyboard buffer
int kbd_buffer_getc (char *ch)
 pop one key (character) from the keyboard buffer
void init_keyboard ()
 Keyboard buffer initialization.

Variables

mutex_t keyboard_mtx
cond_t keyboard_cnd


Detailed Description

Header file for keyboard.c.


Define Documentation

 
#define def_getc (  )     *((volatile char *) KEYBOARD_ADDRESS)

Reads a character directly from the keyboard register.

#define KEYBOARD_ADDRESS   (KEYBOARD_PHYSICAL_ADDRESS | OM_KSEG1)

Tanslate keyboard physical address

#define KEYBOARD_BUFFER_SIZE   80

Size of keyboard buffer

#define KEYBOARD_PHYSICAL_ADDRESS   0x01000008

Defines keyboard physical address


Function Documentation

int kbd_buffer_count (  ) 

Count of characters in buffer.

Returns:
count of characters in the keyboard buffer

int kbd_buffer_empty (  ) 

Keyboard buffer state.

Returns:
EEMPTY if keyboard buffer is empty, ENOTEMPTY if some characters are present

int kbd_buffer_getc ( char *  ch  ) 

pop one key (character) from the keyboard buffer

Parameters:
ch - fetched character
Returns:
0 on empty buffer

int kbd_buffer_putc ( char  ch  ) 

push one key (character) into the keyboard buffer

Parameters:
ch - character to store
Returns:
0 on full buffer, nonzero else


Variable Documentation

cond_t keyboard_cnd

keyboard pool

mutex_t keyboard_mtx

keyboard lock


Generated on Wed Nov 15 17:25:43 2006 for Kalisto by  doxygen 1.4.7