Keypad management with A20 GPIO

Started by VinzC, February 26, 2016, 10:22:38 AM

Previous topic - Next topic

VinzC

Hi all.

I have bought the OLinuXino A20 Lime2 4GB and I want to use the CPU keypad management pins. My keypad would have like 10-12 keys. As per the data sheet all the pins marked KP_xxx belong to port PH. I am hence designing a circuit board to interface with the Lime2 board with some headers to connect with flat cable.

Oddly enough, on the OLinuXino GPIO headers all but the PH8 of port PH pins are located on GPIO_3 — I would ideally be using only one port. PH8 is located on GPIO_1 and PH8 corresponds to the KP_IN0 pin. So rather than add a 40-pin header for just one pin, I want to know if I still can drive a keypad without KP_IN0 and start with KP_IN1 instead.

For short: do the keypad pins have to be adjacent?

As an educated guess I'd say the driver does decide which pins will be used, right? I've seen there's a keypad driver in Sunxi Linux kernel tree, namely sun4i-keypad.c. I suppose I can derive that file and write my own kernel module for my keypad then what KP_IN and KP_OUT pins are used won't be a problem anymore, am I right?

Thanks in advance for any hint or suggestion.