
TIP675-SW-42 – VxWorks Device Driver
Page 29 of 31
EXAMPLE
#include
"tip675.h"
…
int
fd;
int
retval;
T675_READ_STR
rBuf;
…
/*---------------------------------------------------------
read the input registers of the device associated with fd
---------------------------------------------------------*/
retval = ioctl (fd, FIO_T675_READ, (int)&rBuf);
if (retval == ERROR)
{
/* handle function specific error conditions */
} else {
printf( “Input
1-16: %04X\n”, rBuf.in_1_16 );
printf( “Input 17-32: %04X\n”, rBuf.in_17_32 );
printf( “Input 33-48: %04X\n”, rBuf.in_33_48 );
}
…
RETURNS
ERROR if an error occurred or number of bytes read on success.
SEE ALSO
ioLib, basic I/O routine - ioctl(), VxWorks Programmer's Guide: I/O System