AC_MSG_RESULT($arctic2_module)
AM_CONDITIONAL(ENABLE_ARCTIC2_MODULE, test "$arctic2_module" = "yes")
+AC_MSG_CHECKING([whether tatung module is requested])
+AC_ARG_ENABLE(tatung,
+ AS_HELP_STRING([--enable-tatung],
+ [Enable building of tatung raw module (Tatung Webpad support) (default=yes)]),
+ [tatung_module=$enableval],
+ [tatung_module=yes])
+AC_MSG_RESULT($tatung_module)
+AM_CONDITIONAL(ENABLE_TATUNG_MODULE, test "$tatung_module" = "yes")
+
AC_MSG_CHECKING([whether input module is requested])
AC_ARG_ENABLE(input,
AS_HELP_STRING([--enable-input],
ARCTIC2_MODULE =
endif
+if ENABLE_TATUNG_MODULE
+TATUNG_MODULE = tatung.la
+else
+TATUNG_MODULE =
+endif
+
if ENABLE_INPUT_MODULE
INPUT_MODULE = input.la
else
$(H3600_MODULE) \
$(MK712_MODULE) \
$(ARCTIC2_MODULE) \
+ $(TATUNG_MODULE) \
$(H2200_LINEAR_MODULE) \
$(INPUT_MODULE)
arctic2_la_SOURCES = arctic2-raw.c
arctic2_la_LDFLAGS = -module $(LTVSN)
+tatung_la_SOURCES = tatung-raw.c
+tatung_la_LDFLAGS = -module $(LTVSN)
+
input_la_SOURCES = input-raw.c
input_la_LDFLAGS = -module $(LTVSN)
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "config.h"
+#include "tslib-private.h"
+
+struct tatung_ts_event { /* Tatung touchscreen 4bytes protocol */
+ unsigned char x1;
+ unsigned char x2;
+ unsigned char y1;
+ unsigned char y2;
+};
+
+static int tatung_read(struct tslib_module_info *inf, struct ts_sample *samp, int nr)
+{
+ struct tsdev *ts = inf->dev;
+ struct tatung_ts_event *tatung_evt;
+ int ret;
+ int total = 0;
+ tatung_evt = alloca(sizeof(*tatung_evt) * nr);
+ ret = read(ts->fd, tatung_evt, sizeof(*tatung_evt) * nr);
+ if(ret > 0) {
+ int nr = ret / sizeof(*tatung_evt);
+ while(ret >= (int)sizeof(*tatung_evt)) {
+
+ if (tatung_evt->x1==240 || tatung_evt->x2==240 || tatung_evt->y1==240 || tatung_evt->y2==240)
+ {
+ ret = nr;
+ return ret;
+ }
+
+ samp->x = (tatung_evt->x1)*31 + (tatung_evt->x2)-64;
+ samp->y = (tatung_evt->y1)*31 + (tatung_evt->y2)-192;
+ samp->pressure=1;
+ //samp->pressure = tatung_evt->pressure;
+
+#ifdef DEBUG
+ fprintf(stderr,"RAW---------------------------> %d %d %d\n",samp->x,samp->y,samp->pressure);
+#endif /*DEBUG*/
+ gettimeofday(&samp->tv,NULL);
+ samp++;
+ tatung_evt++;
+ ret -= sizeof(*tatung_evt);
+ }
+ } else {
+ return -1;
+ }
+
+ samp->pressure=0;
+ ret = nr;
+ return ret;
+}
+
+static const struct tslib_ops tatung_ops =
+{
+ .read = tatung_read,
+};
+
+TSAPI struct tslib_module_info *mod_init(struct tsdev *dev, const char *params)
+{
+ struct tslib_module_info *m;
+
+ m = malloc(sizeof(struct tslib_module_info));
+ if (m == NULL)
+ return NULL;
+
+ m->ops = &tatung_ops;
+ return m;
+}