The Pedigree Project  0.1
Public Types | Public Member Functions | List of all members
ArmBeagleKeyboard Class Reference

#include <Keyboard.h>

+ Inheritance diagram for ArmBeagleKeyboard:
+ Collaboration diagram for ArmBeagleKeyboard:

Public Types

typedef void(* KeyPressedCallback) (uint64_t)
 
- Public Types inherited from Keyboard
enum  KeyFlags {
  Special = 1ULL << 63, Ctrl = 1ULL << 62, Shift = 1ULL << 61, Alt = 1ULL << 60,
  AltGr = 1ULL << 59, Special = 1ULL << 63, Ctrl = 1ULL << 62, Shift = 1ULL << 61,
  Alt = 1ULL << 60, AltGr = 1ULL << 59
}
 
enum  KeyboardLeds {
  ScrollLock = 1 << 0, NumLock = 1 << 1, CapsLock = 1 << 2, Led1 = 1 << 3,
  Led2 = 1 << 4, Led3 = 1 << 5, Led4 = 1 << 6, Led5 = 1 << 7
}
 Bit numbers follow the same format as the PS/2 keyboard LED byte. More...
 
enum  KeyFlags {
  Special = 1ULL << 63, Ctrl = 1ULL << 62, Shift = 1ULL << 61, Alt = 1ULL << 60,
  AltGr = 1ULL << 59, Special = 1ULL << 63, Ctrl = 1ULL << 62, Shift = 1ULL << 61,
  Alt = 1ULL << 60, AltGr = 1ULL << 59
}
 

Public Member Functions

virtual void initialise ()
 
virtual char getChar ()
 
virtual char getCharNonBlock ()
 
virtual bool shift ()
 
virtual bool ctrl ()
 
virtual bool alt ()
 
virtual bool capsLock ()
 
virtual void setDebugState (bool enableDebugState)
 
virtual bool getDebugState ()
 
virtual void registerCallback (KeyPressedCallback callback)
 
virtual uint64_t getCharacter ()
 
virtual uint64_t getCharacterNonBlock ()
 
- Public Member Functions inherited from Keyboard
virtual char getLedState ()
 
virtual void setLedState (char state)
 

Detailed Description

Note
No actual attached keyboard apart from one on USB perhaps - so this is completely stubbed.

Definition at line 27 of file kernel/machine/arm_beagle/Keyboard.h.

Member Function Documentation

virtual bool ArmBeagleKeyboard::alt ( )
inlinevirtual
Returns
True if alt is currently held.

Definition at line 80 of file kernel/machine/arm_beagle/Keyboard.h.

virtual bool ArmBeagleKeyboard::capsLock ( )
inlinevirtual
Returns
True if caps lock is currently on.

Definition at line 88 of file kernel/machine/arm_beagle/Keyboard.h.

virtual bool ArmBeagleKeyboard::ctrl ( )
inlinevirtual
Returns
True if ctrl is currently held.

Definition at line 72 of file kernel/machine/arm_beagle/Keyboard.h.

virtual char ArmBeagleKeyboard::getChar ( )
inlinevirtual

Retrieves a character from the keyboard. Blocking I/O.

Returns
The character recieved or zero if it is a character without an ascii representation.

Implements Keyboard.

Definition at line 45 of file kernel/machine/arm_beagle/Keyboard.h.

virtual char ArmBeagleKeyboard::getCharNonBlock ( )
inlinevirtual

Retrieves a character from the keyboard. Non blocking I/O.

Returns
The character recieved or zero if it is a character without an ascii representation, or zero also if no character was present.

Implements Keyboard.

Definition at line 56 of file kernel/machine/arm_beagle/Keyboard.h.

virtual void ArmBeagleKeyboard::initialise ( )
inlinevirtual

Initialises the device.

Implements Keyboard.

Definition at line 36 of file kernel/machine/arm_beagle/Keyboard.h.

virtual void ArmBeagleKeyboard::setDebugState ( bool  enableDebugState)
inlinevirtual

Sets the state of the device. When debugging, it is unwise to rely on interrupt- driven I/O, however in normal use polling is extremely slow and CPU-intensive.

The debugger therefore will set the device to "debug state" by calling this function with the argument "true". In "debug state", any buffered input will be discarded, the device's interrupt masked, and the device will rely on polling only. This will be the default state.

When the device is set to "normal state" by calling this function with the argument "false", interrupts may be used, along with buffered input, and it is recommended that during blocking I/O a Semaphore is used to signal incoming interrupts, so that the blocked thread may go to sleep.

Implements Keyboard.

Definition at line 93 of file kernel/machine/arm_beagle/Keyboard.h.

virtual bool ArmBeagleKeyboard::shift ( )
inlinevirtual
Returns
True if shift is currently held.

Definition at line 64 of file kernel/machine/arm_beagle/Keyboard.h.


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