2008-09-25 m. allan noah <kitno455 a t gmail d o t com>

* backend/epjitsu.[ch], backend/epjitsu-cmd.h: backend v 13, 14 and 15:
        - add working page-height control
        - add working brightness, contrast and threshold controls
        - add disabled threshold curve and geometry controls
        - move initialization code to sane_get_devices, for hotplugging
        - support S300 on USB power
        - support S300 225x200 and 600x600 scans
        - support for automatic paper length detection (parm.lines = -1)
        - expose hardware buttons/sensors as options for S300
        * doc/descriptions/epjitsu.desc: change S300 status to good
merge-requests/1/head
m. allan noah 2008-09-25 03:15:49 +00:00
rodzic ba856d2aec
commit 0bbf8bac04
5 zmienionych plików z 1458 dodań i 464 usunięć

Wyświetl plik

@ -1,3 +1,15 @@
2008-09-25 m. allan noah <kitno455 a t gmail d o t com>
* backend/epjitsu.[ch], backend/epjitsu-cmd.h: backend v 13, 14 and 15:
- add working page-height control
- add working brightness, contrast and threshold controls
- add disabled threshold curve and geometry controls
- move initialization code to sane_get_devices, for hotplugging
- support S300 on USB power
- support S300 225x200 and 600x600 scans
- support for automatic paper length detection (parm.lines = -1)
- expose hardware buttons/sensors as options for S300
* doc/descriptions/epjitsu.desc: change S300 status to good
2008-09-25 m. allan noah <kitno455 a t gmail d o t com> 2008-09-25 m. allan noah <kitno455 a t gmail d o t com>
* include/sane/saneopts.h: underscore not allowed in option names * include/sane/saneopts.h: underscore not allowed in option names
* frontend/scanimage.c: fix broken unknown length (-1) binary scans, * frontend/scanimage.c: fix broken unknown length (-1) binary scans,

Wyświetl plik

