Sun Microsystems S16A Laptop User Manual


 
S16A User’s Guide Input and Output
EDT, Inc. October, 1996 11
s16a_configure_ring_buffers
Description
Configures the SBus 16-bit Dual Analog Interface ring buffers. Any previous configuration is replaced, and
previously allocated buffers are released.
Buffers can be allocated and maintained within the SBus 16-bit Dual Analog Interface library or within the
user application itself.
Syntax
int s16a_configure_ring_buffers(S16aDev *s16a_p, int bufsize, int nbufs,
void *bufarray[], int data_output);
Arguments
s16a_p S16A device handle returned from s16a_open
bufsize size of each buffer. For optimal efficiency, allocate a value approximating throughput
divided by 20: that is, if transfer occurs at 20 MB per second, allocate 1 MB per buffer.
Buffers significantly larger or smaller can overuse memory or lock the system up in
processing interrupts.
nbufs number of buffers. Must be 1 or greater. Four is recommended.
bufarray array of pointers to individual buffers if the buffers are allocated by the application. Must
be NULL if in library, or have nbufs elements.
library Must be NULL.
user This array must be filled with the addresses of the buffers allocated by
the application for the library to use.
data_direction Indicates whether this connection is to be used for input or output. Only one direction is
possible per device or subdevice:
EDT_READ = 0
EDT_WRITE = 1
Return
0 on success; –1 on error. If all buffers cannot be allocated, none are allocated and an error is returned.