Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

keyb.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef keyb_h
00004 #define keyb_h
00005 
00006 #include "console.h"
00007 
00008 //
00009 // INTERFACE definition follows 
00010 //
00011 
00012 
00018 class Keyb : public Console
00019 {
00020 public:
00021   // must be implemented in platform part.
00022   int getchar( bool blocking = true );
00023 
00024   // implemented empty
00025   int write( char const *str, size_t len );
00026 private:
00027 
00028 private:
00029 
00030   enum {
00031     /*
00032      * Keyboard I/O ports.
00033      */
00034     K_RDWR          =0x60, /* keyboard data & cmds (read/write) */
00035     K_STATUS        =0x64, /* keybd status (read-only) */
00036     K_CMD           =0x64, /* keybd ctlr command (write-only) */
00037 
00038     /*
00039      * Bit definitions for K_STATUS port.
00040      */
00041     K_OBUF_FUL      =0x01, /* output (from keybd) buffer full */
00042     K_IBUF_FUL      =0x02, /* input (to keybd) buffer full */
00043     K_SYSFLAG       =0x04, /* "System Flag" */
00044     K_CMD_DATA      =0x08, /* 1 = input buf has cmd, 0 = data */
00045     K_KBD_INHIBIT   =0x10, /* 0 if keyboard inhibited */
00046     K_AUX_OBUF_FUL  =0x20, /* 1 = obuf holds aux device data */
00047     K_TIMEOUT       =0x40, /* timout error flag */
00048     K_PARITY_ERROR  =0x80, /* parity error flag */
00049 
00050     /* 
00051      * Keyboard controller commands (sent to K_CMD port).
00052      */
00053     KC_CMD_READ     =0x20, /* read controller command byte */
00054     KC_CMD_WRITE    =0x60, /* write controller command byte */
00055     KC_CMD_DIS_AUX  =0xa7, /* disable auxiliary device */
00056     KC_CMD_ENB_AUX  =0xa8, /* enable auxiliary device */
00057     KC_CMD_TEST_AUX =0xa9, /* test auxiliary device interface */
00058     KC_CMD_SELFTEST =0xaa, /* keyboard controller self-test */
00059     KC_CMD_TEST     =0xab, /* test keyboard interface */
00060     KC_CMD_DUMP     =0xac, /* diagnostic dump */
00061     KC_CMD_DISABLE  =0xad, /* disable keyboard */
00062     KC_CMD_ENABLE   =0xae, /* enable keyboard */
00063     KC_CMD_RDKBD    =0xc4, /* read keyboard ID */
00064     KC_CMD_WIN      =0xd0, /* read  output port */
00065     KC_CMD_WOUT     =0xd1, /* write output port */
00066     KC_CMD_ECHO     =0xee, /* used for diagnostic testing */
00067     KC_CMD_PULSE    =0xff, /* pulse bits 3-0 based on low nybble */
00068 
00069     /* 
00070      * Keyboard commands (send to K_RDWR).
00071      */
00072     K_CMD_LEDS      =0xed, /* set status LEDs (caps lock, etc.) */
00073 
00074     /* 
00075      * Bit definitions for controller command byte (sent following 
00076      * K_CMD_WRITE command).
00077      */
00078     K_CB_ENBLIRQ    =0x01, /* enable data-ready intrpt */
00079     K_CB_SETSYSF    =0x04, /* Set System Flag */
00080     K_CB_INHBOVR    =0x08, /* Inhibit Override */
00081     K_CB_DISBLE     =0x10, /* disable keyboard */
00082 
00083     /* 
00084      * Bit definitions for "Indicator Status Byte" (sent after a 
00085      * K_CMD_LEDS command).  If the bit is on, the LED is on.  Undefined 
00086      * bit positions must be 0.
00087      */
00088     K_LED_SCRLLK    =0x1, /* scroll lock */
00089     K_LED_NUMLK     =0x2, /* num lock */
00090     K_LED_CAPSLK    =0x4, /* caps lock */
00091 
00092     /* 
00093      * Bit definitions for "Miscellaneous port B" (K_PORTB).
00094      */
00095     /* read/write */
00096     K_ENABLETMR2    =0x01, /* enable output from timer 2 */
00097     K_SPKRDATA      =0x02, /* direct input to speaker */
00098     K_ENABLEPRTB    =0x04, /* "enable" port B */
00099     K_EIOPRTB       =0x08, /* enable NMI on parity error */
00100     /* read-only */
00101     K_REFRESHB      =0x10, /* refresh flag from INLTCONT PAL */
00102     K_OUT2B         =0x20, /* timer 2 output */
00103     K_ICKB          =0x40, /* I/O channel check (parity error) */
00104 
00105     /*
00106      * Bit definitions for the keyboard controller's output port.
00107      */
00108     KO_SYSRESET     =0x01, /* processor reset */
00109     KO_GATE20       =0x02, /* A20 address line enable */
00110     KO_AUX_DATA_OUT =0x04, /* output data to auxiliary device */
00111     KO_AUX_CLOCK    =0x08, /* auxiliary device clock */
00112     KO_OBUF_FUL     =0x10, /* keyboard output buffer full */
00113     KO_AUX_OBUF_FUL =0x20, /* aux device output buffer full */
00114     KO_CLOCK        =0x40, /* keyboard clock */
00115     KO_DATA_OUT     =0x80, /* output data to keyboard */
00116   };
00117 
00118 
00119 public:  
00120   Mword get_attributes() const;
00121 };
00122 
00123 #endif // keyb_h

Generated on Mon Sep 26 14:20:11 2005 for Fiasco by  doxygen 1.4.2