# ps2

PS2 library

Author | Matthew Schinkel - borntechi.com, copyright © 2009, all rights reserved.
Adapted-by |
Compiler | >=2.4o

Description

    This library allows a user to read data from a PS2 Keyboard.

Sources

    http://www.computer-engineering.org/ps2protocol/
    http://www.computer-engineering.org/ps2keyboard/scancodes2.html

Dependencies

No dependency found

## Summary

### Global variables/contants

- `const byte PS2_BACKSPACE = 0x66`
- `const byte PS2_ESC = 0x76`
- `const byte PS2_F8 = 0x0A`
- `const byte PS2_F3 = 0x4`
- `const byte PS2_KP6 = 0x74`
- `const byte PS2_F12 = 0x7`
- `const byte PS2_NUM_LOCK = 0x77`
- `const byte PS2_KP_PERIOD = 0x71`
- `const byte PS2_KP_PLUS = 0x79`
- `const byte PS2_KP0 = 0x70`
- `const byte PS2_KP9 = 0x7D`
- `const byte PS2_KP_MINUS = 0x7B`
- `const byte PS2_KP2 = 0x72`
- `const byte PS2_KP3 = 0x7A`
- `const byte PS2_R_SHIFT = 0x59`
- `const byte PS2_F2 = 0x6`
- `const byte PS2_KP8 = 0x75`
- `const byte PS2_F11 = 0x78`
- `const byte PS2_L_ALT = 0x11`
- `const byte PS2_F10 = 0x9`
- `const byte PS2_CAPS = 0x58`
- `const byte PS2_F9 = 0x1`
- `const byte PS2_F7 = 0x83`
- `const byte PS2_F6 = 0x0B`
- `var byte ps2_lookup_table[132] = {`
- `const byte PS2_L_CTRL = 0x14`
- `const byte PS2_KP5 = 0x73`
- `const byte PS2_F5 = 0x3`
- `const byte PS2_F1 = 0x5`
- `const byte PS2_SCROLL = 0x7E`
- `const byte PS2_KP_1 = 0x69`
- `const byte PS2_KP_ASTRISK = 0x7C`
- `const byte PS2_KP_4 = 0x6B`
- `const byte PS2_KP7 = 0x6C`
- `const byte PS2_L_SHIFT = 0x12`
- `const byte PS2_ENTER = 0x5A`
- `const byte PS2_F4 = 0x0C`

### Procedures

### Functions

- `ps2_read_byte() return byte`

Private

- `_ps2_read_bit() return bit`

## API details

### Global variables/contants

- `const byte PS2_BACKSPACE = 0x66`

  No documentation found

- `const byte PS2_ESC = 0x76`

  No documentation found

- `const byte PS2_F8 = 0x0A`

  No documentation found

- `const byte PS2_F3 = 0x4`

  No documentation found

- `const byte PS2_KP6 = 0x74`

  No documentation found

- `const byte PS2_F12 = 0x7`

  No documentation found

- `const byte PS2_NUM_LOCK = 0x77`

  No documentation found

- `const byte PS2_KP_PERIOD = 0x71`

  No documentation found

- `const byte PS2_KP_PLUS = 0x79`

  No documentation found

- `const byte PS2_KP0 = 0x70`

  No documentation found

- `const byte PS2_KP9 = 0x7D`

  No documentation found

- `const byte PS2_KP_MINUS = 0x7B`

  No documentation found

- `const byte PS2_KP2 = 0x72`

  No documentation found

- `const byte PS2_KP3 = 0x7A`

  No documentation found

- `const byte PS2_R_SHIFT = 0x59`

  No documentation found

- `const byte PS2_F2 = 0x6`

  No documentation found

- `const byte PS2_KP8 = 0x75`

  No documentation found

- `const byte PS2_F11 = 0x78`

  No documentation found

- `const byte PS2_L_ALT = 0x11`

  No documentation found

- `const byte PS2_F10 = 0x9`

  No documentation found

- `const byte PS2_CAPS = 0x58`

  No documentation found

- `const byte PS2_F9 = 0x1`

  No documentation found

- `const byte PS2_F7 = 0x83`

  No documentation found

- `const byte PS2_F6 = 0x0B`

  No documentation found

- `var byte ps2_lookup_table[132] = {`

  No documentation found

- `const byte PS2_L_CTRL = 0x14`

  No documentation found

- `const byte PS2_KP5 = 0x73`

  No documentation found

- `const byte PS2_F5 = 0x3`

  No documentation found

- `const byte PS2_F1 = 0x5`

  No documentation found

- `const byte PS2_SCROLL = 0x7E`

  No documentation found

- `const byte PS2_KP_1 = 0x69`

  No documentation found

- `const byte PS2_KP_ASTRISK = 0x7C`

  No documentation found

- `const byte PS2_KP_4 = 0x6B`

  No documentation found

- `const byte PS2_KP7 = 0x6C`

  No documentation found

- `const byte PS2_L_SHIFT = 0x12`

  No documentation found

- `const byte PS2_ENTER = 0x5A`

  No documentation found

- `const byte PS2_F4 = 0x0C`

  No documentation found

### Procedures

### Functions

- `ps2_read_byte() return byte`

      Waits for a byte to be received via PS2

Private

- `_ps2_read_bit() return bit`

      Reads one bit from PS2.

## Related samples

Here are the list of samples which use this library:

18f4620 | 18f4620_ps2_keyboard.jal