1 /*  sane - Scanner Access Now Easy.
2 
3     Copyright (C) 2019 Povilas Kanapickas <povilas@radix.lt>
4 
5     This file is part of the SANE package.
6 
7     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License as
9     published by the Free Software Foundation; either version 2 of the
10     License, or (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful, but
13     WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15     General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License
18     along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 
20     As a special exception, the authors of SANE give permission for
21     additional uses of the libraries contained in this release of SANE.
22 
23     The exception is that, if you link a SANE library with other files
24     to produce an executable, this does not by itself cause the
25     resulting executable to be covered by the GNU General Public
26     License.  Your use of that executable is in no way restricted on
27     account of linking the SANE library code into it.
28 
29     This exception does not, however, invalidate any other reasons why
30     the executable file might be covered by the GNU General Public
31     License.
32 
33     If you submit changes to SANE to the maintainers to be included in
34     a subsequent release, you agree by submitting the changes that
35     those changes may be distributed with this exception intact.
36 
37     If you write modifications of your own for SANE, it is your choice
38     whether to permit this exception to apply to your modifications.
39     If you do not wish that, delete this exception notice.
40 */
41 
42 #define DEBUG_DECLARE_ONLY
43 
44 #include "low.h"
45 
46 namespace genesys {
47 
48 StaticInit<std::vector<Genesys_Gpo>> s_gpo;
49 
genesys_init_gpo_tables()50 void genesys_init_gpo_tables()
51 {
52     s_gpo.init();
53 
54     Genesys_Gpo gpo;
55     gpo.id = GpioId::UMAX;
56     gpo.regs = {
57         { 0x66, 0x11 },
58         { 0x67, 0x00 },
59         { 0x68, 0x51 },
60         { 0x69, 0x20 },
61     };
62     s_gpo->push_back(gpo);
63 
64 
65     gpo = Genesys_Gpo();
66     gpo.id = GpioId::ST12;
67     gpo.regs = {
68         { 0x66, 0x11 },
69         { 0x67, 0x00 },
70         { 0x68, 0x51 },
71         { 0x69, 0x20 },
72     };
73     s_gpo->push_back(gpo);
74 
75 
76     gpo = Genesys_Gpo();
77     gpo.id = GpioId::ST24;
78     gpo.regs = {
79         { 0x66, 0x00 },
80         { 0x67, 0x00 },
81         { 0x68, 0x51 },
82         { 0x69, 0x20 },
83     };
84     s_gpo->push_back(gpo);
85 
86 
87     gpo = Genesys_Gpo();
88     gpo.id = GpioId::MD_5345; // bits 11-12 are for bipolar V-ref input voltage
89     gpo.regs = {
90         { 0x66, 0x30 },
91         { 0x67, 0x18 },
92         { 0x68, 0xa0 },
93         { 0x69, 0x18 },
94     };
95     s_gpo->push_back(gpo);
96 
97 
98     gpo = Genesys_Gpo();
99     gpo.id = GpioId::HP2400;
100     gpo.regs = {
101         { 0x66, 0x30 },
102         { 0x67, 0x00 },
103         { 0x68, 0x31 },
104         { 0x69, 0x00 },
105     };
106     s_gpo->push_back(gpo);
107 
108 
109     gpo = Genesys_Gpo();
110     gpo.id = GpioId::HP2300;
111     gpo.regs = {
112         { 0x66, 0x00 },
113         { 0x67, 0x00 },
114         { 0x68, 0x00 },
115         { 0x69, 0x00 },
116     };
117     s_gpo->push_back(gpo);
118 
119 
120     gpo = Genesys_Gpo();
121     gpo.id = GpioId::CANON_LIDE_35;
122     gpo.regs = {
123         { 0x6c, 0x02 },
124         { 0x6d, 0x80 },
125         { 0x6e, 0xef },
126         { 0x6f, 0x80 },
127     };
128     s_gpo->push_back(gpo);
129 
130 
131     gpo = Genesys_Gpo();
132     gpo.id = GpioId::CANON_LIDE_90;
133     gpo.regs = {
134         { 0x6b, 0x03 },
135         { 0x6c, 0x74 },
136         { 0x6d, 0x80 },
137         { 0x6e, 0x7f },
138         { 0x6f, 0xe0 },
139     };
140     s_gpo->push_back(gpo);
141 
142 
143     gpo = Genesys_Gpo();
144     gpo.id = GpioId::XP200;
145     gpo.regs = {
146         { 0x66, 0x30 },
147         { 0x67, 0x00 },
148         { 0x68, 0xb0 },
149         { 0x69, 0x00 },
150     };
151     s_gpo->push_back(gpo);
152 
153 
154     gpo = Genesys_Gpo();
155     gpo.id = GpioId::HP3670;
156     gpo.regs = {
157         { 0x66, 0x00 },
158         { 0x67, 0x00 },
159         { 0x68, 0x00 },
160         { 0x69, 0x00 },
161     };
162     s_gpo->push_back(gpo);
163 
164 
165     gpo = Genesys_Gpo();
166     gpo.id = GpioId::XP300;
167     gpo.regs = {
168         { 0x6c, 0x09 },
169         { 0x6d, 0xc6 },
170         { 0x6e, 0xbb },
171         { 0x6f, 0x00 },
172     };
173     s_gpo->push_back(gpo);
174 
175 
176     gpo = Genesys_Gpo();
177     gpo.id = GpioId::DP665;
178     gpo.regs = {
179         { 0x6c, 0x18 },
180         { 0x6d, 0x00 },
181         { 0x6e, 0xbb },
182         { 0x6f, 0x00 },
183     };
184     s_gpo->push_back(gpo);
185 
186 
187     gpo = Genesys_Gpo();
188     gpo.id = GpioId::DP685;
189     gpo.regs = {
190         { 0x6c, 0x3f },
191         { 0x6d, 0x46 },
192         { 0x6e, 0xfb },
193         { 0x6f, 0x00 },
194     };
195     s_gpo->push_back(gpo);
196 
197 
198     gpo = Genesys_Gpo();
199     gpo.id = GpioId::CANON_LIDE_200;
200     gpo.regs = {
201         { 0x6b, 0x02 },
202         { 0x6c, 0xf9 }, // 0xfb when idle , 0xf9/0xe9 (1200) when scanning
203         { 0x6d, 0x20 },
204         { 0x6e, 0xff },
205         { 0x6f, 0x00 },
206         { 0xa6, 0x04 },
207         { 0xa7, 0x04 },
208         { 0xa8, 0x00 },
209         { 0xa9, 0x00 },
210     };
211     s_gpo->push_back(gpo);
212 
213 
214     gpo = Genesys_Gpo();
215     gpo.id = GpioId::CANON_LIDE_700F;
216     gpo.regs = {
217         { 0x6b, 0x06 },
218         { 0x6c, 0xdb },
219         { 0x6d, 0xff },
220         { 0x6e, 0xff },
221         { 0x6f, 0x80 },
222         { 0xa6, 0x15 },
223         { 0xa7, 0x07 },
224         { 0xa8, 0x20 },
225         { 0xa9, 0x10 },
226     };
227     s_gpo->push_back(gpo);
228 
229 
230     gpo = Genesys_Gpo();
231     gpo.id = GpioId::KVSS080;
232     gpo.regs = {
233         { 0x6c, 0xf5 },
234         { 0x6d, 0x20 },
235         { 0x6e, 0x7e },
236         { 0x6f, 0xa1 },
237         { 0xa6, 0x06 },
238         { 0xa7, 0x0f },
239         { 0xa8, 0x00 },
240         { 0xa9, 0x08 },
241     };
242     s_gpo->push_back(gpo);
243 
244 
245     gpo = Genesys_Gpo();
246     gpo.id = GpioId::G4050;
247     gpo.regs = {
248         { 0x6c, 0x20 },
249         { 0x6d, 0x00 },
250         { 0x6e, 0xfc },
251         { 0x6f, 0x00 },
252         { 0xa6, 0x08 },
253         { 0xa7, 0x1e },
254         { 0xa8, 0x3e },
255         { 0xa9, 0x06 },
256     };
257     s_gpo->push_back(gpo);
258 
259 
260     gpo = Genesys_Gpo();
261     gpo.id = GpioId::HP_N6310;
262     gpo.regs = {
263         { 0x6c, 0xa3 },
264         { 0x6d, 0x00 },
265         { 0x6e, 0x7f },
266         { 0x6f, 0x00 },
267     };
268     s_gpo->push_back(gpo);
269 
270 
271     gpo = Genesys_Gpo();
272     gpo.id = GpioId::CANON_LIDE_110;
273     gpo.regs = {
274         { 0x6c, 0xfb },
275         { 0x6d, 0x20 },
276         { 0x6e, 0xff },
277         { 0x6f, 0x00 },
278     };
279     s_gpo->push_back(gpo);
280 
281 
282     gpo = Genesys_Gpo();
283     gpo.id = GpioId::CANON_LIDE_120;
284     gpo.regs = {
285         { 0x6c, 0xfb },
286         { 0x6d, 0x20 },
287         { 0x6e, 0xff },
288         { 0x6f, 0x00 },
289     };
290     s_gpo->push_back(gpo);
291 
292 
293     gpo = Genesys_Gpo();
294     gpo.id = GpioId::CANON_LIDE_210;
295     gpo.regs = {
296         { 0x6c, 0xfb },
297         { 0x6d, 0x20 },
298         { 0x6e, 0xff },
299         { 0x6f, 0x00 },
300     };
301     s_gpo->push_back(gpo);
302 
303 
304     gpo = Genesys_Gpo();
305     gpo.id = GpioId::PLUSTEK_OPTICPRO_3600;
306     gpo.regs = {
307         { 0x6c, 0x02 },
308         { 0x6d, 0x00 },
309         { 0x6e, 0x1e },
310         { 0x6f, 0x80 },
311     };
312     s_gpo->push_back(gpo);
313 
314 
315     gpo = Genesys_Gpo();
316     gpo.id = GpioId::PLUSTEK_OPTICFILM_7200;
317     gpo.regs = {
318         { 0x6b, 0x33 },
319         { 0x6c, 0x00 },
320         { 0x6d, 0x80 },
321         { 0x6e, 0x0c },
322         { 0x6f, 0x80 },
323         { 0x7e, 0x00 }
324     };
325     s_gpo->push_back(gpo);
326 
327 
328     gpo = Genesys_Gpo();
329     gpo.id = GpioId::PLUSTEK_OPTICFILM_7200I;
330     gpo.regs = {
331         { 0x6c, 0x4c },
332         { 0x6d, 0x80 },
333         { 0x6e, 0x4c },
334         { 0x6f, 0x80 },
335         { 0xa6, 0x00 },
336         { 0xa7, 0x07 },
337         { 0xa8, 0x20 },
338         { 0xa9, 0x01 },
339     };
340     s_gpo->push_back(gpo);
341 
342     gpo = Genesys_Gpo();
343     gpo.id = GpioId::PLUSTEK_OPTICFILM_7300;
344     gpo.regs = {
345         { 0x6c, 0x4c },
346         { 0x6d, 0x00 },
347         { 0x6e, 0x4c },
348         { 0x6f, 0x80 },
349         { 0xa6, 0x00 },
350         { 0xa7, 0x07 },
351         { 0xa8, 0x20 },
352         { 0xa9, 0x01 },
353     };
354     s_gpo->push_back(gpo);
355 
356 
357     gpo = Genesys_Gpo();
358     gpo.id = GpioId::PLUSTEK_OPTICFILM_7400;
359     gpo.regs = {
360         { 0x6b, 0x30 }, { 0x6c, 0x4c }, { 0x6d, 0x80 }, { 0x6e, 0x4c }, { 0x6f, 0x80 },
361         { 0xa6, 0x00 }, { 0xa7, 0x07 }, { 0xa8, 0x20 }, { 0xa9, 0x01 },
362     };
363     s_gpo->push_back(gpo);
364 
365 
366     gpo = Genesys_Gpo();
367     gpo.id = GpioId::PLUSTEK_OPTICFILM_7500I;
368     gpo.regs = {
369         { 0x6c, 0x4c },
370         { 0x6d, 0x00 },
371         { 0x6e, 0x4c },
372         { 0x6f, 0x80 },
373         { 0xa6, 0x00 },
374         { 0xa7, 0x07 },
375         { 0xa8, 0x20 },
376         { 0xa9, 0x01 },
377     };
378     s_gpo->push_back(gpo);
379 
380 
381     gpo = Genesys_Gpo();
382     gpo.id = GpioId::PLUSTEK_OPTICFILM_8200I;
383     gpo.regs = {
384         { 0x6b, 0x30 }, { 0x6c, 0x4c }, { 0x6d, 0x80 }, { 0x6e, 0x4c }, { 0x6f, 0x80 },
385         { 0xa6, 0x00 }, { 0xa7, 0x07 }, { 0xa8, 0x20 }, { 0xa9, 0x01 },
386     };
387     s_gpo->push_back(gpo);
388 
389 
390     gpo = Genesys_Gpo();
391     gpo.id = GpioId::CANON_4400F;
392     gpo.regs = {
393         { 0x6c, 0x01 },
394         { 0x6d, 0x7f },
395         { 0x6e, 0xff },
396         { 0x6f, 0x00 },
397         { 0xa6, 0x00 },
398         { 0xa7, 0xff },
399         { 0xa8, 0x07 },
400         { 0xa9, 0x00 },
401     };
402     s_gpo->push_back(gpo);
403 
404 
405     gpo = Genesys_Gpo();
406     gpo.id = GpioId::CANON_5600F;
407     gpo.regs = {
408         { 0x6b, 0x87 },
409         { 0x6c, 0xf0 },
410         { 0x6d, 0x5f },
411         { 0x6e, 0x7f },
412         { 0x6f, 0xa0 },
413         { 0xa6, 0x07 },
414         { 0xa7, 0x1c },
415         { 0xa8, 0x00 },
416         { 0xa9, 0x04 },
417     };
418     s_gpo->push_back(gpo);
419 
420 
421     gpo = Genesys_Gpo();
422     gpo.id = GpioId::CANON_8400F;
423     gpo.regs = {
424         { 0x6c, 0x9a },
425         { 0x6d, 0xdf },
426         { 0x6e, 0xfe },
427         { 0x6f, 0x60 },
428         { 0xa6, 0x00 },
429         { 0xa7, 0x03 },
430         { 0xa8, 0x00 },
431         { 0xa9, 0x02 },
432     };
433     s_gpo->push_back(gpo);
434 
435 
436     gpo = Genesys_Gpo();
437     gpo.id = GpioId::CANON_8600F;
438     gpo.regs = {
439         { 0x6c, 0x20 },
440         { 0x6d, 0x7c },
441         { 0x6e, 0xff },
442         { 0x6f, 0x00 },
443         { 0xa6, 0x00 },
444         { 0xa7, 0xff },
445         { 0xa8, 0x00 },
446         { 0xa9, 0x00 },
447     };
448     s_gpo->push_back(gpo);
449 
450 
451     gpo = Genesys_Gpo();
452     gpo.id = GpioId::IMG101;
453     gpo.regs = {
454         { 0x6b, 0x72 }, { 0x6c, 0x1f }, { 0x6d, 0xa4 }, { 0x6e, 0x13 }, { 0x6f, 0xa7 },
455         { 0xa6, 0x11 }, { 0xa7, 0xff }, { 0xa8, 0x19 }, { 0xa9, 0x05 },
456     };
457     s_gpo->push_back(gpo);
458 
459 
460     gpo = Genesys_Gpo();
461     gpo.id = GpioId::PLUSTEK_OPTICBOOK_3800;
462     gpo.regs = {
463         { 0x6b, 0x30 }, { 0x6c, 0x01 }, { 0x6d, 0x80 }, { 0x6e, 0x2d }, { 0x6f, 0x80 },
464         { 0xa6, 0x0c }, { 0xa7, 0x8f }, { 0xa8, 0x08 }, { 0xa9, 0x04 },
465     };
466     s_gpo->push_back(gpo);
467 
468 
469     gpo = Genesys_Gpo();
470     gpo.id = GpioId::CANON_LIDE_80;
471     gpo.regs = {
472         { 0x6c, 0x28 },
473         { 0x6d, 0x90 },
474         { 0x6e, 0x75 },
475         { 0x6f, 0x80 },
476     };
477     s_gpo->push_back(gpo);
478 }
479 
480 } // namespace genesys
481