Linux Device Driver to on/off keyboard LED

Theory:

Keyboard controller has three 8-bit registers:

  • Control Register (0x64)
  • Data Register (0x60)
  • Status Register (0x64)
If the CPU Reads from the port 0x64, the byte is interpreted as Status byte, if CPU writes to the port, the byte is interpreted as Command Port.

Procedure to set the keyboard leds
  • Wait until the keyboard controller until it is not busy
  • Send the command byte 0xED
  • Send the byte corresponding to which LED you want to ON/OFF
    • Bit 0 is scroll lock
    • Bit 1 is num lock
    • Bit 2 is caps lock

Code


Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

PR, PN and PV Variable in Yocto