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_GL841_REGISTERS_H 22141cc406Sopenharmony_ci#define BACKEND_GENESYS_GL841_REGISTERS_H 23141cc406Sopenharmony_ci 24141cc406Sopenharmony_ci#include <cstdint> 25141cc406Sopenharmony_ci 26141cc406Sopenharmony_cinamespace genesys { 27141cc406Sopenharmony_cinamespace gl841 { 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_M16DRAM = 0x08; 38141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_DRAMSEL = 0x04; 39141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_SHDAREA = 0x02; 40141cc406Sopenharmony_cistatic constexpr RegMask REG_0x01_SCAN = 0x01; 41141cc406Sopenharmony_ci 42141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x02 = 0x02; 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_HOMENEG = 0x02; 50141cc406Sopenharmony_cistatic constexpr RegMask REG_0x02_LONGCURV = 0x01; 51141cc406Sopenharmony_ci 52141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPDOG = 0x80; 53141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_AVEENB = 0x40; 54141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_XPASEL = 0x20; 55141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPPWR = 0x10; 56141cc406Sopenharmony_cistatic constexpr RegMask REG_0x03_LAMPTIM = 0x0f; 57141cc406Sopenharmony_ci 58141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_LINEART = 0x80; 59141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_BITSET = 0x40; 60141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_AFEMOD = 0x30; 61141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_FILTER = 0x0c; 62141cc406Sopenharmony_cistatic constexpr RegMask REG_0x04_FESET = 0x03; 63141cc406Sopenharmony_ci 64141cc406Sopenharmony_cistatic constexpr RegShift REG_0x04S_AFEMOD = 4; 65141cc406Sopenharmony_ci 66141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x05 = 0x05; 67141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW = 0xc0; 68141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_600 = 0x00; 69141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_1200 = 0x40; 70141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_DPIHW_2400 = 0x80; 71141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_MTLLAMP = 0x30; 72141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_GMMENB = 0x08; 73141cc406Sopenharmony_cistatic constexpr RegMask REG_0x05_MTLBASE = 0x03; 74141cc406Sopenharmony_ci 75141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x06 = 0x06; 76141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_SCANMOD = 0xe0; 77141cc406Sopenharmony_cistatic constexpr RegShift REG_0x06S_SCANMOD = 5; 78141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_PWRBIT = 0x10; 79141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_GAIN4 = 0x08; 80141cc406Sopenharmony_cistatic constexpr RegMask REG_0x06_OPTEST = 0x07; 81141cc406Sopenharmony_ci 82141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_SRAMSEL = 0x08; 83141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_FASTDMA = 0x04; 84141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_DMASEL = 0x02; 85141cc406Sopenharmony_cistatic constexpr RegMask REG_0x07_DMARDWR = 0x01; 86141cc406Sopenharmony_ci 87141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_DECFLAG = 0x40; 88141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMFFR = 0x20; 89141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMFFG = 0x10; 90141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMFFB = 0x08; 91141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMZR = 0x04; 92141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMZG = 0x02; 93141cc406Sopenharmony_cistatic constexpr RegMask REG_0x08_GMMZB = 0x01; 94141cc406Sopenharmony_ci 95141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_MCNTSET = 0xc0; 96141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_CLKSET = 0x30; 97141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_BACKSCAN = 0x08; 98141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_ENHANCE = 0x04; 99141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_SHORTTG = 0x02; 100141cc406Sopenharmony_cistatic constexpr RegMask REG_0x09_NWAIT = 0x01; 101141cc406Sopenharmony_ci 102141cc406Sopenharmony_cistatic constexpr RegShift REG_0x09S_MCNTSET = 6; 103141cc406Sopenharmony_cistatic constexpr RegShift REG_0x09S_CLKSET = 4; 104141cc406Sopenharmony_ci 105141cc406Sopenharmony_ci 106141cc406Sopenharmony_cistatic constexpr RegMask REG_0x0A_SRAMBUF = 0x01; 107141cc406Sopenharmony_ci 108141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x0D = 0x0d; 109141cc406Sopenharmony_cistatic constexpr RegMask REG_0x0D_CLRLNCNT = 0x01; 110141cc406Sopenharmony_ci 111141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLHI = 0x80; 112141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_TOSHIBA = 0x40; 113141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_TGINV = 0x20; 114141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CK1INV = 0x10; 115141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CK2INV = 0x08; 116141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLINV = 0x04; 117141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CKDIS = 0x02; 118141cc406Sopenharmony_cistatic constexpr RegMask REG_0x16_CTRLDIS = 0x01; 119141cc406Sopenharmony_ci 120141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE = 0xc0; 121141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_NO_DUMMY = 0x00; 122141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_REF = 0x40; 123141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGMODE_XPA = 0x80; 124141cc406Sopenharmony_cistatic constexpr RegMask REG_0x17_TGW = 0x3f; 125141cc406Sopenharmony_cistatic constexpr RegShift REG_0x17S_TGW = 0; 126141cc406Sopenharmony_ci 127141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CNSET = 0x80; 128141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_DCKSEL = 0x60; 129141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKTOGGLE = 0x10; 130141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKDELAY = 0x0c; 131141cc406Sopenharmony_cistatic constexpr RegMask REG_0x18_CKSEL = 0x03; 132141cc406Sopenharmony_ci 133141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1A_MANUAL3 = 0x02; 134141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1A_MANUAL1 = 0x01; 135141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1A_CK4INV = 0x08; 136141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1A_CK3INV = 0x04; 137141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1A_LINECLP = 0x02; 138141cc406Sopenharmony_ci 139141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1C_TGTIME = 0x07; 140141cc406Sopenharmony_ci 141141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1D_CK4LOW = 0x80; 142141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1D_CK3LOW = 0x40; 143141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1D_CK1LOW = 0x20; 144141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1D_TGSHLD = 0x1f; 145141cc406Sopenharmony_cistatic constexpr RegShift REG_0x1DS_TGSHLD = 0; 146141cc406Sopenharmony_ci 147141cc406Sopenharmony_ci 148141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x1E = 0x1e; 149141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1E_WDTIME = 0xf0; 150141cc406Sopenharmony_cistatic constexpr RegShift REG_0x1ES_WDTIME = 4; 151141cc406Sopenharmony_cistatic constexpr RegMask REG_0x1E_LINESEL = 0x0f; 152141cc406Sopenharmony_cistatic constexpr RegShift REG_0x1ES_LINESEL = 0; 153141cc406Sopenharmony_ci 154141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPR = 0x10; 155141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPG = 0x12; 156141cc406Sopenharmony_cistatic constexpr RegAddr REG_EXPB = 0x14; 157141cc406Sopenharmony_cistatic constexpr RegAddr REG_STEPNO = 0x21; 158141cc406Sopenharmony_cistatic constexpr RegAddr REG_FWDSTEP = 0x22; 159141cc406Sopenharmony_cistatic constexpr RegAddr REG_BWDSTEP = 0x23; 160141cc406Sopenharmony_cistatic constexpr RegAddr REG_FASTNO = 0x24; 161141cc406Sopenharmony_cistatic constexpr RegAddr REG_LINCNT = 0x25; 162141cc406Sopenharmony_cistatic constexpr RegAddr REG_DPISET = 0x2c; 163141cc406Sopenharmony_cistatic constexpr RegAddr REG_STRPIXEL = 0x30; 164141cc406Sopenharmony_cistatic constexpr RegAddr REG_ENDPIXEL = 0x32; 165141cc406Sopenharmony_cistatic constexpr RegAddr REG_MAXWD = 0x35; 166141cc406Sopenharmony_cistatic constexpr RegAddr REG_LPERIOD = 0x38; 167141cc406Sopenharmony_ci 168141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x40 = 0x40; 169141cc406Sopenharmony_cistatic constexpr RegMask REG_0x40_HISPDFLG = 0x04; 170141cc406Sopenharmony_cistatic constexpr RegMask REG_0x40_MOTMFLG = 0x02; 171141cc406Sopenharmony_cistatic constexpr RegMask REG_0x40_DATAENB = 0x01; 172141cc406Sopenharmony_ci 173141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_PWRBIT = 0x80; 174141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_BUFEMPTY = 0x40; 175141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_FEEDFSH = 0x20; 176141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_SCANFSH = 0x10; 177141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_HOMESNR = 0x08; 178141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_LAMPSTS = 0x04; 179141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_FEBUSY = 0x02; 180141cc406Sopenharmony_cistatic constexpr RegMask REG_0x41_MOTORENB = 0x01; 181141cc406Sopenharmony_ci 182141cc406Sopenharmony_cistatic constexpr RegMask REG_0x58_VSMP = 0xf8; 183141cc406Sopenharmony_cistatic constexpr RegShift REG_0x58S_VSMP = 3; 184141cc406Sopenharmony_cistatic constexpr RegMask REG_0x58_VSMPW = 0x07; 185141cc406Sopenharmony_cistatic constexpr RegShift REG_0x58S_VSMPW = 0; 186141cc406Sopenharmony_ci 187141cc406Sopenharmony_cistatic constexpr RegMask REG_0x59_BSMP = 0xf8; 188141cc406Sopenharmony_cistatic constexpr RegShift REG_0x59S_BSMP = 3; 189141cc406Sopenharmony_cistatic constexpr RegMask REG_0x59_BSMPW = 0x07; 190141cc406Sopenharmony_cistatic constexpr RegShift REG_0x59S_BSMPW = 0; 191141cc406Sopenharmony_ci 192141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5A_ADCLKINV = 0x80; 193141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5A_RLCSEL = 0x40; 194141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5A_CDSREF = 0x30; 195141cc406Sopenharmony_cistatic constexpr RegShift REG_0x5AS_CDSREF = 4; 196141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5A_RLC = 0x0f; 197141cc406Sopenharmony_cistatic constexpr RegShift REG_0x5AS_RLC = 0; 198141cc406Sopenharmony_ci 199141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5E_DECSEL = 0xe0; 200141cc406Sopenharmony_cistatic constexpr RegShift REG_0x5ES_DECSEL = 5; 201141cc406Sopenharmony_cistatic constexpr RegMask REG_0x5E_STOPTIM = 0x1f; 202141cc406Sopenharmony_cistatic constexpr RegShift REG_0x5ES_STOPTIM = 0; 203141cc406Sopenharmony_ci 204141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x60 = 0x60; 205141cc406Sopenharmony_cistatic constexpr RegMask REG_0x60_ZIMOD = 0x1f; 206141cc406Sopenharmony_cistatic constexpr RegMask REG_0x61_Z1MOD = 0xff; 207141cc406Sopenharmony_cistatic constexpr RegMask REG_0x62_Z1MOD = 0xff; 208141cc406Sopenharmony_ci 209141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x63 = 0x63; 210141cc406Sopenharmony_cistatic constexpr RegMask REG_0x63_Z2MOD = 0x1f; 211141cc406Sopenharmony_cistatic constexpr RegMask REG_0x64_Z2MOD = 0xff; 212141cc406Sopenharmony_cistatic constexpr RegMask REG_0x65_Z2MOD = 0xff; 213141cc406Sopenharmony_ci 214141cc406Sopenharmony_cistatic constexpr RegMask REG_0x67_STEPSEL = 0xc0; 215141cc406Sopenharmony_cistatic constexpr RegMask REG_0x67_FULLSTEP = 0x00; 216141cc406Sopenharmony_cistatic constexpr RegMask REG_0x67_HALFSTEP = 0x40; 217141cc406Sopenharmony_cistatic constexpr RegMask REG_0x67_QUATERSTEP = 0x80; 218141cc406Sopenharmony_cistatic constexpr RegMask REG_0x67_MTRPWM = 0x3f; 219141cc406Sopenharmony_ci 220141cc406Sopenharmony_cistatic constexpr RegMask REG_0x68_FSTPSEL = 0xc0; 221141cc406Sopenharmony_cistatic constexpr RegMask REG_0x68_FULLSTEP = 0x00; 222141cc406Sopenharmony_cistatic constexpr RegMask REG_0x68_HALFSTEP = 0x40; 223141cc406Sopenharmony_cistatic constexpr RegMask REG_0x68_QUATERSTEP = 0x80; 224141cc406Sopenharmony_cistatic constexpr RegMask REG_0x68_FASTPWM = 0x3f; 225141cc406Sopenharmony_ci 226141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_MULTFILM = 0x80; 227141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_GPOM13 = 0x40; 228141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_GPOM12 = 0x20; 229141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_GPOM11 = 0x10; 230141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_GPO18 = 0x02; 231141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6B_GPO17 = 0x01; 232141cc406Sopenharmony_ci 233141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x6B = 0x6b; 234141cc406Sopenharmony_ci 235141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x6C = 0x6c; 236141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6C_GPIOH = 0xff; 237141cc406Sopenharmony_cistatic constexpr RegMask REG_0x6C_GPIOL = 0xff; 238141cc406Sopenharmony_ci 239141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x6D = 0x6d; 240141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x6E = 0x6e; 241141cc406Sopenharmony_cistatic constexpr RegAddr REG_0x6F = 0x6f; 242141cc406Sopenharmony_ci 243141cc406Sopenharmony_cistatic constexpr RegMask REG_0x87_LEDADD = 0x04; 244141cc406Sopenharmony_ci 245141cc406Sopenharmony_ci} // namespace gl841 246141cc406Sopenharmony_ci} // namespace genesys 247141cc406Sopenharmony_ci 248141cc406Sopenharmony_ci#endif // BACKEND_GENESYS_GL841_REGISTERS_H 249