2 * FILE: $Header: /home/ghn/projects/PEAR/egg/eggsh/RCS/hwapi.h,v 1.1 1998/07/21 11:37:32 ghn Exp $
3 * PURPOSE: Define interface to hardware layer
7 * REVISED: $Log: hwapi.h,v $
8 * REVISED: Revision 1.1 1998/07/21 11:37:32 ghn
9 * REVISED: Initial revision
11 * Copyright 1998 - Greg Nelson
14 typedef struct devopts {
15 uint16 type; /* 0 = PEAR */
22 DevOpts should contain any necessary information to determine how
23 this is to be done. The return value, if >= 0, is a device handle.
24 Otherwise it indicated an error. */
25 int32 OpenDev(DevOpts *opts);
29 dd is the device handle returned by opening the device. The
30 function returns the estimated number of bits/second that the
31 device will produce, which should be used as a limit in setting the
33 int32 EvalSpeed(int32 dd);
35 /* Sample from a device.
37 dd is the device handle returned by opening the device. The number
38 of bits requested will be sampled from the device immediately
39 (waiting as needed to collect the data, with no discards) and the
40 result will be returned. */
41 int32 Sample(int32 dd, uint16 bits);
43 /* Discard spare data from device.
45 dd is the device handle returned by opening the device. The input
46 stream is consumed until a wait would be required. The number of
47 bits discarded is returned. */
48 int32 Discard(int32 dd);
52 Closes a specified device handle. */
53 int32 CloseDev(int32 dd);