Hi all,
I am trying to write a touchscreen calibration program for the ADS Graphics
Master platform, which uses a screen resolution of 640 x 480 and kernel
2.4.9.
Looking at my source code further below, my question is, what kind of values
look correct to enter in raw_min_x, raw_max_x, res_x, raw_min_y, raw_max_y,
and res_y?
My guess would be:
raw_min_x = 1
raw_max_x = 640
res_x = 640
raw_min_y = 1
raw_max_y = 480
res_y = 480
But apparently these values do not work when I test the touchscreen. Can
someone help me figure out what kind of values to enter, or if there is an
easier way to directly adjust the calibration settings? Thank you!
Cheers,
//Henry Chea
Semcon Sweden AB
The important part of my program looks like this:
{
int raw_min_x, raw_max_x, res_x;
int raw_min_y, raw_max_y, res_y;
ioctl(fd, 13, 0); //Enables calibration
ioctl(fd, 3, raw_max_x);
ioctl(fd, 4, raw_max_y);
ioctl(fd, 5, res_x);
ioctl(fd, 6, res_y);
ioctl(fd, 10, raw_min_x);
ioctl(fd, 11, raw_min_y);
ioctl(fd, 12, 0); //no xy swap
ioctl(fd, 13, 1); //Calibration is done
}
Looking at some kernel source code (linux/drivers/char/ucb1200_ts.c), here
is how the ioctl arguments are defined:
case 3:
raw_max_x = arg;
break;
case 4:
raw_max_y = arg;
break;
case 5:
res_x = arg;
break;
case 6:
res_y = arg;
break;
case 10:
raw_min_x = arg;
break;
case 11:
raw_min_y = arg;
break;
case 12:
/* New attribute for portrait modes */
xyswap = arg;
/* Allen Add */
case 13: /* 0 = Enable calibration ; 1 = Calibration OK */
cal_ok = arg;
case 14: /* Clear all buffer data */
ts_clear();
break;
case 15: /* X axis reversed setting */
x_rev = arg;
break;
case 16: /* Y axis reversed setting */
y_rev = arg;
break;
case 17: /* Clear all buffer data */
print_par();
break;
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
http://www.arm.linux.org.uk/armlinux/mailinglists.php
Please visit the above addresses for information on this list.