kopia lustrzana https://gitlab.com/sane-project/backends
Added hpsj5s backend for the Hewlett-Packard ScanJet 5S parport scanner
(from Max Vorobiev <pcwizard@zelmail.ru>). Henning Meier-Geinitz <henning@meier-geinitz.de>DEVEL_2_0_BRANCH-1
rodzic
fd51990a85
commit
5f46acb092
2
AUTHORS
2
AUTHORS
|
@ -31,6 +31,7 @@ Backends:
|
|||
gphoto2: Peter Fales (*)
|
||||
hp: Peter Kirchgessner (*)
|
||||
Geoffrey Dairiki
|
||||
hpsj5s: Max Vorobiev (*)
|
||||
leo: Frank Zago (*)
|
||||
matsushita: Frank Zago (*)
|
||||
microtek: Matthew Marjanovic (*)
|
||||
|
@ -139,6 +140,7 @@ Marian Eichholz <eichholz@computer.org>
|
|||
Markus Mertinat <Markus.Mertinat@Physik.Uni-Augsburg.DE>
|
||||
Matthew Duggan <stauff1@users.sourceforge.net>
|
||||
Matthew Marjanovic <maddog@mir.com>
|
||||
Max Vorobiev <pcwizard@yandex.ru>
|
||||
Meino Christian Cramer <mccramer@s.netic.de>
|
||||
Michael Herder <crapsite@gmx.net>
|
||||
Michael K. Johnson <johnsonm@redhat.com>
|
||||
|
|
|
@ -60,8 +60,8 @@ DISTCLEAN_FILES = @DISTCLEAN_FILES@
|
|||
@SET_MAKE@
|
||||
|
||||
PRELOADABLE_BACKENDS = abaton agfafocus apple artec as6e avision bh canon \
|
||||
canon630u @CANON_PP@ coolscan coolscan2 dc25 @DC210@ @DC240@ dmc epson \
|
||||
fujitsu @GPHOTO2@ hp leo matsushita microtek microtek2 \
|
||||
canon630u @CANON_PP@ coolscan coolscan2 dc25 @DC210@ @DC240@ dmc \
|
||||
epson fujitsu @GPHOTO2@ hp hpsj5s leo matsushita microtek microtek2 \
|
||||
mustek mustek_pp mustek_usb nec @NET@ pie @PINT@ plustek \
|
||||
@PNM@ @QCAM@ ricoh s9036 sceptre sharp @SM3600@ @SNAPSCAN@ \
|
||||
sp15c st400 tamarack test teco1 umax umax_pp umax1220u @V4L@
|
||||
|
@ -94,7 +94,9 @@ DISTFILES = abaton.c abaton.conf abaton.h agfafocus.c agfafocus.conf \
|
|||
fujitsu.c fujitsu.conf fujitsu.h fujitsu-scsi.h \
|
||||
gphoto2.c gphoto2.conf gphoto2.h hp-accessor.c hp-accessor.h hp.c hp.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 jinclude.h \
|
||||
hp-option.h hp.README hp-scl.c hp-scl.h hp-scsi.h hp.TODO \
|
||||
hpsj5s.c hpsj5s.conf hpsj5s.h hpsj5s_int.h \
|
||||
jinclude.h \
|
||||
leo.c leo.h leo.conf \
|
||||
lm9830.h \
|
||||
Makefile.in matsushita.c \
|
||||
|
|
|
@ -19,6 +19,7 @@ dmc
|
|||
epson
|
||||
fujitsu
|
||||
hp
|
||||
hpsj5s
|
||||
leo
|
||||
matsushita
|
||||
microtek
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,2 @@
|
|||
#hpsj5s.conf
|
||||
/dev/hpsj5s
|
|
@ -0,0 +1,66 @@
|
|||
#ifndef __HPSJ5S_MIDDLE_LEVEL_API_HEADER__
|
||||
#define __HPSJ5S_MIDDLE_LEVEL_API_HEADER__
|
||||
|
||||
|
||||
#include "hpsj5s_int.h"
|
||||
|
||||
/*
|
||||
Types:
|
||||
*/
|
||||
/*Color modes we support: 1-bit Drawing, 2-bit Halftone, 8-bit Gray Scale, 24-bt True Color*/
|
||||
typedef enum
|
||||
{ Drawing, Halftone, GrayScale, TrueColor }
|
||||
enumColorDepth;
|
||||
|
||||
/*Middle-level API:*/
|
||||
|
||||
static int DetectScanner (void);
|
||||
|
||||
static void StandByScanner (void);
|
||||
|
||||
static void SwitchHardwareState (SANE_Byte mask, SANE_Byte invert_mask);
|
||||
|
||||
static int CheckPaperPresent (void);
|
||||
|
||||
static int ReleasePaper (void);
|
||||
|
||||
static int PaperFeed (SANE_Word wLinesToFeed);
|
||||
|
||||
static void TransferScanParameters (enumColorDepth enColor,
|
||||
SANE_Word wResolution,
|
||||
SANE_Word wCorrectedLength);
|
||||
|
||||
static void TurnOnPaperPulling (enumColorDepth enColor,
|
||||
SANE_Word wResolution);
|
||||
|
||||
static void TurnOffPaperPulling (void);
|
||||
|
||||
static SANE_Byte GetCalibration (void);
|
||||
|
||||
static void CalibrateScanElements (void);
|
||||
|
||||
/*Internal-use functions:*/
|
||||
|
||||
static int OutputCheck (void);
|
||||
static int InputCheck (void);
|
||||
static int CallCheck (void);
|
||||
static void LoadingPaletteToScanner (void);
|
||||
|
||||
/*Low level warappers:*/
|
||||
|
||||
static void WriteAddress (SANE_Byte Address);
|
||||
|
||||
static void WriteData (SANE_Byte Data);
|
||||
|
||||
static void WriteScannerRegister (SANE_Byte Address, SANE_Byte Data);
|
||||
|
||||
static void CallFunctionWithParameter (SANE_Byte Function,
|
||||
SANE_Byte Parameter);
|
||||
|
||||
static SANE_Byte CallFunctionWithRetVal (SANE_Byte Function);
|
||||
|
||||
static SANE_Byte ReadDataByte (void);
|
||||
|
||||
static void ReadDataBlock (SANE_Byte * Buffer, int lenght);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
HP ScanJet 5s kernel module interface.
|
||||
Wrote by: Max Vorobiev.
|
||||
*/
|
||||
|
||||
#ifndef __HPSJ5S_KERNEL_MODULE_INTERFACE__
|
||||
#define __HPSJ5S_KERNEL_MODULE_INTERFACE__
|
||||
|
||||
/*
|
||||
Scanner registers (not all - some of them i cann't identify...)
|
||||
*/
|
||||
|
||||
/*Here we place function code to perform*/
|
||||
#define REGISTER_FUNCTION_CODE 0x70
|
||||
/*Here we place parameter for function*/
|
||||
#define REGISTER_FUNCTION_PARAMETER 0x60
|
||||
|
||||
/*
|
||||
Here we define addresses, used for reading values:
|
||||
*/
|
||||
|
||||
/*this address used to get results (image strips, function result codes, etc.)*/
|
||||
#define ADDRESS_RESULT 0x20
|
||||
|
||||
/*
|
||||
Scanner functions (not all - some of them i cann't identify...)
|
||||
*/
|
||||
|
||||
/*Change scanner hardware state: use FLAGS_HW_xxxx for parameters*/
|
||||
#define FUNCTION_SETUP_HARDWARE 0xA0
|
||||
|
||||
/*Hardware control flags:*/
|
||||
#define FLAGS_HW_MOTOR_READY 0x1 /*Set this flag and non-zero speed to start rotation */
|
||||
#define FLAGS_HW_LAMP_ON 0x2 /*Set this flag to turn on lamp */
|
||||
#define FLAGS_HW_INDICATOR_OFF 0x4 /*Set[Clean] this flag to turn off[on] green light indicator */
|
||||
|
||||
/******************Code for kernel module operations******************************/
|
||||
|
||||
typedef enum
|
||||
{ OP_WRITE_ADDRESS, /*Output byte in address mode */
|
||||
OP_WRITE_DATA_BYTE, /*Output byte in data mode */
|
||||
OP_WRITE_SCANER_REGISTER, /*Output one byte in address mode and one byte in data mode */
|
||||
OP_CALL_FUNCTION_WITH_PARAMETER /*Output first value via 0x70 address, second value via 0x60 */
|
||||
}
|
||||
Op_Code;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char Address;
|
||||
}
|
||||
strWriteAddress;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char Data;
|
||||
}
|
||||
strWriteDataByte;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char Address;
|
||||
unsigned char Data;
|
||||
}
|
||||
strWriteScannerRegister;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char Function;
|
||||
unsigned char Parameter;
|
||||
}
|
||||
strFunctionWithParameter;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Op_Code Code; /*Operation to perform */
|
||||
union
|
||||
{
|
||||
strWriteAddress WrAddr;
|
||||
strWriteDataByte WrData;
|
||||
strWriteScannerRegister WrScannerReg;
|
||||
strFunctionWithParameter FuncParam;
|
||||
}
|
||||
Parameters;
|
||||
}
|
||||
strOperationBlock;
|
||||
|
||||
#endif
|
|
@ -48,7 +48,7 @@ SECT5 = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-as6e.5 sane-dll.5 \
|
|||
sane-snapscan.5 sane-canon.5 sane-coolscan.5 sane-bh.5 sane-dc240.5 \
|
||||
sane-umax_pp.5 sane-umax1220u.5 sane-sm3600.5 sane-usb.5 \
|
||||
sane-mustek_usb.5 sane-sceptre.5 sane-canon_pp.5 sane-canon630u.5 \
|
||||
sane-teco1.5 sane-test.5 sane-sp15c.5 sane-coolscan2.5
|
||||
sane-teco1.5 sane-test.5 sane-sp15c.5 sane-coolscan2.5 sane-hpsj5s.5
|
||||
SECT7 = sane.7
|
||||
MANPAGES = $(SECT1) $(SECT5) $(SECT7)
|
||||
READMES = README AUTHORS COPYING ChangeLog LEVEL2 LICENSE NEWS PROBLEMS \
|
||||
|
@ -84,7 +84,7 @@ DISTFILES = Makefile.in backend-writing.txt doxygen-sanei.conf html.sty \
|
|||
sane-st400.man sane-tamarack.man sane-umax.man sane-umax1220u.man \
|
||||
sane-umax_pp.man sane-usb.man sane-v4l.man sane.man sane.png \
|
||||
sane.tex saned.man scanimage.man sane-sceptre.man sane-canon_pp.man \
|
||||
sane-teco1.man sane-test.man sane-sp15c.man
|
||||
sane-teco1.man sane-test.man sane-sp15c.man sane-hpsj5s.man
|
||||
|
||||
.PHONY: all clean depend dist distclean html html-man install \
|
||||
install-mostang sane-html uninstall
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
;
|
||||
; 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 "hpsj5s" ; name of backend
|
||||
:version "0.02" ; version of backend
|
||||
:status :new ; :alpha, :beta, :stable, :new
|
||||
:manpage "sane-hpsj5s" ; name of manpage (if it exists)
|
||||
:url "http://hpsj5s.sourceforge.net/" ; backend's web page
|
||||
|
||||
:devicetype :scanner ; start of a list of devices....
|
||||
; other types: :stillcam, :vidcam,
|
||||
; :meta, :api
|
||||
|
||||
:mfg "HP" ; name a manufacturer
|
||||
:url "http://www.hp.com/"
|
||||
:model "HP ScanJet 5s" ; name models for above-specified mfg.
|
||||
:interface "Parport (EPP)"
|
||||
:comment "Driver for abstraction layer required"
|
||||
|
||||
; :comment and :url specifiers are optional after :mfg, :model, :desc,
|
||||
; and at the top-level.
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
.TH sane-hpsj5s 5 "24 Feb 2002"
|
||||
.IX sane-hpsj5s
|
||||
.SH NAME
|
||||
sane-hpsj5s - SANE backend for HP ScanJet 5S sheetfed scanner
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B sane-hpsj5s
|
||||
library implements a SANE (Scanner Access Now Easy) backend that
|
||||
provides access to parallel port Hewlett-Packard ScanJet 5S scaner.
|
||||
.PP
|
||||
IMPORTANT: this is alpha code. Don't expect this to work
|
||||
correctly. Many functions are missing, others contain errors. In some
|
||||
cases, your computer might even hang. It cannot be excluded (although
|
||||
I consider it extremely unprobable) that your scanner will be
|
||||
damaged.
|
||||
.PP
|
||||
LIMITATIONS: For now this backend works only at Linux+PC platform.This limitation
|
||||
is due dependance on Linux loadable module. Will be fixed in future. Your system
|
||||
should support
|
||||
.B EPP
|
||||
(or
|
||||
.B EPP+ECP
|
||||
) mode to operate this scaner. Future versions will support ECP and SPP
|
||||
(Nibble and Byte) modes also. It's planned to support for scaners not only
|
||||
at 0 daisy-chain position, but at any one. Support for multiple scaners could
|
||||
be implemented too.
|
||||
.PP
|
||||
Current version implements only gray scale scaning. True Color and B/W modes are
|
||||
not supported for now.
|
||||
.PP
|
||||
That said, TESTERS ARE WELCOME. Send your bug reports and comments to
|
||||
Max Vorobiev <pcwizard@yandex.ru>.
|
||||
.PP
|
||||
.SH "DEVICE NAMES"
|
||||
This backend expects device names of the form:
|
||||
.PP
|
||||
.RS
|
||||
.I special
|
||||
.RE
|
||||
.PP
|
||||
Where
|
||||
.I special
|
||||
is the path-name for the special device that corresponds to hpsj5s scaner driver.
|
||||
The special device name must be a link to device file or device file of hpsj5s.
|
||||
Under Linux, such a device name could be
|
||||
.I /dev/hpsj5s
|
||||
for example.
|
||||
|
||||
.SH CONFIGURATION
|
||||
The contents of the
|
||||
.I hpsj5s.conf
|
||||
file is a list of device names that correspond to HP ScanJet 5S
|
||||
scanners. Empty lines and lines starting with a hash mark (#) are
|
||||
ignored. Only one device name can be listed in
|
||||
.IR hpsj5s.conf
|
||||
for this moment.
|
||||
|
||||
.SH TIPS
|
||||
.PP
|
||||
It seems that HP ScanJet 5S scaner uses software noise correction. This
|
||||
feature is not implemented for now. So does gamma correction and calibration.
|
||||
I'll handle it in future versions.
|
||||
Native resolution for this scaner is 300 DPI. Other modes could be jagged in some
|
||||
ways.
|
||||
.PP
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @CONFIGDIR@/hpsj5s.conf
|
||||
The backend configuration file (see also description of
|
||||
.B SANE_CONFIG_DIR
|
||||
below).
|
||||
.TP
|
||||
.I @LIBDIR@/libsane-hpsj5s.a
|
||||
The static library implementing this backend.
|
||||
.TP
|
||||
.I @LIBDIR@/libsane-hpsj5s.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
|
||||
.SH "SEE ALSO"
|
||||
sane(7)
|
||||
.br
|
||||
http://hpsj5s.sourceforge.net
|
||||
.br
|
||||
.SH AUTHOR
|
||||
Max Vorobiev
|
||||
.br
|
||||
Man page mostly based on canon.man
|
|
@ -182,6 +182,9 @@ The SANE hp backend provides access to HP ScanJet scanners and OfficeJet
|
|||
multi-function peripherals (MFPs) which support SCL (Scanner Control Language
|
||||
by HP). See sane-hp(5) for details.
|
||||
.TP
|
||||
.B hpsj5s
|
||||
The SANE backend for the HP ScanJet 5S scanner. See sane-hpsj5s(5) for details.
|
||||
.TP
|
||||
.B leo
|
||||
This backend support the Across FS-1130, which is a re-badged LEO
|
||||
FS-1130 scanner. See sane-leo(5) for details.
|
||||
|
|
Ładowanie…
Reference in New Issue