adafruit / Adafruit_TCA8418

Arduino Library for TCA8418 Keypad Matrix Driver
Other
4 stars 6 forks source link

Extra key "98" gets sent when key in position "20" is pressed #4

Open neilenns opened 1 year ago

neilenns commented 1 year ago

Took me a long time to chase this one down, including requesting support from TI.

To reproduce:

  1. Create a new test app that calls begin() and then creates a 7x10 matrix by calling matrix(7, 10).
  2. Press the key in position ROW1 COL0 (key "20")
  3. Read all key events in the FIFO queue

Result: A key event for 20 and a key event for 98. Expected result: A key event for 20 and nothing else

More details:

begin() assumes the TCA8418 will be used in GPIO mode and sets all of the GIO pins to send key events to the FIFO queue and enables interrupts on all the GPIO pins.

When using the library to configure a TCA8418 in keyboard matrix mode the matrix() method sets up the KP_GPIOx registers but doesn't clear the equivalent bits from either the GPI_EMx or GPIO_INT_ENx registers.

Proposed solution:

In matrix() set the appropriate GPI_EMx and GPIO_INT_ENx register bits to 0 when setting the matching KP_GPIOx register bit to 1.

sfuelling commented 2 months ago

I had the same issue and posted it on forum.adafruit.com:

https://forums.adafruit.com/viewtopic.php?p=1014666&hilit=TCA8418#p1014666