Electronic Components Datasheet Search
  English  ▼

X  

UM0851 Datasheet(PDF) 181 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) 181 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 177Page - STMicroelectronics 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 Next Button
Zoom Inzoom in Zoom Outzoom out
 181 / 245 page
background image
UM0851
Human interface device (HID) drivers
Doc ID 16604 Rev 2
181/245
The three elements of the input subsystem are the input core, drivers and event handlers.
The relationship between them is shown in Figure 48. Note that while the normal path is
from low-level hardware to drivers, drivers to input core, input core to handler and handler to
user space, there usually is a return path as well.
The interaction between various elements is through events, which are implemented as
structures.
The first field (time) is a simple timestamp. The type field shows the generic type of event
being reported, for example, a key press or button press. The code field tells which of the
various buttons are being manipulated, while the value field tells you what the state or
motion is. For example, if the type is a key or button, code tells you which key or button it is,
and value tells you if the button has been pressed or released.
struct input_event {
struct timeval
time;
__u16 type;
__u16 code;
__s32 value;
}
Initialization and registration
In the spear_kp_init()driver function, which is called either when the module is loaded or
when booting the kernel, the keypad driver grabs the required resources (it should also
check for the presence of the device).
Then it allocates a new input device structure using input_allocate_device () and sets up
input bitfields. In this way the device driver tells the other parts of the input systems what it is
and what events can be generated or accepted by this input device.
The driver registers the input device structure by calling input_register_device()
This adds the struct input_dev to the linked lists of the input driver and calls the device
handler modules _connect functions to tell them a new input device has appeared.
Input_register_device() may sleep and therefore must not be called from an interrupt or with
a spinlock held.
struct input_dev
*input;
input_register_device( input );
Upon any press or release of key, the driver reports it via the input_report_key() call to the
input system. The value is interpreted as a truth value, any nonzero value means key
pressed, zero value means key released. The input code generates events only in case the
value is different from the previous one.
Note:
Input_allocate_device(), input_report_key(), and input_register_device() are part of the
Linux input framework.
7.2.3
Customizing the keypad driver
The keypad controller driver needs some platform data to work correctly. This information is
present in arch/arm/mach-spear300/spear300.c. It includes information about the keymap
table (which represent the value associated with each of the [rows, column] pair) and its
size. It also says whether repeat key is supported or not. The structure for the platform
specific data is given below.



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