kopia lustrzana https://gitlab.com/sane-project/backends
Updated Plustek backend code according to some feedback I got.
rodzic
1737ac83c6
commit
1a9e473dd2
|
@ -10,7 +10,8 @@
|
|||
* History:
|
||||
* 0.40 - starting version of the USB support
|
||||
* 0.41 - added EPSON1250 entries
|
||||
*
|
||||
* - changed reg 0x58 of EPSON Hw0x04B8_0x010F_0 to 0x0d
|
||||
* - reduced memory size of EPSON to 512
|
||||
*.............................................................................
|
||||
*
|
||||
* This file is part of the SANE package.
|
||||
|
@ -1115,7 +1116,7 @@ static HWDef Hw0x04B8_0x010F_0 =
|
|||
12, /* wIntegrationTimeLowLamp */
|
||||
12, /* wIntegrationTimeHighLamp */
|
||||
600, /* wMotorDpi (Full step DPI) */
|
||||
2048, /* wRAMSize (KB) */
|
||||
512, /* wRAMSize (KB) */
|
||||
4, /* wMinIntegrationTimeLowres (ms) */
|
||||
5, /* wMinIntegrationTimeHighres (ms) */
|
||||
3000, /* ok wGreenPWMDutyCycleLow (reg 0x2a + 0x2b) */
|
||||
|
@ -1146,7 +1147,7 @@ static HWDef Hw0x04B8_0x010F_0 =
|
|||
0x02, /* ok pwm freq (reg 0x56) */
|
||||
1, /* ok pwm duty cycle (reg 0x57) */
|
||||
|
||||
0x09, /* ok Paper sense (reg 0x58) */
|
||||
0x0d, /* ok Paper sense (reg 0x58) */
|
||||
|
||||
0x41, /* ok misc io12 (reg 0x59) */
|
||||
0x44, /* ok misc io34 (reg 0x5a) */
|
||||
|
@ -1207,7 +1208,10 @@ static SetDef Settings[] =
|
|||
|
||||
/* EPSON... */
|
||||
{"0x04B8-0x010F", &Cap0x04B8_0x010F_0, &Hw0x04B8_0x010F_0, "Perfection 1250/Photo" },
|
||||
|
||||
|
||||
/* CANON... */
|
||||
/* {"0x04A9-0x220D", ,, "N670U" }, */
|
||||
|
||||
/* UMAX... */
|
||||
/* {"0x1606-0x0060", &Cap..., &HW..., "UMAX 3400" }, */
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
*.............................................................................
|
||||
* History:
|
||||
* 0.40 - starting version of the USB support
|
||||
* 0.41 - no changes
|
||||
* 0.41 - removed CHECK
|
||||
* added Canon to the manufacturer list
|
||||
*
|
||||
*.............................................................................
|
||||
*
|
||||
|
@ -52,14 +53,6 @@
|
|||
* If you do not wish that, delete this exception notice.
|
||||
*/
|
||||
|
||||
#define CHECK(func) \
|
||||
{ \
|
||||
SANE_Status status; \
|
||||
status = func; \
|
||||
if (status != SANE_STATUS_GOOD) \
|
||||
return status; \
|
||||
}
|
||||
|
||||
/*
|
||||
* to allow different vendors...
|
||||
*/
|
||||
|
@ -71,10 +64,10 @@ static TabDef usbVendors[] = {
|
|||
{ 0x0458, "KYE/Genius" },
|
||||
{ 0x03F0, "Hewlett-Packard" },
|
||||
{ 0x04B8, "Epson" },
|
||||
{ 0x04A9, "Canon" },
|
||||
{ 0xFFFF, NULL }
|
||||
};
|
||||
|
||||
|
||||
/********************** the USB scanner interface ****************************/
|
||||
|
||||
/*.............................................................................
|
||||
|
@ -85,7 +78,7 @@ static void usb_initDev( pPlustek_Device dev, int idx, int handle, int vendor )
|
|||
int i;
|
||||
ScanParam sParam;
|
||||
|
||||
DBG( _DBG_INFO, "usb_initDev()\n" );
|
||||
DBG( _DBG_INFO, "usb_initDev(%d,0x%04x)\n", idx, vendor );
|
||||
|
||||
memset( &dev->usbDev, 0, sizeof(DeviceDef));
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* History:
|
||||
* 0.40 - starting version of the USB support
|
||||
* 0.41 - added EPSON1250 specific stuff
|
||||
*
|
||||
* - added alternative usb_IsScannerReady function
|
||||
*.............................................................................
|
||||
*
|
||||
* This file is part of the SANE package.
|
||||
|
@ -82,13 +82,14 @@ static Bool usb_MotorOn( int handle, Bool fOn )
|
|||
return SANE_TRUE;
|
||||
}
|
||||
|
||||
/*................................................................b.............
|
||||
/*.............................................................................
|
||||
*
|
||||
*/
|
||||
static Bool usb_IsScannerReady( pPlustek_Device dev )
|
||||
{
|
||||
u_char value;
|
||||
|
||||
#if 1
|
||||
_UIO( usbio_ReadReg( dev->fd, 7, &value));
|
||||
|
||||
if( value == 0 )
|
||||
|
@ -101,6 +102,22 @@ static Bool usb_IsScannerReady( pPlustek_Device dev )
|
|||
}
|
||||
}
|
||||
|
||||
#else
|
||||
SANE_Word delay;
|
||||
|
||||
for( delay = 0; delay < 300; delay++ ) {
|
||||
_UIO( usbio_ReadReg( dev->fd, 7, &value));
|
||||
|
||||
if( value == 0 )
|
||||
return SANE_TRUE;
|
||||
|
||||
if (value >= 8)
|
||||
_UIO( usbio_WriteReg( dev->fd, 0x07, 0 ));
|
||||
|
||||
usleep( 100000 );
|
||||
}
|
||||
#endif
|
||||
|
||||
DBG( _DBG_ERROR, "Scanner not ready!!!\n" );
|
||||
return SANE_FALSE;
|
||||
}
|
||||
|
@ -636,6 +653,7 @@ static Bool usb_LampOn( pPlustek_Device dev,
|
|||
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & sc->workaroundFlag)) {
|
||||
|
||||
a_bRegs[0x29] = 3; /* mode 3 */
|
||||
a_bRegs[0x5b] = 0x14;
|
||||
usbio_WriteReg( dev->fd, 0x5b, 0x94 );
|
||||
|
||||
} else {
|
||||
|
@ -676,6 +694,7 @@ static Bool usb_LampOn( pPlustek_Device dev,
|
|||
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & sc->workaroundFlag)) {
|
||||
|
||||
a_bRegs[0x29] = 3; /* mode 3 */
|
||||
a_bRegs[0x5b] = 0x14;
|
||||
usbio_WriteReg( dev->fd, 0x5b, 0x14 );
|
||||
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*.............................................................................
|
||||
* Project : SANE library for Plustek USB flatbed scanners.
|
||||
*.............................................................................
|
||||
* File: plustek-usbio.c - this one should go out to a sane library
|
||||
* File: plustek-usbio.c - some I/O stuff
|
||||
*.............................................................................
|
||||
*
|
||||
* based on sources acquired from Plustek Inc.
|
||||
|
|
|
@ -724,7 +724,10 @@ static void usb_GetPauseLimit( pPlustek_Device dev, pScanParam pParam )
|
|||
{
|
||||
pHWDef hw = &dev->usbDev.HwSetting;
|
||||
|
||||
/* Get available buffer size in KB */
|
||||
/* Get available buffer size in KB
|
||||
* for 512kb this will be 296
|
||||
* for 2Mb this will be 1832
|
||||
*/
|
||||
m_dwPauseLimit = (u_long)(hw->wDRAMSize - (16 + 16 + 4) * 3 * 2);
|
||||
m_dwPauseLimit -= (pParam->Size.dwPhyBytes / 1024 + 1);
|
||||
|
||||
|
@ -736,7 +739,7 @@ static void usb_GetPauseLimit( pPlustek_Device dev, pScanParam pParam )
|
|||
m_dwPauseLimit = usb_max( usb_min(m_dwPauseLimit,
|
||||
(u_long)ceil(pParam->Size.dwTotalBytes / 1024.0)), 2);
|
||||
|
||||
a_bRegs[0x4E] = (u_char)floor((m_dwPauseLimit*512.0) / (2*hw->wDRAMSize));
|
||||
a_bRegs[0x4e] = (u_char)floor((m_dwPauseLimit*512.0) / (2*hw->wDRAMSize));
|
||||
|
||||
if( a_bRegs[0x4e] > 1 ) {
|
||||
a_bRegs[0x4e]--;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* History:
|
||||
* 0.40 - starting version of the USB support
|
||||
* 0.41 - minor fixes
|
||||
*
|
||||
* - added workaround stuff for EPSON1250
|
||||
*.............................................................................
|
||||
*
|
||||
* This file is part of the SANE package.
|
||||
|
@ -837,6 +837,7 @@ static Bool usb_AdjustDarkShading( pPlustek_Device dev )
|
|||
|
||||
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & scaps->workaroundFlag)) {
|
||||
a_bRegs[0x29] = 3;
|
||||
a_bRegs[0x5b] = 0x94;
|
||||
usbio_WriteReg( dev->fd, 0x5b, 0x94);
|
||||
} else {
|
||||
a_bRegs[0x29] = 1;
|
||||
|
@ -852,6 +853,7 @@ static Bool usb_AdjustDarkShading( pPlustek_Device dev )
|
|||
*/
|
||||
if(_WAF_MISC_IO6_LAMP==(_WAF_MISC_IO6_LAMP & scaps->workaroundFlag)) {
|
||||
a_bRegs[0x29] = 3;
|
||||
a_bRegs[0x5b] = 0x94;
|
||||
usbio_WriteReg( dev->fd, 0x5b, 0x94 );
|
||||
} else {
|
||||
a_bRegs[0x29] = 1;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
* added USB interface stuff
|
||||
* 0.40 - USB scanning works now
|
||||
* 0.41 - added some configuration stuff and also changed .conf file
|
||||
* added call to sanei_usb_init() and sanei_lm983x_init()
|
||||
*
|
||||
*.............................................................................
|
||||
*
|
||||
|
@ -1103,6 +1104,9 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize )
|
|||
FILE *fp;
|
||||
|
||||
DBG_INIT();
|
||||
|
||||
sanei_usb_init();
|
||||
sanei_lm983x_init();
|
||||
|
||||
#if defined PACKAGE && defined VERSION
|
||||
DBG( _DBG_SANE_INIT, "sane_init: " PACKAGE " " VERSION "\n");
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
:comment "OK - use driver-switch mov=2"
|
||||
|
||||
:mfg "KYE - Genius" ; name of manufacturer
|
||||
:url "http://www.geniusnet.com.tw/"
|
||||
|
||||
:model "Colorpage Vivid III V2"
|
||||
:interface "Parport (SPP, EPP)"
|
||||
|
@ -169,6 +170,25 @@
|
|||
:interface "Parport (SPP, EPP)"
|
||||
:comment "OK - Reported as P12"
|
||||
|
||||
:mfg "Mustek" ; name of manufacturer
|
||||
:url "http://www.mustek.com/"
|
||||
|
||||
;name models for above-specified mfg.
|
||||
:model "BearPaw 1200"
|
||||
:interface "USB"
|
||||
:comment "Mostly OK"
|
||||
|
||||
:model "BearPaw 2400"
|
||||
:interface "USB"
|
||||
:comment "Mostly OK"
|
||||
|
||||
|
||||
:mfg "Hewlett-Packard" ; name of manufacturer
|
||||
:url "http://www.hp.com/"
|
||||
|
||||
:model "HP ScanJet 2200C"
|
||||
:interface "USB"
|
||||
:comment "Mostly OK"
|
||||
|
||||
; :comment and :url specifiers are optional after :mfg, :model, :desc,
|
||||
; and at the top-level.
|
||||
|
|
|
@ -1,19 +1,27 @@
|
|||
.TH sane-plustek 5 "27 December 2001"
|
||||
.TH sane-plustek 5 "30 December 2001"
|
||||
.IX sane-plustek
|
||||
.SH NAME
|
||||
sane-plustek - SANE backend for Plustek parallel port and USB flatbed scanners
|
||||
sane-plustek
|
||||
.br
|
||||
SANE backend for Plustek parallel port and
|
||||
.br
|
||||
LM983[1/2] based USB flatbed scanners
|
||||
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B sane-plustek
|
||||
library implements a SANE (Scanner Access Now Easy) backend that
|
||||
provides access to Plustek parallel port and USB flatbed scanners.
|
||||
The backend needs the kernel module pt_drv which currently can be
|
||||
downloaded from
|
||||
The USB support is part of the SANE package but for usage with
|
||||
parallel port scanners you will need a kernel module, called
|
||||
pt_drv which currently can be downloaded from
|
||||
.br
|
||||
.B http://home.t-online.de/home/g-jaeger/plustek.html
|
||||
.br
|
||||
At present, the following scanners should work with this backend:
|
||||
|
||||
.SH "PARALLEL PORT SUPPORT"
|
||||
|
||||
At present, the following scanners should work with this backend
|
||||
and the corresponding kernel module:
|
||||
.PP
|
||||
Parallelport Model: ASIC: Properties:
|
||||
.br
|
||||
|
@ -53,36 +61,7 @@ OpticPro 4800P/FBII 96001 300x600 dpi 24bit 32Kb
|
|||
.br
|
||||
.PP
|
||||
|
||||
USB Model: ASIC: Properties: Product
|
||||
.br
|
||||
Vendor-ID: 0x07B3 ID
|
||||
.br
|
||||
------------------ ------ ------------------------ ------
|
||||
.br
|
||||
OpticPro U12 LM9832 600x1200dpi 42bit 512Kb 0x0010
|
||||
.br
|
||||
OpticPro UT12 LM9832 600x1200dpi 42bit 512Kb 0x0017
|
||||
.br
|
||||
OpticPro UT16 LM9832 600x1200dpi 42bit 512Kb 0x0017
|
||||
.br
|
||||
OpticPro U24 LM9832 1200x2400dpi 42bit 2Mb 0x0011
|
||||
.br
|
||||
OpticPro UT24 LM9832 1200x2400dpi 42bit 2Mb 0x0017
|
||||
.PP
|
||||
|
||||
.SH "OTHER PLUSTEK SCANNERS"
|
||||
|
||||
The SCSI scanner OpticPro 19200S is a rebadged Artec AM12S scanner
|
||||
and is supported by the
|
||||
.B Artec
|
||||
backend.
|
||||
.br
|
||||
Only the National Semiconductor LM9831/2 based devices of Plustek
|
||||
are supported by this driver. Older versions of the UT12, the U1212
|
||||
and U1248 (GrandTech chipset are not supported)
|
||||
.PP
|
||||
|
||||
.SH "PRIMAX SCANNERS"
|
||||
.B "PRIMAX SCANNERS"
|
||||
|
||||
There are some scanners sold by Primax, but they are in fact
|
||||
Plustek devices. These scanners are also supported.
|
||||
|
@ -101,11 +80,11 @@ Compact 4800 Direct 30bit OpticPro 4830 not tested
|
|||
Compact 9600 Direct 30bit OpticPro 9630 works
|
||||
.PP
|
||||
|
||||
.SH "GENIUS SCANNERS"
|
||||
.B "GENIUS SCANNERS"
|
||||
|
||||
The following devices are sold as Genius Scanners, but are in fact
|
||||
Plustek devices.
|
||||
The following table will show the relationship:
|
||||
The table will show the relationship:
|
||||
.PP
|
||||
Model: Remarks:
|
||||
.br
|
||||
|
@ -114,12 +93,9 @@ Model: Remarks:
|
|||
Colorpage Vivid III V2 Like P12 but has two buttons
|
||||
.br
|
||||
and Wolfson DAC
|
||||
.br
|
||||
Colorpage HR6 V2 Supported by the USB driver
|
||||
(IDs: 0x0458 0x2007)
|
||||
.PP
|
||||
|
||||
.SH "ARIES SCANNERS"
|
||||
.B "ARIES SCANNERS"
|
||||
|
||||
There's one scanner sold as Aries Scanner, but is in fact a
|
||||
Plustek device.
|
||||
|
@ -132,7 +108,7 @@ Model: Plustek Model: Remarks:
|
|||
Scan-It 4800 OpticPro 600 mov=2
|
||||
.PP
|
||||
|
||||
.SH "BrightScan SCANNERS"
|
||||
.B "BrightScan SCANNERS"
|
||||
|
||||
There's one scanner sold as BrightScan OpticPro Scanner, this is also
|
||||
rebadged Plustek device.
|
||||
|
@ -143,6 +119,78 @@ Model: Remarks:
|
|||
--------------------------- ----------------------------
|
||||
.br
|
||||
BrightScan OpticPro OpticPro P12
|
||||
|
||||
.SH "USB SUPPORT"
|
||||
|
||||
The Backend is able to support USB scanner based on the National
|
||||
Semiconductor chipset LM9831 and LM9832. The following tables
|
||||
show various devices which are currently reported to work.
|
||||
.br
|
||||
|
||||
Vendor Plustek - ID: 0x07B3
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
USB Model: ASIC: Properties: Prod-ID
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
OpticPro U12 LM9832 600x1200dpi 42bit 512Kb 0x0010
|
||||
.br
|
||||
OpticPro UT12 LM9832 600x1200dpi 42bit 512Kb 0x0017
|
||||
.br
|
||||
OpticPro UT16 LM9832 600x1200dpi 42bit 512Kb 0x0017
|
||||
.br
|
||||
OpticPro U24 LM9832 1200x2400dpi 42bit 2Mb 0x0011
|
||||
.br
|
||||
OpticPro UT24 LM9832 1200x2400dpi 42bit 2Mb 0x0017
|
||||
.PP
|
||||
|
||||
Vendor KYE/Genius - ID: 0x0458
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
USB Model: ASIC: Properties: Prod-ID
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
Colorpage HR6 V2 LM9832 600x1200dpi 42bit 512Kb 0x2007
|
||||
.PP
|
||||
|
||||
Vendor Hewlett-Packard - ID: 0x03F0
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
USB Model: ASIC: Properties: Prod-ID
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
ScanJet 2200c LM9832 600x1200dpi 42bit 512Kb 0x0605
|
||||
.PP
|
||||
|
||||
Vendor Mustek - ID: 0x0400
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
USB Model: ASIC: Properties: Prod-ID
|
||||
.br
|
||||
----------------------------------------------------------
|
||||
.br
|
||||
BearPaw 1200 LM9831 600x1200dpi 42bit 512Kb 0x1000
|
||||
.br
|
||||
BearPaw 2400 LM9832 1200x2400dpi 42bit 2Mb 0x1001
|
||||
.PP
|
||||
|
||||
.SH "OTHER PLUSTEK SCANNERS"
|
||||
|
||||
The SCSI scanner OpticPro 19200S is a rebadged Artec AM12S scanner
|
||||
and is supported by the
|
||||
.B Artec
|
||||
backend.
|
||||
.br
|
||||
Only the National Semiconductor LM9831/2 based devices of Plustek
|
||||
are supported by this driver. Older versions of the UT12, the U1212
|
||||
and U1248 (GrandTech chipset are not supported)
|
||||
.PP
|
||||
|
||||
.SH "DEVICE NAMES"
|
||||
|
@ -174,7 +222,7 @@ file
|
|||
See the plustek.conf file for examples.
|
||||
.PP
|
||||
|
||||
.SH CONFIGURATION
|
||||
.SH "CONFIGURATION - PARALLEL PORT SCANNER"
|
||||
.PP
|
||||
As the driver is a loadable kernel module, it is configured
|
||||
by invoking insmod with the appropriate parameters or
|
||||
|
@ -308,6 +356,27 @@ other applications before scanning and (if sufficient
|
|||
memory available) disable swapping.
|
||||
.PP
|
||||
|
||||
.SH "CONFIGURATION - USB SCANNER"
|
||||
.PP
|
||||
To use the USB device with this backend, you need at least
|
||||
two entries in the configuration file
|
||||
.br
|
||||
.I @CONFIGDIR@/plustek.conf
|
||||
.TP
|
||||
.I [usb] vendor-id product-id
|
||||
.TP
|
||||
.I /dev/usbscanner
|
||||
.PP
|
||||
.I usb
|
||||
tells the backend, that the following devicename (here
|
||||
.I /dev/usbscanner
|
||||
) has to be used as USB scanner device. If vendor- and
|
||||
product-id has not been specified, the backend tries to
|
||||
detect this by its own.
|
||||
.PP
|
||||
See the plustek.conf file for examples.
|
||||
.PP
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I @CONFIGDIR@/plustek.conf
|
||||
|
|
Ładowanie…
Reference in New Issue