kopia lustrzana https://gitlab.com/sane-project/backends
Added speedup parameters and TPA autodetection for UMAX3400/3450,
added disableSpeedup option.merge-requests/1/head
rodzic
ab64285ff9
commit
2a1b6bd853
|
@ -1809,68 +1809,68 @@ static HWDef Hw0x04B8_0x011D =
|
|||
/** Umax 3400/3450 */
|
||||
static HWDef Hw0x1606_0x0060 =
|
||||
{
|
||||
1.5, /* dMaxMotorSpeed (Max_Speed) */
|
||||
0.8, /* dMaxMoveSpeed (Max_Speed) */
|
||||
0.0, /* dHighSpeed */
|
||||
9, /* dIntegrationTimeLowLamp */
|
||||
9, /* dIntegrationTimeHighLamp */
|
||||
600, /* wMotorDpi (Full step DPI) */
|
||||
512, /* wRAMSize (KB) */
|
||||
8, /* dMinIntegrationTimeLowres (ms) */
|
||||
8, /* dMinIntegrationTimeHighres (ms) */
|
||||
4095, /* wGreenPWMDutyCycleLow (reg 0x2a + 0x2b) */
|
||||
4095, /* wGreenPWMDutyCycleHigh (reg 0x2a + 0x2b) */
|
||||
1.5, /* dMaxMotorSpeed (Max_Speed) */
|
||||
0.8, /* dMaxMoveSpeed (Max_Speed) */
|
||||
3.5, /* dHighSpeed */
|
||||
9, /* dIntegrationTimeLowLamp */
|
||||
9, /* dIntegrationTimeHighLamp */
|
||||
600, /* wMotorDpi (Full step DPI) */
|
||||
512, /* wRAMSize (KB) */
|
||||
8, /* dMinIntegrationTimeLowres (ms) */
|
||||
8, /* dMinIntegrationTimeHighres (ms) */
|
||||
4095, /* wGreenPWMDutyCycleLow (reg 0x2a + 0x2b) */
|
||||
4095, /* wGreenPWMDutyCycleHigh (reg 0x2a + 0x2b) */
|
||||
|
||||
0x06, /* bSensorConfiguration (0x0b) */
|
||||
0x73, /* sensor control settings (reg 0x0c) */
|
||||
0x77, /* sensor control settings (reg 0x0d) */
|
||||
0x15, /* sensor control settings (reg 0x0e) */
|
||||
0x06, /* bSensorConfiguration (0x0b) */
|
||||
0x73, /* sensor control settings (reg 0x0c) */
|
||||
0x77, /* sensor control settings (reg 0x0d) */
|
||||
0x15, /* sensor control settings (reg 0x0e) */
|
||||
|
||||
{0x00, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03},
|
||||
/* mono (reg 0x0f to 0x18) */
|
||||
{0x00, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x07, 0x03},
|
||||
/* mono (reg 0x0f to 0x18) */
|
||||
|
||||
{0x01, 0x0c, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0c},
|
||||
{0x01, 0x0c, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0c},
|
||||
/* color (reg 0x0f to 0x18) */
|
||||
_GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */
|
||||
0x40, /* bReg 0x27 color mode */
|
||||
1, /* bReg 0x29 illumination mode */
|
||||
/* illumination mode settings (not used for CCD devices) */
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
_GREEN_CH, /* bReg_0x26 color mode - bits 4 and 5 */
|
||||
0x40, /* bReg 0x27 color mode */
|
||||
1, /* bReg 0x29 illumination mode */
|
||||
/* illumination mode settings (not used for CCD devices) */
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0 },
|
||||
|
||||
1, /* StepperPhaseCorrection (reg 0x1a + 0x1b) */
|
||||
0x2f, /* bOpticBlackStart (reg 0x1c) */
|
||||
0x3e, /* bOpticBlackEnd (reg 0x1d) */
|
||||
110, /* ? wActivePixelsStart (reg 0x1e + 0x1f) */
|
||||
5469, /* wLineEnd (reg 0x20 + 0x21) */
|
||||
1, /* StepperPhaseCorrection (reg 0x1a + 0x1b) */
|
||||
0x2f, /* bOpticBlackStart (reg 0x1c) */
|
||||
0x3e, /* bOpticBlackEnd (reg 0x1d) */
|
||||
110, /* ? wActivePixelsStart (reg 0x1e + 0x1f) */
|
||||
5469, /* wLineEnd (reg 0x20 + 0x21) */
|
||||
|
||||
1, /* red lamp on (reg 0x2c + 0x2d) */
|
||||
16383, /* red lamp off (reg 0x2e + 0x2f) */
|
||||
0, /* green lamp on (reg 0x30 + 0x31) */
|
||||
0, /* green lamp off (reg 0x32 + 0x33) */
|
||||
32, /* blue lamp on (reg 0x34 + 0x35) */
|
||||
48, /* blue lamp off (reg 0x36 + 0x37) */
|
||||
1, /* red lamp on (reg 0x2c + 0x2d) */
|
||||
16383, /* red lamp off (reg 0x2e + 0x2f) */
|
||||
0, /* green lamp on (reg 0x30 + 0x31) */
|
||||
0, /* green lamp off (reg 0x32 + 0x33) */
|
||||
32, /* blue lamp on (reg 0x34 + 0x35) */
|
||||
48, /* blue lamp off (reg 0x36 + 0x37) */
|
||||
|
||||
3, /* stepper motor control (reg 0x45) */
|
||||
0, /* wStepsAfterPaperSensor2 (reg 0x4c + 0x4d) */
|
||||
11, /* steps to reverse on buffer full (reg 0x50)*/
|
||||
0xfc, /* acceleration profile (reg 0x51) */
|
||||
3, /* lines to process (reg 0x54) */
|
||||
0xcb, /* kickstart (reg 0x55) */
|
||||
0x05, /* pwm freq (reg 0x56) */
|
||||
5, /* pwm duty cycle (reg 0x57) */
|
||||
3, /* stepper motor control (reg 0x45) */
|
||||
0, /* wStepsAfterPaperSensor2 (reg 0x4c + 0x4d) */
|
||||
11, /* steps to reverse on buffer full (reg 0x50)*/
|
||||
0xfc, /* acceleration profile (reg 0x51) */
|
||||
3, /* lines to process (reg 0x54) */
|
||||
0xcb, /* kickstart (reg 0x55) */
|
||||
0x05, /* pwm freq (reg 0x56) */
|
||||
5, /* pwm duty cycle (reg 0x57) */
|
||||
|
||||
0x0d, /* Paper sense (reg 0x58) */
|
||||
0x0d, /* Paper sense (reg 0x58) */
|
||||
|
||||
0x44, /* misc io12 (reg 0x59) */
|
||||
0x45, /* misc io34 (reg 0x5a) */
|
||||
0x7c, /* misc io56 (reg 0x5b) */
|
||||
0, /* test mode ADC Output CODE MSB (reg 0x5c) */
|
||||
0, /* test mode ADC Output CODE LSB (reg 0x5d) */
|
||||
0, /* test mode (reg 0x5e) */
|
||||
_LM9832,
|
||||
MODEL_UMAX,
|
||||
1.0
|
||||
0x44, /* misc io12 (reg 0x59) */
|
||||
0x4a, /* misc io34 (reg 0x5a) */
|
||||
0x7c, /* misc io56 (reg 0x5b) */
|
||||
0, /* test mode ADC Output CODE MSB (reg 0x5c) */
|
||||
0, /* test mode ADC Output CODE LSB (reg 0x5d) */
|
||||
0, /* test mode (reg 0x5e) */
|
||||
_LM9832,
|
||||
MODEL_UMAX,
|
||||
1.0
|
||||
};
|
||||
|
||||
/** Umax 5400 */
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
* - changed usb_Wait4Warmup()
|
||||
* - added usb_WaitPos()
|
||||
* - added usb_FillLampRegs() - sets also PWMDutyCylce now
|
||||
* - added UMAX3450 TPA autodetection
|
||||
* .
|
||||
* <hr>
|
||||
* This file is part of the SANE package.
|
||||
|
@ -263,11 +264,12 @@ static SANE_Bool usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay )
|
|||
DBG( _DBG_INFO2, ">>>> CURRENT MCLK_DIV= %u\n", mclk_div );
|
||||
DBG( _DBG_INFO2, ">>>> MCH = %u\n", mch );
|
||||
DBG( _DBG_INFO2, ">>>> FFS = %u\n", ffs );
|
||||
DBG( _DBG_INFO2, ">>>> FASTSPEED = %.3f (%.3f)\n", speed,
|
||||
hw->dMaxMotorSpeed);
|
||||
DBG( _DBG_INFO2, ">>>> HIGH-SPEED = %.3f (%.3f)\n",
|
||||
speed, hw->dHighSpeed);
|
||||
|
||||
/* disabled ? */
|
||||
if( hw->dHighSpeed == 0.0 ) {
|
||||
if((hw->dHighSpeed == 0.0) || (dev->adj.disableSpeedup != 0)) {
|
||||
DBG( _DBG_INFO2, " * Speedup disabled or not available!\n" );
|
||||
min_ffs = 0xffff;
|
||||
maxf = 0.0;
|
||||
if( !stay )
|
||||
|
@ -1511,14 +1513,31 @@ static SANE_Bool usb_HasTPA( Plustek_Device *dev )
|
|||
DBG( _DBG_INFO, "EPSON-TPA NOT detected\n" );
|
||||
|
||||
if( dev->adj.enableTpa ) {
|
||||
DBG( _DBG_INFO, "EPSON-TPA usage forced\n" );
|
||||
DBG( _DBG_INFO, "EPSON-TPA usage forced\n" );
|
||||
return SANE_TRUE;
|
||||
}
|
||||
|
||||
|
||||
} else if( dev->usbDev.vendor == 0x1606 ) { /* the UMAX section */
|
||||
|
||||
if((dev->usbDev.product == 0x0050) || (dev->usbDev.product == 0x0060)) {
|
||||
|
||||
usbio_ReadReg ( dev->fd, 0x02, &val );
|
||||
DBG( _DBG_INFO, "REG[0x02] = 0x%02x\n", val );
|
||||
|
||||
usbio_WriteReg ( dev->fd, 0x58, dev->usbDev.HwSetting.bReg_0x58 );
|
||||
usbio_WriteReg ( dev->fd, 0x5a, dev->usbDev.HwSetting.bReg_0x5a );
|
||||
usbio_WriteReg ( dev->fd, 0x5b, dev->usbDev.HwSetting.bReg_0x5b );
|
||||
|
||||
usbio_ReadReg ( dev->fd, 0x02, &val );
|
||||
DBG( _DBG_INFO, "REG[0x02] = 0x%02x\n", val );
|
||||
|
||||
if( val & 0x02 ) {
|
||||
DBG( _DBG_INFO, "UMAX-TPA detected\n" );
|
||||
dev->usbDev.ModelStr = model;
|
||||
return SANE_TRUE;
|
||||
} else
|
||||
DBG( _DBG_INFO, "UMAX-TPA NOT detected\n" );
|
||||
|
||||
if( dev->adj.enableTpa ) {
|
||||
DBG( _DBG_INFO, "UMAX-TPA usage forced\n" );
|
||||
dev->usbDev.ModelStr = model;
|
||||
|
|
|
@ -2295,7 +2295,7 @@ static SANE_Bool usb_AutoWarmup( Plustek_Device *dev )
|
|||
* when the diffs are less than thresh for at least 3 loops
|
||||
*/
|
||||
if((diffR < thresh) && (diffG < thresh) && (diffB < thresh)) {
|
||||
if( stable_count >= 3 )
|
||||
if( stable_count > 3 )
|
||||
break;
|
||||
stable_count++;
|
||||
} else {
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
||||
#define BACKEND_VERSION "0.48-3"
|
||||
#define BACKEND_VERSION "0.48-4"
|
||||
#define BACKEND_NAME plustek
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
|
@ -265,6 +265,7 @@ static void show_cnf( pCnfDef cnf )
|
|||
DBG( _DBG_SANE_INIT,"skipFine : %s\n", _YN(cnf->adj.skipFine ));
|
||||
DBG( _DBG_SANE_INIT,"skipFineWhite: %s\n", _YN(cnf->adj.skipFineWhite ));
|
||||
DBG( _DBG_SANE_INIT,"invertNegs. : %s\n", _YN(cnf->adj.invertNegatives));
|
||||
DBG( _DBG_SANE_INIT,"dis.Speedup : %s\n", _YN(cnf->adj.disableSpeedup ));
|
||||
DBG( _DBG_SANE_INIT,"pos_x : %d\n", cnf->adj.pos.x );
|
||||
DBG( _DBG_SANE_INIT,"pos_y : %d\n", cnf->adj.pos.y );
|
||||
DBG( _DBG_SANE_INIT,"pos_shading_y: %d\n", cnf->adj.posShadingY );
|
||||
|
@ -1357,6 +1358,8 @@ sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize )
|
|||
_INT, &config.adj.skipFineWhite,&ival);
|
||||
decodeVal( str, "invertNegatives",
|
||||
_INT, &config.adj.invertNegatives,&ival);
|
||||
decodeVal( str, "disableSpeedup",
|
||||
_INT, &config.adj.disableSpeedup,&ival);
|
||||
|
||||
decodeVal( str, "posOffX", _INT, &config.adj.pos.x, &ival );
|
||||
decodeVal( str, "posOffY", _INT, &config.adj.pos.y, &ival );
|
||||
|
|
|
@ -83,6 +83,12 @@ option negShadingY -1
|
|||
#
|
||||
option invertNegatives 0
|
||||
|
||||
#
|
||||
# to disable the internal sensor speedup function,
|
||||
# 1 disables the feature
|
||||
#
|
||||
option disableSpeedup 0
|
||||
|
||||
#
|
||||
# to save/restore coarse calibration data
|
||||
# (can also be set via frontend)
|
||||
|
|
|
@ -245,6 +245,7 @@ typedef struct {
|
|||
int skipCalibration;
|
||||
int skipFine;
|
||||
int skipFineWhite;
|
||||
int disableSpeedup;
|
||||
int invertNegatives;
|
||||
int cacheCalData;
|
||||
int altCalibrate; /* force use of the alternate canoscan autocal;
|
||||
|
|
Ładowanie…
Reference in New Issue