| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 181 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 181 Page - STMicroelectronics |
|
181 / 245 page ![]() 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. |
|
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 |