Introduction to the input subsystem in Linux device drivers

For input-type devices such as keyboards, mice, touch screens and other Linux drivers, the kernel provides an input subsystem, making the processing of such devices very convenient. In general, the input subsystem consists of three parts: Event-driven "-" input core "-" device driver.

The event driver is responsible for dealing with the user program, such as the device node / dev, etc., he is responsible for it, we do not need to implement this when writing the driver; the device driver is responsible for dealing with the hardware device, the interaction here is very simple, only need Read the data of the relevant hardware, and then throw it to the input core;

For example, taking the button key as an example, the device device number, button value, configuration pin and interrupt mode are defined, and then the application is interrupted. In the interrupt service function, read the corresponding pin value, use the input_report function to send to the input core, and use the input_sync to notify the end of the transmission. In addition, when the module is initialized, define an input_dev structure. This input_dev is the core data structure of the input subsystem device driver. Because the input device is various, it is to tell the core your input device type through this structure.

Two of these important members, these macros are specifically defined in linux/input.h.

One is, evbit, the indicator bit representing the type of event, commonly used as

EV_SYN 0x00 sync event

EV_KEY 0x01 button event

EV_REL 0x02 relative coordinates

EV_ABS 0x03 absolute coordinates

EV_MSC 0x04 other

EV_LED 0x11 LED

EV_SND 0x12 sound

EV_REP 0x14 Repeat

EV_FF 0x15 force feedback

EV_PWR power supply

EV_FF_STATUS status

The other is keybit, which represents the key-value code.

Others

Relative positioning of relbit

Absbit absolute positioning

Mscbit Mouse Systems CorporaTIon, to the effect that some vendors use a 5-byte serial mouse protocol, but Microsoft uses a three-byte protocol, so when the manufacturer makes a serial mouse, the device has two working modes, one is MSC mode. One is the Microsoft model.

Ledbit keyboard indicator event indicator

Sndbit keyboard sound indicator

Ffbit force feedback

Swbit switch, event generated when the device is switched

Our Led Shoebox Light is designed to replace 100W to 1000W Metal Halide and High Pressure Sodium shoebox lights in parking lots and other public areas. China LED Area Lights Manufacturer Supplier. Led Shoebox has 3 Step Dimming(20% / 50% / 75% / 100% wireless remote control) & perfect for parking lots, roadways, car dealerships, campuses, parks, and as a replacement for street lights and vapor lamps. This Led Shoebox Fixture is available in 100w,150w,180w,200w and 320w. Photocell sensor and motion sensor is acceptable. 


Led Shoebox Light

Led Shoebox Light

Led Shoebox,Led Shoebox Light,Led Shoebox Fixture,Shoebox Light

Shenzhen Bbier Lighting Co., Ltd , https://www.chinabbier.com