In this article, we will talk about the driver principle of Linux touch screen device at the technical level.
A touch screen uses an adconverter chip to convert the touch signal on the screen into a digital signal. The touch screen is commonly used with a four-wire resistor and an adconverter chip.
Commonly used are 7843,7846 and ts2003. During touch, these chips convert analog signals to digital signals, that is, the adconverter.
In Linux, these numbers are usually read through interruptions. An interruption occurs when you touch the screen. Linux uses serial ports or I2C, SPI, etc.
Read the number and pass the value to the input layer. This is the general driver principle.
Touch screen verification, because most of the values active from the drive are 8 or 12 bits. The range of coordinates that can be expressed is (0.0) -- (256,256) or
(0, 0) -- (4096,4096), you need to match the number to the screen resolution. At this time, you need to verify the program to match one by one
These. The common verification program is tslib.
After the tslib verification is passed, the application reads the values in tslib, which can be accurately located at this time.
Here is a specific driver for me.
Touch screen ------ TI2007-----------I2C----------INPUT-------TSLIB ------- application.
Detailed code analysis will be described later