1 /* $NetBSD: kbdreg.h,v 1.3 2000/01/23 20:08:23 soda Exp $ */ 2 3 /* 4 * Keyboard definitions 5 */ 6 7 #define KBSTATP (PICA_SYS_KBD + 0x61) /* controller status port (I) */ 8 #define KBS_DIB 0x01 /* data in buffer */ 9 #define KBS_IBF 0x02 /* input buffer low */ 10 #define KBS_WARM 0x04 /* input buffer low */ 11 #define KBS_OCMD 0x08 /* output buffer has command */ 12 #define KBS_NOSEC 0x10 /* security lock not engaged */ 13 #define KBS_TERR 0x20 /* transmission error */ 14 #define KBS_RERR 0x40 /* receive error */ 15 #define KBS_PERR 0x80 /* parity error */ 16 17 #define KBCMDP (PICA_SYS_KBD + 0x61) /* controller port (O) */ 18 #define KBDATAP (PICA_SYS_KBD + 0x60) /* data port (I) */ 19 #define KBOUTP (PICA_SYS_KBD + 0x60) /* data port (O) */ 20 21 #define K_RDCMDBYTE 0x20 22 #define K_LDCMDBYTE 0x60 23 24 #define KC8_TRANS 0x40 /* convert to old scan codes */ 25 #define KC8_MDISABLE 0x20 /* disable mouse */ 26 #define KC8_KDISABLE 0x10 /* disable keyboard */ 27 #define KC8_IGNSEC 0x08 /* ignore security lock */ 28 #define KC8_CPU 0x04 /* exit from protected mode reset */ 29 #define KC8_MENABLE 0x02 /* enable mouse interrupt */ 30 #define KC8_KENABLE 0x01 /* enable keyboard interrupt */ 31 #define CMDBYTE (KC8_TRANS|KC8_CPU|KC8_MENABLE|KC8_KENABLE) 32 33 /* keyboard commands */ 34 #define KBC_RESET 0xFF /* reset the keyboard */ 35 #define KBC_RESEND 0xFE /* request the keyboard resend the last byte */ 36 #define KBC_SETDEFAULT 0xF6 /* resets keyboard to its power-on defaults */ 37 #define KBC_DISABLE 0xF5 /* as per KBC_SETDEFAULT, but also disable key scanning */ 38 #define KBC_ENABLE 0xF4 /* enable key scanning */ 39 #define KBC_TYPEMATIC 0xF3 /* set typematic rate and delay */ 40 #define KBC_SETTABLE 0xF0 /* set scancode translation table */ 41 #define KBC_MODEIND 0xED /* set mode indicators (i.e. LEDs) */ 42 #define KBC_ECHO 0xEE /* request an echo from the keyboard */ 43 44 /* keyboard responses */ 45 #define KBR_EXTENDED 0xE0 /* extended key sequence */ 46 #define KBR_RESEND 0xFE /* needs resend of command */ 47 #define KBR_ACK 0xFA /* received a valid command */ 48 #define KBR_OVERRUN 0x00 /* flooded */ 49 #define KBR_FAILURE 0xFD /* diagnosic failure */ 50 #define KBR_BREAK 0xF0 /* break code prefix - sent on key release */ 51 #define KBR_RSTDONE 0xAA /* reset complete */ 52 #define KBR_ECHO 0xEE /* echo response */ 53