- fix head parking for HP4400

- tune dark calibration for HP4400
merge-requests/1/head
Stéphane Voltz 2008-09-11 04:38:19 +00:00
rodzic 286dbd885d
commit c21bb0ab56
4 zmienionych plików z 50 dodań i 16 usunięć

Wyświetl plik

@ -1,3 +1,7 @@
2008-08-21 Stéphane Voltz <stef.dev@free.fr>
* backend/rts8891.c backend/rts8891_low.c backend/rts8891_low.h: fix
parking for HP4400, tune dark calibration for HP4400
2008-09-07 Nicolas Martin <nicols-guest at users.alioth.debian.org>
* backend/pixma_mp150.c backend/pixma_imageclass.c backend/pixma_common.h
doc/sane-pixma.man doc/descriptions/pixma.desc:

Wyświetl plik

@ -4355,6 +4355,14 @@ dark_calibration (struct Rts8891_Device *dev, int mode, int light)
DBG (DBG_proc, "dark_calibration: start\n");
/* set up sensor specific bottom values */
if(dev->sensor == SENSOR_TYPE_4400)
{
bro = 128;
bgo = 128;
bbo = 128;
}
/* set up starting values */
sanei_rts88xx_set_gain (dev->regs, 0, 0, 0);
sanei_rts88xx_set_scan_area (dev->regs, 1, 2, 4, 4 + CALIBRATION_WIDTH);
@ -5837,7 +5845,7 @@ move_to_scan_area (struct Rts8891_Session *session)
dev->ystart);
/* then send move command */
rts8891_move (dev->devnum, regs, distance, SANE_TRUE);
rts8891_move (dev, regs, distance, SANE_TRUE);
/* wait for completion */
do
@ -6621,7 +6629,7 @@ park_head (struct Rts8891_Device *dev)
}
/* head parking */
status = rts8891_park (dev->devnum, regs);
status = rts8891_park (dev, regs);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error, "park_head: failed to park head!\n");

Wyświetl plik

@ -369,7 +369,7 @@ rts8891_set_default_regs (SANE_Byte * scanner_regs)
}
static SANE_Status
rts8891_move (SANE_Int devnum, SANE_Byte * regs, SANE_Int distance,
rts8891_move (struct Rts8891_Device *device, SANE_Byte * regs, SANE_Int distance,
SANE_Bool forward)
{
SANE_Status status = SANE_STATUS_GOOD;
@ -438,10 +438,32 @@ rts8891_move (SANE_Int devnum, SANE_Byte * regs, SANE_Int distance,
regs[0xe8] = 0x02;
regs[0xe9] = 0x02;
/* hp4400 sensor */
if (device->sensor == SENSOR_TYPE_4400)
{
device->regs[0x10] = 0x10; /* 0x20 */
device->regs[0x11] = 0x2a; /* 0x28 */
device->regs[0x13] = 0x39; /* 0x20 */
device->regs[0x14] = 0xf0; /* 0xf8 */
device->regs[0x15] = 0x29; /* 0x28 */
device->regs[0x16] = 0x0f; /* 0x07 */
device->regs[0x17] = 0x10; /* 0x00 */
device->regs[0x23] = 0x00; /* 0xff */
device->regs[0x35] = 0x29; /* 0x10 */
device->regs[0x36] = 0x21; /* 0x24 */
device->regs[0x39] = 0x00; /* 0x02 */
device->regs[0x80] = 0xb0; /* 0x32 */
device->regs[0x82] = 0xb1; /* 0x33 */
device->regs[0xe2] = 0x0b; /* 0x17 */
device->regs[0xe5] = 0xf3; /* 0xf9 */
device->regs[0xe6] = 0x01; /* 0x00 */
}
/* disable CCD */
regs[0] = 0xf5;
sanei_rts88xx_set_status (devnum, regs, 0x20, 0x28);
sanei_rts88xx_set_status (device->devnum, regs, 0x20, 0x28);
sanei_rts88xx_set_scan_area (regs, distance, distance + 1, 100, 200);
sanei_rts88xx_set_gain (regs, 16, 16, 16);
sanei_rts88xx_set_offset (regs, 127, 127, 127);
@ -458,10 +480,10 @@ rts8891_move (SANE_Int devnum, SANE_Byte * regs, SANE_Int distance,
}
/* write regiters values */
status = rts8891_write_all (devnum, regs, RTS8891_MAX_REGISTERS);
status = rts8891_write_all (device->devnum, regs, RTS8891_MAX_REGISTERS);
/* commit it */
rts8891_commit (devnum, 0x00);
rts8891_commit (device->devnum, 0x00);
return status;
}
@ -472,21 +494,21 @@ rts8891_move (SANE_Int devnum, SANE_Byte * regs, SANE_Int distance,
* messing scanner status
*/
static SANE_Status
rts8891_park (SANE_Int devnum, SANE_Byte * regs)
rts8891_park (struct Rts8891_Device *device, SANE_Byte * regs)
{
SANE_Status status = SANE_STATUS_GOOD;
SANE_Byte motor, sensor, reg;
DBG (DBG_proc, "rts8891_park: start\n");
rts8891_move (devnum, regs, 8000, SANE_FALSE);
rts8891_move (device, regs, 8000, SANE_FALSE);
/* wait for controller home bit to raise, no timeout */
/* at each loop we check that motor is on, then that the sensor bit it cleared */
do
{
sanei_rts88xx_read_reg (devnum, CONTROL_REG, &motor);
sanei_rts88xx_read_reg (devnum, CONTROLER_REG, &sensor);
sanei_rts88xx_read_reg (device->devnum, CONTROL_REG, &motor);
sanei_rts88xx_read_reg (device->devnum, CONTROLER_REG, &sensor);
}
while ((motor & 0x08) && ((sensor & 0x02) == 0));
@ -501,16 +523,16 @@ rts8891_park (SANE_Int devnum, SANE_Byte * regs)
/* re-enable CCD */
regs[0] = regs[0] & 0xef;
sanei_rts88xx_cancel (devnum);
sanei_rts88xx_cancel (device->devnum);
/* reset ? so we don't need to read data */
reg = 0;
/* b7: movement on/off, b3-b0 : movement divisor */
sanei_rts88xx_write_reg (devnum, 0x33, &reg);
sanei_rts88xx_write_reg (devnum, 0x33, &reg);
sanei_rts88xx_write_reg (device->devnum, 0x33, &reg);
sanei_rts88xx_write_reg (device->devnum, 0x33, &reg);
/* movement direction */
sanei_rts88xx_write_reg (devnum, 0x36, &reg);
sanei_rts88xx_cancel (devnum);
sanei_rts88xx_write_reg (device->devnum, 0x36, &reg);
sanei_rts88xx_cancel (device->devnum);
DBG (DBG_proc, "rts8891_park: end\n");
return status;

Wyświetl plik

@ -283,6 +283,6 @@ static SANE_Status rts8891_commit (SANE_Int devnum, SANE_Byte value);
* move the head backward by a huge line number then poll home sensor until
* head has get back home
*/
static SANE_Status rts8891_park (SANE_Int devnum, SANE_Byte * regs);
static SANE_Status rts8891_park (struct Rts8891_Device *device, SANE_Byte * regs);
#endif /* not RTS8891_LOW_H */