keyboard.h

Go to the documentation of this file.
00001 
00007 #ifndef _KEYBOARD_H_
00008 #define _KEYBOARD_H_
00009 
00010 #include "typedefs.h"
00011 #include "sys.h"
00012 #include "thread.h"
00013 #include "mutex.h"
00014 #include "condvar.h"
00015 #include "debug.h"
00016 
00018 #define KEYBOARD_PHYSICAL_ADDRESS       0x01000008
00019 
00020 #define KEYBOARD_ADDRESS                        (KEYBOARD_PHYSICAL_ADDRESS | OM_KSEG1)
00021 
00022 /* #define KEYBOARD_INTERRUPT_NO                3               */
00024 #define KEYBOARD_BUFFER_SIZE 80 
00025 
00027 #define def_getc() \
00028         *((volatile char *) KEYBOARD_ADDRESS)
00029 
00031 typedef struct {
00032         char queue[KEYBOARD_BUFFER_SIZE];
00033         int first;
00034         int last;
00035         int length;
00036 } kbd_buffer_t;
00037 
00038 extern mutex_t keyboard_mtx;
00039 extern cond_t keyboard_cnd;
00040 
00041 void kbd_buffer_init();
00042 int kbd_buffer_empty();
00043 int kbd_buffer_count();
00044 int kbd_buffer_putc(char ch);
00045 int kbd_buffer_getc(char *ch);
00046 
00047 void init_keyboard();
00048 
00049 #endif /*  _KEYBOARD_H_ */

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