genesys: updated button support for HP Scanjet G4010

pixma-add-canon-ts-3400-series
Ralph Little 2021-05-05 12:37:11 -07:00 zatwierdzone przez Povilas Kanapickas
rodzic 9ad2aa54b9
commit fa414e46b1
5 zmienionych plików z 27 dodań i 2 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -372,6 +372,7 @@ enum class GpioId : unsigned
DP665,
DP685,
G4050,
G4010,
HP2300,
HP2400,
HP3670,

Wyświetl plik

@ -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:

Wyświetl plik

@ -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 = {

Wyświetl plik

@ -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);