NO:
W90P710 Programming Guide
VERSION:
2.0
PAGE:
235
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed, distributed or reproduced without permission
from Winbond.
Table No.: 2005-W90P710-11-A
4. A scan code arrived. Set a software event and read the registers
PS2SCANCODE
and
PS2ASCII
.
5. If TX_IRQ is set go to step 5, otherwise go to step 6.
6. A command has been sent. Set a software event.
7. Clear the interrupt by wrinting 1 to the corresponding interrupt bits.
21.4.5 Example
This example tells that how to turn on/off the LEDs on the keyboard if host controller receives the
scan codes including 0x77 (Num Lock), 0x58 (Caps Lock) and 0x7E (Scroll Lock). The steps for
controlling the Keyboard LED are listed below:
1. Write command 0xED (Set status LED’s) to register
PS2CMD
.
2. Wait for keyboard’s reply 0xFA by checking register PS2SCANCODE.
3. Write LED status to register
PS2CMD
. The LED status defines in following table. The LED is
turned on if the status bit is 1, otherwise the LED is turned off.
Table 21-6 LED Status byte
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Caps
Lock
Num
Lock
Scroll
Lock