before you compile tslib you need to edit one of the test applications, ts_calibrate, otherwise it doesn't quite calibrate properly, edit lines 238-244 so they look like the following:

+

+

get_sample (ts, &cal, 0, 10, 10, "Top left");

+

clearbuf(ts);

+

get_sample (ts, &cal, 1, xres - 10, 10, "Top right");

+

clearbuf(ts);

+

get_sample (ts, &cal, 2, xres - 10, yres - 10, "Bot right");

+

clearbuf(ts);

+

get_sample (ts, &cal, 3, 10, yres - 10, "Bot left");

+

+

Now you've changed the screen position of the calibration boxes closer to the corners it should calibrate a lot nicer than it did.

Compile tslib

Compile tslib

Line 69:

Line 82:

==To Do==

==To Do==

Using tslib in your applications.

Using tslib in your applications.

+

+

+

[[Category:Leapster Explorer]]

Latest revision as of 01:59, 27 October 2011

Background

Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. Examples of implemented filters include jitter smoothing and the calibration transform. Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality.

fix ts_calibrate app
before you compile tslib you need to edit one of the test applications, ts_calibrate, otherwise it doesn't quite calibrate properly, edit lines 238-244 so they look like the following:

Once that is done, boot the fbdev kernel, modprobe lf1000_ts, then run ts_calibrate and ts_test.

To include this library in your applications:
Copy the contents of lib to your compiler's lib directory (in buildcross: sys-root/usr/lib)
Copy the contents of include to your compiler's include directory (in buildcross: sys-root/usr/include)