The keyboard controller matrix pressed keys state (indicating which columns/rows are connected) is reflected in the KBD_FULLCODE17_0 to KBD_FULLCODE80_72 registers, as shown in Figure 28-7. These registers are updated only when interrupt event status is inactive to prevent a lost event.
Note: The KBD_FULLCODE31_0 and KBD_FULLCODE63_32 registers, which are limited to supporting keyboards of a maximum 8 × 8 array size, can be used for back-to-back software compatibility.
Each of the 9 × 9 keyboard size supporting registers (KBD_FULLCODE17_0 to KBD_FULLCODE71_54) stores the state of two keyboard rows. The KBD_FULLCODE80_72 register stores the state of the last row, R8:
- The KBD_FULLCODE17_0 register code rows 0, 1 (row 0 is coded between bits 0 and 8, row 1 is coded between bits 16 and 24)
- The KBD_FULLCODE35_18 register code rows 2, 3 (row 2 is coded between bits 0 and 8, row 3 is coded between bits 16 and 24)
- The KBD_FULLCODE53_36 register code rows 4, 5 (row 4 is coded between bits 0 and 8, row 5 is coded between bits 16 and 24)
- The KBD_FULLCODE71_54 register code rows 6, 7 (row 6 is coded between bits 0 and 8, row 7 is coded between bits 16 and 24)
- The KBD_FULLCODE80_72 register code row 8 (row 8 is coded between bits 0 and 8)
In each of these registers (excluding KBD_FULLCODE80_72):
- Bit 0 corresponds to column(0) – row (i) key, … , bit 8 corresponds to column(8) – row (i) key.
- Bits from 9 to 15 are reserved.
- Bit 16 corresponds to column(0) – row (i + 1) key, … , bit 24 corresponds to column (8) – row (i + 1) key.
- Bits 31 to 25 are reserved, where i = 0, 2, 4, 6.
In the KBD_FULLCODE80_72 register, bit 0 corresponds to column (0) – row (8) key, …, the bit 8 corresponds to column (8) – row (8) key, and the remaining bits (from 9 to 31) are reserved.
Each of the 8 × 8-keyboard size supporting registers (KBD_FULLCODE31_0 and KBD_FULLCODE63_32) stores the state of four keyboard rows:
- The KBD_FULLCODE31_0 register code rows 0, 1, 2, and 3 (row 0 is coded between bits 0 and 7, row 1 is coded between bits 8 and 15, row 2 is coded between bits 16 and 23, and row 3 is coded between bits 24 and 31)
- The KBD_FULLCODE63_32 register code rows 4, 5, 6, and 7 (row 4 is coded between bits 0 and 7, row 5 is coded between bits 8 and 15, row 6 is coded between bits 16 and 23, and row 7 is coded between bits 24 and 31)
In these registers:
- KBD_FULLCODE31_0[0] corresponds to column (0) – row (0) key,…, KBD_FULLCODE31_0[7] corresponds to column (7) – row (0).
- KBD_FULLCODE31_0[8] corresponds to column (0) – row (1) key,..., KBD_FULLCODE31_0[15] corresponds to column (7) – row (1).
- KBD_FULLCODE31_0[16] corresponds to column (0) – row (2) key,..., KBD_FULLCODE31_0[23] corresponds to column (7) – row (2).
- KBD_FULLCODE31_0[24] corresponds to column (0) – row (3) key,..., KBD_FULLCODE31_0[31] corresponds to column (7) – row (3).
- KBD_FULLCODE63_32[0] corresponds to column (0) – row (4) key,..., KBD_FULLCODE63_32[7] corresponds to column (7) – row (4).
- KBD_FULLCODE63_32[8] corresponds to column (0) – row (5) key,..., KBD_FULLCODE63_32[15] corresponds to column (7) – row (5).
- KBD_FULLCODE63_32[16] corresponds to column (0) – row (6) key,..., KBD_FULLCODE63_32[23] corresponds to column (7) – row (6).
- KBD_FULLCODE63_32[24] corresponds to column (0) – row (7) key,..., KBD_FULLCODE63_32[31] corresponds to column (7) – row (7).
Note: The keyboard fullcode registers are not updated in software mode.
Note: When using a smaller keyboard (for example, 5 × 5 or 4 × 4), the bits of the unused columns/rows are not used.