TIP675-SW-42 – VxWorks Device Driver
Page 31 of 31
EXAMPLE
#include
"tip675.h"
…
int
fd;
int
retval
T675_WRITE_STR
wBuf;
…
/*-------------------------------------------------------
write 0x1234 0x5678 0x9abc to the output lines 48..1 of
the device associated with fd
-------------------------------------------------------*/
wBuf.out_1_16 = 0x9abc;
wBuf.out_17_32 = 0x5678;
wBuf.out_33_48 = 0x1234;
retval = ioctl(fd, FIO_T675_WRITE, (int)&wBuf);
if (retval == ERROR)
{
/* handle function specific error conditions */
}
…
RETURNS
ERROR if an error occurred or the number of bytes written on success
SEE ALSO
ioLib, basic I/O routine - ioctl(), VxWorks Programmer's Guide: I/O System