| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 182 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 182 Page - STMicroelectronics |
|
182 / 245 page ![]() Human interface device (HID) drivers UM0851 182/245 Doc ID 16604 Rev 2 static struct spear_kp_platform_data spear_kbd_data = { .keymap = spear_keymap, .keymapsize = ARRAY_SIZE(spear_keymap), .rep = 1, }; ● .keymap :Pointer to the Keymap table ● .keymapsize :Array size of the Keymap table (usually # = rows x cols) ● .rep :Repeat key support ('1' if supported) Below is the example for the Keymap table static int spear_keymap[] = { KEY(0, 0, KEY_ESC), KEY(0, 1, KEY_1), . KEY(1, 3, KEY_3), KEY(1, 4, KEY_4), . . KEY(8, 8, KEY_EQUAL), } The keymap table is fully customizable and can support a keypad with a generic NxM matrix (9x9 is the maximum matrix size). The format is like KEY(row , col, val). 7.2.4 Keypad usage The keypad driver provides an event interface to the input layer. Evdev is the generic input event interface. It passes the events generated in the kernel straight to the program, with timestamps. The devices are in /dev/input: crw-r--r-- 1 root root 13, 64 Apr 1 10:49 event0 crw-r--r-- 1 root root 13, 65 Apr 1 10:50 event1 crw-r--r-- 1 root root 13, 66 Apr 1 10:50 event2 crw-r--r-- 1 root root 13, 67 Apr 1 10:50 event3 The device nodes are created in /dev/input directory with the major number 13 and minor number 64. The device can be opened using the open() system call in both blocking and non-blocking modes, and read using the select() system call on the /dev/input/eventX devices, which will always get a whole number of input events on a read. Their layout is: struct input_event { struct timeval time; unsigned short type; unsigned short code; unsigned int value; }; 'time' is the timestamp, it returns the time at which the event happened. Type is for example EV_REL for relative moment, REL_KEY for a key press or key release. More types are defined in include/linux/input.h. 'code' is event code, for example REL_X or KEY_BACKSPACE, again a complete list is in include/linux/input.h. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |