Hi,
> I need to hook up a 3x4 Matrix Keypad to the board and
> have it send an interrupt when a key has been pressed.
What you really want is for your user-space application
to see the key presses.
How the driver is implemented is hidden from the user.
I haven't implemented a key press driver, but I have
seen examples where the key pad is polled rather than
interrupt driven. I'm not sure if you'll have this
book, but there is an example in;
"Embedded Systems Building Blocks", 2nd Ed, Jean
Labrosse.
Its for the uCOS-II RTOS, but the idea is the same as
you might want to implement. According to that text,
typically bounce times are 5ms to 30ms. So they're
pretty long timescales. That driver polls keys,
detects key presses, and keys held down.
If you were to write a driver that was interrupt driven
then you definitely need to take care regarding debouncing.
If you are using a TS-7300 and can use the FPGA, then
you could debounce in the FPGA.
Check out the above book for its polling routine.
I'm pretty sure you could setup a kernel timer inside
your driver, detect key presses, etc, and then send
the results to userspace. Chances are this will be a
lot simpler than trying to use interrupts on non-debounced
pins.
Alternatively, add debounce circuits to your keypad to
ensure that you don't get ringing, and then you can
use interrupts.
Cheers,
Dave
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|