genesys: Add support for Plustek Opticfilm 7400

merge-requests/213/head^2
Povilas Kanapickas 2020-03-27 21:29:27 +02:00
rodzic ef67ab0835
commit adaac29d90
14 zmienionych plików z 364 dodań i 80 usunięć

Wyświetl plik

@ -130,6 +130,9 @@ usb 0x07b3 0x0c04
# Plustek OpticFilm 7300
usb 0x07b3 0x0c12
# Plustek OpticFilm 7400
usb 0x07b3 0x0c3a
# Plustek OpticFilm 7500i
usb 0x07b3 0x0c13

Wyświetl plik

@ -122,6 +122,7 @@ void CommandSetCommon::set_xpa_lamp_power(Genesys_Device& dev, bool set) const
}
},
{ ModelId::PLUSTEK_OPTICFILM_7300, ScanMethod::TRANSPARENCY, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7400, ScanMethod::TRANSPARENCY, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7500I, ScanMethod::TRANSPARENCY, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7500I, ScanMethod::TRANSPARENCY_INFRARED, {
{ 0xa8, 0x07, 0x07 },
@ -203,6 +204,7 @@ void CommandSetCommon::set_motor_mode(Genesys_Device& dev, Genesys_Register_Set&
},
{ ModelId::PLUSTEK_OPTICFILM_7200I, VALUE_FILTER_ANY, {}, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7300, VALUE_FILTER_ANY, {}, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7400, VALUE_FILTER_ANY, {}, {}, {} },
{ ModelId::PLUSTEK_OPTICFILM_7500I, VALUE_FILTER_ANY, {}, {}, {} },
};

Wyświetl plik

@ -142,6 +142,7 @@ std::ostream& operator<<(std::ostream& out, ModelId id)
case ModelId::PLUSTEK_OPTICBOOK_3800: out << "PLUSTEK_OPTICBOOK_3800"; break;
case ModelId::PLUSTEK_OPTICFILM_7200I: out << "PLUSTEK_OPTICFILM_7200I"; break;
case ModelId::PLUSTEK_OPTICFILM_7300: out << "PLUSTEK_OPTICFILM_7300"; break;
case ModelId::PLUSTEK_OPTICFILM_7400: out << "PLUSTEK_OPTICFILM_7400"; break;
case ModelId::PLUSTEK_OPTICFILM_7500I: out << "PLUSTEK_OPTICFILM_7500I"; break;
case ModelId::PLUSTEK_OPTICPRO_3600: out << "PLUSTEK_OPTICPRO_3600"; break;
case ModelId::PLUSTEK_OPTICPRO_ST12: out << "PLUSTEK_OPTICPRO_ST12"; break;
@ -186,6 +187,7 @@ std::ostream& operator<<(std::ostream& out, AdcId id)
case AdcId::PLUSTEK_OPTICBOOK_3800: out << "PLUSTEK_OPTICBOOK_3800"; break;
case AdcId::PLUSTEK_OPTICFILM_7200I: out << "PLUSTEK_OPTICFILM_7200I"; break;
case AdcId::PLUSTEK_OPTICFILM_7300: out << "PLUSTEK_OPTICFILM_7300"; break;
case AdcId::PLUSTEK_OPTICFILM_7400: out << "PLUSTEK_OPTICFILM_7400"; break;
case AdcId::PLUSTEK_OPTICFILM_7500I: out << "PLUSTEK_OPTICFILM_7500I"; break;
case AdcId::PLUSTEK_OPTICPRO_3600: out << "PLUSTEK_OPTICPRO_3600"; break;
case AdcId::WOLFSON_5345: out << "WOLFSON_5345"; break;
@ -230,6 +232,7 @@ std::ostream& operator<<(std::ostream& out, GpioId id)
case GpioId::PLUSTEK_OPTICBOOK_3800: out << "PLUSTEK_OPTICBOOK_3800"; break;
case GpioId::PLUSTEK_OPTICFILM_7200I: out << "PLUSTEK_OPTICFILM_7200I"; break;
case GpioId::PLUSTEK_OPTICFILM_7300: out << "PLUSTEK_OPTICFILM_7300"; break;
case GpioId::PLUSTEK_OPTICFILM_7400: out << "PLUSTEK_OPTICFILM_7400"; break;
case GpioId::PLUSTEK_OPTICFILM_7500I: out << "PLUSTEK_OPTICFILM_7500I"; break;
case GpioId::PLUSTEK_OPTICPRO_3600: out << "PLUSTEK_OPTICPRO_3600"; break;
case GpioId::ST12: out << "ST12"; break;
@ -269,6 +272,7 @@ std::ostream& operator<<(std::ostream& out, MotorId id)
case MotorId::PLUSTEK_OPTICBOOK_3800: out << "PLUSTEK_OPTICBOOK_3800"; break;
case MotorId::PLUSTEK_OPTICFILM_7200I: out << "PLUSTEK_OPTICFILM_7200I"; break;
case MotorId::PLUSTEK_OPTICFILM_7300: out << "PLUSTEK_OPTICFILM_7300"; break;
case MotorId::PLUSTEK_OPTICFILM_7400: out << "PLUSTEK_OPTICFILM_7400"; break;
case MotorId::PLUSTEK_OPTICFILM_7500I: out << "PLUSTEK_OPTICFILM_7500I"; break;
case MotorId::PLUSTEK_OPTICPRO_3600: out << "PLUSTEK_OPTICPRO_3600"; break;
case MotorId::ROADWARRIOR: out << "ROADWARRIOR"; break;

Wyświetl plik

@ -203,6 +203,7 @@ enum class ModelId : unsigned
PLUSTEK_OPTICBOOK_3800,
PLUSTEK_OPTICFILM_7200I,
PLUSTEK_OPTICFILM_7300,
PLUSTEK_OPTICFILM_7400,
PLUSTEK_OPTICFILM_7500I,
PLUSTEK_OPTICPRO_3600,
PLUSTEK_OPTICPRO_ST12,
@ -259,6 +260,7 @@ enum class SensorId : unsigned
CCD_PLUSTEK_OPTICBOOK_3800,
CCD_PLUSTEK_OPTICFILM_7200I,
CCD_PLUSTEK_OPTICFILM_7300,
CCD_PLUSTEK_OPTICFILM_7400,
CCD_PLUSTEK_OPTICFILM_7500I,
CCD_PLUSTEK_OPTICPRO_3600,
CCD_ROADWARRIOR,
@ -311,6 +313,7 @@ enum class AdcId : unsigned
PLUSTEK_OPTICBOOK_3800,
PLUSTEK_OPTICFILM_7200I,
PLUSTEK_OPTICFILM_7300,
PLUSTEK_OPTICFILM_7400,
PLUSTEK_OPTICFILM_7500I,
PLUSTEK_OPTICPRO_3600,
WOLFSON_5345,
@ -365,6 +368,7 @@ enum class GpioId : unsigned
PLUSTEK_OPTICBOOK_3800,
PLUSTEK_OPTICFILM_7200I,
PLUSTEK_OPTICFILM_7300,
PLUSTEK_OPTICFILM_7400,
PLUSTEK_OPTICFILM_7500I,
PLUSTEK_OPTICPRO_3600,
ST12,
@ -402,6 +406,7 @@ enum class MotorId : unsigned
PLUSTEK_OPTICBOOK_3800,
PLUSTEK_OPTICFILM_7200I,
PLUSTEK_OPTICFILM_7300,
PLUSTEK_OPTICFILM_7400,
PLUSTEK_OPTICFILM_7500I,
PLUSTEK_OPTICPRO_3600,
ROADWARRIOR,

Wyświetl plik

@ -997,6 +997,7 @@ void scanner_move_back_home_ta(Genesys_Device& dev)
switch (dev.model->asic_type) {
case AsicType::GL843:
case AsicType::GL845:
break;
default:
throw SaneException("Unsupported asic type");
@ -2980,6 +2981,7 @@ static void genesys_send_shading_coefficient(Genesys_Device* dev, const Genesys_
case SensorId::CCD_CANON_8600F:
case SensorId::CCD_PLUSTEK_OPTICFILM_7200I:
case SensorId::CCD_PLUSTEK_OPTICFILM_7300:
case SensorId::CCD_PLUSTEK_OPTICFILM_7400:
case SensorId::CCD_PLUSTEK_OPTICFILM_7500I:
target_code = 0xe000;
o = 0;

Wyświetl plik

@ -108,26 +108,44 @@ gl846_init_registers (Genesys_Device * dev)
dev->reg.clear();
dev->reg.init_reg(0x01, 0x60);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x01, 0x22);
}
dev->reg.init_reg(0x02, 0x38);
dev->reg.init_reg(0x03, 0x03);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x03, 0xbf);
}
dev->reg.init_reg(0x04, 0x22);
dev->reg.init_reg(0x05, 0x60);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x05, 0x48);
}
dev->reg.init_reg(0x06, 0x10);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x06, 0xf0);
}
dev->reg.init_reg(0x08, 0x60);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x08, 0x00);
}
dev->reg.init_reg(0x09, 0x00);
dev->reg.init_reg(0x0a, 0x00);
dev->reg.init_reg(0x0b, 0x8b);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0x0b, 0x2a);
}
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x0b, 0x4a);
}
dev->reg.init_reg(0x0c, 0x00);
dev->reg.init_reg(0x0d, 0x00);
dev->reg.init_reg(0x10, 0x00);
dev->reg.init_reg(0x11, 0x00);
dev->reg.init_reg(0x12, 0x00);
dev->reg.init_reg(0x13, 0x00);
dev->reg.init_reg(0x14, 0x00);
dev->reg.init_reg(0x15, 0x00);
dev->reg.init_reg(0x10, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x11, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x12, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x13, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x14, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x15, 0x00); // exposure, set during sensor setup
dev->reg.init_reg(0x16, 0xbb); // SENSOR_DEF
dev->reg.init_reg(0x17, 0x13); // SENSOR_DEF
dev->reg.init_reg(0x18, 0x10); // SENSOR_DEF
@ -136,33 +154,48 @@ gl846_init_registers (Genesys_Device * dev)
dev->reg.init_reg(0x1b, 0x00); // SENSOR_DEF
dev->reg.init_reg(0x1c, 0x20); // SENSOR_DEF
dev->reg.init_reg(0x1d, 0x06); // SENSOR_DEF
dev->reg.init_reg(0x1e, 0xf0);
dev->reg.init_reg(0x1e, 0xf0); // WDTIME, LINESEL: set during sensor and motor setup
// SCANFED
dev->reg.init_reg(0x1f, 0x01);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x1f, 0x00);
}
dev->reg.init_reg(0x20, 0x03);
dev->reg.init_reg(0x21, 0x10);
dev->reg.init_reg(0x22, 0x60);
dev->reg.init_reg(0x23, 0x60);
dev->reg.init_reg(0x24, 0x60);
dev->reg.init_reg(0x25, 0x00);
dev->reg.init_reg(0x26, 0x00);
dev->reg.init_reg(0x27, 0x00);
dev->reg.init_reg(0x2c, 0x00);
dev->reg.init_reg(0x2d, 0x00);
dev->reg.init_reg(0x2e, 0x80);
dev->reg.init_reg(0x2f, 0x80);
dev->reg.init_reg(0x30, 0x00);
dev->reg.init_reg(0x31, 0x00);
dev->reg.init_reg(0x32, 0x00);
dev->reg.init_reg(0x33, 0x00);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x20, 0x55);
}
dev->reg.init_reg(0x21, 0x10); // STEPNO: set during motor setup
dev->reg.init_reg(0x22, 0x60); // FWDSTEP: set during motor setup
dev->reg.init_reg(0x23, 0x60); // BWDSTEP: set during motor setup
dev->reg.init_reg(0x24, 0x60); // FASTNO: set during motor setup
dev->reg.init_reg(0x25, 0x00); // LINCNT: set during motor setup
dev->reg.init_reg(0x26, 0x00); // LINCNT: set during motor setup
dev->reg.init_reg(0x27, 0x00); // LINCNT: set during motor setup
dev->reg.init_reg(0x2c, 0x00); // DPISET: set during sensor setup
dev->reg.init_reg(0x2d, 0x00); // DPISET: set during sensor setup
dev->reg.init_reg(0x2e, 0x80); // BWHI: set during sensor setup
dev->reg.init_reg(0x2f, 0x80); // BWLOW: set during sensor setup
dev->reg.init_reg(0x30, 0x00); // STRPIXEL: set during sensor setup
dev->reg.init_reg(0x31, 0x00); // STRPIXEL: set during sensor setup
dev->reg.init_reg(0x32, 0x00); // ENDPIXEL: set during sensor setup
dev->reg.init_reg(0x33, 0x00); // ENDPIXEL: set during sensor setup
// DUMMY: the number of CCD dummy pixels
dev->reg.init_reg(0x34, 0x1f);
dev->reg.init_reg(0x35, 0x00);
dev->reg.init_reg(0x36, 0x40);
dev->reg.init_reg(0x37, 0x00);
dev->reg.init_reg(0x38, 0x2a);
dev->reg.init_reg(0x39, 0xf8);
dev->reg.init_reg(0x3d, 0x00);
dev->reg.init_reg(0x3e, 0x00);
dev->reg.init_reg(0x3f, 0x01);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x34, 0x14);
}
dev->reg.init_reg(0x35, 0x00); // MAXWD: set during scan setup
dev->reg.init_reg(0x36, 0x40); // MAXWD: set during scan setup
dev->reg.init_reg(0x37, 0x00); // MAXWD: set during scan setup
dev->reg.init_reg(0x38, 0x2a); // LPERIOD: set during sensor setup
dev->reg.init_reg(0x39, 0xf8); // LPERIOD: set during sensor setup
dev->reg.init_reg(0x3d, 0x00); // FEEDL: set during motor setup
dev->reg.init_reg(0x3e, 0x00); // FEEDL: set during motor setup
dev->reg.init_reg(0x3f, 0x01); // FEEDL: set during motor setup
dev->reg.init_reg(0x52, 0x02); // SENSOR_DEF
dev->reg.init_reg(0x53, 0x04); // SENSOR_DEF
dev->reg.init_reg(0x54, 0x06); // SENSOR_DEF
@ -172,22 +205,28 @@ gl846_init_registers (Genesys_Device * dev)
dev->reg.init_reg(0x58, 0x59); // SENSOR_DEF
dev->reg.init_reg(0x59, 0x31); // SENSOR_DEF
dev->reg.init_reg(0x5a, 0x40); // SENSOR_DEF
// DECSEL, STEPTIM
dev->reg.init_reg(0x5e, 0x1f);
dev->reg.init_reg(0x5f, 0x01);
dev->reg.init_reg(0x60, 0x00);
dev->reg.init_reg(0x61, 0x00);
dev->reg.init_reg(0x62, 0x00);
dev->reg.init_reg(0x63, 0x00);
dev->reg.init_reg(0x64, 0x00);
dev->reg.init_reg(0x65, 0x00);
dev->reg.init_reg(0x67, 0x7f);
dev->reg.init_reg(0x68, 0x7f);
dev->reg.init_reg(0x69, 0x01);
dev->reg.init_reg(0x6a, 0x01);
dev->reg.init_reg(0x70, 0x01);
dev->reg.init_reg(0x71, 0x00);
dev->reg.init_reg(0x72, 0x02);
dev->reg.init_reg(0x73, 0x01);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x5e, 0x01);
}
dev->reg.init_reg(0x5f, 0x01); // FMOVDEC: overwritten during motor setup
dev->reg.init_reg(0x60, 0x00); // STEPSEL, Z1MOD: overwritten during motor setup
dev->reg.init_reg(0x61, 0x00); // Z1MOD: overwritten during motor setup
dev->reg.init_reg(0x62, 0x00); // Z1MOD: overwritten during motor setup
dev->reg.init_reg(0x63, 0x00); // FSTPSEL, Z2MOD: overwritten during motor setup
dev->reg.init_reg(0x64, 0x00); // Z2MOD: overwritten during motor setup
dev->reg.init_reg(0x65, 0x00); // Z2MOD: overwritten during motor setup
dev->reg.init_reg(0x67, 0x7f); // MTRPWM: overwritten during motor setup
dev->reg.init_reg(0x68, 0x7f); // FASTPWM: overwritten during motor setup
dev->reg.init_reg(0x69, 0x01); // FSHDEC: overwritten during motor setup
dev->reg.init_reg(0x6a, 0x01); // FMOVNO: overwritten during motor setup
// 0x6b, 0x6c, 0x6d, 0x6e, 0x6f - gpio
dev->reg.init_reg(0x70, 0x01); // SENSOR_DEF
dev->reg.init_reg(0x71, 0x00); // SENSOR_DEF
dev->reg.init_reg(0x72, 0x02); // SENSOR_DEF
dev->reg.init_reg(0x73, 0x01); // SENSOR_DEF
dev->reg.init_reg(0x74, 0x00); // SENSOR_DEF
dev->reg.init_reg(0x75, 0x00); // SENSOR_DEF
dev->reg.init_reg(0x76, 0x00); // SENSOR_DEF
@ -197,26 +236,69 @@ gl846_init_registers (Genesys_Device * dev)
dev->reg.init_reg(0x7a, 0x00); // SENSOR_DEF
dev->reg.init_reg(0x7b, 0x09); // SENSOR_DEF
dev->reg.init_reg(0x7c, 0x99); // SENSOR_DEF
dev->reg.init_reg(0x7d, 0x20);
dev->reg.init_reg(0x7d, 0x20); // SENSOR_DEF
dev->reg.init_reg(0x7f, 0x05);
dev->reg.init_reg(0x80, 0x4f);
dev->reg.init_reg(0x87, 0x02);
dev->reg.init_reg(0x94, 0xff);
dev->reg.init_reg(0x9d, 0x04);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0x7f, 0x00);
}
dev->reg.init_reg(0x80, 0x4f); // overwritten during motor setup
dev->reg.init_reg(0x87, 0x02); // SENSOR_DEF
// MTRPLS: pulse width of ADF motor trigger signal
dev->reg.init_reg(0x94, 0x00);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0x94, 0xff);
}
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0x98, 0x20); // ONDUR
dev->reg.init_reg(0x99, 0x00); // ONDUR
dev->reg.init_reg(0x9a, 0x90); // OFFDUR
dev->reg.init_reg(0x9b, 0x00); // OFFDUR
}
dev->reg.init_reg(0x9d, 0x00); // contains STEPTIM
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0x9d, 0x04);
}
dev->reg.init_reg(0x9e, 0x00);
dev->reg.init_reg(0xa1, 0xe0);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0xa1, 0xe0);
}
// RFHSET (SDRAM refresh time)
dev->reg.init_reg(0xa2, 0x1f);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0xa2, 0x0f);
}
// 0xa6, 0xa7 0xa8, 0xa9 - gpio
// Various important settings: GPOM9, MULSTOP, NODECEL, TB3TB1, TB5TB2, FIX16CLK
dev->reg.init_reg(0xab, 0xc0);
dev->reg.init_reg(0xbb, 0x00);
dev->reg.init_reg(0xbc, 0x0f);
dev->reg.init_reg(0xdb, 0xff);
dev->reg.init_reg(0xfe, 0x08);
dev->reg.init_reg(0xff, 0x02);
dev->reg.init_reg(0x98, 0x20);
dev->reg.init_reg(0x99, 0x00);
dev->reg.init_reg(0x9a, 0x90);
dev->reg.init_reg(0x9b, 0x00);
dev->reg.init_reg(0xf8, 0x05);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0xab, 0x01);
}
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0xbb, 0x00); // FIXME: default is the same
}
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0xbc, 0x0f);
dev->reg.init_reg(0xdb, 0xff);
}
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->reg.init_reg(0xbe, 0x07);
}
// 0xd0, 0xd1, 0xd2 - SH0DWN, SH1DWN, SH2DWN - shading bank[0..2] for CCD.
// Set during memory layout setup
// [0xe0..0xf7] - image buffer addresses. Set during memory layout setup
dev->reg.init_reg(0xf8, 0x05); // MAXSEL, MINSEL
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
dev->reg.init_reg(0xfe, 0x08); // MOTTGST, AUTO_O
dev->reg.init_reg(0xff, 0x02); // AUTO_S
}
const auto& sensor = sanei_genesys_find_sensor_any(dev);
const auto& dpihw_sensor = sanei_genesys_find_sensor(dev, sensor.optical_res,
@ -521,12 +603,11 @@ static void gl846_init_optical_regs_scan(Genesys_Device* dev, const Genesys_Sens
r = sanei_genesys_get_address(reg, REG_0x01);
r->value |= REG_0x01_SHDAREA;
if (has_flag(session.params.flags, ScanFlag::DISABLE_SHADING) ||
has_flag(dev->model->flags, ModelFlag::NO_CALIBRATION))
has_flag(dev->model->flags, ModelFlag::NO_CALIBRATION) ||
session.use_host_side_calib)
{
r->value &= ~REG_0x01_DVDSET;
}
else
{
} else {
r->value |= REG_0x01_DVDSET;
}
@ -1161,15 +1242,14 @@ void CommandSetGl846::asic_boot(Genesys_Device* dev, bool cold) const
dev->interface->write_register(0x0e, 0x00);
}
if(dev->usb_mode == 1)
{
val = 0x14;
if (dev->model->model_id == ModelId::PLUSTEK_OPTICBOOK_3800) {
if (dev->usb_mode == 1) {
val = 0x14;
} else {
val = 0x11;
}
dev->interface->write_0x8c(0x0f, val);
}
else
{
val = 0x11;
}
dev->interface->write_0x8c(0x0f, val);
// test CHKVER
val = dev->interface->read_register(REG_0x40);
@ -1191,8 +1271,13 @@ void CommandSetGl846::asic_boot(Genesys_Device* dev, bool cold) const
}
// set up clocks
dev->interface->write_0x8c(0x10, 0x0e);
dev->interface->write_0x8c(0x13, 0x0e);
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400) {
dev->interface->write_0x8c(0x10, 0x0c);
dev->interface->write_0x8c(0x13, 0x0c);
} else {
dev->interface->write_0x8c(0x10, 0x0e);
dev->interface->write_0x8c(0x13, 0x0e);
}
// setup gpio
gl846_init_gpio(dev);

