微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

触摸屏校准值,如何在Android /内核中完成?

我正在将 Android Gingerbread移植到我的定制主板(使用三星S5PV210处理器).我有一个带ESC7000芯片的触摸屏.我在/kernel/drivers/input/touchscreen/usbtouchscreen.c中找到了一个驱动程序.它几乎可以工作,但USB数据包中的位范围,顺序和字节顺序并不好.我修改代码以获得正确的RAW位置(在控制台上使用printk来查看它),现在它几乎可以工作了.我的数据范围从xmin,ymin到xmax,ymax是420,430到3650,3650,而理论上它应该是0,0到4095,4095.这并不奇怪,因为电容式触摸需要校准.这是一个简单的校准,例如每个轴的y = mx b(简单的线性校准).我在驱动程序中四处查看,无法确定校准的处理位置.它必须是可编程的,因为它取决于单位,并且在系统生产中要为每个单元进行一次校准.我想像其他Android设备一样干净.有谁知道校准信息存储在Android系统中的哪个位置?代码在哪里进行补偿计算.任何网络搜索都会提供有关想要重新校准手机的人的信息.所以对我来说没用.

解决方法

看看以下主题https://groups.google.com/forum/#!msg/rowboat/jlbwnmCIDg0/makHFil31pQJ

On EVMs we pass the calibrated values(or let us say hardcoded values
for Xmin/max,Ymin/max and XY resolution) from the driver to the user
space.

Raw events are handled here frameworks/base/libs/ui/InputReader.cpp

SingletouchInputMapper::process(const RawEvent* rawEvent) will process
raw events for a Single touch device. ABS_X and ABS_Y are the values
passed from driver and these are the absolute coordinates in our
case as I told you in my earlier mail.

Correct me if I’m wrong,afaik Android phones have no mechanism to do
calibration from user space. It is a sort of standard in Android
phones to send the calibrated values from driver itself.

What I suggest is,use tslib to calibrate and let it store values in /etc/pointercal. In SingletouchInputMapper::sync(nsecs_t when) calculate the absolute coordinates by parsing the values from /etc/pointercal file.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