5
Copyright (C) 2008, Panasonic Russia Ltd.
6
Copyright (C) 2010, m. allan noah
9
Panasonic KV-S20xx USB-SCSI scanners.
12
#include <sys/param.h>
15
#define BACKEND_NAME kvs20xx
23
#define PANASONIC_ID 0x04da
24
#define KV_S2025C 0xdeadbeef
25
#define KV_S2045C 0xdeadbeee
26
#define KV_S2026C 0x1000
27
#define KV_S2046C 0x1001
28
#define KV_S2048C 0x1009
29
#define KV_S2028C 0x100a
32
#define MAX_READ_DATA_SIZE 0x10000
33
#define BULK_HEADER_SIZE 12
35
typedef unsigned char u8;
37
typedef unsigned short u16;
39
#define SIDE_FRONT 0x00
40
#define SIDE_BACK 0x80
49
MODE, /* scanner modes */
50
RESOLUTION, /* X and Y resolution */
52
DUPLEX, /* Duplex mode */
53
FEEDER_MODE, /* Feeder mode, fixed to Continous */
54
LENGTHCTL, /* Length control mode */
55
MANUALFEED, /* Manual feed mode */
56
FEED_TIMEOUT, /* Feed timeout */
57
DBLFEED, /* Double feed detection mode */
58
FIT_TO_PAGE, /* Scanner shrinks image to fit scanned page */
62
PAPER_SIZE, /* Paper size */
63
LANDSCAPE, /* true if landscape */
64
TL_X, /* upper left X */
65
TL_Y, /* upper left Y */
66
BR_X, /* bottom right X */
67
BR_Y, /* bottom right Y */
70
BRIGHTNESS, /* Brightness */
71
CONTRAST, /* Contrast */
72
THRESHOLD, /* Binary threshold */
73
IMAGE_EMPHASIS, /* Image emphasis */
74
GAMMA_CORRECTION, /* Gamma correction */
75
LAMP, /* Lamp -- color drop out */
83
SANE_Bool b; /**< bool */
84
SANE_Word w; /**< word */
85
SANE_Word *wa; /**< word array */
86
SANE_String s; /**< string */
100
SANE_Option_Descriptor opt[NUM_OPTIONS];
101
Option_Value val[NUM_OPTIONS];
102
SANE_Parameters params;
108
unsigned saved_dummy_size;
114
u16 window_descriptor_block_length;
116
u8 window_identifier;
127
u8 image_composition;
129
u16 halftone_pattern;
133
u8 compression_argument;
136
u8 vendor_unique_identifier;
137
u8 nobuf_fstspeed_dfstop;
141
u8 mcd_lamp_dfeed_sens;
146
u8 ahead_deskew_dfeed_scan_area_fspeed_rshad;
147
u8 continuous_scanning_pages;
148
u8 automatic_threshold_mode;
149
u8 automatic_separation_mode;
150
u8 standard_white_level_mode;
151
u8 b_wnr_noise_reduction;
152
u8 mfeed_toppos_btmpos_dsepa_hsepa_dcont_rstkr;
154
} __attribute__((__packed__));
156
void init_options (struct scanner *);
157
void init_window (struct scanner *s, struct window *wnd, int wnd_id);
162
return x << 8 | x >> 8;
167
return x << 24 | x >> 24 |
168
(x & (u32) 0x0000ff00UL) << 8 | (x & (u32) 0x00ff0000UL) >> 8;
171
#if __BYTE_ORDER == __BIG_ENDIAN
173
set24 (u8 * p, u32 x)
180
#define cpu2be16(x) (x)
181
#define cpu2be32(x) (x)
182
#define cpu2le16(x) swap_bytes16(x)
183
#define cpu2le32(x) swap_bytes32(x)
184
#define le2cpu16(x) swap_bytes16(x)
185
#define le2cpu32(x) swap_bytes32(x)
186
#define be2cpu16(x) (x)
187
#define be2cpu32(x) (x)
188
#define BIT_ORDERING 0
189
#elif __BYTE_ORDER == __LITTLE_ENDIAN
191
set24 (u8 * p, u32 x)
198
#define cpu2le16(x) (x)
199
#define cpu2le32(x) (x)
200
#define cpu2be16(x) swap_bytes16(x)
201
#define cpu2be32(x) swap_bytes32(x)
202
#define le2cpu16(x) (x)
203
#define le2cpu32(x) (x)
204
#define be2cpu16(x) swap_bytes16(x)
205
#define be2cpu32(x) swap_bytes32(x)
206
#define BIT_ORDERING 1
208
#error __BYTE_ORDER not defined
211
#endif /*__KVS20XX_H*/