I want to develop my own keyboard driver to my own keypad. I have to use GPIO to identify Key Events and use I2c to get scan code. I am going to develop the driver like this.
#include <linux/gpio.h>
#include <linux/interrupt.h>
#define GPIO 1 //gpio PIN
...
if(gpio_request(GPIO, "Description")){
Exception
}
gpio_direction_input(GPIO);
...
int irq = 0;
if((irq = gpio_to_irq(GPIO)) < 0 ){
Exception
}
…
int init_module(){
int result = request_irq(GPIO, handler_func, IRQF_TRIGGER_LOW,"Description", "Device id");
if(result){
Exception
}
}
void handler_func(...){
//get scan code via i2c
}
I need to develop an interface and have to handle following operations
In my keypad, print as "1abc" on the [KEY1] .
1. When press key, display 1st Characters as it is -> "1"
2. Special key combinations are used to input other 3 characters
Eg:
key input operations as follows;
KEY1 (direct press) should display "1"
F1 + KEY1 (simultaneous press) should display "a"
F2 + KEY1 (simultaneous press) should display "b"
F3 + KEY1 (simultaneous press) should display "c"
My problem is how should I develop this interface?