RTEMS  5.0.0
Macros | Functions | Variables
i386kbd.h File Reference

I386 keyboard definitions. More...

#include <i386_io.h>

Go to the source code of this file.

Macros

#define KEYBOARD_IRQ   1
 
#define DISABLE_KBD_DURING_INTERRUPTS   0
 
#define kbd_setkeycode   pckbd_setkeycode
 
#define kbd_getkeycode   pckbd_getkeycode
 
#define kbd_translate   pckbd_translate
 
#define kbd_unexpected_up   pckbd_unexpected_up
 
#define kbd_leds   pckbd_leds
 
#define kbd_init_hw   pckbd_init_hw
 
#define kbd_sysrq_xlate   pckbd_sysrq_xlate
 
#define SYSRQ_KEY   0x54
 
#define kbd_request_region()   /* request_region(0x60, 16, "keyboard") */
 
#define kbd_request_irq(handler)   /* request_irq(KEYBOARD_IRQ, handler, 0, "keyboard", NULL) */
 
#define kbd_read_input()   inb(KBD_DATA_REG)
 
#define kbd_read_status()   inb(KBD_STATUS_REG)
 
#define kbd_write_output(val)   outb(val, KBD_DATA_REG)
 
#define kbd_write_command(val)   outb(val, KBD_CNTL_REG)
 
#define kbd_pause()   do { } while(0)
 
#define AUX_IRQ   12
 
#define aux_request_irq(hand, dev_id)   /* request_irq(AUX_IRQ, hand, SA_SHIRQ, "PS/2 Mouse", dev_id) */
 
#define aux_free_irq(dev_id)   /* free_irq(AUX_IRQ, dev_id) */
 
#define KBD_REPORT_UNKN   /* Report unknown scan codes */
 
#define KBD_REPORT_TIMEOUTS   /* Report keyboard timeouts */
 
#define KBD_INIT_TIMEOUT   1000 /* Timeout in ms for initializing the keyboard */
 
#define KBC_TIMEOUT   250 /* Timeout in ms for sending to keyboard controller */
 
#define KBD_TIMEOUT   1000 /* Timeout in ms for keyboard command acknowledge */
 
#define KBD_STATUS_REG   0x64 /* Status register (R) */
 
#define KBD_CNTL_REG   0x64 /* Controller command register (W) */
 
#define KBD_DATA_REG   0x60 /* Keyboard data register (R/W) */
 
#define KBD_CCMD_READ_MODE   0x20 /* Read mode bits */
 
#define KBD_CCMD_WRITE_MODE   0x60 /* Write mode bits */
 
#define KBD_CCMD_GET_VERSION   0xA1 /* Get controller version */
 
#define KBD_CCMD_MOUSE_DISABLE   0xA7 /* Disable mouse interface */
 
#define KBD_CCMD_MOUSE_ENABLE   0xA8 /* Enable mouse interface */
 
#define KBD_CCMD_TEST_MOUSE   0xA9 /* Mouse interface test */
 
#define KBD_CCMD_SELF_TEST   0xAA /* Controller self test */
 
#define KBD_CCMD_KBD_TEST   0xAB /* Keyboard interface test */
 
#define KBD_CCMD_KBD_DISABLE   0xAD /* Keyboard interface disable */
 
#define KBD_CCMD_KBD_ENABLE   0xAE /* Keyboard interface enable */
 
#define KBD_CCMD_WRITE_AUX_OBUF
 
#define KBD_CCMD_WRITE_MOUSE   0xD4 /* Write the following byte to the mouse */
 
#define KBD_CMD_SET_LEDS   0xED /* Set keyboard leds */
 
#define KBD_CMD_SET_RATE   0xF3 /* Set typematic rate */
 
#define KBD_CMD_ENABLE   0xF4 /* Enable scanning */
 
#define KBD_CMD_DISABLE   0xF5 /* Disable scanning */
 
#define KBD_CMD_RESET   0xFF /* Reset */
 
#define KBD_REPLY_POR   0xAA /* Power on reset */
 
#define KBD_REPLY_ACK   0xFA /* Command ACK */
 
#define KBD_REPLY_RESEND   0xFE /* Command NACK, send the cmd again */
 
#define KBD_STAT_OBF   0x01 /* Keyboard output buffer full */
 
#define KBD_STAT_IBF   0x02 /* Keyboard input buffer full */
 
#define KBD_STAT_SELFTEST   0x04 /* Self test successful */
 
#define KBD_STAT_CMD   0x08 /* Last write was a command write (0=data) */
 
#define KBD_STAT_UNLOCKED   0x10 /* Zero if keyboard locked */
 
#define KBD_STAT_MOUSE_OBF   0x20 /* Mouse output buffer full */
 
#define KBD_STAT_GTO   0x40 /* General receive/xmit timeout */
 
#define KBD_STAT_PERR   0x80 /* Parity error */
 
#define AUX_STAT_OBF   (KBD_STAT_OBF | KBD_STAT_MOUSE_OBF)
 
#define KBD_MODE_KBD_INT   0x01 /* Keyboard data generate IRQ1 */
 
#define KBD_MODE_MOUSE_INT   0x02 /* Mouse data generate IRQ12 */
 
#define KBD_MODE_SYS   0x04 /* The system flag (?) */
 
#define KBD_MODE_NO_KEYLOCK   0x08 /* The keylock doesn't affect the keyboard if set */
 
#define KBD_MODE_DISABLE_KBD   0x10 /* Disable keyboard interface */
 
#define KBD_MODE_DISABLE_MOUSE   0x20 /* Disable mouse interface */
 
#define KBD_MODE_KCC   0x40 /* Scan code conversion to PC format */
 
#define KBD_MODE_RFU   0x80
 
#define AUX_SET_RES   0xE8 /* Set resolution */
 
#define AUX_SET_SCALE11   0xE6 /* Set 1:1 scaling */
 
#define AUX_SET_SCALE21   0xE7 /* Set 2:1 scaling */
 
#define AUX_GET_SCALE   0xE9 /* Get scaling factor */
 
#define AUX_SET_STREAM   0xEA /* Set stream mode */
 
#define AUX_SET_SAMPLE   0xF3 /* Set sample rate */
 
#define AUX_ENABLE_DEV   0xF4 /* Enable aux device */
 
#define AUX_DISABLE_DEV   0xF5 /* Disable aux device */
 
#define AUX_RESET   0xFF /* Reset aux device */
 
#define AUX_ACK   0xFA /* Command byte ACK. */
 
#define AUX_BUF_SIZE
 
#define mark_bh(x)
 

Functions

int pckbd_setkeycode (unsigned int scancode, unsigned int keycode)
 
int pckbd_getkeycode (unsigned int scancode)
 
int pckbd_translate (unsigned char scancode, unsigned char *keycode, char raw_mode)
 
char pckbd_unexpected_up (unsigned char keycode)
 
void pckbd_leds (unsigned char leds)
 
void pckbd_init_hw (void)
 

Variables

unsigned char pckbd_sysrq_xlate [128]
 
unsigned char pckbd_read_mask
 
unsigned char aux_device_present
 

Detailed Description

I386 keyboard definitions.

Macro Definition Documentation

◆ AUX_BUF_SIZE

#define AUX_BUF_SIZE
Value:
2048 /* This might be better divisible by
three to make overruns stay in sync
but then the read function would need
a lock etc - ick */

◆ KBD_CCMD_WRITE_AUX_OBUF

#define KBD_CCMD_WRITE_AUX_OBUF
Value:
0xD3 /* Write to output buffer as if
initiated by the auxiliary device */