|
Custom serial keypad driver
Hello. I am working on a custom board with an s3c2410 processor. The device it is used in has a series of buttons that form a keypad. These keys are attached to a microcontroller that generates serial output. Essentially, the keypad is a serial keyboard, attached to ttySAC1 at 9600-8N1. The keycodes for the keys are not standard ascii. There is a custom keycode table.
Previous software that used this device (under linux 2.4 kernel) relied on the application to poll the serial port and lookup the keycode. As I am in the process of bringing everything current on the 2.6 kernel, I would like to treat this serial keypad as a standard input device.
I've not found any standard driver for a serial keyboard that would let me specify my own key codes. I've looked into the "inputattach" program, but not had much success since it is built for certain devices only. I thought about possibly adding my own code to patch inputattach. Is this a good approach? Or is there a simpler way that I am overlooking? Do I need anything as far as a kernel mode driver, or would a patched inputattach by itself be a good solution?
Also - Ultimately I would like to be able to use this numeric keypad in a multi-press alphanumeric mode, similar to texting on a cell-phone. Surely there is code already written to do this somewhere? Or do I have to write from scratch? Please advise.
Thanks,
Matt
|