Electronic Components Datasheet Search
  English  ▼

X  

UM0851 Datasheet(PDF) 182 Page - STMicroelectronics

Part # UM0851
Description  SPEAr is a family of highly customizable ARM-based embedded
PDF  245 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0851 Datasheet(HTML) 182 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 178Page - STMicroelectronics UM0851 Datasheet HTML 179Page - STMicroelectronics UM0851 Datasheet HTML 180Page - STMicroelectronics UM0851 Datasheet HTML 181Page - STMicroelectronics UM0851 Datasheet HTML 182Page - STMicroelectronics UM0851 Datasheet HTML 183Page - STMicroelectronics UM0851 Datasheet HTML 184Page - STMicroelectronics UM0851 Datasheet HTML 185Page - STMicroelectronics UM0851 Datasheet HTML 186Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 182 / 245 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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