i8048
Although most set two make codes are only one-byte wide, there are a handfull of "extended keys" whose make codes are two or four bytes wide. These make codes can be identified by the fact that their first byte is E0h.
you won't always have to use lookup tables to figure out a key's break code--certain relationships do exist between make codes and break codes. Most set two break codes are two bytes long where the first byte is F0h and the second byte is the make code for that key. Break codes for extended keys are usually three bytes long where the first two bytes are E0h, F0h, and the last byte is the last byte of that key's make code.
|
Make Code |
Break Code |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There are two important parameters here: the typematic delay, which is the short delay between the first and second "a", and the typematic rate, which is how many characters per second will appear on your screen after the typematic delay. The typematic delay can range from 0.25 seconds to 1.00 second and the typematic rate can range from 2.0 cps (characters per second) to 30.0 cps. You may change the typematic rate and delay using the "Set Typematic Rate/Delay" (0xF3) command.
At power-on or software reset (see the "Reset" command) the keyboard performs a diagnostic self-test referred to as BAT (Basic Assurance Test) and loads the following default values:
When entering BAT, the keyboard enables its three LED indicators, and turns them off when BAT has completed. At this time, a BAT completion code of either 0xAA (BAT successful) or 0xFC (Error) is sent to the host. This BAT completion code must be sent 500~750 milliseconds after power-on.
Command Set:
A few notes regarding commands the host can issue to the keyboard:
Below are all the commands the host may send to the keyboard:
The next six commands can be issued when the keyboard is in any mode, but it only effects the behavior of the keyboard when in "mode 3" (ie, set to scan code set 3.)
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
| 2.5 | |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
| 2.0 |
Delay
|
|
|
|
|
|
|
|
|
|
MSb | LSb |
Always 0 | Always 0 | Always 0 | Always 0 | Always 0 | Caps Lock | Num Lock | Scroll Lock |
- "Scroll Lock" - Scroll Lock LED off(0)/on(1)
- "Num Lock" - Num Lock LED off(0)/on(1)
- "Caps Lock" - Caps Lock LED off(0)/on(1)
*Originally available in PS/2 keyboards only.
i8042
The 8042 contains the following registers:
The first three registers (input, output, status) are directly accessible via ports 0x60 and 0x64.
|
Write |
|
0x60 | Read | Read Input Buffer |
0x60 | Write | Write Output Buffer |
0x64 | Read | Read Status Register |
0x64 | Write | Send Command |
Writing to port 0x64 doesn't write to any specific register, but sends a command for the 8042 to interpret. If the command accepts a parameter, this parameter is sent to port 0x60. Likewise, any results returned by the command may be read from port 0x60.
to be continued ...........