
TPMC500-SW-42 - VxWorks Device Driver
Page 16 of 19
4.4.1
FIOSTARTSEQ
Setup and start the sequencer
This function reads the values of the specified input lines and stores the input values into a user
supplied FIFO. For this operation the argument
arg
points to a structure named
TP500_IOC_BUF
.
This structure is defined in
tpmc500.h
.
Data structure
TP500_IOC_BUF
:
typedef struct
{
unsigned short
cycletime;
/* sequencer cycletime */
unsigned long
act_channels;
/* number of active channels
*/
TP500_IO_BUFFER
*chan_setup;
/* channel configurations
*/
unsigned long
buf_size;
/* size of buffer */
unsigned long
buf_stat;
/* buffer state / error
*/
unsigned long
putIdx;
/* Index to put data
*/
unsigned long
getIdx;
/* Index to read data
*/
long
*buffer;
/* pointer to buffer
*/
} TP500_IOC_BUF
The
cycletime
argument specifies the length of a cycle. This value is specified in 100
µ
s steps.
The argument
act_channels
specifies the number of active channels.
The pointer
chan_setup
points to an array of data structures specifying the channel setups. The used
data structure is the same used by the read command (for more information refer to the
read
command).
The argument
buf_size
specifies the size of the input FIFO.
The actual state and errors will be shown in the
buf_stat
argument. The following bits are defined.
TP500_SEQ_BUF_OVERRUN
The user supplied FIFO is full and new data
can not be stored
TP500_SEQ_DATA_OVERFLOW
Old data not read by the software when new
values are ready
TP500_SEQ_TIMER_ERR
The specified cycle time is not long enough to
convert the specified channels
TP500_SEQ_INST_RAM_ERR
The sequencer is started, but no channel has
been selected.
The arguments
putIdx
and
getIdx
are used to specify the actual read and write pointer into the FIFO.
putIdx
shall be changed by the driver and just be read from the application.
getIdx
must be moved by
the application after reading a set of input values and is only read by the driver.
The pointer
buffer
points to the user supplied memory area where the sequencer input data will be
stored.
4.4.2 FIOSTOPSEQ
Stop
the
sequencer
This command stops a running sequence cycles. This command needs no argument.