diff --git a/backend/genesys/enums.cpp b/backend/genesys/enums.cpp index ce0ad10b6..ca6125150 100644 --- a/backend/genesys/enums.cpp +++ b/backend/genesys/enums.cpp @@ -279,6 +279,7 @@ std::ostream& operator<<(std::ostream& out, GpioId id) case GpioId::CANON_8600F: out << "CANON_8600F"; break; case GpioId::DP665: out << "DP665"; break; case GpioId::DP685: out << "DP685"; break; + case GpioId::G4010: out << "G4010"; break; case GpioId::G4050: out << "G4050"; break; case GpioId::HP2300: out << "HP2300"; break; case GpioId::HP2400: out << "HP2400"; break; diff --git a/backend/genesys/enums.h b/backend/genesys/enums.h index ae5dedd8e..9d7034bcf 100644 --- a/backend/genesys/enums.h +++ b/backend/genesys/enums.h @@ -372,6 +372,7 @@ enum class GpioId : unsigned DP665, DP685, G4050, + G4010, HP2300, HP2400, HP3670, diff --git a/backend/genesys/gl843.cpp b/backend/genesys/gl843.cpp index e768ac0de..80ebe0e7d 100644 --- a/backend/genesys/gl843.cpp +++ b/backend/genesys/gl843.cpp @@ -1240,6 +1240,7 @@ void CommandSetGl843::begin_scan(Genesys_Device* dev, const Genesys_Sensor& sens dev->interface->write_register(0x7e, 0x04); break; case GpioId::G4050: + case GpioId::G4010: dev->interface->write_register(REG_0xA7, 0xfe); dev->interface->write_register(REG_0xA8, 0x3e); dev->interface->write_register(REG_0xA9, 0x06); @@ -1680,6 +1681,7 @@ void CommandSetGl843::update_hardware_sensors(Genesys_Scanner* s) const */ uint8_t val = s->dev->interface->read_register(REG_0x6D); + DBG(DBG_io, "%s: read buttons_gpio value=0x%x\n", __func__, (int)val); switch (s->dev->model->gpio_id) { @@ -1692,6 +1694,12 @@ void CommandSetGl843::update_hardware_sensors(Genesys_Scanner* s) const s->buttons[BUTTON_EMAIL_SW].write((val & 0x04) == 0); s->buttons[BUTTON_COPY_SW].write((val & 0x08) == 0); break; + case GpioId::G4010: + s->buttons[BUTTON_FILE_SW].write((val & 0x01) == 0); + s->buttons[BUTTON_COPY_SW].write((val & 0x04) == 0); + s->buttons[BUTTON_EXTRA_SW].write((val & 0x40) == 0); // transparency + s->buttons[BUTTON_SCAN_SW].write((val & 0x08) == 0); + break; case GpioId::CANON_4400F: case GpioId::CANON_8400F: default: diff --git a/backend/genesys/tables_gpo.cpp b/backend/genesys/tables_gpo.cpp index 075cafbef..4afc8e314 100644 --- a/backend/genesys/tables_gpo.cpp +++ b/backend/genesys/tables_gpo.cpp @@ -257,6 +257,21 @@ void genesys_init_gpo_tables() s_gpo->push_back(gpo); + gpo = Genesys_Gpo(); + gpo.id = GpioId::G4010; + gpo.regs = { + { 0x6c, 0x20 }, + { 0x6d, 0x00 }, + { 0x6e, 0xfc }, + { 0x6f, 0x00 }, + { 0xa6, 0x08 }, + { 0xa7, 0x1e }, + { 0xa8, 0x3e }, + { 0xa9, 0x06 }, + }; + s_gpo->push_back(gpo); + + gpo = Genesys_Gpo(); gpo.id = GpioId::HP_N6310; gpo.regs = { diff --git a/backend/genesys/tables_model.cpp b/backend/genesys/tables_model.cpp index 6998a5118..04017d013 100644 --- a/backend/genesys/tables_model.cpp +++ b/backend/genesys/tables_model.cpp @@ -342,12 +342,12 @@ void genesys_init_usb_device_tables() model.is_sheetfed = false; model.sensor_id = SensorId::CCD_G4050; model.adc_id = AdcId::G4050; - model.gpio_id = GpioId::G4050; + model.gpio_id = GpioId::G4010; model.motor_id = MotorId::G4050; model.flags = ModelFlag::WARMUP | ModelFlag::DARK_CALIBRATION | ModelFlag::CUSTOM_GAMMA; - model.buttons = GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW; + model.buttons = GENESYS_HAS_SCAN_SW | GENESYS_HAS_FILE_SW | GENESYS_HAS_COPY_SW | GENESYS_HAS_EXTRA_SW; model.search_lines = 100; s_usb_devices->emplace_back(0x03f0, 0x4505, model);