NAME

hco - write and read the high current output buffer

SYNOPSIS

#include <hco_p.h>
#incldue <stdio_p.h>

fd dopen(path)
char *path;

int dclose (fildes)
FD fildes;

int dread (fildes, output)
FD fildes;
unsigned *output;

int dwrite (fidles, output)
FD fildes;
unsigned *output;

int dioctl (fildes, cmd, arg)
FD fildes;
int cmd, arg;

DESCRIPTION

dopen clears the 16 output bits and returns a file descriptor to be used to read, write and close the device. path points to a string "dev/hco X " where X is the minor device number of the 16-bit output biffer, as specified in the configuration.

dread stores the current 16-bit digital output value in the address passed as output and returns 0.

dwrite sets the 16 output bits to the value pointed to by output and returns 0.

dioctl selectively sets and clears bits in the output buffer. If cmd is HO_SETB the bit specified by arg is set to 1. If cmd is HO_CLRB the bit specified by arg is set to 0. arg can range from 1 (high order bit) to 16 (low order bit).

dclose clears the output bits and returns 0.

FILES

/dev/hcoX path name for digital output X.

SEE ALSO

obuf(3U)

DIAGNOSTICS

If dopen is invoked with an illegal minor device number, it returns -1. If dclose, dread, dwrite, or dioctl are passed illegal descriptors, a value of -1 is returned. If dioctl is passed an illegal cmd argument, a value of -1 is returned. If dioctl is passed an arg that is not between 1 and 16 a value of -1 is returned.