merge 64-bit fixes from Fernando Lucas Rodriguez <fernando_lr@terra.es>
[debian/gcpegg] / hwapi.h
1 /* PROGRAM:     eggsh
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
4  * AUTHOR:      Greg Nelson
5  * DATE:        98-04-12
6  *
7  * REVISED:     $Log: hwapi.h,v $
8  * REVISED:     Revision 1.1  1998/07/21 11:37:32  ghn
9  * REVISED:     Initial revision
10  * REVISED:
11  * Copyright 1998 - Greg Nelson
12  */
13
14 typedef struct devopts {
15   uint16 type;  /* 0 = PEAR */
16   uint16 port;
17   uint32 baud;
18 } DevOpts;
19
20 /* Open a device. 
21
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);
26
27 /* Evaluate speed.
28
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
32    data rate. */
33 int32 EvalSpeed(int32 dd);
34
35 /* Sample from a device.
36
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);
42
43 /* Discard spare data from device.
44
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);
49
50 /* Close a device.
51
52    Closes a specified device handle. */
53 int32 CloseDev(int32 dd);