![]() |
![]()
| ![]() |
![]()
NAMEts_read, ts_read_raw, ts_read_mt, ts_read_raw_mt - read tslib touch samples SYNOPSIS#include <tslib.h> int ts_read(struct tsdev *dev, struct ts_sample *samp, int nr); int ts_read_raw(struct tsdev *dev, struct ts_sample *samp, int nr); int ts_read_mt(struct tsdev *dev, struct ts_sample_mt **samp, int slots, int nr); int ts_read_raw_mt(struct tsdev *dev, struct ts_sample_mt **samp, int slots, int nr); DESCRIPTIONts_read() reads nr input samples with tslib's filters applied. struct ts_sample is define as follows: struct ts_sample { ts_read_mt() reads nr * slots input samples with tslib's filters applied. struct ts_sample_mt is defined as follows: struct ts_sample_mt { The user has to provide the amount of memory described in nr and slots to hold them. ts_read_raw() and ts_read_raw_mt() do the same thing without tslib's filters applied. RETURN VALUEThe number of actually read samples is returned. Especially when opened in non-blocking mode, see ts_setup() , that can be less than requested in the call. On failure, a negative error number is returned. EXAMPLEThe following program continuously reads tslib multitouch input samples and prints slot and position values to stdout as the touch screen is touched. #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <tslib.h> #define READ_SAMPLES 1 #define MAX_SLOTS 5 int main(int argc, char **argv) { SEE ALSOts_setup(3), ts_config(3), ts_open(3), ts_close(3), ts.conf(5)
|