NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PS2Keyboard Class Reference

A PS2 keyboard gets characters on the hostbus as input and outputs scancodes on the ps2 bus. More...

Inheritance diagram for PS2Keyboard:
StaticReceiver< PS2Keyboard > Device

Public Member Functions

bool receive (MessageInput &msg)
bool receive (MessagePS2 &msg)
bool receive (MessageLegacy &msg)
 PS2Keyboard (DBus< MessagePS2 > &bus_ps2, unsigned ps2port, unsigned hostkeyboard)
- Public Member Functions inherited from StaticReceiver< PS2Keyboard >
 StaticReceiver ()
- Public Member Functions inherited from Device
void debug_dump ()
 Device (const char *debug_name)

Private Types

enum  {
  MODE_DISABLED = 1 << 0, MODE_RESET = 1 << 1, MODE_RESEND = 1 << 2, MODE_GOT_BREAK = 1 << 3,
  MODE_STOPPED = 1 << 4
}

Private Member Functions

void enqueue (unsigned char value)
 Enqueue a single scancode in the buffer.
void enqueue_string (const char *value)
 Enqueue a whole set of characters.
void reset ()
 Reset the keyboard to its default state.
bool has_shift_modifiers (unsigned char key)
 Returns whether a keycode respects a shift modifier.
void handle_shift_modifiers (unsigned value)
 Enqueues corresponding shift release or press events for the shift-keys if the shift-modifier is changed for the key.

Private Attributes

DBus< MessagePS2 > & _bus_ps2
unsigned _ps2port
unsigned _hostkeyboard
unsigned char _scset
unsigned char _buffer [BUFFERSIZE]
unsigned _pread
unsigned _pwrite
unsigned _response
unsigned char _no_breakcode [32]
unsigned char _indicators
unsigned char _last_command
unsigned char _last_reply
unsigned char _mode

Static Private Attributes

static const unsigned BUFFERSIZE = 18

Additional Inherited Members

- Static Public Member Functions inherited from StaticReceiver< PS2Keyboard >
static bool receive_static (Device *o, M &msg)

Detailed Description

A PS2 keyboard gets characters on the hostbus as input and outputs scancodes on the ps2 bus.

State: stable Features: scancodeset 1,2,3, keyboard commands, breakcode Missing: typematic keys Documentation: PS2 hitrc chapter 11

Member Enumeration Documentation

anonymous enum
private
Enumerator:
MODE_DISABLED 
MODE_RESET 
MODE_RESEND 
MODE_GOT_BREAK 
MODE_STOPPED 

Constructor & Destructor Documentation

PS2Keyboard::PS2Keyboard ( DBus< MessagePS2 > &  bus_ps2,
unsigned  ps2port,
unsigned  hostkeyboard 
)
inline

Member Function Documentation

void PS2Keyboard::enqueue ( unsigned char  value)
inlineprivate

Enqueue a single scancode in the buffer.

Please note that the values are translated if SCS1 is used.

void PS2Keyboard::enqueue_string ( const char *  value)
inlineprivate

Enqueue a whole set of characters.

void PS2Keyboard::handle_shift_modifiers ( unsigned  value)
inlineprivate

Enqueues corresponding shift release or press events for the shift-keys if the shift-modifier is changed for the key.

bool PS2Keyboard::has_shift_modifiers ( unsigned char  key)
inlineprivate

Returns whether a keycode respects a shift modifier.

bool PS2Keyboard::receive ( MessageInput msg)
inline
bool PS2Keyboard::receive ( MessagePS2 msg)
inline
bool PS2Keyboard::receive ( MessageLegacy msg)
inline
void PS2Keyboard::reset ( )
inlineprivate

Reset the keyboard to its default state.

Member Data Documentation

unsigned char PS2Keyboard::_buffer[BUFFERSIZE]
private
DBus<MessagePS2>& PS2Keyboard::_bus_ps2
private
unsigned PS2Keyboard::_hostkeyboard
private
unsigned char PS2Keyboard::_indicators
private
unsigned char PS2Keyboard::_last_command
private
unsigned char PS2Keyboard::_last_reply
private
unsigned char PS2Keyboard::_mode
private
unsigned char PS2Keyboard::_no_breakcode[32]
private
unsigned PS2Keyboard::_pread
private
unsigned PS2Keyboard::_ps2port
private
unsigned PS2Keyboard::_pwrite
private
unsigned PS2Keyboard::_response
private
unsigned char PS2Keyboard::_scset
private
const unsigned PS2Keyboard::BUFFERSIZE = 18
staticprivate

The documentation for this class was generated from the following file: