Difference between revisions of "Keypad"

From ArmadeusWiki
Jump to: navigation, search
(Introduction)
(Solutions)
Line 6: Line 6:
  
 
==Solutions==
 
==Solutions==
There are several solutions to connect a matrix keypad to your Armadeus board:
+
There are several solutions to connect a keypad to your Armadeus board:
 
===Keypad directly connected to i.MXL/27===
 
===Keypad directly connected to i.MXL/27===
 
====One GPIO for one key====
 
====One GPIO for one key====
This type of keypad generally called "common ground keypad" is the easiest one to build. If you need more than 6 keys it is however "GPIO consuming".
+
This type of keypad generally called "common ground keypad" is the easiest one to build: connect your switch to an i.MX GPIO (with a pullup) on one side and to the ground on the other side . If you need more than 6 keys, this construction is however "GPIO consuming" and you would better use matrix keypads.
 
<br>Under Test...
 
<br>Under Test...
 +
 
====Matrix keypads on i.MX27====
 
====Matrix keypads on i.MX27====
 +
The i.MX27 has an internal controller that can drive 8x8 keypads (= 64 keys with 16 dedicated pins): [[Keypad usage on i.MX27]].
 +
Please consult the i.MX27 Reference Manual (Chapter 25) for more informations.
 +
 
====Matrix keypads on i.MXL====
 
====Matrix keypads on i.MXL====
 
[[Driver for i.MX GPIO controlled keypads]]
 
[[Driver for i.MX GPIO controlled keypads]]
Line 23: Line 27:
 
{add a big picture of the keypad link with APF_DEV_LIGHT}
 
{add a big picture of the keypad link with APF_DEV_LIGHT}
 
{add a big picture of the keypad link with APF_DEV_FULL}
 
{add a big picture of the keypad link with APF_DEV_FULL}
| [[Image:keypad.svg|thumb|3x4 matrix keypad connected to i.MXL GPIOs|150px]]
+
| [[Image:keypad.svg|thumb|3x4 matrix keypad connected to i.MX GPIOs|150px]]
 
|}
 
|}
  

Revision as of 23:20, 4 December 2009

How to connect a keypad to your Armadeus board

Introduction

Your Armadeus board allows you to connect a (matrix or not) keypad as input device. Keypads are a collection of switches assembled together to emulate a kind of keyboard to ease user interaction with your system.

Solutions

There are several solutions to connect a keypad to your Armadeus board:

Keypad directly connected to i.MXL/27

One GPIO for one key

This type of keypad generally called "common ground keypad" is the easiest one to build: connect your switch to an i.MX GPIO (with a pullup) on one side and to the ground on the other side . If you need more than 6 keys, this construction is however "GPIO consuming" and you would better use matrix keypads.
Under Test...

Matrix keypads on i.MX27

The i.MX27 has an internal controller that can drive 8x8 keypads (= 64 keys with 16 dedicated pins): Keypad usage on i.MX27. Please consult the i.MX27 Reference Manual (Chapter 25) for more informations.

Matrix keypads on i.MXL

Driver for i.MX GPIO controlled keypads

By default your board supports a direct connection with a 4x4 matrix keypad using the CSI lines: CSI_MCLK, CSI_D0...CSI_D6.

The driver uses the i.MXL GPIO's internal pull-up, therefore your board does not need any additional external resistor.

  • Connect the 4 (rows) lines of the keypad to CSI_MCLK, CSI_D0, CSI_D1, CSI_D2 (resp. PORT_A pin 3, 4, 5, 6)
  • Connect the 4 (columns) lines of the keypad to CSI_D3, CSI_D4, CSI_D5 CSI_D6 (resp. PORT_A pin 7, 8, 9, 10)

{add a big picture of the keypad link with APF_DEV_LIGHT} {add a big picture of the keypad link with APF_DEV_FULL}

3x4 matrix keypad connected to i.MX GPIOs

FPGA solution

Development are also ongoing to connect matrix keypads using the FPGA...

Test

  • use target/demos/keypad_test/ test tool
  • If you have a graphical LCD connected to your board (= virtual terminal), then you should see what you type.
  • If you don't have any virtual terminal, but only the serial console:
# cat /sys/class/input/input0/event0/dev
13:64

If corresponding device node in /dev/input/ is not existing, then:

# mkdir -p /dev/input
# mknod /dev/input/event0 c 13 64
# cat /dev/input/event0

Then you should see weirds characters when pressing keyboard keys:

�,~~_�,}�}�3T,QToT6,TT�,�;��, � �


Links

external links (for exemple: locomo driver model)