Embedded (Touch Pad Library Tslib Compilation and configuration)

Source: Internet
Author: User

original                                    ,         &NB Sp  2016-10-25                                  ,         &NB Sp     Lin Shilin                                      ,         &NB sp; cheats cool                                 &NB Sp                                

650) this.width=650; "class=" Rich_media_thumb "id=" Js_cover "style=" Height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_ jpg/d0yyox6zlbwopczkic4nnhz5c4vkrtno0uv8ibjyibrpceilgj2dl2iahlz6ooibsrh9oiian3pgg9r6iboye4niyxleq/640?wx_fmt= Jpeg&wxfrom=5 "alt=" 640?wx_fmt=jpeg&wxfrom=5 "/>

As a basic input device, the touchpad is almost standard for interactive embedded systems. When we know that we can read the touchpad data through the device node, we need to further optimize these directly acquired native data, such as jitter, noise cancellation, calibration, and so on.

650) this.width=650; "style=" Line-height:25.6px;width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz/ d0yyox6zlbzck8lufgdunpnwyhndj3jkkbwozw5mqmqmuoqg3yepn3naqmzrlz5kvicpfmzzzzuktwjnnibk2ouq/0?wx_fmt=gif& Wxfrom=5&wx_lazy=1 "alt=" 0?wx_fmt=gif&wxfrom=5&wx_lazy=1 "/>
Optimizing the Touch pad raw (native) data is a very complex algorithm task, involving such as matrix operations, determinant and other advanced mathematics, generally need to have a relatively solid mathematical background of the algorithm engineer to do, one of their outstanding results, is today to introduce the Tslib library.


before using the Tslib library , the code that operates the touchpad device looks like this: ( ugly!!) )

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ d0yyox6zlbyqqqiad245jtwkhwlmceliahweibqimmoamj6qvw9hbwjl95bc9nfodtxstqr4vv60lxmc2azkkjctw/640?wx_fmt=png& Wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>


After the tslib Library facelift , the operation of the touchpad code is like this: ( Mei Xuan finish!!) )

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ d0yyox6zlbyqqqiad245jtwkhwlmceliahsfvfqb4moqpoq4yzslnorgia2thv4tuvqogxem6r4oqgzb0x6rd9gdw/640?wx_fmt=png& Wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>

Can be seen, using the Tslib library not only to get a variety of good algorithm escort, and the code more concise, more clear logic, the whole person suddenly become beautiful change handsome have no!


Therefore, the investment time to make Tslib library is worthwhile, the following with the embedded curriculum environment in Guangdong for example (including Guangdong embedded in the GEC210 Development Board), the specific operation steps are as follows:

1, the Internet to make a source library, if you are cute to not use Baidu , it's okay, poke me download (http://download.csdn.net/detail/vincent040/9662825).

2. Drop the source code into Ubuntu and unzip it to Ubuntu's home directory using the following commands:

Tar xjvf tslib-1.4.tar.bz2 -C ~

3, go to the top-level directory of the source code, followed by the following command:

mkdir ~/tslib

./configure --prefix=/home/xxx/tslib--host=arm-none-linux-gnueabi

Make

Make install


Of course, I have the experience of many years I tell you, the above instructions where to pay attention to, in order to save your precious life, yes please call me Lei Feng, Lin Lei.

A) The path behind the--prefix= is the path where you want to install the Tslib library , and the wall crack recommendation is set to an empty directory in the home directory (such as ~/tslib), because if you set up other directories in the system, post make install The time will let you solve the problem of permissions, when you are smart to use sudo, the system may complain that the tool chain can not be found, so unless you are an Ubuntu scientist, the system environment variables know, otherwise do not use small white identity to die, obediently--prefix designated as ~/ Tslib can be.

B) behind the--host= is the prefix of your tool chain , and be careful not to get dizzy and write wrong.

C) when make, the following error generally occurs:

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ D0yyox6zlbyqqqiad245jtwkhwlmceliahoktdicwollzwqrofioy69do16ksgmchswibjuuwerciazvwpvmia1dr5ba/640?wx_fmt=png &wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>
How can we solve this problem? Mo Fang, I see you are destined, today will be the ancestral secret to teach you (silently admit I this age not should wisdom and generosity): that is, the source of the top level directory of the Config.h file, the 181th line, delete ! Then re-make, problem solved.


Finally, you will find the following directories under/home/xxx/tslib:

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ d0yyox6zlbyqqqiad245jtwkhwlmceliahmr2hfeyf6urxc9xixzltyw84qgyuy2rhich1dj8xyy48yob7xiayn1ew/640?wx_fmt=png& Wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>


Next, you need to find a way to get this pile of files into the Development Board, generally first pack them compressed, and then through the serial port or network protocol transmission to the Development Board, and then in the Development Board decompression.


The library is copied to the Development Board, is it all right? non-also , you have worked hard to do these jobs, the Development Board system is ignorant, and you must do so:


1, will tslib/etc/ts.config in the 2nd line, from the original look like this:

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ d0yyox6zlbyqqqiad245jtwkhwlmceliahoqhhgqmgtescdvtsazp34mvsx3addkj6yvplfczqclwdttey07kbew/640?wx_fmt=png& Wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>
change to look like this :

650) this.width=650; "style=" Width:auto;height:auto; "src=" http://mmbiz.qpic.cn/mmbiz_png/ D0yyox6zlbyqqqiad245jtwkhwlmceliahb8gia7iaaw2iaaqzg6xhfur8mu7ib2norv57rsvaawcjeckfx1nfvfqfq/640?wx_fmt=png &wxfrom=5&wx_lazy=1 "alt=" 640?wx_fmt=png&wxfrom=5&wx_lazy=1 "/>
Yes, is the 2nd line in front of the pound # and the space to delete, note, I said well number and space, I did not say well, good for it.


2, in the/etc/profile file of the Development Board system, add the following (assuming you put the Tslib library in the root directory of the Development Board, if not, the following path should be modified accordingly):

Export Tslib_root=/tslib/lib

Export Tslib_tsdevice=/dev/event0

Export tslib_fbdevice=/dev/fb0

Export tslib_conffile=/tslib/etc/ts.conf

Export Tslib_plugindir=/tslib/lib/ts

Export Tslib_consoledevice=none

Export Tslib_calibfile=/tslib/calibration

Export Ld_library_path= $LD _library_path:/tslib/lib

tslib_tsdevice indicates the device node file name for the Board touch screen.

tslib_fbdevice indicates the device node file name for the board LCD.

tslib_conffile indicates the location of the configuration file for the Tslib library, The actual situation should prevail.

tslib_consoledevice indicates the terminal name, None means that the system automatically matches.

tslib_calibfile indicates the location of the correction file, which is executed Ts_ Automatically generated after calibrate.

3, finally, restart the Development Board, let the system re-read the contents of the/etc/profile file, if necessary, perform the following/tslib/bin/ts_calibrate calibration screen, done (again silently admit This age should not have wisdom)!



Embedded (Touch Pad Library Tslib Compilation and configuration)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.