diff options
Diffstat (limited to 'backend/genesys_gl124.h')
| -rw-r--r-- | backend/genesys_gl124.h | 289 | 
1 files changed, 16 insertions, 273 deletions
| diff --git a/backend/genesys_gl124.h b/backend/genesys_gl124.h index 9ca6afd..751321d 100644 --- a/backend/genesys_gl124.h +++ b/backend/genesys_gl124.h @@ -301,228 +301,7 @@  #define REG_TRUEG       0x111  #define REG_TRUEB       0x112 -/** - * writable scanner registers */ -enum -{ -  reg_0x01 = 0, -  reg_0x02, -  reg_0x03, -  reg_0x04, -  reg_0x05, -  reg_0x06, -  reg_0x07, -  reg_0x08, -  reg_0x09, -  reg_0x0a, -  reg_0x0b, -  reg_0x0c, -  reg_0x11, -  reg_0x12, -  reg_0x13, -  reg_0x14, -  reg_0x15, -  reg_0x16, -  reg_0x17, -  reg_0x18, -  reg_0x19, -  reg_0x1a, -  reg_0x1b, -  reg_0x1c, -  reg_0x1d, -  reg_0x1e, -  reg_0x1f, -  reg_0x20, -  reg_0x21, -  reg_0x22, -  reg_0x23, -  reg_0x24, -  reg_0x25, -  reg_0x26, -  reg_0x27, -  reg_0x28, -  reg_0x29, -  reg_0x2a, -  reg_0x2b, -  reg_0x2c, -  reg_0x2d, -  reg_0x3b, -  reg_0x3c, -  reg_0x3d, -  reg_0x3e, -  reg_0x3f, -  reg_0x40, -  reg_0x41, -  reg_0x42, -  reg_0x43, -  reg_0x44, -  reg_0x45, -  reg_0x46, -  reg_0x47, -  reg_0x48, -  reg_0x49, -  reg_0x4f, -  reg_0x52, -  reg_0x53, -  reg_0x54, -  reg_0x55, -  reg_0x56, -  reg_0x57, -  reg_0x58, -  reg_0x59, -  reg_0x5a, -  reg_0x5b, -  reg_0x5c, -  reg_0x5f, -  reg_0x60, -  reg_0x61, -  reg_0x62, -  reg_0x63, -  reg_0x64, -  reg_0x65, -  reg_0x66, -  reg_0x67, -  reg_0x68, -  reg_0x69, -  reg_0x6a, -  reg_0x6b, -  reg_0x6c, -  reg_0x6d, -  reg_0x6e, -  reg_0x6f, -  reg_0x70, -  reg_0x71, -  reg_0x72, -  reg_0x73, -  reg_0x74, -  reg_0x75, -  reg_0x76, -  reg_0x77, -  reg_0x78, -  reg_0x79, -  reg_0x7a, -  reg_0x7b, -  reg_0x7c, -  reg_0x7d, -  reg_0x7e, -  reg_0x7f, -  reg_0x80, -  reg_0x81, -  reg_0x82, -  reg_0x83, -  reg_0x84, -  reg_0x85, -  reg_0x86, -  reg_0x87, -  reg_0x88, -  reg_0x89, -  reg_0x8a, -  reg_0x8b, -  reg_0x8c, -  reg_0x8d, -  reg_0x8e, -  reg_0x8f, -  reg_0x90, -  reg_0x91, -  reg_0x92, -  reg_0x93, -  reg_0x94, -  reg_0x95, -  reg_0x96, -  reg_0x97, -  reg_0x98, -  reg_0x99, -  reg_0x9a, -  reg_0x9b, -  reg_0x9c, -  reg_0x9d, -  reg_0x9e, -  reg_0x9f, -  reg_0xa0, -  reg_0xa1, -  reg_0xa2, -  reg_0xa3, -  reg_0xa4, -  reg_0xa5, -  reg_0xa6, -  reg_0xa7, -  reg_0xa8, -  reg_0xa9, -  reg_0xaa, -  reg_0xab, -  reg_0xac, -  reg_0xad, -  reg_0xae, -  reg_0xaf, -  reg_0xb0, -  reg_0xb1, -  reg_0xb2, -  reg_0xb3, -  reg_0xb4, -  reg_0xb5, -  reg_0xb6, -  reg_0xb7, -  reg_0xb8, -  reg_0xbb, -  reg_0xbc, -  reg_0xbd, -  reg_0xbe, -  reg_0xc3, -  reg_0xc4, -  reg_0xc5, -  reg_0xc6, -  reg_0xc7, -  reg_0xc8, -  reg_0xc9, -  reg_0xca, -  reg_0xcb, -  reg_0xcc, -  reg_0xcd, -  reg_0xce, -  reg_0xd0, -  reg_0xd1, -  reg_0xd2, -  reg_0xd3, -  reg_0xd4, -  reg_0xd5, -  reg_0xd6, -  reg_0xd7, -  reg_0xd8, -  reg_0xd9, -  reg_0xe0, -  reg_0xe1, -  reg_0xe2, -  reg_0xe3, -  reg_0xe4, -  reg_0xe5, -  reg_0xe6, -  reg_0xe7, -  reg_0xe8, -  reg_0xe9, -  reg_0xea, -  reg_0xeb, -  reg_0xec, -  reg_0xed, -  reg_0xee, -  reg_0xef, -  reg_0xf0, -  reg_0xf1, -  reg_0xf2, -  reg_0xf3, -  reg_0xf4, -  reg_0xf5, -  reg_0xf6, -  reg_0xf7, -  reg_0xf8, -  reg_0xf9, -  reg_0xfa, -  reg_0xfb, -  reg_0xfc, -  reg_0xff, -  GENESYS_GL124_MAX_REGS -}; - -#define SETREG(adr,val) {dev->reg[reg_##adr].address=adr;dev->reg[reg_##adr].value=val;} +#define SETREG(adr,val) { dev->reg.init_reg(adr, val); }  typedef struct  { @@ -616,8 +395,6 @@ typedef struct {  static size_t order_01[]={0,1};  static size_t order_0213[]={0,2,1,3}; -/* *INDENT-OFF* */ -  /** @brief database of sensor profiles   * database of sensor profiles giving for each sensor and a given resolution, the period, and timings   * to setup the sensor for the scan. @@ -684,63 +461,29 @@ static Motor_Profile motors[]={  	{MOTOR_CANONLIDE210, 20864, 2, lide210_max},  	{0, 0, 0, NULL},  }; -/* *INDENT-ON* */ -GENESYS_STATIC -SANE_Status gl124_init_scan_regs (Genesys_Device * dev, -                                  Genesys_Register_Set * reg, -				  float xres,        /*dpi */ -				  float yres,        /*dpi */ -				  float startx,        /*optical_res, from dummy_pixel+1 */ -				  float starty,        /*base_ydpi, from home! */ -                                  float pixels, -                                  float lines, -                                  unsigned int depth, -                                  unsigned int channels, -                                  int scan_method, -                                  int scan_mode, -                                  int color_filter, -                                  unsigned int flags); - -#ifndef UNIT_TESTING -static -#endif -  SANE_Status gl124_start_action (Genesys_Device * dev); -#ifndef UNIT_TESTING +  static -#endif -  SANE_Status -gl124_begin_scan (Genesys_Device * dev, Genesys_Register_Set * reg, +SANE_Status gl124_init_scan_regs(Genesys_Device * dev, const Genesys_Sensor& sensor, +                                 Genesys_Register_Set * reg, SetupParams& params); + +static SANE_Status gl124_start_action (Genesys_Device * dev); +static SANE_Status +gl124_begin_scan (Genesys_Device * dev, const Genesys_Sensor& sensor, Genesys_Register_Set * reg,  		  SANE_Bool start_motor); -#ifndef UNIT_TESTING -static -#endif -  SANE_Status +static SANE_Status  gl124_end_scan (Genesys_Device * dev, Genesys_Register_Set * reg,  		SANE_Bool check_stop); -#ifndef UNIT_TESTING -static -#endif -  SANE_Status +static SANE_Status  gl124_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home); -#ifndef UNIT_TESTING -static -#endif -SANE_Status gl124_init (Genesys_Device * dev); -#ifndef UNIT_TESTING -static -#endif -SANE_Status gl124_send_shading_data (Genesys_Device * dev, uint8_t * data, int size); +static SANE_Status gl124_init(Genesys_Device * dev); +static SANE_Status gl124_send_shading_data (Genesys_Device * dev, const Genesys_Sensor& sensor, +                                            uint8_t * data, int size); -#ifndef UNIT_TESTING -static -#endif -SANE_Status gl124_feed (Genesys_Device * dev, unsigned int steps, int reverse); +static SANE_Status gl124_feed (Genesys_Device * dev, unsigned int steps, int reverse); -GENESYS_STATIC SANE_Status +static SANE_Status  gl124_stop_action (Genesys_Device * dev); -GENESYS_STATIC SANE_Status +static SANE_Status  gl124_send_slope_table (Genesys_Device * dev, int table_nr,  			uint16_t * slope_table, int steps); - -/* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ | 
