Added support for Plustek OpticSlim M12 (untested). Based on patch from Gerhard

Jaeger <gerhard@gjaeger.de>. Fixed gt68xx homepage links in man page. Changed
minimum version of libusb to 0.1.8.
merge-requests/1/head
Henning Geinitz 2005-09-29 18:22:30 +00:00
rodzic 88acee2eee
commit fb40be18dc
13 zmienionych plików z 212 dodań i 14 usunięć

Wyświetl plik

@ -1,3 +1,14 @@
2005-09-29 Henning Meier-Geinitz <henning@meier-geinitz.de>
* backend/gt68xx.c backend/gt68xx.conf backend/gt68xx_devices.c
backend/gt68xx_generic.c backend/gt68xx_generic.h
backend/gt68xx_high.c backend/gt68xx_low.c backend/gt68xx_low.h
doc/sane-gt68xx.man doc/descriptions/gt68xx.desc
doc/gt68xx/gt68xx.CHANGES doc/gt68xx/gt68xx.TODO:
Added support for Plustek OpticSlim M12 (untested). Based on patch
from Gerhard Jaeger <gerhard@gjaeger.de>. Fixed gt68xx homepage
links in man page. Changed minimum version of libusb to 0.1.8.
2005-09-28 Oliver Schwartz <Oliver.Schwartz@gmx.de>
* backend/snapscan-options.c backend/snapscan-scsi.c

Wyświetl plik

@ -48,7 +48,7 @@
#include "../include/sane/config.h"
#define BUILD 76
#define BUILD 77
#define MAX_DEBUG
#define WARMUP_TIME 60
#define CALIBRATION_HEIGHT 2.5
@ -600,6 +600,11 @@ init_options (GT68xx_Scanner * s)
s->val[OPT_COARSE_CAL].w = SANE_TRUE;
if (!debug_options)
DISABLE (OPT_COARSE_CAL);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
{
s->val[OPT_COARSE_CAL].w = SANE_FALSE;
DISABLE (OPT_COARSE_CAL);
}
/* coarse calibration only once */
s->opt[OPT_COARSE_CAL_ONCE].name = "coarse-calibration-once";
@ -616,6 +621,8 @@ init_options (GT68xx_Scanner * s)
s->val[OPT_COARSE_CAL_ONCE].w = SANE_FALSE;
if (!debug_options)
DISABLE (OPT_COARSE_CAL_ONCE);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
DISABLE (OPT_COARSE_CAL_ONCE);
/* calibration */
s->opt[OPT_QUALITY_CAL].name = SANE_NAME_QUALITY_CAL;
@ -627,6 +634,11 @@ init_options (GT68xx_Scanner * s)
s->val[OPT_QUALITY_CAL].w = SANE_TRUE;
if (!debug_options)
DISABLE (OPT_QUALITY_CAL);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
{
s->val[OPT_QUALITY_CAL].w = SANE_FALSE;
DISABLE (OPT_QUALITY_CAL);
}
/* backtrack lines */
s->opt[OPT_BACKTRACK_LINES].name = "backtrack-lines";
@ -647,6 +659,12 @@ init_options (GT68xx_Scanner * s)
if (!debug_options)
DISABLE (OPT_BACKTRACK_LINES);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
{
s->val[OPT_BACKTRACK_LINES].w = 0x3f;
DISABLE (OPT_BACKTRACK_LINES);
}
/* "Enhancement" group: */
s->opt[OPT_ENHANCEMENT_GROUP].title = SANE_I18N ("Enhancement");
s->opt[OPT_ENHANCEMENT_GROUP].desc = "";
@ -1795,7 +1813,8 @@ sane_start (SANE_Handle handle)
if (!(s->dev->model->flags & GT68XX_FLAG_NO_STOP))
RIE (gt68xx_device_stop_scan (s->dev));
RIE (gt68xx_device_carriage_home (s->dev));
if (!(s->dev->model->flags & GT68XX_FLAG_SHEET_FED))
RIE (gt68xx_device_carriage_home (s->dev));
gt68xx_scanner_wait_for_positioning (s);
gettimeofday (&s->start_time, 0);
@ -1816,6 +1835,7 @@ sane_start (SANE_Handle handle)
scan_request.backtrack_lines = 0;
RIE (gt68xx_scanner_calibrate (s, &scan_request));
RIE (gt68xx_scanner_start_scan (s, &scan_request, &scan_params));
for (i = 0; i < scan_params.overscan_lines; ++i)
RIE (gt68xx_scanner_read_line (s, buffer_pointers));
@ -2084,8 +2104,16 @@ sane_cancel (SANE_Handle handle)
}
gt68xx_scanner_stop_scan (s);
gt68xx_scanner_wait_for_positioning (s);
gt68xx_device_carriage_home (s->dev);
if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED)
{
gt68xx_device_paperfeed (s->dev);
}
else
{
gt68xx_scanner_wait_for_positioning (s);
gt68xx_device_carriage_home (s->dev);
}
if (s->gamma_table)
free (s->gamma_table);
s->gamma_table = 0;

