kopia lustrzana https://gitlab.com/sane-project/backends
Added hp4200 backend. Code from Julien BLACHE's sane-backends-extras debian
package, based on Frank Zago's patches based on Adrian Perez Jorge's code. Fixed compilation warnings. Fixed bug when no sane device was given. Code indented by indent -gnu. Added man page.merge-requests/1/head
rodzic
6953fd4e2c
commit
3c5ea794ba
2
AUTHORS
2
AUTHORS
|
@ -38,6 +38,8 @@ Backends:
|
|||
hp: Peter Kirchgessner (*)
|
||||
Geoffrey Dairiki
|
||||
hpsj5s: Max Vorobiev
|
||||
hp4200: Adrian Perez Jorge, Andrew John Lewis, Arnar Mar Hrafnkelsson,
|
||||
Frank Zago, Henning Meier-Geinitz (*)
|
||||
hp5400: Martijn van Oosterhout, Thomas Soumarmon (*)
|
||||
ibm: M.F., Henning Meier-Geinitz (*)
|
||||
leo: Frank Zago (*)
|
||||
|
|
10
ChangeLog
10
ChangeLog
|
@ -2,6 +2,16 @@
|
|||
|
||||
* doc/descriptions/niash.desc doc/descriptions/sm3840.desc:
|
||||
Removed ":new".
|
||||
* AUTHORS configure configure.in backend/Makefile.in
|
||||
backend/dll.conf backend/hp4200.c backend/hp4200.conf
|
||||
backend/hp4200.h backend/hp4200_lm9830.c
|
||||
backend/hp4200_lm9830.h doc/Makefile.in
|
||||
doc/sane-hp4200.man doc/sane.man
|
||||
doc/descriptions/hp4200.desc: Added hp4200 backend. Code from
|
||||
Julien BLACHE's sane-backends-extras debian package, based on
|
||||
Frank Zago's patches based on Adrian Perez Jorge's code. Fixed
|
||||
compilation warnings. Fixed bug when no sane device was
|
||||
given. Code indented by indent -gnu. Added man page.
|
||||
|
||||
2005-08-10 Gerhard Jaeger <gerhard@gjaeger.de>
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ DISTFILES = abaton.c abaton.conf abaton.h agfafocus.c agfafocus.conf \
|
|||
hp-device.c hp-device.h hp.h hp-handle.c hp-handle.h hp-hpmem.c hp-option.c \
|
||||
hp-option.h hp.README hp-scl.c hp-scl.h hp-scsi.h hp.TODO \
|
||||
hpsj5s.c hpsj5s.conf hpsj5s.h \
|
||||
hp4200.c hp4200.conf hp4200.h hp4200_lm9830.c hp4200_lm9830.h \
|
||||
hp5400.c hp5400.h hp5400.conf hp5400_debug.c hp5400_debug.h \
|
||||
hp5400_internal.c hp5400_internal.h hp5400_xfer.h \
|
||||
hp5400_sane.c hp5400_sanei.c hp5400_sanei.h \
|
||||
|
@ -361,6 +362,9 @@ libsane-hp.la: ../sanei/sanei_usb.lo
|
|||
libsane-hp.la: $(addsuffix .lo,$(EXTRA_hp))
|
||||
libsane-hp.la: ../sanei/sanei_pio.lo
|
||||
libsane-hp.la: ../sanei/sanei_thread.lo
|
||||
libsane-hp4200.la: ../sanei/sanei_constrain_value.lo
|
||||
libsane-hp4200.la: ../sanei/sanei_usb.lo
|
||||
libsane-hp4200.la: ../sanei/sanei_pv8630.lo
|
||||
libsane-hp5400.la: ../sanei/sanei_usb.lo
|
||||
libsane-ibm.la: ../sanei/sanei_scsi.lo
|
||||
libsane-ibm.la: ../sanei/sanei_config2.lo
|
||||
|
|
|
@ -24,6 +24,7 @@ genesys
|
|||
gt68xx
|
||||
hp
|
||||
hpsj5s
|
||||
hp4200
|
||||
hp5400
|
||||
ibm
|
||||
leo
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# Configuration file for the hp4200 backend
|
||||
#
|
||||
|
||||
# HP4200
|
||||
usb 0x03f0 0x0105
|
|
@ -0,0 +1,267 @@
|
|||
/*
|
||||
Copyright (C) 2000 by Adrian Perez Jorge
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _HP4200_H
|
||||
#define _HP4200_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MCLKDIV_SCALING 2
|
||||
#define NUM_REGISTERS 0x80
|
||||
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
#define MM_PER_INCH 25.4
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#define DBG_error0 0
|
||||
#define DBG_error 1
|
||||
#define DBG_sense 2
|
||||
#define DBG_warning 3
|
||||
#define DBG_inquiry 4
|
||||
#define DBG_info 5
|
||||
#define DBG_info2 6
|
||||
#define DBG_proc 7
|
||||
#define DBG_read 8
|
||||
#define DBG_sane_init 10
|
||||
#define DBG_sane_proc 11
|
||||
#define DBG_sane_info 12
|
||||
#define DBG_sane_option 13
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
enum HP4200_Option
|
||||
{
|
||||
OPT_NUM_OPTS = 0,
|
||||
|
||||
OPT_RES,
|
||||
|
||||
OPT_TL_X, /* top-left x */
|
||||
OPT_TL_Y, /* top-left y */
|
||||
OPT_BR_X, /* bottom-right x */
|
||||
OPT_BR_Y, /* bottom-right y */
|
||||
|
||||
OPT_BACKTRACK,
|
||||
|
||||
OPT_GAMMA_VECTOR_R,
|
||||
OPT_GAMMA_VECTOR_G,
|
||||
OPT_GAMMA_VECTOR_B,
|
||||
|
||||
OPT_PREVIEW,
|
||||
|
||||
NUM_OPTIONS /* must come last */
|
||||
};
|
||||
|
||||
/* already declared in the sane includes...
|
||||
typedef union
|
||||
{
|
||||
SANE_Word w;
|
||||
SANE_Bool b;
|
||||
SANE_Fixed f;
|
||||
SANE_Word *wa;
|
||||
}
|
||||
Option_Value;
|
||||
*/
|
||||
|
||||
enum ScannerModels
|
||||
{
|
||||
HP4200
|
||||
};
|
||||
|
||||
typedef struct HP4200_Device
|
||||
{
|
||||
struct HP4200_Device *next;
|
||||
SANE_Device dev;
|
||||
SANE_Handle handle;
|
||||
}
|
||||
HP4200_Device;
|
||||
|
||||
struct _scanner_buffer_t
|
||||
{
|
||||
unsigned char *buffer; /* buffer memory space */
|
||||
int size; /* size of the buffer */
|
||||
int num_bytes; /* number of bytes left (to read) */
|
||||
unsigned char *data_ptr; /* cursor in buffer */
|
||||
};
|
||||
|
||||
typedef struct _scanner_buffer_t scanner_buffer_t;
|
||||
|
||||
struct _ciclic_buffer_t
|
||||
{
|
||||
int good_bytes; /* number of valid bytes of the image */
|
||||
int num_lines; /* number of lines of the ciclic buffer */
|
||||
int size; /* size in bytes of the buffer space */
|
||||
unsigned char *buffer; /* pointer to the buffer space */
|
||||
unsigned char **buffer_ptrs; /* pointers to the beginning of each
|
||||
line in the buffer space */
|
||||
int can_consume; /* num of bytes the ciclic buf can consume */
|
||||
int current_line; /* current scanned line */
|
||||
int first_good_line; /* number of lines to fill the ``pipeline'' */
|
||||
unsigned char *buffer_position; /* pointer to the first byte that
|
||||
can be copied */
|
||||
int pixel_position; /* pixel position in current line */
|
||||
|
||||
/* color indexes for the proper line in the ciclic buffer */
|
||||
int red_idx;
|
||||
int green_idx;
|
||||
int blue_idx;
|
||||
};
|
||||
|
||||
typedef struct _ciclic_buffer_t ciclic_buffer_t;
|
||||
|
||||
struct _hardware_parameters_t
|
||||
{
|
||||
unsigned int SRAM_size;
|
||||
unsigned char SRAM_bandwidth;
|
||||
unsigned long crystal_frequency;
|
||||
unsigned int min_pixel_data_buffer_limit;
|
||||
unsigned int motor_full_steps_per_inch;
|
||||
float motor_max_speed;
|
||||
unsigned int scan_bar_max_speed;
|
||||
unsigned int start_of_scanning_area;
|
||||
unsigned int calibration_strip_height;
|
||||
unsigned int scan_area_width;
|
||||
double scan_area_length; /* in inches */
|
||||
unsigned int sensor_num_pixels;
|
||||
unsigned int sensor_pixel_start;
|
||||
unsigned int sensor_pixel_end;
|
||||
int sensor_cds_state; /* 0 == off, 1 == on */
|
||||
int sensor_signal_polarity; /* 0 == ??, 1 == ?? */
|
||||
int sensor_max_integration_time;
|
||||
int sensor_line_separation;
|
||||
int sensor_type;
|
||||
unsigned int sensor_resolution;
|
||||
int sensor_control_signals_polarity;
|
||||
int sensor_control_signals_state;
|
||||
int sensor_control_pixel_rate_timing;
|
||||
int sensor_control_line_rate_timing;
|
||||
unsigned int sensor_black_clamp_timing; /* ??? */
|
||||
unsigned int sensor_CIS_timing;
|
||||
int sensor_toshiba_timing;
|
||||
int sensor_color_modes; /* bitmask telling color modes supported */
|
||||
int illumination_mode;
|
||||
int motor_control_mode;
|
||||
int motor_paper_sense_mode;
|
||||
int motor_pause_reverse_mode;
|
||||
int misc_io_mode;
|
||||
int num_tr_pulses;
|
||||
int guard_band_duration;
|
||||
int pulse_duration;
|
||||
int fsteps_25_speed;
|
||||
int fsteps_50_speed;
|
||||
int steps_to_reverse;
|
||||
struct
|
||||
{
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
}
|
||||
target_value;
|
||||
unsigned short home_sensor;
|
||||
};
|
||||
|
||||
typedef struct _hardware_parameters_t hardware_parameters_t;
|
||||
|
||||
struct _user_parameters_t
|
||||
{
|
||||
unsigned int image_width;
|
||||
unsigned int lines_to_scan;
|
||||
unsigned int horizontal_resolution;
|
||||
unsigned int vertical_resolution;
|
||||
int hres_reduction_method; /* interpolation/??? */
|
||||
int vres_reduction_method;
|
||||
SANE_Bool color; /* color/grayscale */
|
||||
int bpp;
|
||||
int scan_mode; /* preview/full scan */
|
||||
SANE_Bool no_reverse;
|
||||
SANE_Word gamma[3][1024]; /* gamma table for rgb */
|
||||
};
|
||||
|
||||
typedef struct _user_parameters_t user_parameters_t;
|
||||
|
||||
struct _measured_parameters_t
|
||||
{
|
||||
unsigned int datalink_bandwidth;
|
||||
struct
|
||||
{
|
||||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
}
|
||||
coarse_calibration_data;
|
||||
struct
|
||||
{
|
||||
int *pRedOffset;
|
||||
int *pGreenOffset;
|
||||
int *pBlueOffset;
|
||||
int *pRedGain;
|
||||
int *pGreenGain;
|
||||
int *pBlueGain;
|
||||
}
|
||||
fine_calibration_data;
|
||||
int max_integration_time;
|
||||
int color_mode;
|
||||
};
|
||||
|
||||
typedef struct _measured_parameters_t measured_parameters_t;
|
||||
|
||||
struct _runtime_parameters_t
|
||||
{
|
||||
long num_bytes_left_to_scan;
|
||||
int status_bytes; /* number of status bytes per line */
|
||||
int image_line_size; /* line size in bytes without status bytes */
|
||||
int scanner_line_size; /* line size in bytes including the
|
||||
status bytes */
|
||||
int first_pixel; /* first pixel in the line to be scanned */
|
||||
int steps_to_skip;
|
||||
};
|
||||
|
||||
typedef struct _runtime_parameters_t runtime_parameters_t;
|
||||
|
||||
struct _HP4200_Scanner
|
||||
{
|
||||
struct _HP4200_Scanner *next;
|
||||
|
||||
SANE_Option_Descriptor opt[NUM_OPTIONS];
|
||||
Option_Value val[NUM_OPTIONS];
|
||||
|
||||
SANE_Bool scanning;
|
||||
SANE_Bool aborted_by_user;
|
||||
|
||||
SANE_Parameters params;
|
||||
|
||||
HP4200_Device *dev;
|
||||
hardware_parameters_t hw_parms;
|
||||
user_parameters_t user_parms;
|
||||
measured_parameters_t msrd_parms;
|
||||
unsigned int regs[NUM_REGISTERS];
|
||||
int mclk;
|
||||
float mclk_div;
|
||||
|
||||
int fd;
|
||||
|
||||
ciclic_buffer_t ciclic_buffer;
|
||||
scanner_buffer_t scanner_buffer;
|
||||
runtime_parameters_t runtime_parms;
|
||||
};
|
||||
|
||||
typedef struct _HP4200_Scanner HP4200_Scanner;
|
||||
|
||||
#endif /* !_HP4200_H */
|
|
@ -0,0 +1,219 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
|
||||
Copyright (C) 2000 Adrian Perez Jorge
|
||||
|
||||
This file is part of the SANE package.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
|
||||
This file implements a backend for the HP4200C flatbed scanner
|
||||
*/
|
||||
|
||||
|
||||
#include "hp4200_lm9830.h"
|
||||
|
||||
static SANE_Status
|
||||
lm9830_read_register (int fd, unsigned char reg, unsigned char *data)
|
||||
{
|
||||
SANE_Status retval;
|
||||
|
||||
if (!data)
|
||||
return -SANE_STATUS_INVAL;
|
||||
retval = sanei_pv8630_write_byte (fd, PV8630_REPPADDRESS, reg);
|
||||
if (retval != SANE_STATUS_GOOD)
|
||||
return retval;
|
||||
return sanei_pv8630_read_byte (fd, PV8630_RDATA, data);
|
||||
}
|
||||
|
||||
static SANE_Status
|
||||
lm9830_write_register (int fd, unsigned char reg, unsigned char value)
|
||||
{
|
||||
SANE_Status retval;
|
||||
|
||||
retval = sanei_pv8630_write_byte (fd, PV8630_REPPADDRESS, reg);
|
||||
if (retval != SANE_STATUS_GOOD)
|
||||
return retval;
|
||||
|
||||
return sanei_pv8630_write_byte (fd, PV8630_RDATA, value);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static int
|
||||
lm9830_dump_registers (int fd)
|
||||
{
|
||||
int i;
|
||||
unsigned char value = 0;
|
||||
|
||||
for (i = 0; i < 0x80; i++)
|
||||
{
|
||||
lm9830_read_register (fd, i, &value);
|
||||
printf ("%.2x:0x%.2x", i, value);
|
||||
if ((i + 1) % 8)
|
||||
printf (", ");
|
||||
else
|
||||
printf ("\n");
|
||||
}
|
||||
puts ("");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int
|
||||
pv8630_reset_buttons (int fd)
|
||||
{
|
||||
lm9830_write_register (fd, 0x59, 0x10);
|
||||
lm9830_write_register (fd, 0x59, 0x90);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int
|
||||
lm9830_lamp_off (int fd)
|
||||
{
|
||||
lm9830_write_register (fd, 0x07, 0x00);
|
||||
lm9830_write_register (fd, 0x2c, 0x00);
|
||||
lm9830_write_register (fd, 0x2d, 0x01);
|
||||
lm9830_write_register (fd, 0x2e, 0x3f);
|
||||
lm9830_write_register (fd, 0x2f, 0xff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
lm9830_lamp_on (int fd)
|
||||
{
|
||||
lm9830_write_register (fd, 0x07, 0x00);
|
||||
lm9830_write_register (fd, 0x2c, 0x3f);
|
||||
lm9830_write_register (fd, 0x2d, 0xff);
|
||||
lm9830_write_register (fd, 0x2e, 0x00);
|
||||
lm9830_write_register (fd, 0x2f, 0x01);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* This function prints what button was pressed (the time before this
|
||||
* code was executed).
|
||||
*/
|
||||
|
||||
static int
|
||||
hp4200c_what_button (int fd)
|
||||
{
|
||||
unsigned char button;
|
||||
|
||||
pv8630_read_buttons (fd, &button);
|
||||
|
||||
if (button & 0x08)
|
||||
puts ("Scan");
|
||||
if (button & 0x10)
|
||||
puts ("Copy");
|
||||
if (button & 0x20)
|
||||
puts ("E-mail");
|
||||
if ((button & 0x38) == 0)
|
||||
puts ("None");
|
||||
|
||||
pv8630_reset_buttons (fd);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
lm9830_ini_scanner (int fd, unsigned char *regs)
|
||||
{
|
||||
#ifdef unused
|
||||
unsigned char inittable[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x1A, 0x00, 0x0A, 0x60, 0x2F, 0x13, 0x06,
|
||||
0x17, 0x01, 0x03, 0x03, 0x05, 0x00, 0x00, 0x0B,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0D, 0x21, 0x00, 0x40,
|
||||
0x15, 0x18, 0x00, 0x40, 0x02, 0x98, 0x00, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x3F, 0xFF, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x30,
|
||||
0x25, 0x25, 0x24, 0x28, 0x24, 0x28, 0x00, 0x00,
|
||||
0x00, 0x00, 0x06, 0x1D, 0x00, 0x13, 0x05, 0x48,
|
||||
0x01, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x02,
|
||||
0x00, 0x15, 0x00, 0x45, 0x00, 0x10, 0x08, 0x17,
|
||||
0x2B, 0x90, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00
|
||||
};
|
||||
#endif
|
||||
|
||||
unsigned char daisy[] = { 0x99, 0x66, 0xcc, 0x33 };
|
||||
unsigned char *regdata;
|
||||
unsigned int i;
|
||||
|
||||
sanei_pv8630_write_byte (fd, PV8630_RMODE, 0x02);
|
||||
for (i = 0; i < sizeof (daisy); i++)
|
||||
{
|
||||
sanei_pv8630_write_byte (fd, PV8630_RDATA, daisy[i]);
|
||||
}
|
||||
sanei_pv8630_write_byte (fd, PV8630_RMODE, 0x16);
|
||||
lm9830_write_register (fd, 0x42, 0x06);
|
||||
|
||||
if (!regs)
|
||||
return 0;
|
||||
/* regdata = inittable; */
|
||||
else
|
||||
regdata = regs;
|
||||
|
||||
for (i = 8; i < 0x60; i++)
|
||||
{
|
||||
lm9830_write_register (fd, i, regdata[i]);
|
||||
}
|
||||
for (i = 0x60; i < 0x70; i++)
|
||||
{
|
||||
lm9830_write_register (fd, i, 0);
|
||||
}
|
||||
lm9830_write_register (fd, 0x70, 0x70);
|
||||
for (i = 0x71; i < 0x80; i++)
|
||||
{
|
||||
lm9830_write_register (fd, i, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
lm9830_reset (int fd)
|
||||
{
|
||||
lm9830_write_register (fd, 0x07, 0x08);
|
||||
usleep (100);
|
||||
lm9830_write_register (fd, 0x07, 0x00);
|
||||
usleep (100);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
|
||||
Copyright (C) 2000 Adrian Perez Jorge
|
||||
|
||||
This file is part of the SANE package.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, the authors of SANE give permission for
|
||||
additional uses of the libraries contained in this release of SANE.
|
||||
|
||||
The exception is that, if you link a SANE library with other files
|
||||
to produce an executable, this does not by itself cause the
|
||||
resulting executable to be covered by the GNU General Public
|
||||
License. Your use of that executable is in no way restricted on
|
||||
account of linking the SANE library code into it.
|
||||
|
||||
This exception does not, however, invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public
|
||||
License.
|
||||
|
||||
If you submit changes to SANE to the maintainers to be included in
|
||||
a subsequent release, you agree by submitting the changes that
|
||||
those changes may be distributed with this exception intact.
|
||||
|
||||
If you write modifications of your own for SANE, it is your choice
|
||||
whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, delete this exception notice.
|
||||
|
||||
This file implements a backend for the HP4200C flatbed scanner
|
||||
*/
|
||||
|
||||
|
||||
#define INPUT_SIGNAL_POLARITY_NEGATIVE 0
|
||||
#define INPUT_SIGNAL_POLARITY_POSITIVE 1
|
||||
#define CDS_OFF 0
|
||||
#define CDS_ON (1 << 1)
|
||||
#define SENSOR_EVENODD (1 << 2)
|
||||
#define SENSOR_STANDARD 0
|
||||
#define SENSOR_RESOLUTION_300 0
|
||||
#define SENSOR_RESOLUTION_600 (1 << 3)
|
||||
#define LINE_SKIPPING_COLOR_PHASE_DELAY(n) (((n) & 0x0f) << 4)
|
||||
|
||||
#define PHI1_POLARITY_POSITIVE 0
|
||||
#define PHI1_POLARITY_NEGATIVE 1
|
||||
#define PHI2_POLARITY_POSITIVE 0
|
||||
#define PHI2_POLARITY_NEGATIVE (1 << 1)
|
||||
#define RS_POLARITY_POSITIVE 0
|
||||
#define RS_POLARITY_NEGATIVE (1 << 2)
|
||||
#define CP1_POLARITY_POSITIVE 0
|
||||
#define CP1_POLARITY_NEGATIVE (1 << 3)
|
||||
#define CP2_POLARITY_POSITIVE 0
|
||||
#define CP2_POLARITY_NEGATIVE (1 << 4)
|
||||
#define TR1_POLARITY_POSITIVE 0
|
||||
#define TR1_POLARITY_NEGATIVE (1 << 5)
|
||||
#define TR2_POLARITY_POSITIVE 0
|
||||
#define TR2_POLARITY_NEGATIVE (1 << 6)
|
||||
|
||||
#define PHI1_OFF 0
|
||||
#define PHI1_ACTIVE 1
|
||||
#define PHI2_OFF 0
|
||||
#define PHI2_ACTIVE (1 << 1)
|
||||
#define RS_OFF 0
|
||||
#define RS_ACTIVE (1 << 2)
|
||||
#define CP1_OFF 0
|
||||
#define CP1_ACTIVE (1 << 3)
|
||||
#define CP2_OFF 0
|
||||
#define CP2_ACTIVE (1 << 4)
|
||||
#define TR1_OFF 0
|
||||
#define TR1_ACTIVE (1 << 5)
|
||||
#define TR2_OFF 0
|
||||
#define TR2_ACTIVE (1 << 6)
|
||||
#define NUMBER_OF_TR_PULSES(n) (((n) - 1) << 7)
|
||||
|
||||
#define TR_PULSE_DURATION(n) ((n) & 0x0f)
|
||||
#define TR_PHI1_GUARDBAND_DURATION(n) (((n) & 0x0f) << 4)
|
||||
|
||||
#define CIS_TR1_TIMING_OFF 0
|
||||
#define CIS_TR1_TIMING_MODE1 1
|
||||
#define CIS_TR1_TIMING_MODE2 2
|
||||
#define FAKE_OPTICAL_BLACK_PIXELS_OFF 0
|
||||
#define FAKE_OPTICAL_BLACK_PIXELS_ON (1 << 2)
|
||||
|
||||
#define PIXEL_RATE_3_CHANNELS 0
|
||||
#define LINE_RATE_3_CHANNELS 1
|
||||
#define MODEA_1_CHANNEL 4
|
||||
#define MODEB_1_CHANNEL 5
|
||||
#define GRAY_CHANNEL_RED 0
|
||||
#define GRAY_CHANNEL_GREEN (1 << 3)
|
||||
#define GRAY_CHANNEL_BLU (2 << 3)
|
||||
|
||||
#define TR_RED(n) ((n) << 5)
|
||||
#define TR_GREEN(n) ((n) << 6)
|
||||
#define TR_BLUE(n) ((n) << 7)
|
||||
|
||||
#define TR_RED_DROP(n) (n)
|
||||
#define TR_GREEN_DROP(n) ((n) << 2)
|
||||
#define TR_BLUE_DROP(n) ((n) << 4)
|
||||
|
||||
#define ILLUMINATION_MODE(n) (n)
|
||||
|
||||
#define HIBYTE(w) ((SANE_Byte)(((w) >> 8) & 0xff))
|
||||
#define LOBYTE(w) ((SANE_Byte)((w) & 0xff))
|
||||
|
||||
#define EPP_MODE 0
|
||||
#define NIBBLE_MODE 1
|
||||
|
||||
#define PPORT_DRIVE_CURRENT(n) ((n) << 1)
|
||||
|
||||
#define RAM_SIZE_64 0
|
||||
#define RAM_SIZE_128 1
|
||||
#define RAM_SIZE_256 2
|
||||
|
||||
#define SRAM_DRIVER_CURRENT(n) ((n) << 2)
|
||||
#define SRAM_BANDWIDTH_4 0
|
||||
#define SRAM_BANDWIDTH_8 (1 << 4)
|
||||
#define SCANNING_FULL_DUPLEX 0
|
||||
#define SCANNING_HALF_DUPLEX (1 << 5)
|
||||
|
||||
#define FULL_STEPPING 0
|
||||
#define MICRO_STEPPING 1
|
||||
#define CURRENT_SENSING_PHASES(n) (((n) - 1) << 1)
|
||||
#define PHASE_A_POLARITY_POSITIVE 0
|
||||
#define PHASE_A_POLARITY_NEGATIVE (1 << 2)
|
||||
#define PHASE_B_POLARITY_POSITIVE 0
|
||||
#define PHASE_B_POLARITY_NEGATIVE (1 << 3)
|
||||
#define STEPPER_MOTOR_TRISTATE 0
|
||||
#define STEPPER_MOTOR_OUTPUT (1 << 4)
|
||||
|
||||
#define ACCELERATION_PROFILE_STOPPED(n) (n)
|
||||
#define ACCELERATION_PROFILE_25P(n) ((n) << 2)
|
||||
#define ACCELERATION_PROFILE_50P(n) ((n) << 4)
|
||||
|
||||
#define NON_REVERSING_EXTRA_LINES(n) (n)
|
||||
#define FIRST_LINE_TO_PROCESS(n) ((n) << 3)
|
||||
|
||||
#define KICKSTART_STEPS(n) (n)
|
||||
#define HOLD_CURRENT_TIMEOUT(n) ((n) << 3)
|
||||
|
||||
#define PAPER_SENSOR_1_POLARITY_LOW 0
|
||||
#define PAPER_SENSOR_1_POLARITY_HIGH 1
|
||||
#define PAPER_SENSOR_1_TRIGGER_LEVEL 0
|
||||
#define PAPER_SENSOR_1_TRIGGER_EDGE (1 << 1)
|
||||
#define PAPER_SENSOR_1_NO_STOP_SCAN 0
|
||||
#define PAPER_SENSOR_1_STOP_SCAN (1 << 2)
|
||||
#define PAPER_SENSOR_2_POLARITY_LOW 0
|
||||
#define PAPER_SENSOR_2_POLARITY_HIGH (1 << 3)
|
||||
#define PAPER_SENSOR_2_TRIGGER_LEVEL 0
|
||||
#define PAPER_SENSOR_2_TRIGGER_EDGE (1 << 4)
|
||||
#define PAPER_SENSOR_2_NO_STOP_SCAN 0
|
||||
#define PAPER_SENSOR_2_STOP_SCAN (1 << 5)
|
||||
|
||||
#define MISCIO_1_TYPE_INPUT 0
|
||||
#define MISCIO_1_TYPE_OUTPUT 1
|
||||
#define MISCIO_1_POLARITY_LOW 0
|
||||
#define MISCIO_1_POLARITY_HIGH (1 << 1)
|
||||
#define MISCIO_1_TRIGGER_LEVEL 0
|
||||
#define MISCIO_1_TRIGGER_EDGE (1 << 2)
|
||||
#define MISCIO_1_OUTPUT_STATE_LOW 0
|
||||
#define MISCIO_1_OUTPUT_STATE_HIGH (1 << 3)
|
||||
#define MISCIO_2_TYPE_INPUT 0
|
||||
#define MISCIO_2_TYPE_OUTPUT (1 << 4)
|
||||
#define MISCIO_2_POLARITY_LOW 0
|
||||
#define MISCIO_2_POLARITY_HIGH (1 << 5)
|
||||
#define MISCIO_2_TRIGGER_LEVEL 0
|
||||
#define MISCIO_2_TRIGGER_EDGE (1 << 6)
|
||||
#define MISCIO_2_OUTPUT_STATE_LOW 0
|
||||
#define MISCIO_2_OUTPUT_STATE_HIGH (1 << 7)
|
||||
|
||||
#define PIXEL_PACKING(n) ((n) << 3)
|
||||
#define DATAMODE(n) ((n) << 5)
|
Plik diff jest za duży
Load Diff
|
@ -336,7 +336,7 @@ else
|
|||
microtek2 mustek mustek_usb nec pie plustek \
|
||||
plustek_pp ricoh s9036 sceptre sharp \
|
||||
sp15c st400 tamarack test teco1 teco2 teco3 umax umax_pp umax1220u \
|
||||
artec_eplus48u ma1509 ibm hp5400 u12 snapscan niash sm3840"
|
||||
artec_eplus48u ma1509 ibm hp5400 u12 snapscan niash sm3840 hp4200"
|
||||
|
||||
if test "${sane_cv_use_libjpeg}" != "yes"; then
|
||||
echo "*** disabling DC210 backend (failed to find JPEG library)"
|
||||
|
|
|
@ -52,7 +52,7 @@ SECT5 = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-as6e.5 sane-dll.5 \
|
|||
sane-teco1.5 sane-teco2.5 sane-teco3.5 sane-test.5 sane-sp15c.5 \
|
||||
sane-coolscan2.5 sane-hpsj5s.5 sane-gt68xx.5 sane-artec_eplus48u.5 \
|
||||
sane-ma1509.5 sane-ibm.5 sane-hp5400.5 sane-plustek_pp.5 sane-u12.5 \
|
||||
sane-niash.5 sane-sm3840.5 sane-genesys.5
|
||||
sane-niash.5 sane-sm3840.5 sane-genesys.5 sane-hp4200.5
|
||||
SECT7 = sane.7
|
||||
SECT8 = saned.8
|
||||
MANPAGES = $(SECT1) $(SECT5) $(SECT7) $(SECT8)
|
||||
|
@ -103,7 +103,7 @@ DISTFILES = Makefile.in backend-writing.txt descriptions.txt \
|
|||
sane-teco1.man sane-teco2.man sane-teco3.man sane-test.man sane-sp15c.man \
|
||||
sane-hpsj5s.man gamma4scanimage.man sane-gt68xx.man sane-artec_eplus48u.man \
|
||||
sane-ma1509.man sane-ibm.man sane-hp5400.man sane-plustek_pp.man \
|
||||
sane-u12.man sane-niash.man sane-sm3840.man sane-genesys.man
|
||||
sane-u12.man sane-niash.man sane-sm3840.man sane-genesys.man sane-hp4200.man
|
||||
|
||||
.PHONY: all clean depend dist distclean html html-man install \
|
||||
sane-html uninstall
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
;
|
||||
; SANE Backend specification file
|
||||
;
|
||||
; It's basically emacs-lisp --- so ";" indicates comment to end of line.
|
||||
; All syntactic elements are keyword tokens, followed by a string or
|
||||
; keyword argument, as specified.
|
||||
;
|
||||
; ":backend" *must* be specified.
|
||||
; All other information is optional (but what good is the file without it?).
|
||||
|
||||
|
||||
:backend "hp4200" ; name of backend
|
||||
:version "1.0-1" ; version of backend
|
||||
:new :yes
|
||||
:manpage "sane-hp4200" ; name of manpage (if it exists)
|
||||
:url "http://hp4200-backend.sourceforge.net" ; backend's web page
|
||||
|
||||
:devicetype :scanner ; start of a list of devices....
|
||||
; other types: :stillcam, :vidcam,
|
||||
; :meta, :api
|
||||
|
||||
:mfg "Hewlett-Packard" ; name a manufacturer
|
||||
:url "http://www.hp.com/"
|
||||
|
||||
:model "ScanJet 4200C" ; name models for above-specified mfg.
|
||||
:interface "USB"
|
||||
:status :minimal
|
||||
:comment "8bpp, 150/300/600 dpi only, and scanned image needs postprocessing"
|
||||
|
||||
:model "ScanJet 4200Cxi" ; name models for above-specified mfg.
|
||||
:interface "USB"
|
||||
:status :minimal
|
||||
:comment "8bpp, 150/300/600 dpi only, and scanned image needs postprocessing"
|
||||
|
||||
:model "ScanJet 4200Cse" ; name models for above-specified mfg.
|
||||
:interface "USB"
|
||||
:status :minimal
|
||||
:comment "8bpp, 150/300/600 dpi only, and scanned image needs postprocessing"
|
||||
|
||||
; :comment and :url specifiers are optional after :mfg, :model, :desc,
|
||||
; and at the top-level.
|
|
@ -0,0 +1,98 @@
|
|||
.TH sane-hp4200 5 "13 August 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
|
||||
.IX sane-hp4200
|
||||
.SH NAME
|
||||
sane-hp4200 \- SANE backend for Hewlett-Packard 4200 scanners
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B sane-hp4200
|
||||
library implements a SANE (Scanner Access Now Easy) backend that provides
|
||||
access to the following Hewlett-Packard USB flatbed scanners:
|
||||
.PP
|
||||
.RS
|
||||
ScanJet 4200 C
|
||||
.br
|
||||
ScanJet 4200 Cxi
|
||||
.br
|
||||
ScanJet 4200 Cse
|
||||
.RE
|
||||
.PP
|
||||
More details can be found on the hp4200 backend homepage
|
||||
.IR http://hp4200-backend.sourceforge.net/ .
|
||||
.PP
|
||||
This is ALPHA software. Keep your hand at the scanner's plug and unplug it, if
|
||||
the head bumps at the end of the scan area.
|
||||
.PP
|
||||
If you own a scanner other than the ones listed above that works with this
|
||||
backend, please let us know this by sending the scanner's exact model name and
|
||||
the USB vendor and device ids (e.g. from
|
||||
.IR /proc/bus/usb/devices ,
|
||||
.I sane-find-scanner
|
||||
or syslog) to us. Even if the scanner's name is only slightly different from
|
||||
the models mentioned above, please let us know.
|
||||
.PP
|
||||
|
||||
.SH CONFIGURATION
|
||||
The contents of the
|
||||
.I hp4200.conf
|
||||
file is a list of usb lines containing vendor and product ids that correspond
|
||||
to USB scanners. The file can also contain the names of device files that
|
||||
correspond to an HP 4200 scanner. Empty lines and lines starting with a hash
|
||||
mark (#) are ignored. The scanners are autodetected by
|
||||
.B usb vendor_id product_id
|
||||
statements which are already included into
|
||||
.IR hp4200.conf .
|
||||
"vendor_id" and "product_id" are hexadecimal numbers that identify the
|
||||
scanner. If autodetection does not work, add the device name of your scanner
|
||||
to the configuration file, e.g.
|
||||
.IR /dev/usb/scanner0 .
|
||||
.PP
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @CONFIGDIR@/hp4200.conf
|
||||
The backend configuration file (see also description of
|
||||
.B SANE_CONFIG_DIR
|
||||
below).
|
||||
.TP
|
||||
.I @LIBDIR@/libsane-hp4200.a
|
||||
The static library implementing this backend.
|
||||
.TP
|
||||
.I @LIBDIR@/libsane-hp4200.so
|
||||
The shared library implementing this backend (present on systems that
|
||||
support dynamic loading).
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B SANE_CONFIG_DIR
|
||||
This environment variable specifies the list of directories that may
|
||||
contain the configuration file. Under UNIX, the directories are
|
||||
separated by a colon (`:'), under OS/2, they are separated by a
|
||||
semi-colon (`;'). If this variable is not set, the configuration file
|
||||
is searched in two default directories: first, the current working
|
||||
directory (".") and then in @CONFIGDIR@. If the value of the
|
||||
environment variable ends with the directory separator character, then
|
||||
the default directories are searched after the explicitly specified
|
||||
directories. For example, setting
|
||||
.B SANE_CONFIG_DIR
|
||||
to "/tmp/config:" would result in directories "tmp/config", ".", and
|
||||
"@CONFIGDIR@" being searched (in this order).
|
||||
.TP
|
||||
.B SANE_DEBUG_HP4200
|
||||
If the library was compiled with debug support enabled, this
|
||||
environment variable controls the debug level for this backend. Higher
|
||||
debug levels increase the verbosity of the output.
|
||||
|
||||
Example:
|
||||
export SANE_DEBUG_HP4200=4
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR sane (7),
|
||||
.BR sane\-usb (5),
|
||||
.br
|
||||
.I http://hp4200-backend.sourceforge.net/
|
||||
|
||||
.SH AUTHOR
|
||||
Adrian Perez Jorge, Andrew John Lewis, Arnar Mar Hrafnkelsson, Frank Zago,
|
||||
Henning Meier-Geinitz. Current maintainer: Henning Meier-Geinitz <henning@meier-geinitz.de>.
|
||||
|
||||
.SH BUGS
|
||||
Probably many. Send bug reports to the sane-devel mailing list: sane-devel@lists.alioth.debian.org.
|
|
@ -1,4 +1,4 @@
|
|||
.TH sane 7 "29 May 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
|
||||
.TH sane 7 "13 August 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
|
||||
.IX sane
|
||||
|
||||
.SH NAME
|
||||
|
@ -270,6 +270,11 @@ The SANE backend for the Hewlett-Packard ScanJet 5S scanner. See
|
|||
.BR sane\-hpsj5s (5)
|
||||
for details.
|
||||
.TP
|
||||
.B hp4200
|
||||
The SANE backend for the Hewlett-Packard ScanJet 4200 series. See
|
||||
.BR sane\-hp4200 (5)
|
||||
for details.
|
||||
.TP
|
||||
.B hp5400
|
||||
The SANE backend for the Hewlett-Packard ScanJet 54XXC series. See
|
||||
.BR sane\-hp5400 (5)
|
||||
|
|
Ładowanie…
Reference in New Issue