StuBS
ps2controller.h File Reference

PS/2 Controller (Intel 8042, also known as Keyboard Controller) More...

#include "types.h"
#include "object/key.h"
#include "object/pointer.h"
Include dependency graph for ps2controller.h:
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  PS2Controller
 PS/2 Controller.
 

Enumerations

enum  PS2Controller::Delay {
  PS2Controller::DELAY_250MS = 0 ,
  PS2Controller::DELAY_500MS = 1 ,
  PS2Controller::DELAY_750MS = 2 ,
  PS2Controller::DELAY_1000MS = 3
}
 Delay before the keyboard starts repeating sending a pressed key. More...
 
enum  PS2Controller::Speed {
  PS2Controller::SPEED_30_0CPS = 0x00 ,
  PS2Controller::SPEED_26_7CPS = 0x01 ,
  PS2Controller::SPEED_24_0CPS = 0x02 ,
  PS2Controller::SPEED_21_8CPS = 0x03 ,
  PS2Controller::SPEED_20_7CPS = 0x04 ,
  PS2Controller::SPEED_18_5CPS = 0x05 ,
  PS2Controller::SPEED_17_1CPS = 0x06 ,
  PS2Controller::SPEED_16_0CPS = 0x07 ,
  PS2Controller::SPEED_15_0CPS = 0x08 ,
  PS2Controller::SPEED_13_3CPS = 0x09 ,
  PS2Controller::SPEED_12_0CPS = 0x0a ,
  PS2Controller::SPEED_10_9CPS = 0x0b ,
  PS2Controller::SPEED_10_0CPS = 0x0c ,
  PS2Controller::SPEED_09_2CPS = 0x0d ,
  PS2Controller::SPEED_08_6CPS = 0x0e ,
  PS2Controller::SPEED_08_0CPS = 0x0f ,
  PS2Controller::SPEED_07_5CPS = 0x10 ,
  PS2Controller::SPEED_06_7CPS = 0x11 ,
  PS2Controller::SPEED_06_0CPS = 0x12 ,
  PS2Controller::SPEED_05_5CPS = 0x13 ,
  PS2Controller::SPEED_05_0CPS = 0x14 ,
  PS2Controller::SPEED_04_6CPS = 0x15 ,
  PS2Controller::SPEED_04_3CPS = 0x16 ,
  PS2Controller::SPEED_04_0CPS = 0x17 ,
  PS2Controller::SPEED_03_7CPS = 0x18 ,
  PS2Controller::SPEED_03_3CPS = 0x19 ,
  PS2Controller::SPEED_03_0CPS = 0x1a ,
  PS2Controller::SPEED_02_7CPS = 0x1b ,
  PS2Controller::SPEED_02_5CPS = 0x1c ,
  PS2Controller::SPEED_02_3CPS = 0x1d ,
  PS2Controller::SPEED_02_1CPS = 0x1e ,
  PS2Controller::SPEED_02_0CPS = 0x1f
}
 Repeat Rate of Characters. More...
 
enum  PS2Controller::LED {
  PS2Controller::LED_SCROLL_LOCK = 1 << 0 ,
  PS2Controller::LED_NUM_LOCK = 1 << 1 ,
  PS2Controller::LED_CAPS_LOCK = 1 << 2
}
 Keyboard LEDs. More...
 

Functions

void PS2Controller::init ()
 Initialization of connected devices.
 
bool PS2Controller::fetch (Key &pressed)
 Retrieve the keyboard event.
 
bool PS2Controller::fetch (Pointer &state)
 Retrieve the mouse event.
 
void PS2Controller::setRepeatRate (Speed speed, Delay delay)
 Configure the repeat rate of the keyboard.
 
void PS2Controller::setLed (enum LED led, bool on)
 Enable or disable a keyboard LED.
 
void PS2Controller::drainBuffer ()
 Empties the keyboard buffer.
 

Detailed Description

PS/2 Controller (Intel 8042, also known as Keyboard Controller)