Linux touch screen driver analysis-Linux general technology-Linux programming and kernel information, the following is a detailed description. The best example for developing a touch screen driver is the implementation of mc68328digi. c. Before I see the original text, I will parse the structure used in it.
1, struct ts_pen_info
This structure is the core data structure of the touch screen. The interaction between the user program and the driver is completed through the data structure. The x and y coordinates and states in the struct are the original event-driven data sources in the gui.
2. Annular queue
The gui program extracts ts_pen_info through read. A circular queue is maintained in the kernel. As long as the queue is not empty, data is immediately returned to the application.
3. Interrupt Driving Mechanism
The touch screen is the input device, so the interrupt drive mechanism is used. If a touch event occurs, it is filled with an item in the ring queue.
4. Necessity of Timer
The interrupt processing function of the touch screen must start a timer. The timer is used to detect the Drag operation. When the touch screen is not released, the interruption only occurs once. This has little to do with the trigger mode, and is not a problem of edge trigger and Level Trigger. The main reason is that the interrupt processing function of the touch screen will not open the interrupt if it is not released. During this period, the new coordinates of the touch screen are detected through the timer.
5. misc driver
The touch screen is driven by Misc structure.
These 5 points are the core of the touch screen driver. To understand this, you can easily read and write your own touch screen driver. The source code of the program will be provided later for research by interested friends.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service