NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Capacitive touch integration with android
Content is no longer maintained and is being kept for reference only!
Contents
Capacitive touch integration with Android - Flow & Trap[edit]
Introduction[edit]
Today more and more different fields are adopting touch screen or touch panels for application with human/machinery or human/computer interfaces. There are two types of touch panels are popular now a days.
- Resistive touch
- Capacitive touch
Resistive touch is simple, cheaper and easy to integrate. However with this touch level of calibration is required to be in place. There are various calibration algorithms available which can be use for this purpose.
Capacitive touch on other side has multi touch support and less prone to dust particle. Most capacitive touch controller has capability to support multiple configuration (x & y axis). According to configuration set for the touch one has to scale the inputs received from touch to the area of LCD. Kindly refer below figure.
As mentioned in above figure if touch screen having the same resolution as LCD on which it is mounted on then there is no question of scaling, but calibration might require to remove mechanical alignment error if introduce while mounting.
But as seen in second figure, where touch resolution is different than that of LCD’s. In such case every inputs coming from touch panel/screen has to be scaled or mapped to LCD’s visible resolution.
During integration phase, came across the problem - even after getting scaled input from touch driver, android screen does not show correct behavior. Very first thing of suspect is calibration issue, but after debugging and looking at the co-ordinate’s values from touch driver, found that values are getting re-scaled again at somewhere. To understand the cause; this document will briefly highlight on - input flow with respect to kernel and android interface and give solution for problem statement.
Touch Event Flow in brief[edit]
Below diagram explains top to bottom flow of touch event. Diagram has taken from the link {http://cjix.info/blog/misc/internal-input-event-handling-in-the-linux-kernel-and-the-android-userspace}.
Where does android do scaling?[edit]
Linux driver reports x and y axis’s information to input subsystem[edit]
Android’s input layer read axis’s information[edit]
Android’s input layer scale co-ordinates before dispatch to window manager[edit]
Problem Statement[edit]
At time it happens that
- Inside touch driver, function configures touch screen to get input based on lcd screen’s x & y parameters.
- Also in other case; touch driver its self does the scaling of touch co-ordinates to lcd screen area.
In both case mentioned above, android layer has to be aware of this or else it will proceed with scaling based on axis information.
Solution:[edit]
To avoid mentioned problem, driver has to report axis’s information based on behavior. Ex. If driver configures touch screen to get 800x480 inputs for LCD 800x480 ( on which it is mounted on), then in probe function it has to be changed to 800x480 instead of maximum value. Or else put the value that has been defined in board file.
References[edit]
Technical Support and Product Updates[edit]
For further information or to report any problems, contact http://e2e.ti.com/android or http://support.ti.com.
For community support join http://groups.google.com/group/rowboat
For IRC #rowboat on irc.freenode.net