kopia lustrzana https://gitlab.com/sane-project/backends
LiDE80 WIP : Working frontend
rodzic
4ab0b21fac
commit
6ebd7e35b4
|
@ -213,10 +213,14 @@ static Genesys_Frontend Wolfson[] = {
|
||||||
, {0x00, 0x00, 0x00}
|
, {0x00, 0x00, 0x00}
|
||||||
},
|
},
|
||||||
{DAC_CANONLIDE80,
|
{DAC_CANONLIDE80,
|
||||||
{0x74, 0x80, 0x00, 0x00}
|
/* reg0: control 74 data, 70 no data
|
||||||
|
* reg3: offset
|
||||||
|
* reg6: gain
|
||||||
|
* reg0 , reg3, reg6 */
|
||||||
|
{0x70, 0x16, 0x60, 0x00}
|
||||||
|
, {0x00, 0x00, 0x00}
|
||||||
, {0x00, 0x00, 0x00}
|
, {0x00, 0x00, 0x00}
|
||||||
, {0x00, 0x00, 0x00}
|
, {0x00, 0x00, 0x00}
|
||||||
, {0x16, 0x16, 0x16}
|
|
||||||
, {0x00, 0x00, 0x00}
|
, {0x00, 0x00, 0x00}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1282,8 +1286,8 @@ static Genesys_Motor Motor[] = {
|
||||||
},
|
},
|
||||||
},},
|
},},
|
||||||
{MOTOR_CANONLIDE80,
|
{MOTOR_CANONLIDE80,
|
||||||
1200, /* 2400 ???? */
|
2400, /* 2400 ???? */
|
||||||
2400,
|
4800,
|
||||||
2, /* max step type */
|
2, /* max step type */
|
||||||
1, /* power mode count */
|
1, /* power mode count */
|
||||||
{
|
{
|
||||||
|
|
|
@ -1189,12 +1189,87 @@ gl841_send_slope_table (Genesys_Device * dev, int table_nr,
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SANE_Status
|
||||||
|
gl841_set_lide80_fe (Genesys_Device * dev, uint8_t set)
|
||||||
|
{
|
||||||
|
SANE_Status status = SANE_STATUS_GOOD;
|
||||||
|
|
||||||
|
DBGSTART;
|
||||||
|
|
||||||
|
if (set == AFE_INIT)
|
||||||
|
{
|
||||||
|
DBG (DBG_proc, "%s(): setting DAC %u\n", __FUNCTION__,
|
||||||
|
dev->model->dac_type);
|
||||||
|
|
||||||
|
/* sets to default values */
|
||||||
|
sanei_genesys_init_fe (dev);
|
||||||
|
|
||||||
|
/* write them to analog frontend */
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x00, dev->frontend.reg[0]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing reg 0x00 failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x03, dev->frontend.reg[1]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing reg 0x03 failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x06, dev->frontend.reg[2]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing reg 0x06 failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (set == AFE_SET)
|
||||||
|
{
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x00, dev->frontend.reg[0]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing reg 0x00 failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x03, dev->frontend.offset[0]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing offset failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
status = sanei_genesys_fe_write_data (dev, 0x06, dev->frontend.gain[0]);
|
||||||
|
if (status != SANE_STATUS_GOOD)
|
||||||
|
{
|
||||||
|
DBG (DBG_error, "%s: writing gain failed: %s\n", __FUNCTION__,
|
||||||
|
sane_strstatus (status));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
DBGCOMPLETED;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set values of Analog Device type frontend */
|
/* Set values of Analog Device type frontend */
|
||||||
static SANE_Status
|
static SANE_Status
|
||||||
gl841_set_ad_fe (Genesys_Device * dev, uint8_t set)
|
gl841_set_ad_fe (Genesys_Device * dev, uint8_t set)
|
||||||
{
|
{
|
||||||
SANE_Status status = SANE_STATUS_GOOD;
|
SANE_Status status = SANE_STATUS_GOOD;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* special case for LiDE 80 analog frontend */
|
||||||
|
if(dev->model->dac_type==DAC_CANONLIDE80)
|
||||||
|
{
|
||||||
|
return gl841_set_lide80_fe(dev, set);
|
||||||
|
}
|
||||||
|
|
||||||
DBG (DBG_proc, "gl841_set_ad_fe(): start\n");
|
DBG (DBG_proc, "gl841_set_ad_fe(): start\n");
|
||||||
if (set == AFE_INIT)
|
if (set == AFE_INIT)
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue