kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'gl843'
commit
47fa684a1b
|
@ -479,7 +479,7 @@ libsane_fujitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
|||
libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_magic.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
EXTRA_DIST += fujitsu.conf.in
|
||||
|
||||
libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_gl847.c genesys_gl847.h genesys_low.h
|
||||
libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_gl843.c genesys_gl843.h genesys_gl847.c genesys_gl847.h genesys_low.h
|
||||
libgenesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys
|
||||
|
||||
nodist_libsane_genesys_la_SOURCES = genesys-s.c
|
||||
|
|
|
@ -157,7 +157,7 @@ libfujitsu_la_OBJECTS = $(am_libfujitsu_la_OBJECTS)
|
|||
libgenesys_la_LIBADD =
|
||||
am_libgenesys_la_OBJECTS = libgenesys_la-genesys.lo \
|
||||
libgenesys_la-genesys_gl646.lo libgenesys_la-genesys_gl841.lo \
|
||||
libgenesys_la-genesys_gl847.lo
|
||||
libgenesys_la-genesys_gl843.lo libgenesys_la-genesys_gl847.lo
|
||||
libgenesys_la_OBJECTS = $(am_libgenesys_la_OBJECTS)
|
||||
libgphoto2_i_la_LIBADD =
|
||||
am_libgphoto2_i_la_OBJECTS = libgphoto2_i_la-gphoto2.lo
|
||||
|
@ -1993,7 +1993,7 @@ nodist_libsane_fujitsu_la_SOURCES = fujitsu-s.c
|
|||
libsane_fujitsu_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=fujitsu
|
||||
libsane_fujitsu_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS)
|
||||
libsane_fujitsu_la_LIBADD = $(COMMON_LIBS) libfujitsu.la ../sanei/sanei_init_debug.lo ../sanei/sanei_constrain_value.lo ../sanei/sanei_config.lo ../sanei/sanei_config2.lo sane_strstatus.lo ../sanei/sanei_usb.lo ../sanei/sanei_scsi.lo ../sanei/sanei_magic.lo $(MATH_LIB) $(SCSI_LIBS) $(USB_LIBS) $(RESMGR_LIBS)
|
||||
libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_gl847.c genesys_gl847.h genesys_low.h
|
||||
libgenesys_la_SOURCES = genesys.c genesys.h genesys_gl646.c genesys_gl646.h genesys_gl841.c genesys_gl843.c genesys_gl843.h genesys_gl847.c genesys_gl847.h genesys_low.h
|
||||
libgenesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys
|
||||
nodist_libsane_genesys_la_SOURCES = genesys-s.c
|
||||
libsane_genesys_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=genesys
|
||||
|
@ -2871,6 +2871,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgenesys_la-genesys.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgenesys_la-genesys_gl646.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgenesys_la-genesys_gl841.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgenesys_la-genesys_gl843.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgenesys_la-genesys_gl847.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgphoto2_i_la-gphoto2.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgt68xx_la-gt68xx.Plo@am__quote@
|
||||
|
@ -3340,6 +3341,13 @@ libgenesys_la-genesys_gl841.lo: genesys_gl841.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl841.lo `test -f 'genesys_gl841.c' || echo '$(srcdir)/'`genesys_gl841.c
|
||||
|
||||
libgenesys_la-genesys_gl843.lo: genesys_gl843.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl843.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl843.Tpo -c -o libgenesys_la-genesys_gl843.lo `test -f 'genesys_gl843.c' || echo '$(srcdir)/'`genesys_gl843.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgenesys_la-genesys_gl843.Tpo $(DEPDIR)/libgenesys_la-genesys_gl843.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genesys_gl843.c' object='libgenesys_la-genesys_gl843.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgenesys_la-genesys_gl843.lo `test -f 'genesys_gl843.c' || echo '$(srcdir)/'`genesys_gl843.c
|
||||
|
||||
libgenesys_la-genesys_gl847.lo: genesys_gl847.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgenesys_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgenesys_la-genesys_gl847.lo -MD -MP -MF $(DEPDIR)/libgenesys_la-genesys_gl847.Tpo -c -o libgenesys_la-genesys_gl847.lo `test -f 'genesys_gl847.c' || echo '$(srcdir)/'`genesys_gl847.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libgenesys_la-genesys_gl847.Tpo $(DEPDIR)/libgenesys_la-genesys_gl847.Plo
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
#include "../include/sane/config.h"
|
||||
|
||||
#define BUILD 18
|
||||
#define BUILD 30
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
@ -175,6 +175,8 @@ genesys_init_cmd_set (Genesys_Device * dev)
|
|||
return sanei_gl646_init_cmd_set (dev);
|
||||
case GENESYS_GL841:
|
||||
return sanei_gl841_init_cmd_set (dev);
|
||||
case GENESYS_GL843:
|
||||
return sanei_gl843_init_cmd_set (dev);
|
||||
case GENESYS_GL847:
|
||||
return sanei_gl847_init_cmd_set (dev);
|
||||
default:
|
||||
|
@ -715,6 +717,7 @@ sanei_genesys_get_address (Genesys_Register_Set * regs, SANE_Byte addr)
|
|||
if (regs[i].address == addr)
|
||||
return ®s[i];
|
||||
}
|
||||
DBG (DBG_error, "sanei_genesys_get_address: failed to find address for register 0x%02x, crash expected !\n",addr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -743,9 +746,12 @@ sanei_genesys_get_address (Genesys_Register_Set * regs, SANE_Byte addr)
|
|||
SANE_Int
|
||||
sanei_genesys_generate_slope_table (uint16_t * slope_table,
|
||||
unsigned int max_steps,
|
||||
unsigned int use_steps, uint16_t stop_at,
|
||||
uint16_t vstart, uint16_t vend,
|
||||
unsigned int steps, double g,
|
||||
unsigned int use_steps,
|
||||
uint16_t stop_at,
|
||||
uint16_t vstart,
|
||||
uint16_t vend,
|
||||
unsigned int steps,
|
||||
double g,
|
||||
unsigned int *used_steps,
|
||||
unsigned int *vfinal)
|
||||
{
|
||||
|
@ -789,7 +795,7 @@ sanei_genesys_generate_slope_table (uint16_t * slope_table,
|
|||
if (t2 < stop_at)
|
||||
break;
|
||||
*slope_table++ = t2;
|
||||
DBG (DBG_io, "slope_table[%3d] = %5d\n", c, t2);
|
||||
/* DBG (DBG_io, "slope_table[%3d] = %5d\n", c, t2); */
|
||||
sum += t2;
|
||||
}
|
||||
if (t2 > stop_at)
|
||||
|
@ -809,7 +815,7 @@ sanei_genesys_generate_slope_table (uint16_t * slope_table,
|
|||
for (i = 0; i < max_steps; i++, c++)
|
||||
{
|
||||
*slope_table++ = *vfinal;
|
||||
DBG (DBG_io, "slope_table[%3d] = %5d\n", c, *vfinal);
|
||||
/* DBG (DBG_io, "slope_table[%3d] = %5d\n", c, *vfinal); */
|
||||
}
|
||||
|
||||
(*used_steps)++;
|
||||
|
@ -884,21 +890,20 @@ sanei_genesys_create_slope_table3 (Genesys_Device * dev,
|
|||
if (vend > 65535)
|
||||
vend = 65535;
|
||||
|
||||
sum_time = sanei_genesys_generate_slope_table (slope_table, max_step,
|
||||
sum_time = sanei_genesys_generate_slope_table (slope_table,
|
||||
max_step,
|
||||
use_steps,
|
||||
vtarget,
|
||||
vstart,
|
||||
vend,
|
||||
dev->motor.slopes[power_mode]
|
||||
[step_type].minimum_steps <<
|
||||
step_type,
|
||||
dev->motor.slopes[power_mode]
|
||||
[step_type].g, used_steps,
|
||||
dev->motor.slopes[power_mode][step_type].minimum_steps << step_type,
|
||||
dev->motor.slopes[power_mode][step_type].g,
|
||||
used_steps,
|
||||
&vfinal);
|
||||
|
||||
if (final_exposure)
|
||||
*final_exposure = (vfinal * dev->motor.base_ydpi) / yres;
|
||||
|
||||
|
||||
DBG (DBG_proc,
|
||||
"sanei_genesys_create_slope_table: returns sum_time=%d, completed\n",
|
||||
sum_time);
|
||||
|
@ -1474,6 +1479,8 @@ genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data,
|
|||
* tested instead of adding all the others */
|
||||
/* many scanners send coefficient for lineart/gray like in color mode */
|
||||
if (dev->settings.scan_mode < 2
|
||||
&& dev->model->ccd_type != CCD_KVSS080
|
||||
&& dev->model->ccd_type != CCD_G4050
|
||||
&& dev->model->ccd_type != CCD_DSMOBILE600
|
||||
&& dev->model->ccd_type != CCD_XP300
|
||||
&& dev->model->ccd_type != CCD_DP665
|
||||
|
@ -1504,7 +1511,7 @@ genesys_send_offset_and_shading (Genesys_Device * dev, uint8_t * data,
|
|||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
status = dev->model->cmd_set->bulk_write_data (dev, 0x3c, data, size);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
|
@ -2541,14 +2548,8 @@ genesys_dummy_dark_shading (Genesys_Device * dev)
|
|||
|
||||
DBG (DBG_proc, "genesys_dummy_dark_shading \n");
|
||||
|
||||
pixels_per_line =
|
||||
(genesys_pixels_per_line (dev->calib_reg)
|
||||
* genesys_dpiset (dev->calib_reg)) / dev->sensor.optical_res;
|
||||
|
||||
if (dev->settings.scan_mode == SCAN_MODE_COLOR) /* single pass color */
|
||||
channels = 3;
|
||||
else
|
||||
channels = 1;
|
||||
pixels_per_line = dev->calib_pixels;
|
||||
channels = dev->calib_channels;
|
||||
|
||||
FREE_IFNOT_NULL (dev->dark_average_data);
|
||||
|
||||
|
@ -2574,6 +2575,11 @@ genesys_dummy_dark_shading (Genesys_Device * dev)
|
|||
skip = 4;
|
||||
xend = 68;
|
||||
}
|
||||
if(dev->model->ccd_type==CCD_KVSS080)
|
||||
{
|
||||
skip = 2;
|
||||
xend = dev->sensor.black_pixels;
|
||||
}
|
||||
|
||||
/* average each channels on half left margin */
|
||||
dummy1 = 0;
|
||||
|
@ -3090,7 +3096,6 @@ compute_averaged_planar (Genesys_Device * dev,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Computes shading coefficient using formula in data sheet. 16bit data values
|
||||
* manipulated here are little endian. For now we assume deletion scanning type
|
||||
|
@ -3123,7 +3128,7 @@ compute_coefficients (Genesys_Device * dev,
|
|||
|
||||
DBG (DBG_io,
|
||||
"compute_coefficients: pixels_per_line=%d, coeff=0x%04x\n", pixels_per_line, coeff);
|
||||
|
||||
|
||||
/* compute start & end values depending of the offset */
|
||||
if (offset < 0)
|
||||
{
|
||||
|
@ -3159,6 +3164,7 @@ compute_coefficients (Genesys_Device * dev,
|
|||
ptr[1] = dk / 256;
|
||||
ptr[2] = val & 0xff;
|
||||
ptr[3] = val / 256;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3256,9 +3262,10 @@ genesys_send_shading_coefficient (Genesys_Device * dev)
|
|||
{
|
||||
SANE_Status status;
|
||||
uint16_t pixels_per_line;
|
||||
uint16_t *fixup,*shading;
|
||||
uint8_t *shading_data; /**> contains 16bit words in little endian */
|
||||
uint8_t channels;
|
||||
unsigned int x, j;
|
||||
unsigned int x, j, src, dst;
|
||||
int o;
|
||||
unsigned int length; /**> number of shading calibration data words */
|
||||
unsigned int i, res, factor;
|
||||
|
@ -3438,6 +3445,42 @@ genesys_send_shading_coefficient (Genesys_Device * dev)
|
|||
coeff,
|
||||
target_code);
|
||||
break;
|
||||
case CCD_KVSS080:
|
||||
target_code = 0xe000;
|
||||
o = 4;
|
||||
cmat[0] = 0;
|
||||
cmat[1] = 1;
|
||||
cmat[2] = 2;
|
||||
compute_coefficients (dev,
|
||||
shading_data,
|
||||
pixels_per_line,
|
||||
3,
|
||||
cmat,
|
||||
o,
|
||||
coeff,
|
||||
target_code);
|
||||
/* shading data fixup */
|
||||
shading=(uint16_t *)shading_data;
|
||||
fixup = malloc ((length*256)/252+512);
|
||||
if (!shading_data)
|
||||
{
|
||||
DBG (DBG_error, "%s: failed to allocate memory for shading fixup\n",__FUNCTION__);
|
||||
return SANE_STATUS_NO_MEM;
|
||||
}
|
||||
src=0;
|
||||
dst=0;
|
||||
while(src<length/2)
|
||||
{
|
||||
fixup[dst]=shading[src];
|
||||
if((dst%256)==252)
|
||||
dst+=4;
|
||||
dst++;
|
||||
src++;
|
||||
}
|
||||
free(shading_data);
|
||||
shading_data=fixup;
|
||||
length = ((length*256)/252+512);
|
||||
break;
|
||||
case CIS_CANONLIDE100:
|
||||
case CIS_CANONLIDE200:
|
||||
/* we are using SHDAREA, and AVEENB is disabled */
|
||||
|
@ -4452,6 +4495,7 @@ genesys_warmup_lamp (Genesys_Device * dev)
|
|||
do
|
||||
{
|
||||
sanei_genesys_test_buffer_empty (dev, &empty);
|
||||
usleep (100 * 1000);
|
||||
}
|
||||
while (empty);
|
||||
RIE (sanei_genesys_read_data_from_scanner
|
||||
|
@ -4477,13 +4521,13 @@ genesys_warmup_lamp (Genesys_Device * dev)
|
|||
}
|
||||
if (dev->model->cmd_set->get_bitset_bit (dev->reg))
|
||||
{
|
||||
first_average /= pixel;
|
||||
second_average /= pixel;
|
||||
difference = abs (first_average - second_average);
|
||||
DBG (DBG_info,
|
||||
"genesys_warmup_lamp: average = %.2f, diff = %.3f\n",
|
||||
100 * ((second_average) / (256 * 256)),
|
||||
100 * (difference / second_average));
|
||||
first_average /= pixel;
|
||||
second_average /= pixel;
|
||||
difference = abs (first_average - second_average);
|
||||
|
||||
if (second_average > (100 * 256)
|
||||
&& (difference / second_average) < 0.002)
|
||||
|
@ -4508,7 +4552,7 @@ genesys_warmup_lamp (Genesys_Device * dev)
|
|||
"genesys_warmup_lamp: average 1 = %.2f %%, average 2 = %.2f %%\n",
|
||||
first_average, second_average);
|
||||
if (abs (first_average - second_average) < 15
|
||||
&& second_average > 120)
|
||||
&& second_average > 55)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5756,7 +5800,8 @@ calc_parameters (Genesys_Scanner * s)
|
|||
((br_x - tl_x) * s->dev->settings.xres) / MM_PER_INCH;
|
||||
|
||||
/* we need an even number of pixels for even/odd handling */
|
||||
if (s->dev->model->flags & GENESYS_FLAG_ODD_EVEN_CIS)
|
||||
if (s->dev->model->flags & GENESYS_FLAG_ODD_EVEN_CIS
|
||||
|| s->dev->model->asic_type == GENESYS_GL843)
|
||||
{
|
||||
s->params.pixels_per_line = (s->params.pixels_per_line/2)*2;
|
||||
}
|
||||
|
@ -6363,6 +6408,14 @@ init_options (Genesys_Scanner * s)
|
|||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
static SANE_Bool present;
|
||||
static SANE_Status
|
||||
check_present (SANE_String_Const devname)
|
||||
{
|
||||
present=SANE_TRUE;
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
||||
static SANE_Status
|
||||
attach (SANE_String_Const devname, Genesys_Device ** devp, SANE_Bool may_wait)
|
||||
{
|
||||
|
@ -6417,6 +6470,20 @@ attach (SANE_String_Const devname, Genesys_Device ** devp, SANE_Bool may_wait)
|
|||
return status;
|
||||
}
|
||||
|
||||
/* KV-SS080 is an auxiliary device which requires a master device to be here */
|
||||
if(vendor == 0x04da && product == 0x100f)
|
||||
{
|
||||
present=SANE_FALSE;
|
||||
sanei_usb_find_devices (vendor, 0x1006, check_present);
|
||||
sanei_usb_find_devices (vendor, 0x1007, check_present);
|
||||
sanei_usb_find_devices (vendor, 0x1010, check_present);
|
||||
if(present==SANE_FALSE)
|
||||
{
|
||||
DBG (DBG_error,"attach: master device not present\n");
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_SCANNERS && genesys_usb_device_list[i].model != 0; i++)
|
||||
{
|
||||
if (vendor == genesys_usb_device_list[i].vendor &&
|
||||
|
@ -7023,7 +7090,9 @@ sane_close (SANE_Handle handle)
|
|||
|
||||
/* we need this to avoid ASIC getting stuck
|
||||
* in bulk writes */
|
||||
sanei_usb_reset (s->dev->dn);
|
||||
if(s->dev->model->asic_type==GENESYS_GL847
|
||||
||s->dev->model->asic_type==GENESYS_GL843)
|
||||
sanei_usb_reset (s->dev->dn);
|
||||
|
||||
sanei_usb_close (s->dev->dn);
|
||||
free (s);
|
||||
|
|
|
@ -80,3 +80,9 @@ usb 0x04a7 0x0229
|
|||
|
||||
# Xerox Travel Scanner 100
|
||||
usb 0x04a7 0x04ac
|
||||
|
||||
# Panasonic KV-SS080
|
||||
usb 0x04da 0x100f
|
||||
|
||||
# Hewlett Packard ScanJet G4050
|
||||
usb 0x03f0 0x4605
|
||||
|
|
|
@ -145,7 +145,23 @@ static Genesys_Frontend Wolfson[] = {
|
|||
, {0x32, 0x04, 0x00}
|
||||
, {0x00, 0x00, 0x00}
|
||||
}
|
||||
,
|
||||
, /* KV-SS080 */
|
||||
{DAC_KVSS080,
|
||||
{0x00, 0x23, 0x24, 0x0f}
|
||||
, {0x00, 0x00, 0x00}
|
||||
, {0x80, 0x80, 0x80}
|
||||
, {0x4b, 0x4b, 0x4b}
|
||||
, {0x00,0x00,0x00}
|
||||
}
|
||||
,
|
||||
{DAC_G4050,
|
||||
{0x00, 0x23, 0x24, 0x1f}
|
||||
, {0x00, 0x00, 0x00}
|
||||
, {0x45, 0x45, 0x45} /* 0x20, 0x21, 0x22 */
|
||||
, {0x4b, 0x4b, 0x4b} /* 0x28, 0x29, 0x2a */
|
||||
, {0x00,0x00,0x00}
|
||||
}
|
||||
,
|
||||
};
|
||||
|
||||
|
||||
|
@ -452,7 +468,40 @@ static Genesys_Sensor Sensor[] = {
|
|||
1.0, 1.0, 1.0,
|
||||
NULL, NULL, NULL}
|
||||
,
|
||||
|
||||
{CCD_KVSS080,
|
||||
600,
|
||||
38, /* black pixels on left */
|
||||
38, /* 36 dummy pixels */
|
||||
152,
|
||||
5200, /* 5100 */
|
||||
160, /* TAU white ref */
|
||||
160, /* gain white ref */
|
||||
/* 08 09 0a 0b */
|
||||
{0x00, 0x00, 0x00, 0x6a} ,
|
||||
/* 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d */
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x1c, 0x01, 0x2a, 0x2c, 0x00, 0x20, 0x04} , /* 18=00 at 600 dpi */
|
||||
/* 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e */
|
||||
{0x0c, 0x0f, 0x00, 0x03, 0x06, 0x09, 0x6b, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x23} ,
|
||||
1.0, 1.0, 1.0,
|
||||
NULL, NULL, NULL}
|
||||
,
|
||||
{CCD_G4050,
|
||||
600, /* XXX STEF XXX 4800 */
|
||||
48,
|
||||
28,
|
||||
152,
|
||||
2698*2, /* XXX STEF XXX 42574 */
|
||||
210,
|
||||
230,
|
||||
/* 08 09 0a 0b */
|
||||
{0x00, 0x00, 0x18, 0x69} ,
|
||||
/* 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d */
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x01, 0x2a, 0x30, 0x00, 0x00, 0x08} ,
|
||||
/* 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e */
|
||||
{0x0e, 0x11, 0x02, 0x05, 0x08, 0x0b, 0x6b, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x6f} ,
|
||||
1.0, 1.0, 1.0,
|
||||
NULL, NULL, NULL}
|
||||
,
|
||||
};
|
||||
|
||||
/** for General Purpose Output specific settings:
|
||||
|
@ -553,11 +602,19 @@ static Genesys_Gpo Gpo[] = {
|
|||
,
|
||||
/* CANONLIDE200 */
|
||||
{GPO_CANONLIDE200,
|
||||
{0xfb, 0x20} /* 0xfb when idle , 0xf9/0xe9 (1200) when scanning */
|
||||
,
|
||||
{0xff, 0x00}
|
||||
,
|
||||
}
|
||||
{0xfb, 0x20}, /* 0xfb when idle , 0xf9/0xe9 (1200) when scanning */
|
||||
{0xff, 0x00},
|
||||
}
|
||||
,
|
||||
{GPO_KVSS080,
|
||||
{0xf5, 0x20},
|
||||
{0x7e, 0xa1},
|
||||
}
|
||||
,
|
||||
{GPO_G4050,
|
||||
{0x20, 0x00},
|
||||
{0xfc, 0x00},
|
||||
}
|
||||
,
|
||||
};
|
||||
|
||||
|
@ -805,6 +862,31 @@ static Genesys_Motor Motor[] = {
|
|||
},
|
||||
},
|
||||
},
|
||||
{MOTOR_KVSS080,
|
||||
1200,
|
||||
1200,
|
||||
2,
|
||||
1,
|
||||
{ /* motor slopes */
|
||||
{ /* power mode 0 */
|
||||
{ 22222, 500, 246, 0.5 }, /* max speed / dpi * base dpi => exposure */
|
||||
{ 22222, 500, 246, 0.5 },
|
||||
{ 22222, 500, 246, 0.5 },
|
||||
},
|
||||
},
|
||||
},
|
||||
{MOTOR_G4050,
|
||||
1200, 2400,
|
||||
2,
|
||||
1,
|
||||
{ /* motor slopes */
|
||||
{ /* power mode 0 */
|
||||
{ 3961, 240, 95, 0.8 }, /* full step */
|
||||
{ 3961, 240, 95, 0.8 }, /* half step */
|
||||
{ 3961, 240, 95, 0.8 }, /* quarter step */
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/* here we have the various device settings...
|
||||
|
@ -914,6 +996,110 @@ static Genesys_Model canon_lide_50_model = {
|
|||
400
|
||||
};
|
||||
|
||||
static Genesys_Model panasonic_kvss080_model = {
|
||||
"panasonic-kv-ss080", /* Name */
|
||||
"Panasonic", /* Device vendor string */
|
||||
"KS-SS080", /* Device model name */
|
||||
GENESYS_GL843,
|
||||
NULL,
|
||||
|
||||
{ 600, 300, 200, 150, 100, 75, 0}, /* possible x-resolutions */
|
||||
{ 600, 300, 200, 150, 100, 75, 0}, /* possible y-resolutions */
|
||||
{16, 8, 0}, /* possible depths in gray mode */
|
||||
{16, 8, 0}, /* possible depths in color mode */
|
||||
|
||||
SANE_FIX (7.6), /* Start of scan area in mm (x) */
|
||||
SANE_FIX (12.5), /* Start of scan area in mm (y) */
|
||||
SANE_FIX (218.5), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (297.0), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (9.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
|
||||
SANE_FIX (0.0), /* Size of scan area in TA mode in mm (x) */
|
||||
SANE_FIX (0.0), /* Size of scan area in TA mode in mm (y) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */
|
||||
|
||||
SANE_FIX (0.0), /* Size of scan area after paper sensor stops
|
||||
sensing document in mm */
|
||||
SANE_FIX (0.0), /* Amount of feeding needed to eject document
|
||||
after finishing scanning in mm */
|
||||
|
||||
0, 4, 8, /* RGB CCD Line-distance correction in pixel */
|
||||
|
||||
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
|
||||
|
||||
SANE_FALSE, /* Is this a CIS scanner? */
|
||||
SANE_FALSE, /* Is this a sheetfed scanner? */
|
||||
CCD_KVSS080,
|
||||
DAC_KVSS080,
|
||||
GPO_KVSS080,
|
||||
MOTOR_KVSS080,
|
||||
GENESYS_FLAG_LAZY_INIT |
|
||||
GENESYS_FLAG_SKIP_WARMUP |
|
||||
/* GENESYS_FLAG_NO_CALIBRATION | */
|
||||
/* GENESYS_FLAG_DARK_CALIBRATION | */
|
||||
GENESYS_FLAG_OFFSET_CALIBRATION |
|
||||
GENESYS_FLAG_CUSTOM_GAMMA,
|
||||
GENESYS_HAS_SCAN_SW ,
|
||||
100,
|
||||
100
|
||||
};
|
||||
|
||||
static Genesys_Model hpg4050_model = {
|
||||
"hewlett-packard-scanjet-g4050", /* Name */
|
||||
"Hewlett Packard", /* Device vendor string */
|
||||
"ScanJet G4050", /* Device model name */
|
||||
GENESYS_GL843,
|
||||
NULL,
|
||||
|
||||
{ 600, 300, 200, 150, 75, 0}, /* possible x-resolutions */
|
||||
{ 600, 300, 200, 150, 75, 0}, /* possible y-resolutions */
|
||||
{16, 8, 0}, /* possible depths in gray mode */
|
||||
{16, 8, 0}, /* possible depths in color mode */
|
||||
|
||||
SANE_FIX (0.42), /* Start of scan area in mm (x) */
|
||||
SANE_FIX (7.9), /* Start of scan area in mm (y) */
|
||||
SANE_FIX (218.0), /* Size of scan area in mm (x) */
|
||||
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
||||
|
||||
SANE_FIX (3.0), /* Start of white strip in mm (y) */
|
||||
SANE_FIX (0.0), /* Start of black mark in mm (x) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
|
||||
SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
|
||||
SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
|
||||
SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */
|
||||
|
||||
SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */
|
||||
|
||||
SANE_FIX (0.0), /* Size of scan area after paper sensor stops
|
||||
sensing document in mm */
|
||||
SANE_FIX (0.0), /* Amount of feeding needed to eject document
|
||||
after finishing scanning in mm */
|
||||
|
||||
0, 32, 48, /* RGB CCD Line-distance correction in pixel */
|
||||
|
||||
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
|
||||
|
||||
SANE_FALSE, /* Is this a CIS scanner? */
|
||||
SANE_FALSE, /* Is this a sheetfed scanner? */
|
||||
CCD_G4050,
|
||||
DAC_G4050,
|
||||
GPO_G4050,
|
||||
MOTOR_G4050,
|
||||
GENESYS_FLAG_LAZY_INIT | /* Which flags are needed for this scanner? */
|
||||
GENESYS_FLAG_SKIP_WARMUP |
|
||||
GENESYS_FLAG_NO_CALIBRATION |
|
||||
GENESYS_FLAG_CUSTOM_GAMMA,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW,
|
||||
280,
|
||||
400
|
||||
};
|
||||
|
||||
|
||||
static Genesys_Model canon_lide_100_model = {
|
||||
"canon-lide-100", /* Name */
|
||||
|
@ -2163,5 +2349,8 @@ static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
|
|||
{0x04a9, 0x1904, &canon_lide_100_model},
|
||||
{0x04a9, 0x1905, &canon_lide_200_model},
|
||||
{0x04a9, 0x1906, &canon_5600f_model},
|
||||
/* GL843 devices */
|
||||
{0x04da, 0x100f, &panasonic_kvss080_model},
|
||||
{0x03f0, 0x4605, &hpg4050_model},
|
||||
{0, 0, NULL}
|
||||
};
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,513 @@
|
|||
/* sane - Scanner Access Now Easy.
|
||||
|
||||
Copyright (C) 2010 Stéphane Voltz <stef.dev@free.fr>
|
||||
|
||||
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.
|
||||
*/
|
||||
#include "../include/sane/config.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "../include/sane/sane.h"
|
||||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
||||
#ifndef HACK
|
||||
#undef BACKEND_NAME
|
||||
#define BACKEND_NAME genesys_gl843
|
||||
#endif
|
||||
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
#include "../include/sane/sanei_usb.h"
|
||||
|
||||
#include "../include/_stdint.h"
|
||||
#include "genesys.h"
|
||||
|
||||
#define DBGSTART DBG (DBG_proc, "%s start\n", __FUNCTION__);
|
||||
#define DBGCOMPLETED DBG (DBG_proc, "%s completed\n", __FUNCTION__);
|
||||
|
||||
#define REG01 0x01
|
||||
#define REG01_CISSET 0x80
|
||||
#define REG01_DOGENB 0x40
|
||||
#define REG01_DVDSET 0x20
|
||||
#define REG01_STAGGER 0x10
|
||||
#define REG01_COMPENB 0x08
|
||||
#define REG01_TRUEGRAY 0x04
|
||||
#define REG01_SHDAREA 0x02
|
||||
#define REG01_SCAN 0x01
|
||||
|
||||
#define REG02 0x02
|
||||
#define REG02_NOTHOME 0x80
|
||||
#define REG02_ACDCDIS 0x40
|
||||
#define REG02_AGOHOME 0x20
|
||||
#define REG02_MTRPWR 0x10
|
||||
#define REG02_FASTFED 0x08
|
||||
#define REG02_MTRREV 0x04
|
||||
#define REG02_HOMENEG 0x02
|
||||
#define REG02_LONGCURV 0x01
|
||||
|
||||
#define REG03 0x03
|
||||
#define REG03_LAMPDOG 0x80
|
||||
#define REG03_AVEENB 0x40
|
||||
#define REG03_XPASEL 0x20
|
||||
#define REG03_LAMPPWR 0x10
|
||||
#define REG03_LAMPTIM 0x0f
|
||||
|
||||
#define REG04 0x04
|
||||
#define REG04_LINEART 0x80
|
||||
#define REG04_BITSET 0x40
|
||||
#define REG04_AFEMOD 0x30
|
||||
#define REG04_FILTER 0x0c
|
||||
#define REG04_FESET 0x03
|
||||
|
||||
#define REG04S_AFEMOD 4
|
||||
|
||||
#define REG05 0x05
|
||||
#define REG05_DPIHW 0xc0
|
||||
#define REG05_DPIHW_600 0x00
|
||||
#define REG05_DPIHW_1200 0x40
|
||||
#define REG05_DPIHW_2400 0x80
|
||||
#define REG05_DPIHW_4800 0xc0
|
||||
#define REG05_MTLLAMP 0x30
|
||||
#define REG05_GMMENB 0x08
|
||||
#define REG05_MTLBASE 0x03
|
||||
|
||||
#define REG06 0x06
|
||||
#define REG06_SCANMOD 0xe0
|
||||
#define REG06S_SCANMOD 5
|
||||
#define REG06_PWRBIT 0x10
|
||||
#define REG06_GAIN4 0x08
|
||||
#define REG06_OPTEST 0x07
|
||||
|
||||
#define REG07_LAMPSIM 0x80
|
||||
|
||||
#define REG08_DECFLAG 0x40
|
||||
#define REG08_GMMFFR 0x20
|
||||
#define REG08_GMMFFG 0x10
|
||||
#define REG08_GMMFFB 0x08
|
||||
#define REG08_GMMZR 0x04
|
||||
#define REG08_GMMZG 0x02
|
||||
#define REG08_GMMZB 0x01
|
||||
|
||||
#define REG09_MCNTSET 0xc0
|
||||
#define REG09_EVEN1ST 0x20
|
||||
#define REG09_BLINE1ST 0x10
|
||||
#define REG09_BACKSCAN 0x08
|
||||
#define REG09_ENHANCE 0x04
|
||||
#define REG09_SHORTTG 0x02
|
||||
#define REG09_NWAIT 0x01
|
||||
|
||||
#define REG09S_MCNTSET 6
|
||||
#define REG09S_CLKSET 4
|
||||
|
||||
#define REG0B 0x0b
|
||||
#define REG0B_DRAMSEL 0x07
|
||||
#define REG0B_ENBDRAM 0x08
|
||||
#define REG0B_ENBDRAM 0x08
|
||||
#define REG0B_RFHDIS 0x10
|
||||
#define REG0B_CLKSET 0xe0
|
||||
#define REG0B_24MHZ 0x00
|
||||
#define REG0B_30MHZ 0x20
|
||||
#define REG0B_40MHZ 0x40
|
||||
#define REG0B_48MHZ 0x60
|
||||
#define REG0B_60MHZ 0x80
|
||||
|
||||
#define REG0D 0x0d
|
||||
#define REG0D_JAMPCMD 0x80
|
||||
#define REG0D_DOCCMD 0x40
|
||||
#define REG0D_CCDCMD 0x20
|
||||
#define REG0D_FULLSTP 0x10
|
||||
#define REG0D_SEND 0x08
|
||||
#define REG0D_CLRMCNT 0x04
|
||||
#define REG0D_CLRDOCJM 0x02
|
||||
#define REG0D_CLRLNCNT 0x01
|
||||
|
||||
#define REG0F 0x0f
|
||||
|
||||
#define REG16_CTRLHI 0x80
|
||||
#define REG16_TOSHIBA 0x40
|
||||
#define REG16_TGINV 0x20
|
||||
#define REG16_CK1INV 0x10
|
||||
#define REG16_CK2INV 0x08
|
||||
#define REG16_CTRLINV 0x04
|
||||
#define REG16_CKDIS 0x02
|
||||
#define REG16_CTRLDIS 0x01
|
||||
|
||||
#define REG17_TGMODE 0xc0
|
||||
#define REG17_TGMODE_NO_DUMMY 0x00
|
||||
#define REG17_TGMODE_REF 0x40
|
||||
#define REG17_TGMODE_XPA 0x80
|
||||
#define REG17_TGW 0x3f
|
||||
#define REG17S_TGW 0
|
||||
|
||||
#define REG18 0x18
|
||||
#define REG18_CNSET 0x80
|
||||
#define REG18_DCKSEL 0x60
|
||||
#define REG18_CKTOGGLE 0x10
|
||||
#define REG18_CKDELAY 0x0c
|
||||
#define REG18_CKSEL 0x03
|
||||
|
||||
#define REG1A_TGLSW2 0x80
|
||||
#define REG1A_TGLSW1 0x40
|
||||
#define REG1A_MANUAL3 0x02
|
||||
#define REG1A_MANUAL1 0x01
|
||||
#define REG1A_CK4INV 0x08
|
||||
#define REG1A_CK3INV 0x04
|
||||
#define REG1A_LINECLP 0x02
|
||||
|
||||
#define REG1C_TGTIME 0x07
|
||||
|
||||
#define REG1D_CK4LOW 0x80
|
||||
#define REG1D_CK3LOW 0x40
|
||||
#define REG1D_CK1LOW 0x20
|
||||
#define REG1D_TGSHLD 0x1f
|
||||
#define REG1DS_TGSHLD 0
|
||||
|
||||
|
||||
#define REG1E 0x1e
|
||||
#define REG1E_WDTIME 0xf0
|
||||
#define REG1ES_WDTIME 4
|
||||
#define REG1E_LINESEL 0x0f
|
||||
#define REG1ES_LINESEL 0
|
||||
|
||||
#define REG21 0x21
|
||||
|
||||
#define REG29 0x29
|
||||
#define REG2A 0x2a
|
||||
#define REG2B 0x2b
|
||||
|
||||
#define REG40 0x40
|
||||
#define REG40_DOCSNR 0x80
|
||||
#define REG40_ADFSNR 0x40
|
||||
#define REG40_COVERSNR 0x20
|
||||
#define REG40_CHKVER 0x10
|
||||
#define REG40_DOCJAM 0x08
|
||||
#define REG40_HISPDFLG 0x04
|
||||
#define REG40_MOTMFLG 0x02
|
||||
#define REG40_DATAENB 0x01
|
||||
|
||||
#define REG41_PWRBIT 0x80
|
||||
#define REG41_BUFEMPTY 0x40
|
||||
#define REG41_FEEDFSH 0x20
|
||||
#define REG41_SCANFSH 0x10
|
||||
#define REG41_HOMESNR 0x08
|
||||
#define REG41_LAMPSTS 0x04
|
||||
#define REG41_FEBUSY 0x02
|
||||
#define REG41_MOTORENB 0x01
|
||||
|
||||
#define REG58_VSMP 0xf8
|
||||
#define REG58S_VSMP 3
|
||||
#define REG58_VSMPW 0x07
|
||||
#define REG58S_VSMPW 0
|
||||
|
||||
#define REG59_BSMP 0xf8
|
||||
#define REG59S_BSMP 3
|
||||
#define REG59_BSMPW 0x07
|
||||
#define REG59S_BSMPW 0
|
||||
|
||||
#define REG5A_ADCLKINV 0x80
|
||||
#define REG5A_RLCSEL 0x40
|
||||
#define REG5A_CDSREF 0x30
|
||||
#define REG5AS_CDSREF 4
|
||||
#define REG5A_RLC 0x0f
|
||||
#define REG5AS_RLC 0
|
||||
|
||||
#define REG5E 0x5e
|
||||
#define REG5E_DECSEL 0xe0
|
||||
#define REG5ES_DECSEL 5
|
||||
#define REG5E_STOPTIM 0x1f
|
||||
#define REG5ES_STOPTIM 0
|
||||
|
||||
#define REG5F 0x5f
|
||||
|
||||
#define REG60 0x60
|
||||
#define REG60_Z1MOD 0x1f
|
||||
#define REG61 0x61
|
||||
#define REG61_Z1MOD 0xff
|
||||
#define REG62 0x62
|
||||
#define REG62_Z1MOD 0xff
|
||||
|
||||
#define REG63 0x63
|
||||
#define REG63_Z2MOD 0x1f
|
||||
#define REG64 0x64
|
||||
#define REG64_Z2MOD 0xff
|
||||
#define REG65 0x65
|
||||
#define REG65_Z2MOD 0xff
|
||||
|
||||
#define REG67 0x67
|
||||
|
||||
#define REG68 0x68
|
||||
|
||||
#define REG67S_STEPSEL 6
|
||||
#define REG67_STEPSEL 0xc0
|
||||
#define REG67_FULLSTEP 0x00
|
||||
#define REG67_HALFSTEP 0x20
|
||||
#define REG67_EIGHTHSTEP 0x60
|
||||
#define REG67_16THSTEP 0x80
|
||||
|
||||
#define REG68S_FSTPSEL 6
|
||||
#define REG68_FSTPSEL 0xc0
|
||||
#define REG68_FULLSTEP 0x00
|
||||
#define REG68_HALFSTEP 0x20
|
||||
#define REG68_EIGHTHSTEP 0x60
|
||||
#define REG68_16THSTEP 0x80
|
||||
|
||||
#define REG69 0x69
|
||||
#define REG6A 0x6a
|
||||
|
||||
#define REG6B 0x6b
|
||||
#define REG6B_MULTFILM 0x80
|
||||
#define REG6B_GPOM13 0x40
|
||||
#define REG6B_GPOM12 0x20
|
||||
#define REG6B_GPOM11 0x10
|
||||
#define REG6B_GPO18 0x02
|
||||
#define REG6B_GPO17 0x01
|
||||
|
||||
#define REG6C 0x6c
|
||||
#define REG6C_GPIO16 0x80
|
||||
#define REG6C_GPIO15 0x40
|
||||
#define REG6C_GPIO14 0x20
|
||||
#define REG6C_GPIO13 0x10
|
||||
#define REG6C_GPIO12 0x08
|
||||
#define REG6C_GPIO11 0x04
|
||||
#define REG6C_GPIO10 0x02
|
||||
#define REG6C_GPIO9 0x01
|
||||
#define REG6C_GPIOH 0xff
|
||||
#define REG6C_GPIOL 0xff
|
||||
|
||||
#define REG6D 0x6d
|
||||
#define REG6E 0x6e
|
||||
#define REG6F 0x6f
|
||||
|
||||
#define REG9D 0x9d
|
||||
#define REG9DS_STEPTIM 2
|
||||
|
||||
#define REG87_LEDADD 0x04
|
||||
|
||||
#define REGA6 0xa6
|
||||
#define REGA7 0xa7
|
||||
#define REGA9 0xa9
|
||||
|
||||
#define SCAN_TABLE 0 /* table 1 at 0x4000 */
|
||||
#define BACKTRACK_TABLE 1 /* table 2 at 0x4800 */
|
||||
#define STOP_TABLE 2 /* table 3 at 0x5000 */
|
||||
#define FAST_TABLE 3 /* table 4 at 0x5800 */
|
||||
#define HOME_TABLE 4 /* table 5 at 0x6000 */
|
||||
|
||||
#define SCAN_FLAG_SINGLE_LINE 0x001
|
||||
#define SCAN_FLAG_DISABLE_SHADING 0x002
|
||||
#define SCAN_FLAG_DISABLE_GAMMA 0x004
|
||||
#define SCAN_FLAG_DISABLE_BUFFER_FULL_MOVE 0x008
|
||||
#define SCAN_FLAG_IGNORE_LINE_DISTANCE 0x010
|
||||
#define SCAN_FLAG_USE_OPTICAL_RES 0x020
|
||||
#define SCAN_FLAG_DISABLE_LAMP 0x040
|
||||
#define SCAN_FLAG_DYNAMIC_LINEART 0x080
|
||||
|
||||
/**
|
||||
* writable scanner registers */
|
||||
enum
|
||||
{
|
||||
reg_0x01 = 0,
|
||||
reg_0x02,
|
||||
reg_0x03,
|
||||
reg_0x04,
|
||||
reg_0x05,
|
||||
reg_0x06,
|
||||
reg_0x08,
|
||||
reg_0x09,
|
||||
reg_0x0a,
|
||||
reg_0x0b,
|
||||
reg_0x0c,
|
||||
reg_0x0f,
|
||||
reg_0x10,
|
||||
reg_0x11,
|
||||
reg_0x12,
|
||||
reg_0x13,
|
||||
reg_0x14,
|
||||
reg_0x15,
|
||||
reg_0x16,
|
||||
reg_0x17,
|
||||
reg_0x18,
|
||||
reg_0x19,
|
||||
reg_0x1a,
|
||||
reg_0x1b,
|
||||
reg_0x1c,
|
||||
reg_0x1d,
|
||||
reg_0x1e,
|
||||
reg_0x1f,
|
||||
reg_0x20,
|
||||
reg_0x21,
|
||||
reg_0x22,
|
||||
reg_0x23,
|
||||
reg_0x24,
|
||||
reg_0x25,
|
||||
reg_0x26,
|
||||
reg_0x27,
|
||||
reg_0x28,
|
||||
reg_0x2c,
|
||||
reg_0x2d,
|
||||
reg_0x2e,
|
||||
reg_0x2f,
|
||||
reg_0x30,
|
||||
reg_0x31,
|
||||
reg_0x32,
|
||||
reg_0x33,
|
||||
reg_0x34,
|
||||
reg_0x35,
|
||||
reg_0x36,
|
||||
reg_0x37,
|
||||
reg_0x38,
|
||||
reg_0x39,
|
||||
reg_0x3a,
|
||||
reg_0x3b,
|
||||
reg_0x3c,
|
||||
reg_0x3d,
|
||||
reg_0x3e,
|
||||
reg_0x3f,
|
||||
reg_0x51,
|
||||
reg_0x52,
|
||||
reg_0x53,
|
||||
reg_0x54,
|
||||
reg_0x55,
|
||||
reg_0x56,
|
||||
reg_0x57,
|
||||
reg_0x58,
|
||||
reg_0x59,
|
||||
reg_0x5a,
|
||||
reg_0x5d,
|
||||
reg_0x5e,
|
||||
reg_0x5f,
|
||||
reg_0x60,
|
||||
reg_0x61,
|
||||
reg_0x62,
|
||||
reg_0x63,
|
||||
reg_0x64,
|
||||
reg_0x65,
|
||||
reg_0x67,
|
||||
reg_0x68,
|
||||
reg_0x69,
|
||||
reg_0x6a,
|
||||
reg_0x6b,
|
||||
reg_0x70,
|
||||
reg_0x71,
|
||||
reg_0x72,
|
||||
reg_0x73,
|
||||
reg_0x74,
|
||||
reg_0x75,
|
||||
reg_0x76,
|
||||
reg_0x77,
|
||||
reg_0x78,
|
||||
reg_0x79,
|
||||
reg_0x7a,
|
||||
reg_0x7b,
|
||||
reg_0x7c,
|
||||
reg_0x7d,
|
||||
reg_0x7e,
|
||||
reg_0x7f,
|
||||
reg_0x80,
|
||||
reg_0x81,
|
||||
reg_0x82,
|
||||
reg_0x83,
|
||||
reg_0x84,
|
||||
reg_0x85,
|
||||
reg_0x86,
|
||||
reg_0x87,
|
||||
reg_0x88,
|
||||
reg_0x89,
|
||||
reg_0x8a,
|
||||
reg_0x8b,
|
||||
reg_0x8c,
|
||||
reg_0x8d,
|
||||
reg_0x8e,
|
||||
reg_0x8f,
|
||||
reg_0x90,
|
||||
reg_0x91,
|
||||
reg_0x92,
|
||||
reg_0x93,
|
||||
reg_0x94,
|
||||
reg_0x95,
|
||||
reg_0x96,
|
||||
reg_0x97,
|
||||
reg_0x98,
|
||||
reg_0x99,
|
||||
reg_0x9a,
|
||||
reg_0x9b,
|
||||
reg_0x9c,
|
||||
reg_0x9d,
|
||||
reg_0xa0,
|
||||
reg_0xa1,
|
||||
reg_0xa2,
|
||||
reg_0xa3,
|
||||
reg_0xa4,
|
||||
reg_0xa5,
|
||||
reg_0xab,
|
||||
reg_0xac,
|
||||
reg_0xad,
|
||||
reg_0xae,
|
||||
reg_0xaf,
|
||||
GENESYS_GL843_MAX_REGS
|
||||
};
|
||||
|
||||
#define SETREG(adr,val) {dev->reg[reg_##adr].address=adr;dev->reg[reg_##adr].value=val;}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ra6;
|
||||
uint8_t ra7;
|
||||
uint8_t ra8;
|
||||
uint8_t ra9;
|
||||
} Gpio_layout;
|
||||
|
||||
static Gpio_layout gpios[]={
|
||||
/* G4050 */
|
||||
{
|
||||
0x08, 0x1e, 0x3e, 0x06
|
||||
},
|
||||
/* KV-SS080 */
|
||||
{
|
||||
0x06, 0x0f, 0x00, 0x08
|
||||
}
|
||||
};
|
||||
|
||||
static uint16_t kvss080_profile[]={44444, 34188, 32520, 29630, 26666, 24242, 22222, 19048, 16666, 15686, 14814, 14034, 12402, 11110, 8888, 7618, 6666, 5926, 5228, 4678, 4172, 3682, 3336, 3074, 2866, 2702, 2566, 2450, 2352, 2266, 2188, 2118, 2056, 2002, 1950, 1904, 1860, 1820, 1784, 1748, 1716, 1684, 1656, 1628, 1600, 1576, 1552, 1528, 1506, 1486, 1466, 1446, 1428, 1410, 1394, 1376, 1360, 1346, 1330, 1316, 1302, 1288, 1276, 1264, 1250, 1238, 1228, 1216, 1206, 1194, 1184, 1174, 1164, 1154, 1146, 1136, 1128, 1120, 1110, 1102, 1094, 1088, 1080, 1072, 1064, 1058, 1050, 1044, 1038, 1030, 1024, 1018, 1012, 1006, 1000, 994, 988, 984, 978, 972, 968, 962, 958, 952, 948, 942, 938, 934, 928, 924, 920, 916, 912, 908, 904, 900, 896, 892, 888, 884, 882, 878, 874, 870, 868, 864, 860, 858, 854, 850, 848, 844, 842, 838, 836, 832, 830, 826, 824, 822, 820, 816, 814, 812, 808, 806, 804, 802, 800, 796, 794, 792, 790, 788, 786, 784, 782, 778, 776, 774, 772, 770, 768, 766, 764, 762, 760, 758, 756, 754, 752, 750, 750, 748, 746, 744, 742, 740, 738, 736, 734, 734, 732, 730, 728, 726, 724, 724, 722, 720, 718, 716, 716, 714, 712, 710, 710, 708, 706, 704, 704, 702, 700, 698, 698, 696, 694, 694, 692, 690, 690, 688, 686, 686, 684, 682, 682, 680, 678, 678, 676, 674, 674, 672, 672, 670, 668, 668, 666, 666, 664, 662, 662, 660, 660, 658, 656, 656, 654, 654, 652, 652, 650, 650, 648, 646, 646, 644, 644, 642, 642, 640, 640, 638, 638, 636, 636, 636, 634, 634, 632, 632, 630, 630, 628, 628, 626, 626, 624, 624, 624, 622, 622, 620, 620, 618, 618, 618, 616, 616, 614, 614, 612, 612, 612, 610, 610, 608, 608, 608, 606, 606, 606, 604, 604, 602, 602, 602, 600, 600, 600, 598, 598, 596, 596, 596, 594, 594, 594, 592, 592, 592, 590, 590, 590, 588, 588, 588, 586, 586, 586, 584, 584, 584, 582, 582, 582, 590, 590, 590, 588, 588, 588, 586, 586, 586, 584, 584, 584, 582, 582, 582, 580, 580, 580, 578, 578, 578, 576, 576, 576, 576, 574, 574, 574, 572, 572, 572, 570, 570, 570, 568, 568, 568, 568, 566, 566, 566, 564, 564, 564, 562, 562, 562, 562, 560, 560, 560, 558, 558, 558, 558, 556, 556, 556, 554, 554, 554, 552, 552, 552, 552, 550, 550, 550, 548, 548, 548, 548, 546, 546, 546, 546, 544, 544, 544, 542, 542, 542, 542, 540, 540, 540, 538, 538, 538, 538, 536, 536, 536, 536, 534, 534, 534, 534, 532, 532, 532, 530, 530, 530, 530, 528, 528, 528, 528, 526, 526, 526, 526, 524, 524, 524, 524, 522, 522, 522, 522, 520, 520, 520, 520, 518, 518, 518, 516, 516, 516, 516, 514, 514, 514, 514, 514, 512, 512, 512, 512, 510, 510, 510, 510, 508, 508, 508, 508, 506, 506, 506, 506, 504, 504, 504, 504, 502, 502, 502, 502, 500, 500, 500, 500};
|
|
@ -130,7 +130,6 @@
|
|||
|
||||
/* todo: used?
|
||||
#define VALUE_READ_STATUS 0x86
|
||||
#define VALUE_BUF_ENDACCESS 0x8C
|
||||
*/
|
||||
|
||||
/* Read/write bulk data/registers */
|
||||
|
@ -243,6 +242,7 @@ Genesys_Color_Order;
|
|||
|
||||
#define GENESYS_GL646 646
|
||||
#define GENESYS_GL841 841
|
||||
#define GENESYS_GL843 843
|
||||
#define GENESYS_GL846 846
|
||||
#define GENESYS_GL847 847
|
||||
#define GENESYS_GL848 848
|
||||
|
@ -261,6 +261,8 @@ Genesys_Color_Order;
|
|||
#define DAC_WOLFSON_HP3670 9
|
||||
#define DAC_WOLFSON_DSM600 10
|
||||
#define DAC_CANONLIDE200 11
|
||||
#define DAC_KVSS080 12
|
||||
#define DAC_G4050 13
|
||||
|
||||
#define CCD_UMAX 0
|
||||
#define CCD_ST12 1 /* SONY ILX548: 5340 Pixel ??? */
|
||||
|
@ -279,6 +281,8 @@ Genesys_Color_Order;
|
|||
#define CCD_DP685 14
|
||||
#define CIS_CANONLIDE200 15
|
||||
#define CIS_CANONLIDE100 16
|
||||
#define CCD_KVSS080 17
|
||||
#define CCD_G4050 18
|
||||
|
||||
#define GPO_UMAX 0
|
||||
#define GPO_ST12 1
|
||||
|
@ -293,6 +297,8 @@ Genesys_Color_Order;
|
|||
#define GPO_DP665 10
|
||||
#define GPO_DP685 11
|
||||
#define GPO_CANONLIDE200 12
|
||||
#define GPO_KVSS080 13
|
||||
#define GPO_G4050 14
|
||||
|
||||
#define MOTOR_UMAX 0
|
||||
#define MOTOR_5345 1
|
||||
|
@ -308,6 +314,8 @@ Genesys_Color_Order;
|
|||
#define MOTOR_DSMOBILE_600 12
|
||||
#define MOTOR_CANONLIDE200 13
|
||||
#define MOTOR_CANONLIDE100 14
|
||||
#define MOTOR_KVSS080 15
|
||||
#define MOTOR_G4050 16
|
||||
|
||||
|
||||
/* Forward typedefs */
|
||||
|
@ -584,6 +592,7 @@ struct Genesys_Calibration_Cache
|
|||
struct Genesys_Device
|
||||
{
|
||||
SANE_Int dn;
|
||||
SANE_Bool usb_mode;
|
||||
SANE_String file_name;
|
||||
SANE_String calib_file;
|
||||
Genesys_Model *model;
|
||||
|
@ -801,6 +810,7 @@ sanei_genesys_buffer_consume(Genesys_Buffer * buf, size_t size);
|
|||
/*---------------------------------------------------------------------------*/
|
||||
extern SANE_Status sanei_gl646_init_cmd_set (Genesys_Device * dev);
|
||||
extern SANE_Status sanei_gl841_init_cmd_set (Genesys_Device * dev);
|
||||
extern SANE_Status sanei_gl843_init_cmd_set (Genesys_Device * dev);
|
||||
extern SANE_Status sanei_gl847_init_cmd_set (Genesys_Device * dev);
|
||||
|
||||
#endif /* not GENESYS_LOW_H */
|
||||
|
|
Ładowanie…
Reference in New Issue