User`s guide
Setting Up the Keypad Port (KPP)
i.MX53 System Development User’s Guide, Rev. 1
17-2 Freescale Semiconductor
17.2 Creating a Custom Keymap
The input.h file defines codes for general keyboards, as follows.
...
#define KEY_HOME 102
#define KEY_UP 103
#define KEY_PAGEUP 104
#define KEY_LEFT 105
#define KEY_RIGHT 106
#define KEY_END 107
#define KEY_DOWN 108
#define KEY_PAGEDOWN 109
#define KEY_INSERT 110
#define KEY_DELETE 111
...
Use these labels or add new ones to create your custom keymap.
17.3 Configuring the Pads with the Machine Layer File
The mx53_<board name>.c file contains the structures to configure the pads. They are as follows:
static struct pad_desc mx53common_pads[] = {
…
…
…
/* Keypad */
MX53_PAD_KEY_COL0__KEY_COL0,
MX53_PAD_KEY_ROW0__KEY_ROW0,
MX53_PAD_KEY_COL1__KEY_COL1,
MX53_PAD_KEY_ROW1__KEY_ROW1,
MX53_PAD_KEY_COL2__KEY_COL2,
MX53_PAD_KEY_ROW2__KEY_ROW2,
MX53_PAD_KEY_COL3__KEY_COL3,
MX53_PAD_KEY_ROW3__KEY_ROW3,
MX53_PAD_KEY_COL4__KEY_COL4,
MX53_PAD_KEY_ROW4__KEY_ROW4,
…
…
…
};
Use the following procedure to configure the pads:
1. Add the configured pin's definitions from the iomux-mx53.h files to the structures in the
mx53_<board name>.c file.
NOTE
Remove any entry that can cause pin conflict. i.e.
MX53_PAD_KEY_COL2_KEY_COL2 conflicts with
MX53_PAD_KEY_COL2_TXCAN1.
2. On init function, set up the pads using the function below:
mxc_iomux_v3_setup_multiple_pads(mx53common_pads, ARRAY_SIZE(mx53common_pads));