1141cc406Sopenharmony_ci/* sane - Scanner Access Now Easy.
2141cc406Sopenharmony_ci
3141cc406Sopenharmony_ci   Copyright (C) 2019 Povilas Kanapickas <povilas@radix.lt>
4141cc406Sopenharmony_ci
5141cc406Sopenharmony_ci   This file is part of the SANE package.
6141cc406Sopenharmony_ci
7141cc406Sopenharmony_ci   This program is free software; you can redistribute it and/or
8141cc406Sopenharmony_ci   modify it under the terms of the GNU General Public License as
9141cc406Sopenharmony_ci   published by the Free Software Foundation; either version 2 of the
10141cc406Sopenharmony_ci   License, or (at your option) any later version.
11141cc406Sopenharmony_ci
12141cc406Sopenharmony_ci   This program is distributed in the hope that it will be useful, but
13141cc406Sopenharmony_ci   WITHOUT ANY WARRANTY; without even the implied warranty of
14141cc406Sopenharmony_ci   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15141cc406Sopenharmony_ci   General Public License for more details.
16141cc406Sopenharmony_ci
17141cc406Sopenharmony_ci   You should have received a copy of the GNU General Public License
18141cc406Sopenharmony_ci   along with this program.  If not, see <https://www.gnu.org/licenses/>.
19141cc406Sopenharmony_ci*/
20141cc406Sopenharmony_ci
21141cc406Sopenharmony_ci#ifndef BACKEND_GENESYS_GL646_REGISTERS_H
22141cc406Sopenharmony_ci#define BACKEND_GENESYS_GL646_REGISTERS_H
23141cc406Sopenharmony_ci
24141cc406Sopenharmony_ci#include <cstdint>
25141cc406Sopenharmony_ci
26141cc406Sopenharmony_cinamespace genesys {
27141cc406Sopenharmony_cinamespace gl646 {
28141cc406Sopenharmony_ci
29141cc406Sopenharmony_ciusing RegAddr = std::uint16_t;
30141cc406Sopenharmony_ciusing RegMask = std::uint8_t;
31141cc406Sopenharmony_ciusing RegShift = unsigned;
32141cc406Sopenharmony_ci
33141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x01 = 0x01;
34141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_CISSET = 0x80;
35141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_DOGENB = 0x40;
36141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_DVDSET = 0x20;
37141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_FASTMOD = 0x10;
38141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_COMPENB = 0x08;
39141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_DRAMSEL = 0x04;
40141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_SHDAREA = 0x02;
41141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_SCAN = 0x01;
42141cc406Sopenharmony_ci
43141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_NOTHOME = 0x80;
44141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_ACDCDIS = 0x40;
45141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_AGOHOME = 0x20;
46141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_MTRPWR = 0x10;
47141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_FASTFED = 0x08;
48141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_MTRREV = 0x04;
49141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_STEPSEL = 0x03;
50141cc406Sopenharmony_ci
51141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_FULLSTEP = 0x00;
52141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_HALFSTEP = 0x01;
53141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_QUATERSTEP = 0x02;
54141cc406Sopenharmony_ci
55141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_TG3 = 0x80;
56141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_AVEENB = 0x40;
57141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_XPASEL = 0x20;
58141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPPWR = 0x10;
59141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPDOG = 0x08;
60141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPTIM = 0x07;
61141cc406Sopenharmony_ci
62141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_LINEART = 0x80;
63141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_BITSET = 0x40;
64141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_ADTYPE = 0x30;
65141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_FILTER = 0x0c;
66141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_FESET = 0x03;
67141cc406Sopenharmony_ci
68141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x05 = 0x05;
69141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW = 0xc0;
70141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_600 = 0x00;
71141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_1200 = 0x40;
72141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_2400 = 0x80;
73141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_4800 = 0xc0;
74141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_GMMTYPE = 0x30;
75141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_GMM14BIT = 0x10;
76141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_GMMENB = 0x08;
77141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_LEDADD = 0x04;
78141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_BASESEL = 0x03;
79141cc406Sopenharmony_ci
80141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x06 = 0x06;
81141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_PWRBIT = 0x10;
82141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_GAIN4 = 0x08;
83141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_OPTEST = 0x07;
84141cc406Sopenharmony_ci
85141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_DMASEL = 0x02;
86141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_DMARDWR = 0x01;
87141cc406Sopenharmony_ci
88141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLHI = 0x80;
89141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_SELINV = 0x40;
90141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_TGINV = 0x20;
91141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CK1INV = 0x10;
92141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CK2INV = 0x08;
93141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLINV = 0x04;
94141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CKDIS = 0x02;
95141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLDIS = 0x01;
96141cc406Sopenharmony_ci
97141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE = 0xc0;
98141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_NO_DUMMY = 0x00;
99141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_REF = 0x40;
100141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_XPA = 0x80;
101141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGW = 0x3f;
102141cc406Sopenharmony_ci
103141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CNSET = 0x80;
104141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_DCKSEL = 0x60;
105141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKTOGGLE = 0x10;
106141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKDELAY = 0x0c;
107141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKSEL = 0x03;
108141cc406Sopenharmony_ci
109141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1D_CKMANUAL = 0x80;
110141cc406Sopenharmony_ci
111141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1E_WDTIME = 0xf0;
112141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1E_LINESEL = 0x0f;
113141cc406Sopenharmony_ci
114141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_PWRBIT = 0x80;
115141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_BUFEMPTY = 0x40;
116141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_FEEDFSH = 0x20;
117141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_SCANFSH = 0x10;
118141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_HOMESNR = 0x08;
119141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_LAMPSTS = 0x04;
120141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_FEBUSY = 0x02;
121141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_MOTMFLG = 0x01;
122141cc406Sopenharmony_ci
123141cc406Sopenharmony_cistatic constexpr RegMask REG_0x66_LOW_CURRENT = 0x10;
124141cc406Sopenharmony_ci
125141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6A_FSTPSEL = 0xc0;
126141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6A_FASTPWM = 0x3f;
127141cc406Sopenharmony_ci
128141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6C_TGTIME = 0xc0;
129141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6C_Z1MOD = 0x38;
130141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6C_Z2MOD = 0x07;
131141cc406Sopenharmony_ci
132141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPR = 0x10;
133141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPG = 0x12;
134141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPB = 0x14;
135141cc406Sopenharmony_cistatic constexpr RegAddr REG_SCANFED = 0x1f;
136141cc406Sopenharmony_cistatic constexpr RegAddr REG_BUFSEL = 0x20;
137141cc406Sopenharmony_cistatic constexpr RegAddr REG_LINCNT = 0x25;
138141cc406Sopenharmony_cistatic constexpr RegAddr REG_DPISET = 0x2c;
139141cc406Sopenharmony_cistatic constexpr RegAddr REG_STRPIXEL = 0x30;
140141cc406Sopenharmony_cistatic constexpr RegAddr REG_ENDPIXEL = 0x32;
141141cc406Sopenharmony_cistatic constexpr RegAddr REG_DUMMY = 0x34;
142141cc406Sopenharmony_cistatic constexpr RegAddr REG_MAXWD = 0x35;
143141cc406Sopenharmony_cistatic constexpr RegAddr REG_LPERIOD = 0x38;
144141cc406Sopenharmony_cistatic constexpr RegAddr REG_FEEDL = 0x3d;
145141cc406Sopenharmony_cistatic constexpr RegAddr REG_VALIDWORD = 0x42;
146141cc406Sopenharmony_cistatic constexpr RegAddr REG_FEDCNT = 0x48;
147141cc406Sopenharmony_cistatic constexpr RegAddr REG_SCANCNT = 0x4b;
148141cc406Sopenharmony_cistatic constexpr RegAddr REG_Z1MOD = 0x60;
149141cc406Sopenharmony_cistatic constexpr RegAddr REG_Z2MOD = 0x62;
150141cc406Sopenharmony_ci
151141cc406Sopenharmony_ci} // namespace gl646
152141cc406Sopenharmony_ci} // namespace genesys
153141cc406Sopenharmony_ci
154141cc406Sopenharmony_ci#endif // BACKEND_GENESYS_GL646_REGISTERS_H
155