The class inherits from the Arduino Stream class, so queued ps2 keyboard presses can be read like a Serial port.
This class allows the user to declare a PS2 Keyboard. The PS2 Keyboard class is currently only supported on the Serial Wombat 18AB chip.
Warning
The PS2 Keyboard pin mode requires 20 to 25% of the Serial Wombat 18AB chip's processor capacity.
Assigning pin modes which together exceed avaialble processing capacity causes malfunctions within the Serial Wombat chip.
The PS2 Keyboard pin mode requires a clock pin (to which this pin mode is assigned) and an additional data pin. Both should be tied high to 5v with a pull up resistor. I use a 5.1k.
Warning
The PS2 Keyboard inputs are 5V inputs. It is suggested that pins 9,10,11,12,14, or 15 on the Serial Wombat 18AB chip be used for PS2 Keyboard because they are 5V tollerant. Using other pins may damage the Serial Wombat chip.
Pin attached to the PS2 Keyboard Clock line. This line shoudl be pulled up to 5V with a resistor (5.1k suggested). This pin should be a 5V tolerant pin.
dataPin
Pin attached to the PS2 Keyboard data line. This line shoudl be pulled up to 5V with a resistor (5.1k suggested). This pin should be a 5V tolerant pin.
bufferMode
0: Public data is lower case ASCII of key pressed (Default) 1: Public data is PS2 Keyboard 'make' code of last key pressed or released.
queueMode
0: Queued data is ASCII values, taking into account shift keys 1: Queued data is make codes of keys when pressed 2: All PS2 codes are queued 3: A bitfield of held keys is maintained instead of a queue
queueAddress
An optional parameter that allows a previously initialized queue in User RAM on the SW18AB chip to be used instead of the pin mode's internal 16 byte buffer. 0xFFFF uses pin mode buffer.
pullUpDown
0: No pull ups or pull downs 1: Internal 3.3v pullup (not recommended) 2: Internal Pulldown (not recommended)
This function will read bytes from the SerialWombatPS2Keyboard queue into buffer. If 'length' characters are not available to read then the value returned will be less than length.