SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
After reset, all available functional modes are disabled, except detect-event mode, which is always active. Table 28-13 describes the keyboard controller hardware mode.
Step | Register/Bit Field/Programming Model | Value |
---|---|---|
Activate the internal keyboard controller sequencer by setting the bit. | KBD_CTRL[1] NSOFTWARE_MODE | 0b1 |
Select the functional mode by setting its corresponding bit to 1. | KBD_CTRL[8:5] | 0x– |
Configure the duration of a key press to allow shortcut detection (desired value of the long-key interrupt or repeat mode value). | KBD_KEYLONGTIME[11:0] LONG_KEY_VALUE | 0x– |
Configure the period of the long inactivity on the keyboard (desired value of the time-out interrupt). | KBD_TIMEOUT[15:0] TIMEOUT_VALUE | 0x– |
Configure the debouncing time of filtering the glitches on pressing or releasing key. | KBD_DEBOUNCINGTIME[5:0] DEBOUNCING_VALUE | 0x– |
Clear the interrupt-status register. | KBD_IRQSTATUS | 0x0000000F |
Enable (by writing 1)/disable (by writing 0) certain keyboard event for generating an interrupt request | KBD_IRQENABLE_SET or KBD_IRQENABLE_CLR[2:0] IT_..._EN | 0x– |
Unmask (0b1)/mask (0b0) the expected source of wake-up event that generates a wake-up request. | KBD_IRQWAKEEN[2:0] WUP_..._ENA | 0x– |
Wait for the KBD_IRQ interrupt signal assertion. | ||
Read the interrupt-status register to determine which event caused the interrupt. | KBD_IRQSTATUS | |
Read the KBD_FULLCODE17_0 to KBD_FULLCODE80_72 registers (or 8 × 8 keyboard-size-supporting KBD_FULLCODE31_0 and KBD_FULLCODE63_32 registers) to determine which key matrix combination was pressed. | KBD_FULLCODE17_0 [ROWi bits] (where i = 0 or 1) up to KBD_FULLCODE71_54 [ROWi bits] (where i = 6 or 7); KBD_FULLCODE80_72 [ROWi bits] (where i = 8); (or KBD_FULLCODE31_0[j] FULL_CODE_31_0 and KBD_FULLCODE63_32[k] FULL_CODE_63_32 bits (where j = 0 to 31, k = 32 to 63) | |
Clear the corresponding bit(s) in the interrupt-status register by writing logical 1. | KBD_IRQSTATUS | 0x1 |
The long-key detection mode and the repeat mode cannot be used simultaneously, because they share the same interrupt status bit and are mutually exclusive. Software must ensure that only one of these modes at a time is selected.
All interrupts are disabled on reset.
When two events occur successively before the first event is read, the second interrupt is generated when the first interrupt is cleared. When more than two events in a row occur, the KBD_IRQSTATUS[3] MISS_EVENT bit is set. Software must check this bit, which is not reflected on the KBD_IRQ line.
The keyboard controller uses a posted-write scheme to update any internal register. Software must read the pending write status bits to ensure that the next write access is not discarded because of ongoing write synchronization. For more information, see Section 28.4.8.1, Write Registers Access.