Wyświetl plik

@ -164,6 +164,10 @@ usb 0x07b3 0x0403
# Plustek OpticPro UT16B
#model "UT16B"
##############################################################################
# Autodetect Plustek OpticSlim M12
usb 0x07b3 0x0412
##############################################################################
# Autodetect Plustek OpticSlim 1200
usb 0x07b3 0x0413

Wyświetl plik

@ -78,6 +78,7 @@ static GT68xx_Command_Set mustek_gt6816_command_set = {
gt6816_is_moving,
gt68xx_generic_move_relative,
gt6816_carriage_home,
/* gt68xx_generic_paperfeed */ NULL,
gt68xx_generic_start_scan,
gt68xx_generic_read_scanned_data,
gt6816_stop_scan,
@ -87,6 +88,45 @@ static GT68xx_Command_Set mustek_gt6816_command_set = {
gt68xx_generic_get_id
};
static GT68xx_Command_Set mustek_gt6816_sheetfed_command_set = {
"mustek-gt6816", /* Name of this command set */
0x40, /* Request type */
0x01, /* Request */
0x200c, /* Memory read - wValue */
0x200b, /* Memory write - wValue */
0x2010, /* Send normal command - wValue */
0x3f40, /* Send normal command - wIndex */
0x2011, /* Receive normal result - wValue */
0x3f00, /* Receive normal result - wIndex */
0x2012, /* Send small command - wValue */
0x3f40, /* Send small command - wIndex */
0x2013, /* Receive small result - wValue */
0x3f00, /* Receive small result - wIndex */
/* activate */ NULL,
/* deactivate */ NULL,
gt6816_check_firmware,
gt6816_download_firmware,
gt6816_get_power_status,
gt6816_get_ta_status,
gt6816_lamp_control,
gt6816_is_moving,
gt68xx_generic_move_relative,
/* gt6816_carriage_home */ NULL,
gt68xx_generic_paperfeed,
gt68xx_generic_start_scan,
gt68xx_generic_read_scanned_data,
gt6801_stop_scan,
gt68xx_generic_setup_scan,
gt68xx_generic_set_afe,
gt68xx_generic_set_exposure_time,
gt68xx_generic_get_id
};
static GT68xx_Command_Set mustek_gt6801_command_set = {
"mustek-gt6801",
@ -117,6 +157,7 @@ static GT68xx_Command_Set mustek_gt6801_command_set = {
gt6801_is_moving,
/* gt68xx_generic_move_relative *** to be tested */ NULL,
gt6801_carriage_home,
/* gt68xx_generic_paperfeed */ NULL,
gt68xx_generic_start_scan,
gt68xx_generic_read_scanned_data,
gt6801_stop_scan,
@ -155,6 +196,7 @@ static GT68xx_Command_Set plustek_gt6801_command_set = {
gt6801_is_moving,
/* gt68xx_generic_move_relative *** to be tested */ NULL,
gt6801_carriage_home,
/* gt68xx_generic_paperfeed */ NULL,
gt68xx_generic_start_scan,
gt68xx_generic_read_scanned_data,
gt6801_stop_scan,
@ -1406,6 +1448,54 @@ static GT68xx_Model genius_vivid1200xe_model = {
/* Tested by hmg */
};
static GT68xx_Model plustek_opticslim_m12_model = {
"plustek-opticslim-m12", /* Name */
"Plustek", /* Device vendor string */
"OpticSlim M12", /* Device model name */
"cism216.fw", /* Name of the firmware file */
SANE_FALSE, /* Dynamic allocation flag */
&mustek_gt6816_sheetfed_command_set, /* Command set used by this scanner */
600, /* maximum optical sensor resolution */
1200, /* maximum motor resolution */
600, /* base x-res used to calculate geometry */
600, /* base y-res used to calculate geometry */
1200, /* if ydpi is equal or higher, disable backtracking */
SANE_FALSE, /* Use base_ydpi for all resolutions */
{600, 300, 200, 150, 100, 0}, /* possible x-resolutions */
{600, 300, 200, 150, 100, 0}, /* possible y-resolutions */
{16, 8, 0}, /* possible depths in gray mode */
{16, 8, 0}, /* possible depths in color mode */
SANE_FIX (1.0), /* Start of scan area in mm (x) */
SANE_FIX (9.5), /* 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 (10.0), /* Start of white strip in mm (y) */
SANE_FIX (140.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 */
0, /* CCD distcance for CCD with 6 lines) */
COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */
{0x24, 0x0a, 0x23, 0x0f, 0x23, 0x0b}, /* Default offset/gain */
{0x157, 0x157, 0x157}, /* Default exposure parameters */
SANE_FIX (2.0), /* Default gamma value */
SANE_TRUE, /* Is this a CIS scanner? */
GT68XX_FLAG_NO_POWER_STATUS | GT68XX_FLAG_SHEET_FED
};
static GT68xx_Model plustek_opticslim1200_model = {
"plustek-opticslim-1200", /* Name */
"Plustek", /* Device vendor string */
@ -1575,6 +1665,7 @@ static GT68xx_USB_Device_Entry gt68xx_usb_device_list[] = {
{0x07b3, 0x0401, &plustek_op1248u_model}, /* Same scanner, different id? */
{0x07b3, 0x0402, &plustek_u16b_model},
{0x07b3, 0x0403, &plustek_u16b_model}, /* two ids? 403 seems to be more common */
{0x07b3, 0x0412, &plustek_opticslim_m12_model},
{0x07b3, 0x0413, &plustek_opticslim1200_model},
{0x07b3, 0x0422, &plustek_opticslim2400_model},
{0x0458, 0x2011, &genius_vivid3x_model},

Wyświetl plik

@ -96,10 +96,17 @@ gt68xx_generic_read_scanned_data (GT68xx_Device * dev, SANE_Bool * ready)
RIE (gt68xx_device_req (dev, req, req));
if (req[0] == 0)
*ready = SANE_TRUE;
*ready = SANE_FALSE;
if (dev->model->flags & GT68XX_FLAG_SHEET_FED)
{
if (req[0] == 0 && req[1] == 0x35)
*ready = SANE_TRUE;
}
else
*ready = SANE_FALSE;
{
if (req[0] == 0)
*ready = SANE_TRUE;
}
return SANE_STATUS_GOOD;
}
@ -194,6 +201,19 @@ gt68xx_generic_get_id (GT68xx_Device * dev)
return SANE_STATUS_GOOD;
}
SANE_Status
gt68xx_generic_paperfeed (GT68xx_Device * dev)
{
GT68xx_Packet req;
SANE_Status status;
memset (req, 0, sizeof (req));
req[0] = 0x83;
req[1] = 0x01;
RIE (gt68xx_device_req (dev, req, req));
return SANE_STATUS_GOOD;
}
#define MAX_PIXEL_MODE 15600

Wyświetl plik

@ -61,6 +61,7 @@ static SANE_Status
gt68xx_generic_set_exposure_time (GT68xx_Device * dev,
GT68xx_Exposure_Parameters * params);
static SANE_Status gt68xx_generic_get_id (GT68xx_Device * dev);
static SANE_Status gt68xx_generic_paperfeed (GT68xx_Device * dev);
static SANE_Status
gt68xx_generic_setup_scan (GT68xx_Device * dev,

Wyświetl plik

@ -510,7 +510,8 @@ gt68xx_scanner_start_scan_extended (GT68xx_Scanner * scanner,
return status;
}
if (scanner->dev->model->is_cis)
if (scanner->dev->model->is_cis
&& !(scanner->dev->model->flags & GT68XX_FLAG_SHEET_FED))
{
status =
gt68xx_device_set_exposure_time (scanner->dev,

Wyświetl plik

@ -611,6 +611,16 @@ gt68xx_device_carriage_home (GT68xx_Device * dev)
return SANE_STATUS_UNSUPPORTED;
}
SANE_Status
gt68xx_device_paperfeed (GT68xx_Device * dev)
{
CHECK_DEV_ACTIVE (dev, "gt68xx_device_paperfeed");
if (dev->model->command_set->paperfeed)
return (*dev->model->command_set->paperfeed) (dev);
else
return SANE_STATUS_UNSUPPORTED;
}
SANE_Status
gt68xx_device_start_scan (GT68xx_Device * dev)
{

Wyświetl plik

@ -113,6 +113,7 @@
#define GT68XX_FLAG_SCAN_FROM_HOME (1 << 9) /* Move home after calibration */
#define GT68XX_FLAG_USE_OPTICAL_X (1 << 10) /* Use optical xdpi for 50 dpi and below */
#define GT68XX_FLAG_ALWAYS_LINEMODE (1 << 11) /* Linemode must be used for any resolution */
#define GT68XX_FLAG_SHEET_FED (1 << 12) /* we have a sheet fed scanner */
/* Forward typedefs */
typedef struct GT68xx_USB_Device_Entry GT68xx_USB_Device_Entry;
@ -333,6 +334,7 @@ struct GT68xx_Command_Set
*/
SANE_Status (*is_moving) (GT68xx_Device * dev, SANE_Bool * moving);
/** Move the scanner carriage by the specified number of steps.
*
* @param dev Device object.
@ -353,6 +355,12 @@ struct GT68xx_Command_Set
*/
SANE_Status (*carriage_home) (GT68xx_Device * dev);
/** Eject the paper at the end of the scan.
*
* @param dev Device object.
*/
SANE_Status (*paperfeed) (GT68xx_Device * dev);
/** Start scanning the image.
*
* @param dev Device object.
@ -903,6 +911,17 @@ gt68xx_device_move_relative (GT68xx_Device * dev, SANE_Int distance);
*/
static SANE_Status gt68xx_device_carriage_home (GT68xx_Device * dev);
/** Eject the paper after the end of scanning.
*
*
* @param dev Device object.
*
* @return
* - #SANE_STATUS_GOOD - success; the movement is started.
* - #SANE_STATUS_IO_ERROR - a communication error occured.
*/
static SANE_Status gt68xx_device_paperfeed (GT68xx_Device * dev);
/** Start scanning the image.
*
* This function initiates scanning with parameters set by

Wyświetl plik

@ -1,5 +1,5 @@
:backend "gt68xx"
:version "1.0-76"
:version "1.0-77"
:manpage "sane-gt68xx"
:url "http://www.meier-geinitz.de/sane/gt68xx-backend/"
:comment "Only the USB scanners mentioned below are supported. For other Mustek BearPaws, look at the Plustek and the MA-1509 backend."
@ -276,6 +276,11 @@
:interface "USB"
:status :good
:comment "Works up to 1200 dpi."
:model "OpticSlim M12"
:interface "USB"
:status :basic
:comment "Scans, but no calibration is performed and the area selection is limited."
; -----------------------------------------------------------------------------
:mfg "RevScan"

Wyświetl plik

@ -1,5 +1,12 @@
gt68xx.CHANGES -*-text-*-
V 1.0.77 (2005-09-29)
* Added support for Plustek OpticSlim M12 (untested). Based on patch from
Gerhard Jaeger <gerhard@gjaeger.de>.
* Fixed gt68xx homepage links in man page. Changed minimum version of libusb
to 0.1.8.
V 1.0.76 (2005-09-18)
* Fixed segfault that may happen with Mustek ScanExpress A3 USB.

Wyświetl plik

@ -82,6 +82,7 @@ Mustek BearPaw 2400 CU Plus
Mustek ScanExpress A3 USB
- still slight vert. stripes
- why is line distance setup necessary?
- line distance varies with resolution (0,5,5 at 300 dpi, 0, 6, 7 with 150 dpi)
- exposure doesn't seem to have any effect
Mustek ScanExpress 1248 UB

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-gt68xx 5 "18 August 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.TH sane-gt68xx 5 "29 September 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane-gt68xx
.SH NAME
sane-gt68xx \- SANE backend for GT-68XX based USB flatbed scanners
@ -9,7 +9,7 @@ library implements a SANE (Scanner Access Now Easy) backend that provides
access to USB flatbed scanners based on the Grandtech GT-6801 and GT-6816
chips. A list of supported scanners can be found on the gt68xx backend
homepage:
.IR http://www.meier-geinitz.de/sane/gt68xx/ .
.IR http://www.meier-geinitz.de/sane/gt68xx-backend/ .
.PP
This is BETA software. Especially if you test new or untested scanners, keep
your hand at the scanner's plug and unplug it, if the head bumps at the end of
@ -27,8 +27,8 @@ or GT-6816 chipset, you can try to add it to the backend. Have a look at the
following web page:
.I http://www.meier-geinitz.de/sane/gt68xx-backend/adding.html
.PP
.SH KERNEL ISSUES
Please use libusb-0.1.6 or later. Without libusb or with older libusb versions
.SH LIBUSB ISSUES
Please use libusb-0.1.8 or later. Without libusb or with older libusb versions
all kinds of trouble can be expected. The scanner should be found by
sane-find-scanner without further actions. For setting permissions and general
USB information looks at
@ -212,7 +212,7 @@ Y-resolution differ.
Support for buttons is missing.
.PP
More detailed bug information is available at the gt68xx backend homepage
.IR http://www.meier-geinitz.de/sane/gt68xx .
.IR http://www.meier-geinitz.de/sane/gt68xx-backend/ .
Please contact me if you find a bug or missing feature:
<henning@meier-geinitz.de>. Please send a debug log if your scanner isn't
detected correctly (see SANE_DEBUG_GT68XX above).