Keyboard Class Reference

#include <keyboard.h>

Inheritance diagram for Keyboard:
Inheritance graph
[legend]
Collaboration diagram for Keyboard:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void SetNewValueFromUi (const std::string &)
virtual int Step (bool &trueHwStep, SystemClockOffset *timeToNextStepIn_ns=0)
 Return nonzero if a breakpoint was hit.
 Keyboard (UserInterface *, const char *name, const char *baseWindow)
void SetClockFreq (SystemClockOffset f)
virtual ~Keyboard ()

Protected Member Functions

void InsertMakeCodeToBuffer (int)
void InsertBreakCodeToBuffer (int)
int InsertScanCodeToBuffer (unsigned char scan)

Protected Attributes

unsigned char myPortValue
Pin clk
Pin data
unsigned int bitCnt
SystemClockOffset myClockFreq
unsigned int buffer [KBD_BUFFER_SIZE]
unsigned int bufferWriteIndex
unsigned int bufferReadIndex
unsigned char actualChar
unsigned char lastPortValue

Detailed Description

A PS2-style keyboard sending scan-codes obtained from UI to pins on device (I guess).

Definition at line 41 of file keyboard.h.


Constructor & Destructor Documentation

Keyboard::Keyboard ( UserInterface ui,
const char *  name,
const char *  baseWindow 
)

Definition at line 182 of file keyboard.cpp.

References UserInterface::AddExternalType(), bitCnt, lastPortValue, myPortValue, and UserInterface::Write().

Here is the call graph for this function:

Keyboard::~Keyboard (  )  [virtual]

Definition at line 200 of file keyboard.cpp.


Member Function Documentation

void Keyboard::InsertBreakCodeToBuffer ( int  key  )  [protected]

Definition at line 229 of file keyboard.cpp.

References InsertScanCodeToBuffer(), keynumberToScancode2, and xToNumber.

Referenced by SetNewValueFromUi().

Here is the call graph for this function:

Here is the caller graph for this function:

void Keyboard::InsertMakeCodeToBuffer ( int  key  )  [protected]

Definition at line 214 of file keyboard.cpp.

References InsertScanCodeToBuffer(), keynumberToScancode2, and xToNumber.

Referenced by SetNewValueFromUi().

Here is the call graph for this function:

Here is the caller graph for this function:

int Keyboard::InsertScanCodeToBuffer ( unsigned char  scan  )  [protected]

Definition at line 206 of file keyboard.cpp.

References buffer, bufferReadIndex, bufferWriteIndex, and KBD_BUFFER_SIZE.

Referenced by InsertBreakCodeToBuffer(), and InsertMakeCodeToBuffer().

Here is the caller graph for this function:

void Keyboard::SetClockFreq ( SystemClockOffset  f  ) 

Definition at line 202 of file keyboard.cpp.

References myClockFreq.

void Keyboard::SetNewValueFromUi ( const std::string &  s  )  [virtual]

Implements ExternalType.

Definition at line 254 of file keyboard.cpp.

References InsertBreakCodeToBuffer(), and InsertMakeCodeToBuffer().

Here is the call graph for this function:

int Keyboard::Step ( bool &  trueHwStep,
SystemClockOffset timeToNextStepIn_ns = 0 
) [virtual]

Return nonzero if a breakpoint was hit.

Implements SimulationMember.

Definition at line 43 of file keyboard.cpp.

References actualChar, avr_error, bitCnt, buffer, bufferReadIndex, bufferWriteIndex, clk, data, IDLE, KBD_BUFFER_SIZE, lastPortValue, myClockFreq, and myPortValue.


Member Data Documentation

unsigned char Keyboard::actualChar [protected]

Definition at line 60 of file keyboard.h.

Referenced by Step().

unsigned int Keyboard::bitCnt [protected]

Definition at line 47 of file keyboard.h.

Referenced by Keyboard(), and Step().

unsigned int Keyboard::buffer[KBD_BUFFER_SIZE] [protected]

Definition at line 52 of file keyboard.h.

Referenced by InsertScanCodeToBuffer(), and Step().

unsigned int Keyboard::bufferReadIndex [protected]

Definition at line 54 of file keyboard.h.

Referenced by InsertScanCodeToBuffer(), and Step().

unsigned int Keyboard::bufferWriteIndex [protected]

Definition at line 53 of file keyboard.h.

Referenced by InsertScanCodeToBuffer(), and Step().

Pin Keyboard::clk [protected]

Definition at line 44 of file keyboard.h.

Referenced by Step().

Pin Keyboard::data [protected]

Definition at line 45 of file keyboard.h.

Referenced by Step().

unsigned char Keyboard::lastPortValue [protected]

Definition at line 61 of file keyboard.h.

Referenced by Keyboard(), and Step().

Definition at line 50 of file keyboard.h.

Referenced by SetClockFreq(), and Step().

unsigned char Keyboard::myPortValue [protected]

Definition at line 43 of file keyboard.h.

Referenced by Keyboard(), and Step().


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 16:52:51 2012 for Simulavr by  doxygen 1.6.3