SANEI 1.3.1.76-0750
sanei_pv8630.h
1/* sane - Scanner Access Now Easy.
2
3 Copyright (C) 2000 Adrian Perez Jorge
4 Copyright (C) 2001 Frank Zago
5 Copyright (C) 2001 Marcio Teixeira
6
7 This file is part of the SANE package.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <https://www.gnu.org/licenses/>.
21
22 As a special exception, the authors of SANE give permission for
23 additional uses of the libraries contained in this release of SANE.
24
25 The exception is that, if you link a SANE library with other files
26 to produce an executable, this does not by itself cause the
27 resulting executable to be covered by the GNU General Public
28 License. Your use of that executable is in no way restricted on
29 account of linking the SANE library code into it.
30
31 This exception does not, however, invalidate any other reasons why
32 the executable file might be covered by the GNU General Public
33 License.
34
35 If you submit changes to SANE to the maintainers to be included in
36 a subsequent release, you agree by submitting the changes that
37 those changes may be distributed with this exception intact.
38
39 If you write modifications of your own for SANE, it is your choice
40 whether to permit this exception to apply to your modifications.
41 If you do not wish that, delete this exception notice.
42
43 Interface files for the PowerVision 8630 chip, a USB to
44 parallel converter used in many scanners.
45
46 */
47
48#ifndef sanei_pv8630_h
49#define sanei_pv8630_h
50
51#include "../include/sane/config.h"
52#include "../include/sane/sane.h"
53
54typedef enum
55{
56 PV8630_REQ_READBYTE = 0x00,
57 PV8630_REQ_WRITEBYTE = 0x01,
58 PV8630_REQ_EPPBULKREAD = 0x02,
59 PV8630_REQ_EPPBULKWRITE = 0x03,
60 PV8630_REQ_FLUSHBUFFER = 0x04,
61 PV8630_REQ_ENABLEINTERRUPT = 0x05,
62 PV8630_REQ_DISABLEINTERRUPT = 0x06,
63 PV8630_REQ_READWORD = 0x08,
64 PV8630_REQ_WRITEWORD = 0x09
65}
66SANEI_PV_Request;
67
68typedef enum
69{
70 PV8630_RDATA = 0x00,
71 PV8630_REPPADDRESS = 0x01,
72 PV8630_UNKNOWN = 0x02,
73 PV8630_RMODE = 0x03,
74 PV8630_RSTATUS = 0x04
75}
76SANEI_PV_Index;
77
78extern void sanei_pv8630_init (void);
79extern SANE_Status sanei_pv8630_write_byte (int fd, SANEI_PV_Index index,
80 SANE_Byte byte);
81extern SANE_Status sanei_pv8630_read_byte (int fd, SANEI_PV_Index index,
82 SANE_Byte * byte);
83extern SANE_Status sanei_pv8630_prep_bulkread (int fd, int len);
84extern SANE_Status sanei_pv8630_prep_bulkwrite (int fd, int len);
85extern SANE_Status sanei_pv8630_flush_buffer (int fd);
86extern SANE_Status sanei_pv8630_bulkwrite (int fd, const void *data,
87 size_t * len);
88extern SANE_Status sanei_pv8630_bulkread (int fd, void *data, size_t * len);
89extern SANE_Status sanei_pv8630_xpect_byte (int fd, SANEI_PV_Index index,
90 SANE_Byte value, SANE_Byte mask);
91extern SANE_Status sanei_pv8630_wait_byte (int fd, SANEI_PV_Index index,
92 SANE_Byte value, SANE_Byte mask,
93 int timeout);
94#endif /* sanei_pv8630_h */