- add support for uncalibrated scan for Visioneer Strobe XP200

- button support for MD5345, HP2300 and XP200
merge-requests/1/head
Stéphane Voltz 2009-01-19 05:46:43 +00:00
rodzic a0cb0435bc
commit 81953325e8
8 zmienionych plików z 2454 dodań i 583 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2009-01-19 Stéphane Voltz <stef.dev@free.fr>
* backend/genesys.c backend/genesys.conf.in backend/genesys.h
backend/genesys_devices.c backend/genesys_gl646.c
backend/genesys_gl841.c backend/genesys_low.h: add support for
uncalibrated scans in all modes for Visioneer Strobe XP200. Add
support for buttons for MD5345/HP2300 and XP200
2009-01-18 m. allan noah <kitno455 a t gmail d o t com>
* doc/descriptions/unsupported.desc: everything reported from
2008-07 to 2009-01
@ -13,15 +20,6 @@
* backend/genesys_devices.c: Make half-ccd mode optional.
Reenable clock register setup from sensor struct, set SCANMOD.
2009-01-16 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
* .cvsignore, Makefile.in, aclocal.m4, config.sub, configure,
configure.in, backend/cvsignore, include/Makefile.in,
include/sane/config.h.in, INSTALL, Makefile.am, missing:
Convert top-level Makefile to be generated by automake.
"dist" target now includes m4 directory. Updated "libcheck"
target to look at dynamic libraries instead of static.
>>>>>>> 1.3429
2009-01-17 Nicolas Martin <nicols-guest at users.alioth.debian.org>
* pixma_mp150.c:
Fixed "Busy mode" exit processing.
@ -32,6 +30,14 @@
* frontend/scanimage.c: make batch mode create output files
atomically. Patch by Simon Matter <simon.matter@invoca.ch>.
2009-01-16 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
* .cvsignore, Makefile.in, aclocal.m4, config.sub, configure,
configure.in, backend/cvsignore, include/Makefile.in,
include/sane/config.h.in, INSTALL, Makefile.am, missing:
Convert top-level Makefile to be generated by automake.
"dist" target now includes m4 directory. Updated "libcheck"
target to look at dynamic libraries instead of static.
2009-01-16 Chris Bagwell <cbagwell-guest at users.alioth.debian.org>
* doc/Makefile.in, frontend/Makefile.in, include/Makefile.in,
japi/Makefile.in, lib/Makefile.in, po/Makefile.in,

Wyświetl plik

