
TPMC500-SW-42 - VxWorks Device Driver
Page 17 of 19
4.4.3 ioctl()
example
#define SBUF_SIZE
0x200
int
fd;
STATUS result;
TP500_IOC_BUF
seq_buf;
TP500_IO_BUFFER seq_rw_par[2];
long
seq_data_buf[SBUF_SIZE];
...
/*---------------------------------------------------------
Start sequence using channel 1 and 3
Channel 1:
differential
data correction on
gain = 1
Channel 3:
single-ended
data correction off
gain = 5
---------------------------------------------------------*/
seq_buf.cycletime
= 10000;
/* Cycletime 1s */
seq_buf.buffer
=
seq_data_buf;
seq_buf.act_channels =
2;
seq_buf.buf_size
= SBUF_SIZE / seq_buf.act_channels;
seq_buf.chan_setup
= seq_rw_par;
seq_rw_par[0].Channel =
1;
seq_rw_par[0].Gain
= 1;
seq_rw_par[0].flags
= TP500_CORRENA | TP500_DIFFMODE;
seq_rw_par[1].Channel =
3;
seq_rw_par[1].Gain
= 5;
seq_rw_par[1].Mode
= TP500_CORRDIS | TP500_SNGLMODE;
result = ioctl(fd, FIOSTARTSEQ , (int)&cntrl_par);
if (result == OK)
{
/* Sequencer started */
}
else
{
/* Error when starting the sequencer */
}
...