1
/* sane - Scanner Access Now Easy.
2
Copyright (C) 2007 Ilia Sotnikov <hostcc@gmail.com>
3
HP ScanJet 4570c support by Markham Thomas
4
This file is part of the SANE package.
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License as
8
published by the Free Software Foundation; either version 2 of the
9
License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
As a special exception, the authors of SANE give permission for
22
additional uses of the libraries contained in this release of SANE.
24
The exception is that, if you link a SANE library with other files
25
to produce an executable, this does not by itself cause the
26
resulting executable to be covered by the GNU General Public
27
License. Your use of that executable is in no way restricted on
28
account of linking the SANE library code into it.
30
This exception does not, however, invalidate any other reasons why
31
the executable file might be covered by the GNU General Public
34
If you submit changes to SANE to the maintainers to be included in
35
a subsequent release, you agree by submitting the changes that
36
those changes may be distributed with this exception intact.
38
If you write modifications of your own for SANE, it is your choice
39
whether to permit this exception to apply to your modifications.
40
If you do not wish that, delete this exception notice.
42
This file is part of a SANE backend for
43
HP ScanJet 4500C/4570C/5500C/5550C/5590/7650 Scanners
49
#include "hp5590_low.h"
51
#define TMA_MAX_X_INCHES 1.69
52
#define TMA_MAX_Y_INCHES 6
54
#define ADF_MAX_Y_INCHES 14
104
enum hp5590_lamp_state
106
LAMP_STATE_TURNOFF = 1,
108
LAMP_STATE_SET_TURNOFF_TIME,
109
LAMP_STATE_SET_TURNOFF_TIME_LONG
114
enum hp_scanner_types scanner_type;
115
unsigned int usb_vendor_id;
116
unsigned int usb_product_id;
117
const char *vendor_id;
120
enum proto_flags proto_flags;
123
#define FEATURE_NONE 0
124
#define FEATURE_ADF 1 << 0
125
#define FEATURE_TMA 1 << 1
126
#define FEATURE_LCD 1 << 2
132
unsigned int features;
133
const char *fw_version;
134
unsigned int max_dpi_x;
135
unsigned int max_dpi_y;
136
unsigned int max_pixels_x;
137
unsigned int max_pixels_y;
140
unsigned int max_motor_param;
141
unsigned int normal_motor_param;
144
static SANE_Status hp5590_model_def (enum hp_scanner_types scanner_type,
145
const struct hp5590_model ** model);
146
static SANE_Status hp5590_vendor_product_id (enum hp_scanner_types scanner_type,
147
SANE_Word * vendor_id,
148
SANE_Word * product_id);
149
static SANE_Status hp5590_init_scanner (SANE_Int dn,
150
enum proto_flags proto_flags,
151
struct scanner_info **info,
152
enum hp_scanner_types scanner_type);
153
static SANE_Status hp5590_power_status (SANE_Int dn,
154
enum proto_flags proto_flags);
155
static SANE_Status hp5590_read_max_scan_count (SANE_Int dn,
156
enum proto_flags proto_flags,
157
unsigned int *max_count);
158
static SANE_Status hp5590_select_source_and_wakeup (SANE_Int dn,
159
enum proto_flags proto_flags,
160
enum scan_sources source,
161
SANE_Bool extend_lamp_timeout);
162
static SANE_Status hp5590_stop_scan (SANE_Int dn,
163
enum proto_flags proto_flags);
164
static SANE_Status hp5590_read_scan_count (SANE_Int dn,
165
enum proto_flags proto_flags,
166
unsigned int *count);
167
static SANE_Status hp5590_set_scan_params (SANE_Int dn,
168
enum proto_flags proto_flags,
169
struct scanner_info *scanner_info,
170
unsigned int top_x, unsigned int top_y,
171
unsigned int width, unsigned int height,
173
enum color_depths color_depth,
174
enum scan_modes scan_mode,
175
enum scan_sources scan_source);
176
static SANE_Status hp5590_send_forward_calibration_maps (SANE_Int dn,
177
enum proto_flags proto_flags);
178
static SANE_Status hp5590_send_reverse_calibration_map (SANE_Int dn,
179
enum proto_flags proto_flags);
180
static SANE_Status hp5590_inc_scan_count (SANE_Int dn,
181
enum proto_flags proto_flags);
182
static SANE_Status hp5590_start_scan (SANE_Int dn,
183
enum proto_flags proto_flags);
184
static SANE_Status hp5590_read (SANE_Int dn,
185
enum proto_flags proto_flags,
186
unsigned char *bytes,
187
unsigned int size, void *state);
188
static SANE_Status hp5590_read_buttons (SANE_Int dn,
189
enum proto_flags proto_flags,
190
enum button_status *status);
191
static SANE_Status hp5590_read_part_number (SANE_Int dn,
192
enum proto_flags proto_flags);
193
static SANE_Status hp5590_calc_pixel_bits (unsigned int dpi,
194
enum color_depths color_depth,
195
unsigned int *pixel_bits);
196
static SANE_Status hp5590_is_data_available (SANE_Int dn,
197
enum proto_flags proto_flags);
198
static SANE_Status hp5590_reset_scan_head (SANE_Int dn,
199
enum proto_flags proto_flags);
200
#endif /* HP5590_H */