@ -52,7 +52,7 @@
#include "../include/sane/config.h"
#define BUILD 9
#define BUILD 10
#include <errno.h>
#include <string.h>
@ -493,13 +493,13 @@ genesys_dpiset (Genesys_Register_Set * reg)
* ie registers 42-43-44
*/
/*candidate for moving into chip specific files?*/
static SANE_Status
genesys_read_valid_words (Genesys_Device * dev, unsigned int *words)
SANE_Status
sanei_genesys_read_valid_words (Genesys_Device * dev, unsigned int *words)
{
SANE_Status status;
u_int8_t value;
DBG (DBG_proc, "genesys_read_valid_words\n");
DBG (DBG_proc, "sanei_genesys_read_valid_words\n");
RIE (sanei_genesys_read_register (dev, 0x44, &value));
*words = value;
@ -511,7 +511,7 @@ genesys_read_valid_words (Genesys_Device * dev, unsigned int *words)
else
*words += ((value & 0x0f) * 256 * 256);
DBG (DBG_proc, "genesys_read_valid_words: %d words\n", *words);
DBG (DBG_proc, "sanei_genesys_read_valid_words: %d words\n", *words);
return SANE_STATUS_GOOD;
}
@ -544,10 +544,9 @@ sanei_genesys_stop_motor (Genesys_Device * dev)
* This function generates a slope table using the given slope
* truncated at the given exposure time or step count, whichever comes first.
* The reached step time is then stored in final_exposure and used for the rest
* of the table. The summed time of the acerleation steps is returned, and the
* of the table. The summed time of the acceleration steps is returned, and the
* number of accerelation steps is put into used_steps.
*
* @param dev Device struct
* @param slope_table Table to write to
* @param max_step Size of slope_table in steps
* @param use_steps Maximum number of steps to use for acceleration
@ -562,12 +561,14 @@ sanei_genesys_stop_motor (Genesys_Device * dev)
* @note All times in pixel time. Correction for other motor timings is not
* done.
*/
static SANE_Int
genesys_generate_slope_table (u_int16_t * slope_table, unsigned int max_steps,
unsigned int use_steps, u_int16_t stop_at,
u_int16_t vstart, u_int16_t vend,
unsigned int steps, double g,
unsigned int *used_steps, unsigned int *vfinal)
SANE_Int
sanei_genesys_generate_slope_table (u_int16_t * slope_table,
unsigned int max_steps,
unsigned int use_steps, u_int16_t stop_at,
u_int16_t vstart, u_int16_t vend,
unsigned int steps, double g,
unsigned int *used_steps,
unsigned int *vfinal)
{
double t;
SANE_Int sum = 0;
@ -581,14 +582,15 @@ genesys_generate_slope_table (u_int16_t * slope_table, unsigned int max_steps,
if (!vfinal)
vfinal = &_vfinal;
DBG (DBG_proc, "genesys_generate_slope_table: table size: %d\n", max_steps);
DBG (DBG_proc, "sanei_genesys_generate_slope_table: table size: %d\n",
max_steps);
DBG (DBG_proc,
"genesys_generate_slope_table: stop at time: %d, use %d steps max\n",
"sanei_genesys_generate_slope_table: stop at time: %d, use %d steps max\n",
stop_at, use_steps);
DBG (DBG_proc,
"genesys_generate_slope_table: target slope: "
"sanei_genesys_generate_slope_table: target slope: "
"vstart: %d, vend: %d, steps: %d, g: %g\n", vstart, vend, steps, g);
sum = 0;
@ -701,17 +703,19 @@ sanei_genesys_create_slope_table3 (Genesys_Device * dev,
if (vend > 65535)
vend = 65535;
sum_time = 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, &vfinal);
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,
&vfinal);
if (final_exposure)
*final_exposure = (vfinal * dev->motor.base_ydpi) / yres;
@ -762,17 +766,18 @@ genesys_create_slope_table4 (Genesys_Device * dev,
if (vend > 65535)
vend = 65535;
sum_time = genesys_generate_slope_table (slope_table, 128,
steps,
vtarget,
vstart,
vend,
dev->motor.
slopes[power_mode][step_type].
minimum_steps << step_type,
dev->motor.
slopes[power_mode][step_type].g,
NULL, NULL);
sum_time = sanei_genesys_generate_slope_table (slope_table, 128,
steps,
vtarget,
vstart,
vend,
dev->motor.
slopes[power_mode]
[step_type].
minimum_steps << step_type,
dev->motor.
slopes[power_mode]
[step_type].g, NULL, NULL);
DBG (DBG_proc,
"sanei_genesys_create_slope_table: returns sum_time=%d, completed\n",
@ -828,7 +833,7 @@ genesys_create_slope_table2 (Genesys_Device * dev,
/*
type=1 : full
type=2 : half
type=4 : quater
type=4 : quarter
vend * type * base_ydpi / exposure = yres
*/
@ -928,7 +933,8 @@ sanei_genesys_create_slope_table (Genesys_Device * dev,
same_speed, yres, power_mode);
if (dev->model->motor_type == MOTOR_5345
|| dev->model->motor_type == MOTOR_HP2300)
|| dev->model->motor_type == MOTOR_HP2300
|| dev->model->motor_type == MOTOR_HP2400)
return genesys_create_slope_table2 (dev, slope_table, steps,
step_type, exposure_time,
same_speed, yres, power_mode);
@ -1101,9 +1107,9 @@ sanei_genesys_create_gamma_table (u_int16_t * gamma_table, int size,
if (value > maximum)
value = maximum;
gamma_table[i] = value;
DBG (DBG_data,
"sanei_genesys_create_gamma_table: gamma_table[%.3d] = %.5d\n",
i, (int) value);
/* DBG (DBG_data,
"sanei_genesys_create_gamma_table: gamma_table[%.3d] = %.5d\n",
i, (int) value); */
}
DBG (DBG_proc, "sanei_genesys_create_gamma_table: completed\n");
}
@ -1207,7 +1213,7 @@ sanei_genesys_exposure_time (Genesys_Device * dev, Genesys_Register_Set * reg,
switch (xdpi)
{
case 600:
return 19200; /*11902; */
return 8751; /*11902; 19200 */
default:
return 11111;
}
@ -1413,7 +1419,7 @@ sanei_genesys_read_data_from_scanner (Genesys_Device * dev, u_int8_t * data,
/* wait until buffer not empty for up to 5 seconds */
do
{
status = genesys_read_valid_words (dev, &words);
status = sanei_genesys_read_valid_words (dev, &words);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
@ -3658,59 +3664,106 @@ genesys_start_scan (Genesys_Device * dev)
RIE (genesys_warmup_lamp (dev));
}
/* set top left x and y values */
if ((dev->model->flags & GENESYS_FLAG_SEARCH_START)
&& (dev->model->y_offset_calib == 0))
/* set top left x and y values if flatbed scanners */
if (dev->model->is_sheetfed == SANE_FALSE)
{
status = dev->model->cmd_set->search_start_position (dev);
if ((dev->model->flags & GENESYS_FLAG_SEARCH_START)
&& (dev->model->y_offset_calib == 0))
{
status = dev->model->cmd_set->search_start_position (dev);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to search start position: %s\n",
sane_strstatus (status));
return status;
}
if (dev->model->flags & GENESYS_FLAG_USE_PARK)
status = dev->model->cmd_set->park_head (dev, dev->reg, 1);
else
status = dev->model->cmd_set->slow_back_home (dev, 1);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to move scanhead to "
"home position: %s\n", sane_strstatus (status));
return status;
}
dev->scanhead_position_in_steps = 0;
}
else
{
/* Go home */
/* TODO: check we can drop this since we cannot have the
scanner's head wandering here */
if (dev->model->flags & GENESYS_FLAG_USE_PARK)
status = dev->model->cmd_set->park_head (dev, dev->reg, 1);
else
status = dev->model->cmd_set->slow_back_home (dev, 1);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to move scanhead to "
"home position: %s\n", sane_strstatus (status));
return status;
}
dev->scanhead_position_in_steps = 0;
}
}
/* load document if needed (for sheetfed scanner for instance) */
if (dev->model->is_sheetfed == SANE_TRUE
&& dev->model->cmd_set->load_document != NULL)
{
status = dev->model->cmd_set->load_document (dev);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to search start position: %s\n",
"genesys_start_scan: failed to load document: %s\n",
sane_strstatus (status));
return status;
}
}
/* calibration : sheetfed scanners can't calibrate before each scan */
/* so we use a NO_CALIBRATION flags for those scanners */
if (dev->model->flags & GENESYS_FLAG_NO_CALIBRATION)
{
/* TODO send predefined calibration values from default
* values or built from a calibration scan */
/* send custom or generic gamma tables depending on flag */
if (dev->model->flags & GENESYS_FLAG_CUSTOM_GAMMA)
{
/* use custom gamma table */
status = dev->model->cmd_set->send_gamma_table (dev, 0);
}
else
{
/* send default gamma table if no custom gamma */
status = dev->model->cmd_set->send_gamma_table (dev, 1);
}
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to init gamma table: %s\n",
sane_strstatus (status));
return status;
}
if (dev->model->flags & GENESYS_FLAG_USE_PARK)
status = dev->model->cmd_set->park_head (dev, dev->reg, 1);
else
status = dev->model->cmd_set->slow_back_home (dev, 1);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to move scanhead to "
"home position: %s\n", sane_strstatus (status));
return status;
}
/* head hasn't moved */
dev->scanhead_position_in_steps = 0;
}
else
{
/* Go home */
/* TODO: check we can drop this since we cannot have the
scanner's head wandering here */
if (dev->model->flags & GENESYS_FLAG_USE_PARK)
status = dev->model->cmd_set->park_head (dev, dev->reg, 1);
else
status = dev->model->cmd_set->slow_back_home (dev, 1);
status = genesys_flatbed_calibration (dev);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to move scanhead to "
"home position: %s\n", sane_strstatus (status));
"genesys_start_scan: failed to do flatbed calibration: %s\n",
sane_strstatus (status));
return status;
}
dev->scanhead_position_in_steps = 0;
}
/* calibration */
status = genesys_flatbed_calibration (dev);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: failed to do flatbed calibration: %s\n",
sane_strstatus (status));
return status;
}
status = dev->model->cmd_set->init_regs_for_scan (dev);
@ -3778,19 +3831,22 @@ genesys_start_scan (Genesys_Device * dev)
/* then we wait for at least one word of valid scan data
this is also done in sanei_genesys_read_data_from_scanner -- pierre */
do
if (dev->model->is_sheetfed == SANE_FALSE)
{
usleep (100 * 1000);
status = genesys_read_valid_words (dev, &steps);
if (status != SANE_STATUS_GOOD)
do
{
DBG (DBG_error,
"genesys_start_scan: Failed to read valid words: %s\n",
sane_strstatus (status));
return status;
usleep (100 * 1000);
status = sanei_genesys_read_valid_words (dev, &steps);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"genesys_start_scan: Failed to read valid words: %s\n",
sane_strstatus (status));
return status;
}
}
while (steps < 1);
}
while (steps < 1);
DBG (DBG_proc, "genesys_start_scan: completed\n");
return SANE_STATUS_GOOD;
@ -3883,6 +3939,15 @@ genesys_fill_read_buffer (Genesys_Device * dev)
DBG (DBG_proc, "genesys_fill_read_buffer: start\n");
/* for sheetfed scanner, we must check is document is shorter than
* the requested scan */
if (dev->model->is_sheetfed == SANE_TRUE)
{
status = dev->model->cmd_set->detect_document_end (dev);
if (status != SANE_STATUS_GOOD)
return status;
}
space = dev->read_buffer.size - dev->read_buffer.avail;
work_buffer_dst = sanei_genesys_buffer_get_write_pos (&(dev->read_buffer),
@ -3910,7 +3975,8 @@ genesys_fill_read_buffer (Genesys_Device * dev)
DBG (DBG_error, "genesys_fill_read_buffer: reading %lu bytes\n",
(u_long) size);
/* size is already maxed to our needs. bulk_read_data
/* size is already maxed to our needs. for most models bulk_read_data
will read as much data as requested. */
status =
dev->model->cmd_set->bulk_read_data (dev, 0x45, work_buffer_dst, size);
@ -3938,6 +4004,8 @@ genesys_fill_read_buffer (Genesys_Device * dev)
RIE (sanei_genesys_buffer_produce (&(dev->read_buffer), size));
DBG (DBG_proc, "genesys_fill_read_buffer: end\n");
return SANE_STATUS_GOOD;
}
@ -4458,6 +4526,12 @@ Problems with the first approach:
*len = bytes;
}
/* avoid signaling some extra data because we have treated a full block
* on the last block */
if (dev->total_bytes_read + *len > dev->total_bytes_to_read)
*len = dev->total_bytes_to_read - dev->total_bytes_read;
/* count bytes sent to frontend */
dev->total_bytes_read += *len;
RIE (sanei_genesys_buffer_consume (src_buffer, bytes));
@ -4909,7 +4983,7 @@ init_options (Genesys_Scanner * s)
s->opt[OPT_SCAN_SW].desc = SANE_DESC_SCAN;
s->opt[OPT_SCAN_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_SCAN_SW].unit = SANE_UNIT_NONE;
if (model->flags & GENESYS_FLAG_SCAN_SW)
if (model->buttons & GENESYS_HAS_SCAN_SW)
s->opt[OPT_SCAN_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_SCAN_SW].cap = SANE_CAP_INACTIVE;
@ -4922,7 +4996,7 @@ init_options (Genesys_Scanner * s)
s->opt[OPT_FILE_SW].desc = "File button";
s->opt[OPT_FILE_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_FILE_SW].unit = SANE_UNIT_NONE;
if (model->flags & GENESYS_FLAG_FILE_SW)
if (model->buttons & GENESYS_HAS_FILE_SW)
s->opt[OPT_FILE_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_FILE_SW].cap = SANE_CAP_INACTIVE;
@ -4934,7 +5008,7 @@ init_options (Genesys_Scanner * s)
s->opt[OPT_EMAIL_SW].desc = SANE_DESC_EMAIL;
s->opt[OPT_EMAIL_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_EMAIL_SW].unit = SANE_UNIT_NONE;
if (model->flags & GENESYS_FLAG_EMAIL_SW)
if (model->buttons & GENESYS_HAS_EMAIL_SW)
s->opt[OPT_EMAIL_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_EMAIL_SW].cap = SANE_CAP_INACTIVE;
@ -4946,7 +5020,7 @@ init_options (Genesys_Scanner * s)
s->opt[OPT_COPY_SW].desc = SANE_DESC_COPY;
s->opt[OPT_COPY_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_COPY_SW].unit = SANE_UNIT_NONE;
if (model->flags & GENESYS_FLAG_COPY_SW)
if (model->buttons & GENESYS_HAS_COPY_SW)
s->opt[OPT_COPY_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_COPY_SW].cap = SANE_CAP_INACTIVE;
@ -4958,13 +5032,39 @@ init_options (Genesys_Scanner * s)
s->opt[OPT_PAGE_LOADED_SW].desc = SANE_DESC_PAGE_LOADED;
s->opt[OPT_PAGE_LOADED_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_PAGE_LOADED_SW].unit = SANE_UNIT_NONE;
if (model->flags & GENESYS_FLAG_PAGE_LOADED_SW)
if (model->buttons & GENESYS_HAS_PAGE_LOADED_SW)
s->opt[OPT_PAGE_LOADED_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_PAGE_LOADED_SW].cap = SANE_CAP_INACTIVE;
s->val[OPT_PAGE_LOADED_SW].b = 0;
s->last_val[OPT_PAGE_LOADED_SW].b = 0;
/* OCR button */
s->opt[OPT_OCR_SW].name = "ocr";
s->opt[OPT_OCR_SW].title = "OCR button";
s->opt[OPT_OCR_SW].desc = "OCR button";
s->opt[OPT_OCR_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_OCR_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_OCR_SW)
s->opt[OPT_OCR_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_OCR_SW].cap = SANE_CAP_INACTIVE;
s->val[OPT_OCR_SW].b = 0;
s->last_val[OPT_OCR_SW].b = 0;
/* power button */
s->opt[OPT_POWER_SW].name = "power";
s->opt[OPT_POWER_SW].title = "Power button";
s->opt[OPT_POWER_SW].desc = "Power button";
s->opt[OPT_POWER_SW].type = SANE_TYPE_BOOL;
s->opt[OPT_POWER_SW].unit = SANE_UNIT_NONE;
if (model->buttons & GENESYS_HAS_POWER_SW)
s->opt[OPT_POWER_SW].cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;
else
s->opt[OPT_POWER_SW].cap = SANE_CAP_INACTIVE;
s->val[OPT_POWER_SW].b = 0;
s->last_val[OPT_POWER_SW].b = 0;
RIE (calc_parameters (s));
DBG (DBG_proc, "init_options: exit\n");
@ -5097,11 +5197,11 @@ attach_one_device (SANE_String_Const devname)
}
/* configuration framework functions */
static SANE_Status config_attach_genesys (SANEI_Config * config,
const char *devname)
static SANE_Status
config_attach_genesys (SANEI_Config * config, const char *devname)
{
/* no options yet for this backend */
config=config;
config = config;
/* the devname has been processed and is ready to be used
* directly. Since the backend is an USB only one, we can
@ -5112,17 +5212,18 @@ static SANE_Status config_attach_genesys (SANEI_Config * config,
}
/* probes for scanner to attach to the backend */
static SANE_Status probe_genesys_devices(void)
static SANE_Status
probe_genesys_devices (void)
{
SANEI_Config config;
SANE_Status status;
DBG (DBG_proc, "probe_genesys_devices: start\n");
new_dev = 0;
new_dev_len = 0;
new_dev_alloced = 0;
/* set configuration options structure : no option for this backend */
config.descriptors = NULL;
config.values = NULL;
@ -5161,7 +5262,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
/* init usb use */
sanei_usb_init ();
DBG (DBG_info, "sane_init: %s endian machine\n",
#ifdef WORDS_BIGENDIAN
"big"
@ -5177,7 +5278,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
devlist = 0;
/* cold-plug case :detection of allready connected scanners */
status = probe_genesys_devices();
status = probe_genesys_devices ();
DBG (DBG_proc, "sane_init: exit\n");
@ -5217,7 +5318,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
local_only == SANE_TRUE ? "true" : "false");
/* hot-plug case :detection of newly connected scanners */
probe_genesys_devices();
probe_genesys_devices ();
if (devlist)
free (devlist);
@ -5495,8 +5596,12 @@ get_option_value (Genesys_Scanner * s, int option, void *val)
case OPT_FILE_SW:
case OPT_EMAIL_SW:
case OPT_COPY_SW:
RIE(s->dev->model->cmd_set->update_hardware_sensors(s,option));
s->last_val[option].b = *(SANE_Bool *) val = s->val[option].b;
case OPT_PAGE_LOADED_SW:
case OPT_OCR_SW:
case OPT_POWER_SW:
RIE(s->dev->model->cmd_set->update_hardware_sensors(s));
*(SANE_Bool *) val = s->val[option].b;
s->last_val[option].b = *(SANE_Bool *) val;
break;
default:
DBG (DBG_warn, "get_option_value: can't get unknown option %d\n",
@ -5908,20 +6013,33 @@ sane_cancel (SANE_Handle handle)
return;
}
/* park head */
if (s->dev->model->flags & GENESYS_FLAG_USE_PARK)
status = s->dev->model->cmd_set->park_head (s->dev, s->dev->reg, 1);
else
status = s->dev->model->cmd_set->slow_back_home (s->dev, 1);
if (status != SANE_STATUS_GOOD)
/* park head if flatbed scanner */
if (s->dev->model->is_sheetfed == SANE_FALSE)
{
DBG (DBG_error,
"sane_cancel: failed to move scanhead to home position: %s\n",
sane_strstatus (status));
return;
if (s->dev->model->flags & GENESYS_FLAG_USE_PARK)
status = s->dev->model->cmd_set->park_head (s->dev, s->dev->reg, 1);
else
status = s->dev->model->cmd_set->slow_back_home (s->dev, 1);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error,
"sane_cancel: failed to move scanhead to home position: %s\n",
sane_strstatus (status));
return;
}
}
else
{ /* in case of sheetfed scanners, we have to eject the document if still present */
status = s->dev->model->cmd_set->eject_document (s->dev);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error, "sane_cancel: failed to eject document: %s\n",
sane_strstatus (status));
return;
}
}
/*enable power saving mode*/
/*enable power saving mode */
status = s->dev->model->cmd_set->save_power (s->dev, SANE_TRUE);
if (status != SANE_STATUS_GOOD)
{

Wyświetl plik

@ -33,3 +33,6 @@ usb 0x04a9 0x2213
# Canon LiDE 60
usb 0x04a9 0x221c
# Visioneer Strobe XP200
usb 0x04a7 0x0426

Wyświetl plik

@ -62,7 +62,6 @@
#define SANE_I18N(text) text
#endif
/** List of SANE options
*/
enum Genesys_Option
@ -102,6 +101,8 @@ enum Genesys_Option
OPT_EMAIL_SW,
OPT_COPY_SW,
OPT_PAGE_LOADED_SW,
OPT_OCR_SW,
OPT_POWER_SW,
/* must come last: */
NUM_OPTIONS

Wyświetl plik

@ -59,59 +59,66 @@ static Genesys_Frontend Wolfson[] = {
, {0x02, 0x02, 0x02}
, {0x00, 0x00, 0x00}
}
, /* UMAX */
, /* 0: UMAX */
{{0x00, 0x03, 0x05, 0x03}
, {0x00, 0x00, 0x00}
, {0xc8, 0xc8, 0xc8}
, {0x04, 0x04, 0x04}
, {0x00, 0x00, 0x00}
}
, /* ST12 */
, /* 1: ST12 */
{{0x00, 0x03, 0x05, 0x21}
, {0x00, 0x00, 0x00}
, {0xc8, 0xc8, 0xc8}
, {0x06, 0x06, 0x06}
, {0x00, 0x00, 0x00}
}
, /* ST24 */
, /* 2: ST24 */
{{0x00, 0x03, 0x05, 0x12}
, {0x00, 0x00, 0x00}
, {0xc8, 0xc8, 0xc8}
, {0x04, 0x04, 0x04}
, {0x00, 0x00, 0x00}
}
, /* MD6228/MD6471 */
, /* 3: MD6228/MD6471 */
{{0x00, 0x03, 0x05, 0x02}
, {0x00, 0x00, 0x00}
, {0xc0, 0xc0, 0xc0}
, {0x07, 0x07, 0x07}
, {0x00, 0x00, 0x00}
}
, /* HP2400c */
, /* 4: HP2400c */
{{0x00, 0x03, 0x04, 0x02}
, {0x00, 0x00, 0x00}
, {0xb0, 0xb0, 0xb0}
, {0x04, 0x04, 0x04}
, {0x00, 0x00, 0x00}
}
, /* HP2300c */
, /* 5: HP2300c */
{{0x00, 0x3d, 0x08, 0x00}
, {0x00, 0x00, 0x00}
, {0xe1, 0xe1, 0xe1}
, {0x93, 0x93, 0x93}
, {0x00, 0x19, 0x06}
}
, /* CANONLIDE35 */
, /* 6: CANONLIDE35 */
{{0x58, 0x00, 0x00, 0x00} /* TODO create an AnalogDevice struct */
, {0x00, 0x00, 0x00}
, {0x06, 0x00, 0x00}
, {0x0c, 0x00, 0x00}
, {0x00, 0x00, 0x00}
}
, /* 7: XP200 */
};
/** for setting up the sensor-specific settings:
* Optical Resolution, number of black pixels, number of dummy pixels,
* CCD_start_xoffset, and overall number of sensor pixels
* registers 0x08-0x0b, 0x10-0x1d and 0x52-0x59
* registers 0x08-0x0b, 0x10-0x1d and 0x52-0x5e
*/
static Genesys_Sensor Sensor[] = {
/* UMAX */
/* 0: UMAX */
{1200, 48, 64, 0, 10800, 210, 230,
{0x01, 0x03, 0x05, 0x07}
,
@ -124,7 +131,7 @@ static Genesys_Sensor Sensor[] = {
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* Plustek OpticPro S12/ST12 */
/* 1: Plustek OpticPro S12/ST12 */
{600, 48, 85, 152, 5416, 210, 230,
{0x02, 0x00, 0x06, 0x04}
,
@ -137,7 +144,7 @@ static Genesys_Sensor Sensor[] = {
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* Plustek OpticPro S24/ST24 */
/* 2: Plustek OpticPro S24/ST24 */
{1200, 48, 64, 0, 10800, 210, 230,
{0x0e, 0x0c, 0x00, 0x0c}
,
@ -150,7 +157,7 @@ static Genesys_Sensor Sensor[] = {
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* MD6471 */
/* 3: MD6471 */
{1200,
48,
16, 0, 10872,
@ -166,22 +173,22 @@ static Genesys_Sensor Sensor[] = {
2.38, 2.35, 2.34,
NULL, NULL, NULL}
,
/* HP2400c */
/* 4: HP2400c */
{1200,
48,
15, 0, 10872, 210, 200,
{0x14, 0x15, 0x00, 0x00}
{0x14, 0x15, 0x00, 0x00} /* registers 0x08-0x0b */
,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x08, 0x3f, 0x2a, 0x00, 0x00,
0x00, 0x02}
,
{0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x00, 0x00,
{0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x0e, 0x00,
0x00}
,
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* HP2300c */
/* 5: HP2300c */
{600,
48,
20, 0, 5454, 210, 200,
@ -218,6 +225,21 @@ static Genesys_Sensor Sensor[] = {
,
1.0, 1.0, 1.0,
NULL, NULL, NULL}
,
/* 7: Strobe XP200 */
{600,
48,
38, 0, 5454, 210, 200,
{0x16, 0x00, 0x01, 0x03}
,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a,
0x00, 0x05}
,
{0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x06, 0x0b, 0x10,
0x16}
,
2.1, 2.1, 2.1,
NULL, NULL, NULL}
};
/** for General Purpose Output specific settings:
@ -280,6 +302,14 @@ static Genesys_Gpo Gpo[] = {
{0xef, 0x80}
,
}
,
/* 7: XP200 */
{
{0x30, 0x00}
,
{0xb0, 0x00}
,
}
};
#define MOTOR_ST24 2
@ -345,16 +375,16 @@ static Genesys_Motor Motor[] = {
1,
1,
{{{
11000,
3000,
128,
1.0,
11000, /* start speed */
3000, /* max speed */
128, /* min steps */
0.25,
},
{
11000,
3000,
128,
1.0,
0.5,
},},},
},
{ /* HP 2300c */
@ -393,6 +423,24 @@ static Genesys_Motor Motor[] = {
0.8,
},},},
},
{ /* Strobe XP200 */
600,
600,
1,
1,
{{{
3500,
1300,
60,
0.25,
},
{
3500,
1400,
60,
0.5,
},},},
},
};
/* here we have the various device settings...
@ -429,13 +477,14 @@ static Genesys_Model umax_astra_4500_model = {
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_UMAX,
DAC_WOLFSON_UMAX,
GPO_UMAX,
MOTOR_UMAX,
GENESYS_FLAG_UNTESTED /* Which flags are needed for this scanner? */
| GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_FLAG_UNTESTED, /* Which flags are needed for this scanner? */
/* untested, values set by hmg */
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
20,
200
};
@ -472,6 +521,7 @@ static Genesys_Model canon_lide_50_model = {
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_TRUE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_CANONLIDE35,
DAC_CANONLIDE35,
GPO_CANONLIDE35,
@ -480,11 +530,11 @@ static Genesys_Model canon_lide_50_model = {
GENESYS_FLAG_SKIP_WARMUP |
GENESYS_FLAG_OFFSET_CALIBRATION |
GENESYS_FLAG_DARK_WHITE_CALIBRATION |
GENESYS_FLAG_SCAN_SW |
GENESYS_FLAG_FILE_SW |
GENESYS_FLAG_EMAIL_SW |
GENESYS_FLAG_COPY_SW |
GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_HAS_SCAN_SW |
GENESYS_HAS_FILE_SW |
GENESYS_HAS_EMAIL_SW |
GENESYS_HAS_COPY_SW,
280,
400
};
@ -521,6 +571,7 @@ static Genesys_Model canon_lide_60_model = {
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_TRUE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_CANONLIDE35,
DAC_CANONLIDE35,
GPO_CANONLIDE35,
@ -530,6 +581,8 @@ static Genesys_Model canon_lide_60_model = {
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_DARK_WHITE_CALIBRATION
| GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
300,
400
}; /* this is completely untested -- hmg */
@ -566,6 +619,7 @@ static Genesys_Model hp2300c_model = {
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_HP2300,
DAC_WOLFSON_HP2300,
GPO_HP2300,
@ -576,21 +630,22 @@ static Genesys_Model hp2300c_model = {
| GENESYS_FLAG_MUST_WAIT
| GENESYS_FLAG_DARK_CALIBRATION
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_CUSTOM_GAMMA
| GENESYS_FLAG_HALF_CCD_MODE,
| GENESYS_FLAG_CUSTOM_GAMMA,
GENESYS_HAS_SCAN_SW | GENESYS_HAS_COPY_SW,
9,
132
};
static Genesys_Model hp2400c_model = {
static
Genesys_Model hp2400c_model = {
"hewlett-packard-scanjet-2400c", /* Name */
"Hewlett Packard", /* Device vendor string */
"ScanJet 2400c", /* Device model name */
GENESYS_GL646,
NULL,
{1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
{1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
{1200, 600, 300, 150, 75, 50, 0}, /* possible x-resolutions */
{1200, 600, 300, 150, 75, 50, 0}, /* possible y-resolutions */
{16, 8, 0}, /* possible depths in gray mode */
{16, 8, 0}, /* possible depths in color mode */
@ -609,11 +664,12 @@ static Genesys_Model hp2400c_model = {
SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */
0, 8, 16, /* RGB CCD Line-distance correction in pixel */
0, 0, 0, /* RGB CCD Line-distance correction in pixel */
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_HP2400,
DAC_WOLFSON_HP2400,
GPO_HP2400,
@ -625,7 +681,57 @@ static Genesys_Model hp2400c_model = {
| GENESYS_FLAG_DARK_CALIBRATION
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_CUSTOM_GAMMA
| GENESYS_FLAG_HALF_CCD_MODE,
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_NO_CALIBRATION,
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
20,
132
};
static
Genesys_Model visioneer_xp200_model = {
"visioneer-strobe-xp200", /* Name */
"Visioneer", /* Device vendor string */
"Strobe XP200", /* Device model name */
GENESYS_GL646,
NULL,
{600, 300, 200, 100, 75, 0}, /* possible x-resolutions */
{600, 300, 200, 100, 75, 0}, /* possible y-resolutions */
{16, 8, 0}, /* possible depths in gray mode */
{16, 8, 0}, /* possible depths in color mode */
SANE_FIX (0.5), /* Start of scan area in mm (x) */
SANE_FIX (10.5), /* Start of scan area in mm (y) */
SANE_FIX (215.9), /* Size of scan area in mm (x) */
SANE_FIX (297.2), /* Size of scan area in mm (y) */
SANE_FIX (0.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) */
0, 0, 0, /* RGB CCD Line-distance correction in pixel */
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_TRUE, /* Is this a CIS scanner? */
SANE_TRUE, /* Is this a sheetfed scanner? */
CIS_XP200,
DAC_AD_XP200, /* Analog Device frontend */
GPO_XP200,
MOTOR_XP200,
GENESYS_FLAG_UNTESTED /* not fully working yet */
| GENESYS_FLAG_14BIT_GAMMA
| GENESYS_FLAG_CUSTOM_GAMMA
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_NO_CALIBRATION,
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW,
20,
132
};
@ -662,13 +768,14 @@ static Genesys_Model hp3670c_model = {
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_UMAX,
DAC_WOLFSON_UMAX,
GPO_UMAX,
MOTOR_UMAX,
GENESYS_FLAG_UNTESTED /* Which flags are needed for this scanner? */
| GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_FLAG_UNTESTED, /* Which flags are needed for this scanner? */
/* untested, values set by mike p. according to vendor's datasheet. */
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
20,
200
};
@ -705,13 +812,13 @@ static Genesys_Model plustek_st12_model = {
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_ST12,
DAC_WOLFSON_ST12,
GPO_ST12,
MOTOR_UMAX,
GENESYS_FLAG_UNTESTED /* Which flags are needed for this scanner? */
| GENESYS_FLAG_14BIT_GAMMA
| GENESYS_FLAG_HALF_CCD_MODE,
GENESYS_FLAG_UNTESTED | GENESYS_FLAG_14BIT_GAMMA, /* Which flags are needed for this scanner? */
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
20,
200
};
@ -748,6 +855,7 @@ static Genesys_Model plustek_st24_model = {
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_ST24,
DAC_WOLFSON_ST24,
GPO_ST24,
@ -757,9 +865,8 @@ static Genesys_Model plustek_st24_model = {
| GENESYS_FLAG_LAZY_INIT
| GENESYS_FLAG_USE_PARK
| GENESYS_FLAG_SKIP_WARMUP
| GENESYS_FLAG_SEARCH_START
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_HALF_CCD_MODE,
| GENESYS_FLAG_SEARCH_START | GENESYS_FLAG_OFFSET_CALIBRATION,
GENESYS_HAS_NO_BUTTONS, /* no buttons supported */
20,
200
};
@ -796,6 +903,7 @@ static Genesys_Model medion_md5345_model = {
COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */
SANE_FALSE, /* Is this a CIS scanner? */
SANE_FALSE, /* Is this a sheetfed scanner? */
CCD_5345,
DAC_WOLFSON_5345,
GPO_5345,
@ -808,8 +916,8 @@ static Genesys_Model medion_md5345_model = {
| GENESYS_FLAG_DARK_CALIBRATION
| GENESYS_FLAG_STAGGERED_LINE
| GENESYS_FLAG_OFFSET_CALIBRATION
| GENESYS_FLAG_CUSTOM_GAMMA
| GENESYS_FLAG_HALF_CCD_MODE,
| GENESYS_FLAG_CUSTOM_GAMMA,
GENESYS_HAS_COPY_SW | GENESYS_HAS_EMAIL_SW | GENESYS_HAS_POWER_SW | GENESYS_HAS_OCR_SW | GENESYS_HAS_SCAN_SW,
32,
200
};
@ -824,5 +932,6 @@ static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
{0x07b3, 0x0600, &plustek_st12_model},
{0x07b3, 0x0601, &plustek_st24_model},
{0x0461, 0x0377, &medion_md5345_model},
{0x04a7, 0x0426, &visioneer_xp200_model},
{0, 0, NULL}
};

Plik diff jest za duży Load Diff

Wyświetl plik

@ -5286,7 +5286,7 @@ gl841_init (Genesys_Device * dev)
}
static SANE_Status
gl841_update_hardware_sensors (Genesys_Scanner * s, SANE_Int option)
gl841_update_hardware_sensors (Genesys_Scanner * s)
{
/* do what is needed to get a new set of events, but try to not lose
any of them.
@ -5357,6 +5357,10 @@ static Genesys_Command_Set gl841_cmd_set = {
gl841_bulk_read_data,
gl841_update_hardware_sensors,
NULL,
NULL,
NULL,
};
SANE_Status

Wyświetl plik

@ -94,16 +94,19 @@
#define GENESYS_FLAG_ALT_SLOPE_CREATE (1 << 11) /* use alternative slope
creation function */
#define GENESYS_FLAG_DARK_WHITE_CALIBRATION (1 << 12) /*yet another calibration method. does white and dark shading in one run, depending on a black and a white strip*/
#define GENESYS_FLAG_DARK_WHITE_CALIBRATION (1 << 12) /* yet another calibration method. does white and dark shading in one run, depending on a black and a white strip*/
#define GENESYS_FLAG_CUSTOM_GAMMA (1 << 13) /* allow custom gamma tables */
#define GENESYS_FLAG_NO_CALIBRATION (1 << 14) /* allow scanners to use skip the calibration, needed for sheetfed scanners */
#define GENESYS_FLAG_HALF_CCD_MODE (1 << 15) /* scanner has setting for half ccd mode */
#define GENESYS_FLAG_SCAN_SW (1 << 14) /* scanner has SCAN button */
#define GENESYS_FLAG_FILE_SW (1 << 15) /* scanner has FILE button */
#define GENESYS_FLAG_COPY_SW (1 << 16) /* scanner has COPY button */
#define GENESYS_FLAG_EMAIL_SW (1 << 17) /* scanner has EMAIL button */
#define GENESYS_FLAG_PAGE_LOADED_SW (1 << 18) /* scanner has paper in detection */
#define GENESYS_FLAG_HALF_CCD_MODE (1 << 19) /* scanner has setting for half ccd mode */
#define GENESYS_HAS_NO_BUTTONS 0 /* scanner has no supported button */
#define GENESYS_HAS_SCAN_SW (1 << 0) /* scanner has SCAN button */
#define GENESYS_HAS_FILE_SW (1 << 1) /* scanner has FILE button */
#define GENESYS_HAS_COPY_SW (1 << 2) /* scanner has COPY button */
#define GENESYS_HAS_EMAIL_SW (1 << 3) /* scanner has EMAIL button */
#define GENESYS_HAS_PAGE_LOADED_SW (1 << 4) /* scanner has paper in detection */
#define GENESYS_HAS_OCR_SW (1 << 5) /* scanner has OCR button */
#define GENESYS_HAS_POWER_SW (1 << 6) /* scanner has power button */
/* USB control message values */
#define REQUEST_TYPE_IN (USB_TYPE_VENDOR | USB_DIR_IN)
@ -132,6 +135,8 @@
#define BULK_REGISTER 0x11
#define BULKIN_MAXSIZE 0xFE00
#define GL646_BULKIN_MAXSIZE 0xFFC0
#define GL646_BULKIN_MINSIZE 0x0800
#define BULKOUT_MAXSIZE 0xF000
/* AFE values */
@ -233,13 +238,14 @@ Genesys_Color_Order;
/*135 registers for gl841 + 1 null-reg*/
#define GENESYS_MAX_REGS 136
#define DAC_WOLFSON_UMAX 0
#define DAC_WOLFSON_ST12 1
#define DAC_WOLFSON_ST24 2
#define DAC_WOLFSON_5345 3
#define DAC_WOLFSON_UMAX 0
#define DAC_WOLFSON_ST12 1
#define DAC_WOLFSON_ST24 2
#define DAC_WOLFSON_5345 3
#define DAC_WOLFSON_HP2400 4
#define DAC_WOLFSON_HP2300 5
#define DAC_CANONLIDE35 6
#define DAC_CANONLIDE35 6
#define DAC_AD_XP200 7 /* Analog Device frontend */
#define CCD_UMAX 0
#define CCD_ST12 1 /* SONY ILX548: 5340 Pixel ??? */
@ -248,6 +254,7 @@ Genesys_Color_Order;
#define CCD_HP2400 4
#define CCD_HP2300 5
#define CCD_CANONLIDE35 6
#define CIS_XP200 7 /* CIS sensor for Strobe XP200 */
#define GPO_UMAX 0
#define GPO_ST12 1
@ -256,6 +263,7 @@ Genesys_Color_Order;
#define GPO_HP2400 4
#define GPO_HP2300 5
#define GPO_CANONLIDE35 6
#define GPO_XP200 7
#define MOTOR_UMAX 0
#define MOTOR_5345 1
@ -263,6 +271,7 @@ Genesys_Color_Order;
#define MOTOR_HP2400 3
#define MOTOR_HP2300 4
#define MOTOR_CANONLIDE35 5
#define MOTOR_XP200 6
/* Forward typedefs */
@ -352,8 +361,23 @@ typedef struct Genesys_Command_Set
in Genesys_Scanner.last_val[], in such a way that a button up/down
relative to Genesys_Scanner.last_val[] is not lost.
*/
SANE_Status (*update_hardware_sensors) (struct Genesys_Scanner * s,
SANE_Int option);
SANE_Status (*update_hardware_sensors) (struct Genesys_Scanner * s);
/* functions for sheetfed scanners */
/**
* load document into scanner
*/
SANE_Status (*load_document) (Genesys_Device * dev);
/**
* detects is the scanned document has left scanner. In this
* case it updates the amount of data to read and set up
* flags in the dev struct
*/
SANE_Status (*detect_document_end) (Genesys_Device * dev);
/**
* eject document from scanner
*/
SANE_Status (*eject_document) (Genesys_Device * dev);
} Genesys_Command_Set;
typedef struct Genesys_Model
@ -393,12 +417,14 @@ typedef struct Genesys_Model
Genesys_Color_Order line_mode_color_order; /* Order of the CCD/CIS colors */
SANE_Bool is_cis; /* Is this a CIS or CCD scanner? */
SANE_Bool is_sheetfed; /* Is this sheetfed scanner? */
SANE_Int ccd_type; /* which SENSOR type do we have ? */
SANE_Int dac_type; /* which DAC do we have ? */
SANE_Int gpo_type; /* General purpose output type */
SANE_Int motor_type; /* stepper motor type */
SANE_Word flags; /* Which hacks are needed for this scanner? */
SANE_Word buttons; /* Button flags, described existing buttons for the model */
/*@} */
SANE_Int shading_lines; /* how many lines are used for shading calibration */
SANE_Int search_lines; /* how many lines are used to search start position */
@ -469,6 +495,7 @@ struct Genesys_Device
Genesys_Motor motor;
u_int16_t slope_table0[256];
u_int16_t slope_table1[256];
u_int8_t control[6];
time_t init_date;
u_int8_t *white_average_data;
@ -480,6 +507,8 @@ struct Genesys_Device
SANE_Int lamp_off_time;
SANE_Bool read_active;
SANE_Bool document; /* for sheetfed scanner's, is TRUE when there
is a document in the scanner */
Genesys_Buffer read_buffer;
Genesys_Buffer lines_buffer;
@ -490,6 +519,7 @@ struct Genesys_Device
size_t total_bytes_read; /* total bytes read sent to frontend */
size_t total_bytes_to_read; /* total bytes read to be sent to frontend */
size_t wpl; /* asic's word per line */
Genesys_Current_Setup current_setup; /* contains the real used values */
@ -536,6 +566,9 @@ extern void sanei_genesys_init_structs (Genesys_Device * dev);
extern SANE_Status
sanei_genesys_init_shading_data (Genesys_Device * dev, int pixels_per_line);
extern SANE_Status sanei_genesys_read_valid_words (Genesys_Device * dev,
unsigned int *steps);
extern SANE_Status sanei_genesys_read_feed_steps (Genesys_Device * dev,
unsigned int *steps);
@ -571,6 +604,12 @@ sanei_genesys_exposure_time2 (Genesys_Device * dev,
extern SANE_Int
sanei_genesys_exposure_time (Genesys_Device * dev, Genesys_Register_Set * reg,
int xdpi);
extern SANE_Int
sanei_genesys_generate_slope_table (u_int16_t * slope_table, unsigned int max_steps,
unsigned int use_steps, u_int16_t stop_at,
u_int16_t vstart, u_int16_t vend,
unsigned int steps, double g,
unsigned int *used_steps, unsigned int *vfinal);
extern SANE_Int
sanei_genesys_create_slope_table (Genesys_Device * dev,