2000-10-10 00:52:10 +00:00
|
|
|
|
2001-06-27 22:18:47 +00:00
|
|
|
#define _COMEDILIB_DEPRECATED
|
|
|
|
|
2000-10-10 00:52:10 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <comedilib.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "comedi_test.h"
|
|
|
|
|
|
|
|
|
|
|
|
int test_mode0_read(void)
|
|
|
|
{
|
|
|
|
comedi_trig it;
|
2004-06-19 19:55:26 +00:00
|
|
|
sampl_t data;
|
2000-10-10 00:52:10 +00:00
|
|
|
unsigned int chanspec;
|
|
|
|
int save_errno;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
printf("rev 1\n");
|
|
|
|
|
|
|
|
memset(&it,0,sizeof(it));
|
|
|
|
it.subdev = subdevice;
|
|
|
|
it.mode = 0;
|
|
|
|
it.n_chan = 1;
|
|
|
|
it.chanlist = &chanspec;
|
2004-06-19 19:55:26 +00:00
|
|
|
it.data = &data;
|
2000-10-10 00:52:10 +00:00
|
|
|
it.n = 1;
|
|
|
|
|
|
|
|
chanspec = CR_PACK(0,0,0);
|
|
|
|
|
|
|
|
ret = comedi_trigger(device,&it);
|
|
|
|
save_errno = errno;
|
|
|
|
|
|
|
|
printf("comedi_trig_ioctl: %d\n",ret);
|
|
|
|
if(ret<0){
|
|
|
|
printf("W: comedi_trig_ioctl: errno=%d %s\n",save_errno,
|
|
|
|
strerror(save_errno));
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|