Wyświetl plik

@ -1005,6 +1005,7 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
if (dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7200I ||
dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7300 ||
dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7400 ||
dev->model->model_id == ModelId::PLUSTEK_OPTICFILM_7500I)
{
s.optical_pixels = align_int_up(s.optical_pixels, 16);
@ -1056,9 +1057,10 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
s.output_line_bytes_raw = s.output_line_bytes;
s.conseq_pixel_dist = 0;
if (dev->model->asic_type == AsicType::GL845 ||
dev->model->asic_type == AsicType::GL846 ||
dev->model->asic_type == AsicType::GL847)
if ((dev->model->asic_type == AsicType::GL845 ||
dev->model->asic_type == AsicType::GL846 ||
dev->model->asic_type == AsicType::GL847) &&
dev->model->model_id != ModelId::PLUSTEK_OPTICFILM_7400)
{
if (s.segment_count > 1) {
s.conseq_pixel_dist = sensor.segment_size;

Wyświetl plik

@ -60,7 +60,8 @@ void genesys_init_frontend_tables()
GenesysFrontendLayout analog_devices;
analog_devices.type = FrontendType::ANALOG_DEVICES;
analog_devices.offset_addr = { 0x05, 0x06, 0x07 };
analog_devices.gain_addr = { 0x02, 0x03, 0x04 };
Genesys_Frontend fe;
fe.id = AdcId::WOLFSON_UMAX;
@ -504,6 +505,23 @@ void genesys_init_frontend_tables()
s_frontends->push_back(fe);
fe = Genesys_Frontend();
fe.id = AdcId::PLUSTEK_OPTICFILM_7400;
fe.layout = analog_devices;
fe.regs = {
{ 0x00, 0xf8 },
{ 0x01, 0x80 },
{ 0x02, 0x1f },
{ 0x03, 0x14 },
{ 0x04, 0x19 },
{ 0x05, 0x1b },
{ 0x06, 0x1e },
{ 0x07, 0x0e },
};
fe.reg2 = {0x00, 0x00, 0x00};
s_frontends->push_back(fe);
fe = Genesys_Frontend();
fe.id = AdcId::PLUSTEK_OPTICFILM_7500I;
fe.layout = analog_devices;

Wyświetl plik

@ -320,6 +320,16 @@ void genesys_init_gpo_tables()
};
s_gpo->push_back(gpo);
gpo = Genesys_Gpo();
gpo.id = GpioId::PLUSTEK_OPTICFILM_7400;
gpo.regs = {
{ 0x6b, 0x30 }, { 0x6c, 0x4c }, { 0x6d, 0x80 }, { 0x6e, 0x4c }, { 0x6f, 0x80 },
{ 0xa6, 0x00 }, { 0xa7, 0x07 }, { 0xa8, 0x20 }, { 0xa9, 0x01 },
};
s_gpo->push_back(gpo);
gpo = Genesys_Gpo();
gpo.id = GpioId::PLUSTEK_OPTICFILM_7500I;
gpo.regs = {

Wyświetl plik

@ -53,6 +53,21 @@ void genesys_init_memory_layout_tables()
};
s_memory_layout->push_back(ml);
ml = MemoryLayout();
ml.models = { ModelId::PLUSTEK_OPTICFILM_7400 };
ml.regs = {
{ 0x81, 0x6d }, { 0x82, 0x00 }, { 0x83, 0x00 }, { 0x84, 0x00 },
{ 0x85, 0x00 }, { 0x86, 0x00 },
{ 0xd0, 0x0a }, { 0xd1, 0x0a }, { 0xd2, 0x0a },
{ 0xe0, 0x00 }, { 0xe1, 0x68 }, { 0xe2, 0x03 }, { 0xe3, 0x00 },
{ 0xe4, 0x03 }, { 0xe5, 0x01 }, { 0xe6, 0x05 }, { 0xe7, 0x99 },
{ 0xe8, 0x05 }, { 0xe9, 0x9a }, { 0xea, 0x08 }, { 0xeb, 0x32 },
{ 0xec, 0x08 }, { 0xed, 0x33 }, { 0xee, 0x0a }, { 0xef, 0xcb },
{ 0xf0, 0x0a }, { 0xf1, 0xcc }, { 0xf2, 0x0d }, { 0xf3, 0x64 },
{ 0xf4, 0x0d }, { 0xf5, 0x65 }, { 0xf6, 0x0f }, { 0xf7, 0xfd },
};
s_memory_layout->push_back(ml);
/* On GL847 and GL124, the values of the base address for shading data must be multiplied by
8192=0x4000 to give address on AHB

Wyświetl plik

@ -2405,6 +2405,71 @@ void genesys_init_usb_device_tables()
s_usb_devices->emplace_back(0x07b3, 0x0c12, model);
model = Genesys_Model();
model.name = "plustek-opticfilm-7400";
model.vendor = "PLUSTEK";
model.model = "OpticFilm 7400";
model.model_id = ModelId::PLUSTEK_OPTICFILM_7400;
model.asic_type = AsicType::GL845;
model.resolutions = {
{
{ ScanMethod::TRANSPARENCY },
{ 7200, 3600, 2400, 1200, 600 },
{ 7200, 3600, 2400, 1200, 600 },
}
};
model.bpp_gray_values = { 16 };
model.bpp_color_values = { 16 };
model.default_method = ScanMethod::TRANSPARENCY;
model.x_offset = 0.0;
model.y_offset = 0.0;
model.x_size = 36.0;
model.y_size = 44.0;
model.y_offset_calib_white = 0.0;
model.y_size_calib_mm = 0.0;
model.x_offset_calib_black = 6.5;
model.x_size_calib_mm = 37.0;
model.x_offset_ta = 1.0;
model.y_offset_ta = 29.0;
model.x_size_ta = 37.0;
model.y_size_ta = 25.0;
model.y_offset_sensor_to_ta = 0.0;
model.y_offset_calib_black_ta = 6.5;
model.y_offset_calib_white_ta = 0.0;
model.y_size_calib_ta_mm = 2.0;
model.post_scan = 0.0;
model.eject_feed = 0.0;
model.ld_shift_r = 0;
model.ld_shift_g = 12;
model.ld_shift_b = 24;
model.line_mode_color_order = ColorOrder::RGB;
model.is_cis = false;
model.is_sheetfed = false;
model.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7400;
model.adc_id = AdcId::PLUSTEK_OPTICFILM_7400;
model.gpio_id = GpioId::PLUSTEK_OPTICFILM_7400;
model.motor_id = MotorId::PLUSTEK_OPTICFILM_7400;
model.flags = ModelFlag::CUSTOM_GAMMA |
ModelFlag::SKIP_WARMUP |
ModelFlag::DARK_CALIBRATION |
ModelFlag::SHADING_REPARK;
model.search_lines = 200;
s_usb_devices->emplace_back(0x07b3, 0x0c3a, model);
model = Genesys_Model();
model.name = "plustek-opticfilm-7500i";
model.vendor = "PLUSTEK";

Wyświetl plik

@ -452,6 +452,20 @@ void genesys_init_motor_tables()
s_motors->push_back(std::move(motor));
motor = Genesys_Motor();
motor.id = MotorId::PLUSTEK_OPTICFILM_7400;
motor.base_ydpi = 3600;
motor.optical_ydpi = 3600;
profile = MotorProfile();
profile.slope = MotorSlope::create_from_steps(64102 * 4, 400 * 4, 30);
profile.step_type = StepType::QUARTER;
profile.motor_vref = 3;
motor.profiles.push_back(profile);
motor.fast_profiles.push_back(profile);
s_motors->push_back(std::move(motor));
motor = Genesys_Motor();
motor.id = MotorId::PLUSTEK_OPTICFILM_7500I;
motor.base_ydpi = 3600;

Wyświetl plik

@ -3245,6 +3245,58 @@ void genesys_init_sensor_tables()
}
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7400; // gl845
sensor.optical_res = 7200;
sensor.method = ScanMethod::TRANSPARENCY;
sensor.register_dpihw = 1200;
sensor.ccd_size_divisor = 1;
sensor.black_pixels = 88; // TODO
sensor.dummy_pixel = 20;
sensor.ccd_start_xoffset = 120;
sensor.fau_gain_white_ref = 210;
sensor.gain_white_ref = 230;
sensor.exposure = { 0x0000, 0x0000, 0x0000 };
sensor.exposure_lperiod = 14000;
sensor.stagger_config = StaggerConfig{7200, 4};
sensor.use_host_side_calib = true;
sensor.custom_regs = {
{ 0x08, 0x00 }, { 0x09, 0x00 }, { 0x0a, 0x00 },
{ 0x16, 0x27 }, { 0x17, 0x0c }, { 0x18, 0x10 }, { 0x19, 0x2a },
{ 0x1a, 0x00 }, { 0x1b, 0x00 }, { 0x1c, 0x20 }, { 0x1d, 0x84 },
{ 0x52, 0x09 }, { 0x53, 0x0d }, { 0x54, 0x0f }, { 0x55, 0x01 },
{ 0x56, 0x04 }, { 0x57, 0x07 }, { 0x58, 0x31 }, { 0x59, 0x79 }, { 0x5a, 0xc0 },
{ 0x70, 0x0a }, { 0x71, 0x0b }, { 0x72, 0x0c }, { 0x73, 0x0d },
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x00 },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x00 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x00 }, { 0x7d, 0x00 },
{ 0x87, 0x00 },
};
sensor.gamma = { 1.0f, 1.0f, 1.0f };
sensor.get_ccd_size_divisor_fun = get_ccd_size_divisor_exact;
{
struct CustomSensorSettings
{
ValueFilterAny<unsigned> resolutions;
unsigned register_dpiset;
};
CustomSensorSettings custom_settings[] = {
{ { 600 }, 100 },
{ { 1200 }, 200 },
{ { 2400 }, 400 },
{ { 3600 }, 600 },
{ { 7200 }, 1200 },
};
for (const CustomSensorSettings& setting : custom_settings) {
sensor.resolutions = setting.resolutions;
sensor.shading_resolution = setting.resolutions.values()[0];
sensor.register_dpiset = setting.register_dpiset;
s_sensors->push_back(sensor);
}
}
sensor = Genesys_Sensor();
sensor.sensor_id = SensorId::CCD_PLUSTEK_OPTICFILM_7500I; // gl843
sensor.optical_res = 7200;
@ -3398,9 +3450,11 @@ void genesys_init_sensor_tables()
{ 0x1a, 0x34 }, { 0x1b, 0x00 }, { 0x1c, 0x20 }, { 0x1d, 0x06 },
{ 0x52, 0x02 }, { 0x53, 0x04 }, { 0x54, 0x06 }, { 0x55, 0x08 },
{ 0x56, 0x0a }, { 0x57, 0x00 }, { 0x58, 0x59 }, { 0x59, 0x31 }, { 0x5a, 0x40 },
{ 0x70, 0x01 }, { 0x71, 0x00 }, { 0x72, 0x02 }, { 0x73, 0x01 },
{ 0x74, 0x00 }, { 0x75, 0x00 }, { 0x76, 0x3c },
{ 0x77, 0x00 }, { 0x78, 0x00 }, { 0x79, 0x9f },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 },
{ 0x7a, 0x00 }, { 0x7b, 0x00 }, { 0x7c, 0x55 }, { 0x7d, 0x20 },
{ 0x87, 0x02 },
};
sensor.gamma = { 1.7f, 1.7f, 1.7f };
sensor.get_ccd_size_divisor_fun = default_get_ccd_size_divisor_for_dpi;

Wyświetl plik

@ -27,6 +27,11 @@
:usbid "0x07b3" "0x0c12"
:status :basic
:model "OpticFilm 7400"
:interface "USB"
:usbid "0x07b3" "0x0c3a"
:status :basic
:model "OpticFilm 7500i"
:interface "USB"
:usbid "0x07b3" "0x0c13"