@ -1,3 +1,31 @@
static void
putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
{
int i;
for (i = nbytes - 1; i >= 0; i--) {
pnt[i] = value & 0xff;
value = value >> 8;
}
}
#define SET_WINDOW_LEN 72
#define set_SW_byte7(out, val) out[7] = val
#define set_SW_xres(out, val) putnbyte(out + 0x0a, val, 2)
#define set_SW_yres(out, val) putnbyte(out + 0x0c, val, 2)
#define set_SW_xpix(out, val) putnbyte(out + 0x16, val, 4)
#define set_SW_ypix(out, val) putnbyte(out + 0x1a, val, 4)
#define set_SW_compo(out, val) out[0x21] = val /*color=5,gray=2*/
#define set_SW_bpp(out, val) out[0x22] = val
#define set_SW_byte31(out, val) out[0x31] = val
#define set_SW_byte32(out, val) out[0x32] = val
#define set_SW_byte33(out, val) out[0x33] = val
#define set_SW_lpb(out, val) out[0x34] = val
#define set_SW_byte35(out, val) out[0x35] = val
#define set_SW_byte36(out, val) out[0x36] = val
#define set_SW_byte38(out, val) out[0x38] = val /*move motor?*/
#define set_SW_fres(out, val) putnbyte(out + 0x39, val, 2)
/*************** COARSE CALIBRATION DEFAULT PAYLOAD *************/ /*************** COARSE CALIBRATION DEFAULT PAYLOAD *************/
/* 1b c6 (send coarse cal) command payload - not resolution specific? */ /* 1b c6 (send coarse cal) command payload - not resolution specific? */
/* first group of 3 is offset?, larger # == brighter */ /* first group of 3 is offset?, larger # == brighter */
@ -121,7 +149,6 @@ static unsigned char setWindowScan_FI60F_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
/*************** S300 150dpi *************/ /*************** S300 150dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */ /* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_150[] = { static unsigned char setWindowCoarseCal_S300_150[] = {
@ -160,13 +187,56 @@ static unsigned char sendCal2Header_S300_150[] = { /* plus 0xc780 data bytes */
/* 1b d1 (set window) before scan */ /* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_150[] = { static unsigned char setWindowScan_S300_150[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00,
/*0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc8, 0x00, 0x00, 0x09, 0x0d, 0x00, 0x00,*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc8, 0x00, 0x00, 0x06, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xc8, 0x00, 0x00, 0x06, 0xe2, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x01, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
/*************** S300 225dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_225[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x63c0 bytes) */
static unsigned char setWindowFineCal_S300_225[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */
static unsigned char setWindowSendCal_S300_225[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_225[] = { /* plus 0xc780 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_225[] = { /* plus 0xc780 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xd0, 0x34, 0xd0, 0x34, 0xd0, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_225[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe1, 0x00, 0xc8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x34, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 300dpi *************/ /*************** S300 300dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x6000 bytes) */ /* 1b d1 (set window) before coarse cal (read 1 line of 0x6000 bytes) */
static unsigned char setWindowCoarseCal_S300_300[] = { static unsigned char setWindowCoarseCal_S300_300[] = {
@ -205,15 +275,13 @@ static unsigned char sendCal2Header_S300_300[] = { /* plus 0xc000 data bytes */
/* 1b d1 (set window) before scan */ /* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_300[] = { static unsigned char setWindowScan_S300_300[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
/*0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x12, 0x18, 0x00, 0x00,*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf0, 0x00, 0x00, 0x0d, 0xc4, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x01, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
#if 0 /*************** S300 600dpi USB and AC power *************/
/*************** S300 600dpi *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0xbc40 bytes) */ /* 1b d1 (set window) before coarse cal (read 1 line of 0xbc40 bytes) */
static unsigned char setWindowCoarseCal_S300_600[] = { static unsigned char setWindowCoarseCal_S300_600[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x02, 0x58, 0x02, 0x58, 0x00, 0x00,
@ -254,4 +322,138 @@ static unsigned char setWindowScan_S300_600[] = {
0x00, 0x80, 0x80, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
#endif
/*S300 can also use a USB power cable, but it requires a different set of params?*/
/*************** S300 150dpi USB *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_150_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x63c0 bytes) */
static unsigned char setWindowFineCal_S300_150_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */
static unsigned char setWindowSendCal_S300_150_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x60, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_150_U[] = { /* plus 0xc780 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_150_U[] = { /* plus 0xc780 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xd0, 0x34, 0xd0, 0x34, 0xd0, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_150_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x90, 0x00, 0x00, 0x09, 0x0d, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 225dpi USB *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_225_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x63c0 bytes) */
static unsigned char setWindowFineCal_S300_225_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */
static unsigned char setWindowSendCal_S300_225_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_225_U[] = { /* plus 0xc780 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_225_U[] = { /* plus 0xc780 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xd0, 0x34, 0xd0, 0x34, 0xd0, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_225_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xe1, 0x00, 0xc8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xe0, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 300dpi USB *************/
/* 1b d1 (set window) before coarse cal (read 1 line of 0x63c0 bytes) */
static unsigned char setWindowCoarseCal_S300_300_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before fine cal (read 16 lines of 0x63c0 bytes) */
static unsigned char setWindowFineCal_S300_300_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b d1 (set window) before gain/offset tables (write 1 line of 0xc780 bytes) */
static unsigned char setWindowSendCal_S300_300_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x03, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* 1b c3 (gain?) command header */
static unsigned char sendCal1Header_S300_300_U[] = { /* plus 0xc780 data bytes */
0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0xe2, 0x0a, 0x00, 0x04
/*0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0xa5, 0x0b, 0x00, 0x05*/
};
/* 1b c4 (offset?) command header */
static unsigned char sendCal2Header_S300_300_U[] = { /* plus 0xc780 data bytes */
0x77, 0x26, 0x77, 0x26, 0x77, 0x26, 0x07
/*0xd0, 0x34, 0xd0, 0x34, 0xd0, 0x34, 0x08*/
};
/* 1b d1 (set window) before scan */
static unsigned char setWindowScan_S300_300_U[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x01, 0x2c, 0x01, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xf0, 0x00, 0x00, 0x12, 0x11, 0x00, 0x00,
0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************** S300 600dpi USB is same as AC power *************/

Plik diff jest za duży Load Diff

Wyświetl plik

@ -21,6 +21,28 @@ enum scanner_Option
OPT_X_RES, OPT_X_RES,
OPT_Y_RES, OPT_Y_RES,
OPT_GEOMETRY_GROUP,
OPT_TL_X,
OPT_TL_Y,
OPT_BR_X,
OPT_BR_Y,
OPT_PAGE_WIDTH,
OPT_PAGE_HEIGHT,
OPT_ENHANCEMENT_GROUP,
OPT_BRIGHTNESS,
OPT_CONTRAST,
OPT_GAMMA,
OPT_THRESHOLD,
OPT_THRESHOLD_CURVE,
OPT_SENSOR_GROUP,
OPT_SCAN_SW,
OPT_HOPPER,
OPT_TOP,
OPT_ADF_OPEN,
OPT_SLEEP,
/* must come last: */ /* must come last: */
NUM_OPTIONS NUM_OPTIONS
}; };
@ -41,6 +63,8 @@ struct transfer {
int rx_bytes; int rx_bytes;
int tx_bytes; int tx_bytes;
int done;
unsigned char * buffer; unsigned char * buffer;
}; };
@ -50,17 +74,29 @@ struct scanner
/* immutable values which are set during init of scanner. */ /* immutable values which are set during init of scanner. */
struct scanner *next; struct scanner *next;
int missing;
int model; int model;
int usb_power;
int has_fb; int has_fb;
int has_adf; int has_adf;
int x_res_150; int x_res_150;
int x_res_225;
int x_res_300; int x_res_300;
int x_res_600; int x_res_600;
int y_res_150; int y_res_150;
int y_res_225;
int y_res_300; int y_res_300;
int y_res_600; int y_res_600;
/* the scan size in 1/1200th inches, NOT basic_units or sane units */
int max_x;
int max_y;
int min_x;
int min_y;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* immutable values which are set during inquiry probing of the scanner. */ /* immutable values which are set during inquiry probing of the scanner. */
SANE_Device sane; /*contains: name, vendor, model, type*/ SANE_Device sane; /*contains: name, vendor, model, type*/
@ -81,6 +117,21 @@ struct scanner
SANE_Int x_res_list[4]; SANE_Int x_res_list[4];
SANE_Int y_res_list[4]; SANE_Int y_res_list[4];
/*geometry group*/
SANE_Range tl_x_range;
SANE_Range tl_y_range;
SANE_Range br_x_range;
SANE_Range br_y_range;
SANE_Range paper_x_range;
SANE_Range paper_y_range;
/*enhancement group*/
SANE_Range brightness_range;
SANE_Range contrast_range;
SANE_Range gamma_range;
SANE_Range threshold_range;
SANE_Range threshold_curve_range;
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* changeable vars to hold user input. modified by SANE_Options above */ /* changeable vars to hold user input. modified by SANE_Options above */
@ -90,7 +141,23 @@ struct scanner
int res; /* from a limited list, x and y same */ int res; /* from a limited list, x and y same */
int resolution_x; /* unused dummy */ int resolution_x; /* unused dummy */
int resolution_y; /* unused dummy */ int resolution_y; /* unused dummy */
/*geometry group*/
/* The desired size of the scan, all in 1/1200 inch */
int tl_x;
int tl_y;
int br_x;
int br_y;
int page_width;
int page_height;
/*enhancement group*/
int brightness;
int contrast;
int gamma;
int threshold; int threshold;
int threshold_curve;
int height; /* may run out on adf */ int height; /* may run out on adf */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
@ -117,7 +184,7 @@ struct scanner
/* values which are set by scanning functions to keep track of pages, etc */ /* values which are set by scanning functions to keep track of pages, etc */
int started; int started;
int side; int side;
int send_eof; /*we've sent all of image*/ int last43;
/* requested size params (almost no relation to actual data?) */ /* requested size params (almost no relation to actual data?) */
int req_width; /* pixel width of first read-head? */ int req_width; /* pixel width of first read-head? */
@ -156,10 +223,20 @@ struct scanner
/* values used by the command and data sending function */ /* values used by the command and data sending function */
int fd; /* The scanner device file descriptor. */ int fd; /* The scanner device file descriptor. */
/* --------------------------------------------------------------------- */
/* values which are used by the get hardware status command */
time_t last_ghs;
int hw_scan_sw;
int hw_hopper;
int hw_top;
int hw_adf_open;
int hw_sleep;
}; };
#define MODEL_S300 0 #define MODEL_NONE 0
#define MODEL_FI60F 1 #define MODEL_S300 1
#define MODEL_FI60F 2
#define USB_COMMAND_TIME 10000 #define USB_COMMAND_TIME 10000
#define USB_DATA_TIME 10000 #define USB_DATA_TIME 10000
@ -261,7 +338,6 @@ static SANE_Status load_fw(struct scanner *s);
static SANE_Status get_ident(struct scanner *s); static SANE_Status get_ident(struct scanner *s);
static SANE_Status change_params(struct scanner *s); static SANE_Status change_params(struct scanner *s);
void update_block_totals(struct scanner * s);
static SANE_Status destroy(struct scanner *s); static SANE_Status destroy(struct scanner *s);
static SANE_Status teardown_buffers(struct scanner *s); static SANE_Status teardown_buffers(struct scanner *s);
@ -270,6 +346,7 @@ static SANE_Status setup_buffers(struct scanner *s);
static SANE_Status ingest(struct scanner *s); static SANE_Status ingest(struct scanner *s);
static SANE_Status coarsecal(struct scanner *s); static SANE_Status coarsecal(struct scanner *s);
static SANE_Status finecal(struct scanner *s); static SANE_Status finecal(struct scanner *s);
static SANE_Status send_lut(struct scanner *s);
static SANE_Status lamp(struct scanner *s, unsigned char set); static SANE_Status lamp(struct scanner *s, unsigned char set);
static SANE_Status set_window(struct scanner *s, int window); static SANE_Status set_window(struct scanner *s, int window);
static SANE_Status scan(struct scanner *s); static SANE_Status scan(struct scanner *s);
@ -278,7 +355,14 @@ static SANE_Status read_from_scanner(struct scanner *s, struct transfer *tp);
static SANE_Status fill_frontback_buffers_S300(struct scanner *s); static SANE_Status fill_frontback_buffers_S300(struct scanner *s);
static SANE_Status fill_frontback_buffers_FI60F(struct scanner *s); static SANE_Status fill_frontback_buffers_FI60F(struct scanner *s);
static SANE_Status get_hardware_status (struct scanner *s);
int get_page_width (struct scanner *s);
int get_page_height (struct scanner *s);
unsigned char get_stat(struct scanner *s);
/* utils */ /* utils */
void update_transfer_totals(struct transfer * t);
static void hexdump (int level, char *comment, unsigned char *p, int l); static void hexdump (int level, char *comment, unsigned char *p, int l);
static size_t maxStringSize (const SANE_String_Const strings[]); static size_t maxStringSize (const SANE_String_Const strings[]);

Wyświetl plik

@ -11,9 +11,9 @@
:backend "epjitsu" ; name of backend :backend "epjitsu" ; name of backend
:url "http://www.thebility.com/epjitsu/" :url "http://www.thebility.com/epjitsu/"
:version "1.0.12" ; version of backend :version "15" ; version of backend
:manpage "sane-epjitsu" ; name of manpage (if it exists) :manpage "sane-epjitsu" ; name of manpage (if it exists)
:comment "Only basic support provided, see sane-epjitsu manpage" :comment "See sane-epjitsu manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api
@ -30,9 +30,9 @@
:model "ScanSnap S300" :model "ScanSnap S300"
:interface "USB" :interface "USB"
:status :basic :status :good
:usbid "0x04c5" "0x1156" :usbid "0x04c5" "0x1156"
:comment "10 sheet ADF, 150/300 dpi, always scans in triplex color, no TWAIN driver" :comment "Duplex, 150/225/300/600 dpi, binary/gray/color, AC/USB power, buttons/sensors all supported. Scanner always scans in _triplex_ color, fast USB required. Calibration only fair at high resolution."
:model "ScanSnap S300M" :model "ScanSnap S300M"
:interface "USB" :interface "USB"