触摸屏校准值,它是如何在Android中/内核做了什么? [英] Touch screen calibration values, How is it done in Android/Kernel?

查看:339
本文介绍了触摸屏校准值,它是如何在Android中/内核做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植Android的姜饼,以我的自定义板(带有三星S5PV210处理器)。我有与ESC7000芯片的触摸屏。我发现/kernel/drivers/input/touchscreen/usbtouchscreen.c的驱动程序。它几乎工作,但该位范围,顺序和字节顺序是不是在USB数据包好。我修改了code得到正确的RAW位置(使用的printk在控制台上看到它),现在几乎工作。我的资料范围从XMIN,YMIN到XMAX,YMAX是420,430到3650,3650而在理论上,它应该是0,0至4095,4095。既然电容式触摸需要校准也就不足为奇了。这是一个简单的校准像表达式y = mx + b。对于每一个轴(简单的线性校正)。我在车手环顾四周,其中校准处理我想不通。它必须是可编程的,因为它是单元依赖性和要被校准的系统生产的每一个单元中的一个的时间。我想这样做干净像其他Android设备。任何人都知道在哪里校准信息存储在Android系统?哪里是code做补偿计算。关于任何网络搜索提供了有关人希望重新调整他们的电话信息。所以这是没有用的我。

I'm porting Android Gingerbread to my custom board (with a Samsung S5PV210 processor). I have a touch screen with an ESC7000 chip. I found a driver in /kernel/drivers/input/touchscreen/usbtouchscreen.c . It almost worked but the bit range, order and byte ordering was not good in the USB packets. I modified the code to get the right RAW position (used printk on console to see it) and now it almost works. My data range from xmin, ymin to xmax, ymax is 420,430 to 3650, 3650 while in theory, it should be 0,0 to 4095,4095. That is not surprising since a capacitive touch needs calibration. This is a simple calibration like y=mx+b for each axis (simple linear calibration). I looked around in the drivers and I can't figure out where the calibration is processed. It has to be programmable since it's unit dependent and is to be calibrated for each unit one time in system production. I want to do it clean like other Android device. Anybody knows where the calibration information is stored in an Android system? Where is the code doing the compensation calculation. Any web search about that gives information about people wanting to recalibrate their phone. So it's useless for me.

推荐答案

看一看以下螺纹:的 https://groups.google.com/forum/#​​!msg/rowboat/jlbwnmCIDg0/makHFil31pQJ

在EVM的我们通过校准值(或让我们说辛苦codeD值
  对于在Xmin /最大值,YMIN /最大值和XY分辨率)从驱动器向用户
  空间。结果
  ...

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.

原始事件这里处理框架/基/库/ UI / InputReader.cpp

SingleTouchInputMapper ::过程(常量RawEvent * rawEvent)将处理
  原始事件的单点触摸设备。 ABS_X和ABS_Y是值
  从司机过去了,这些都是在绝对坐标的我们
  情况下,我告诉你在我前面的邮件。

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.

纠正我,如果我错了,据我所知的Andr​​oid手机都没有机制做
  从用户空间校准。这是Android的一种标准
  手机从驱动程序本身发送的校准值。

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.

我的建议是,使用tslib的校准和让IT卖场值的/ etc / pointercal。在 SingleTouchInputMapper ::同步(nsecs_t时)通过从/ etc / pointercal文件解析的值计算绝对坐标。

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.

这篇关于触摸屏校准值,它是如何在Android中/内核做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