enabling led light in Keyboard
Posted: Tue Mar 31, 2009 1:16 pm
i got little confused while coding keyboard handler,
i am sending 0xED( Set/Reset Mode Indicators) request to keyboard port 60h
then i want to set CAPSLOCK led- but according to keyboard datasheet-
ED Set/Reset Mode Indicators, keyboard responds with ACK then
waits for a following option byte. When the option byte is
received the keyboard again ACK's and then sets the LED's
accordingly. Scanning is resumed if scanning was enabled.
If another command is received instead of the option byte
(high bit set on) this command is terminated. Hardware
defaults to these indicators turned off.
|7-3|2|1|0| Keyboard Status Indicator Option Byte
| | | `--- Scroll-Lock indicator (0=off, 1=on)
| | `---- Num-Lock indicator (0=off, 1=on)
| `----- Caps-Lock indicator (0=off, 1=on)
`------- reserved (must be zero)
not sure whats that option byte means and how to set that
so could some help me out here...
here is piece of my code
i am sending 0xED( Set/Reset Mode Indicators) request to keyboard port 60h
then i want to set CAPSLOCK led- but according to keyboard datasheet-
ED Set/Reset Mode Indicators, keyboard responds with ACK then
waits for a following option byte. When the option byte is
received the keyboard again ACK's and then sets the LED's
accordingly. Scanning is resumed if scanning was enabled.
If another command is received instead of the option byte
(high bit set on) this command is terminated. Hardware
defaults to these indicators turned off.
|7-3|2|1|0| Keyboard Status Indicator Option Byte
| | | `--- Scroll-Lock indicator (0=off, 1=on)
| | `---- Num-Lock indicator (0=off, 1=on)
| `----- Caps-Lock indicator (0=off, 1=on)
`------- reserved (must be zero)
not sure whats that option byte means and how to set that
so could some help me out here...
here is piece of my code
Code: Select all
if((inp8(0x64)&2) == 0) break;
outp8(0x60,0xED);
outp8(0x60,0x04);