kopia lustrzana https://gitlab.com/sane-project/backends
Introduce structure for specifying model-specific parameters on the ASIC level.
rodzic
529b6a1d6d
commit
5d556cd5e6
|
@ -102,6 +102,8 @@ static const Scanner_Model models[] = {
|
||||||
|
|
||||||
0x055f, 0x0409, /* USB vendor and product ID */
|
0x055f, 0x0409, /* USB vendor and product ID */
|
||||||
|
|
||||||
|
¶msMustekBP2448TAPro,
|
||||||
|
|
||||||
{5 /* count */, 1200, 600, 300, 150, 75}, /* possible resolutions */
|
{5 /* count */, 1200, 600, 300, 150, 75}, /* possible resolutions */
|
||||||
|
|
||||||
/* x and y size of scan area in mm */
|
/* x and y size of scan area in mm */
|
||||||
|
@ -134,6 +136,8 @@ static const Scanner_Model models[] = {
|
||||||
|
|
||||||
0x05da, 0x3025, /* USB vendor and product ID */
|
0x05da, 0x3025, /* USB vendor and product ID */
|
||||||
|
|
||||||
|
¶msMicrotek4800H48U,
|
||||||
|
|
||||||
{5 /* count */, 1200, 600, 300, 150, 75}, /* possible resolutions */
|
{5 /* count */, 1200, 600, 300, 150, 75}, /* possible resolutions */
|
||||||
|
|
||||||
/* x and y size of scan area in mm */
|
/* x and y size of scan area in mm */
|
||||||
|
@ -678,6 +682,7 @@ sane_open (SANE_String_Const devname, SANE_Handle * handle)
|
||||||
memset (s, 0, sizeof (*s));
|
memset (s, 0, sizeof (*s));
|
||||||
s->model = device->model;
|
s->model = device->model;
|
||||||
s->state.chip.device_name = device->name;
|
s->state.chip.device_name = device->name;
|
||||||
|
s->state.chip.params = device->model->asic_params;
|
||||||
|
|
||||||
Scanner_Init (&s->state);
|
Scanner_Init (&s->state);
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,8 @@ typedef struct
|
||||||
unsigned short vendor_id;
|
unsigned short vendor_id;
|
||||||
unsigned short product_id;
|
unsigned short product_id;
|
||||||
|
|
||||||
|
const ASIC_ModelParams * asic_params;
|
||||||
|
|
||||||
/** @name Scanner model parameters */
|
/** @name Scanner model parameters */
|
||||||
/*@{ */
|
/*@{ */
|
||||||
SANE_Word dpi_values[MAX_RESOLUTIONS]; /* possible resolutions */
|
SANE_Word dpi_values[MAX_RESOLUTIONS]; /* possible resolutions */
|
||||||
|
|
|
@ -63,6 +63,15 @@
|
||||||
#include "mustek_usb2_asic.h"
|
#include "mustek_usb2_asic.h"
|
||||||
|
|
||||||
|
|
||||||
|
const ASIC_ModelParams paramsMustekBP2448TAPro = {
|
||||||
|
SDRAMCLK_DELAY_12_ns
|
||||||
|
};
|
||||||
|
|
||||||
|
const ASIC_ModelParams paramsMicrotek4800H48U = {
|
||||||
|
SDRAMCLK_DELAY_8_ns
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static SANE_Status PrepareScanChip (ASIC * chip);
|
static SANE_Status PrepareScanChip (ASIC * chip);
|
||||||
static SANE_Status WaitCarriageHome (ASIC * chip);
|
static SANE_Status WaitCarriageHome (ASIC * chip);
|
||||||
static SANE_Status WaitUnitReady (ASIC * chip);
|
static SANE_Status WaitUnitReady (ASIC * chip);
|
||||||
|
@ -399,7 +408,8 @@ RamAccess (ASIC * chip, RAMACCESS * access)
|
||||||
if (status != SANE_STATUS_GOOD)
|
if (status != SANE_STATUS_GOOD)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
SendData (chip, ES01_79_AFEMCLK_SDRAMCLK_DELAY_CONTROL, SDRAMCLK_DELAY_12_ns);
|
SendData (chip, ES01_79_AFEMCLK_SDRAMCLK_DELAY_CONTROL,
|
||||||
|
chip->params->SDRAM_Delay);
|
||||||
|
|
||||||
if (access->IsWriteAccess)
|
if (access->IsWriteAccess)
|
||||||
{
|
{
|
||||||
|
@ -1836,7 +1846,8 @@ Asic_Open (ASIC * chip)
|
||||||
USB_POWER_SAVE_ENABLE | USB_REMOTE_WAKEUP_ENABLE |
|
USB_POWER_SAVE_ENABLE | USB_REMOTE_WAKEUP_ENABLE |
|
||||||
LED_MODE_FLASH_SLOWLY);
|
LED_MODE_FLASH_SLOWLY);
|
||||||
SendData (chip, ES01_86_DisableAllClockWhenIdle, 0);
|
SendData (chip, ES01_86_DisableAllClockWhenIdle, 0);
|
||||||
SendData (chip, ES01_79_AFEMCLK_SDRAMCLK_DELAY_CONTROL, SDRAMCLK_DELAY_12_ns);
|
SendData (chip, ES01_79_AFEMCLK_SDRAMCLK_DELAY_CONTROL,
|
||||||
|
chip->params->SDRAM_Delay);
|
||||||
|
|
||||||
/* SDRAM initialization sequence */
|
/* SDRAM initialization sequence */
|
||||||
SendData (chip, ES01_87_SDRAM_Timing, 0xf1);
|
SendData (chip, ES01_87_SDRAM_Timing, 0xf1);
|
||||||
|
|
|
@ -148,6 +148,11 @@ typedef struct
|
||||||
SANE_Byte bScanDecSteps;
|
SANE_Byte bScanDecSteps;
|
||||||
} MOTORMOVE;
|
} MOTORMOVE;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SANE_Byte SDRAM_Delay;
|
||||||
|
} ASIC_ModelParams;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* AFE */
|
/* AFE */
|
||||||
|
@ -194,6 +199,8 @@ typedef struct
|
||||||
SANE_String_Const device_name;
|
SANE_String_Const device_name;
|
||||||
int fd; /* file descriptor of scanner */
|
int fd; /* file descriptor of scanner */
|
||||||
|
|
||||||
|
const ASIC_ModelParams * params;
|
||||||
|
|
||||||
FIRMWARESTATE firmwarestate;
|
FIRMWARESTATE firmwarestate;
|
||||||
SANE_Bool isFirstOpenChip; /* == SANE_FALSE after first Asic_Open */
|
SANE_Bool isFirstOpenChip; /* == SANE_FALSE after first Asic_Open */
|
||||||
SANE_Bool isUsb20;
|
SANE_Bool isUsb20;
|
||||||
|
@ -967,6 +974,8 @@ typedef struct
|
||||||
#define ES01_2CE_VALID_PIXEL_PARAMETER_OF_SEGMENT15 0x2CE
|
#define ES01_2CE_VALID_PIXEL_PARAMETER_OF_SEGMENT15 0x2CE
|
||||||
#define ES01_2CF_VALID_PIXEL_PARAMETER_OF_SEGMENT16 0x2CF
|
#define ES01_2CF_VALID_PIXEL_PARAMETER_OF_SEGMENT16 0x2CF
|
||||||
|
|
||||||
|
extern const ASIC_ModelParams paramsMustekBP2448TAPro;
|
||||||
|
extern const ASIC_ModelParams paramsMicrotek4800H48U;
|
||||||
|
|
||||||
void SetAFEGainOffset (ASIC * chip);
|
void SetAFEGainOffset (ASIC * chip);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue