1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
|
/* registers.h - Register definition for E1 ASIC
*
* Copyright (C) 2004, 2005 Anderson Lizardo
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* FIXME: This code was initially taken from pxscan-0.41 and is based on the
* E3 ASIC definition. Probably some of the registers below are incorrect for
* E1 or even do not exist on it.
*/
/* ASIC ID - R */
struct REG0
{
unsigned AsicType:8;
};
/* General Register 0 - R/W */
struct REG1
{
unsigned Data:8;
};
/* General Register 1 - R/W */
struct REG2
{
unsigned Data:8;
};
/* Command Register 0 - R/W */
struct REG3
{
unsigned SysReset:1;
unsigned FiFoReset:1;
unsigned EppUsb:1;
unsigned WatchDog:1;
unsigned SelfTest:1;
unsigned ScanSpeed:3;
};
/* Command Register 1 - R/W */
struct REG4
{
unsigned AsicTest:1;
unsigned NoLineOffset:1;
unsigned Refresh:1;
unsigned RefreshForever:1;
unsigned WaitDelay:2;
unsigned ScanMode:2;
};
/* Command Register 2 - R/W */
struct REG5
{
unsigned Sensor:2;
unsigned SensorRes:2; /* Sensor Resolution: 0 - 300 dpi; 1 - 600 dpi */
unsigned Afe:3;
unsigned Adc1210:1;
};
/* Motor Control - R/W */
struct REG6
{
unsigned MotorPower:1;
unsigned HalfFull:1; /* 0 - Full Step; 1 - Half Step */
unsigned Operation:3;
unsigned LineOffset:3;
};
/* Motor Move Steps High Byte - R/W */
struct REG7
{
unsigned Data:8;
};
/* Motor Move Steps Low Byte - R/W */
struct REG8
{
unsigned Data:8;
};
/* Motor Back Steps (Scanning) - R/W */
struct REG9
{
unsigned Data:8;
};
/* Motor Trigger Period High Byte (Unit: 0.5 us) - R/W */
struct REG10
{
unsigned Data:8;
};
/* Motor Trigger Period Low Byte (Unit: 0.5 us) - R/W */
struct REG11
{
unsigned Data:8;
};
/* Sensor Status - R/W */
struct REG12
{
unsigned Lamp:1;
unsigned KeyButton:1;
unsigned HomeSensor:1;
unsigned FinishFlag:1;
unsigned FiFoEmpty:2;
unsigned Reserved:2;
};
/* AFE Programming Register - R/W */
struct REG13
{
unsigned SDI:1;
unsigned SDO:1; /* Data to scanner's ADC ( = SDI of SDC ) */
unsigned SCLK:1;
unsigned SEN:1;
unsigned Reserved:1;
unsigned VSMP:3; /* VSMP = Video SAMPle sync pulse */
};
/* Memory Address Port (MSB) - R/W */
struct REG14
{
unsigned Mem:5;
unsigned Reserved:2;
unsigned Mem_512_2048:1;
};
/* Memory Address Port High Byte - R/W */
struct REG15
{
unsigned Data:8;
};
/* Memory Address Port Low Byte - R/W */
struct REG16
{
unsigned Data:8;
};
/* Memory Data Port - R/W */
struct REG17
{
unsigned Data:8;
};
/* Data Size High Byte - R/W */
struct REG18
{
unsigned Data:8;
};
/* Data Size Low Byte - R/W */
struct REG19
{
unsigned Data:8;
};
/* Scan Area Start Point High Byte - R/W */
struct REG20
{
unsigned AreaStart:6;
unsigned Reserved:2;
};
/* Scan Area Start Point Low Byte - R/W */
struct REG21
{
unsigned AreaStart:8;
};
/* Scan Area Width High Byte - R/W */
struct REG22
{
unsigned AreaWidth:6;
unsigned Reserved:2;
};
/* Scan Area Width Low Byte - R/W */
struct REG23
{
unsigned AreaWidth:8;
};
/* General Purpose I/O Register 0 - R */
struct REG24
{
unsigned ProductID:5;
unsigned Gio5:1;
unsigned Gio6:1;
unsigned Reserved:1;
};
/* General Purpose I/O Register 1 - R/W */
struct REG25
{
unsigned Gio11:1;
unsigned Gio12:1;
unsigned Gio13:1;
unsigned Gio14:1;
unsigned Gio11ctl:1;
unsigned Gio12ctl:1;
unsigned Gio13ctl:1;
unsigned Gio14ctl:1;
};
/* Buffer Bank R/W Difference Motor Start & Stop - R/W */
struct REG26
{
unsigned Stop:4;
unsigned Start:4;
};
/* X-Direction & Y-Direction Resolution Control High Byte - R/W */
struct REG27
{
unsigned YRes:3;
unsigned AutoPattern:1;
unsigned XRes:3;
unsigned True16Bit:1;
};
/* X-Direction Resolution Control Low Byte - R/W */
struct REG28
{
unsigned XRes:8;
};
/* Y-Direction Resolution Control Low Byte - R/W */
struct REG29
{
unsigned YRes:8;
};
union
{
struct REG0 r;
unsigned char w;
} reg0;
union
{
struct REG1 r;
unsigned char w;
} reg1;
union
{
struct REG2 r;
unsigned char w;
} reg2;
union
{
struct REG3 r;
unsigned char w;
} reg3;
union
{
struct REG4 r;
unsigned char w;
} reg4;
union
{
struct REG5 r;
unsigned char w;
} reg5;
union
{
struct REG6 r;
unsigned char w;
} reg6;
union
{
struct REG7 r;
unsigned char w;
} reg7;
union
{
struct REG8 r;
unsigned char w;
} reg8;
union
{
struct REG9 r;
unsigned char w;
} reg9;
union
{
struct REG10 r;
unsigned char w;
} reg10;
union
{
struct REG11 r;
unsigned char w;
} reg11;
union
{
struct REG12 r;
unsigned char w;
} reg12;
union
{
struct REG13 r;
unsigned char w;
} reg13;
union
{
struct REG14 r;
unsigned char w;
} reg14;
union
{
struct REG15 r;
unsigned char w;
} reg15;
union
{
struct REG16 r;
unsigned char w;
} reg16;
union
{
struct REG17 r;
unsigned char w;
} reg17;
union
{
struct REG18 r;
unsigned char w;
} reg18;
union
{
struct REG19 r;
unsigned char w;
} reg19;
union
{
struct REG20 r;
unsigned char w;
} reg20;
union
{
struct REG21 r;
unsigned char w;
} reg21;
union
{
struct REG22 r;
unsigned char w;
} reg22;
union
{
struct REG23 r;
unsigned char w;
} reg23;
union
{
struct REG24 r;
unsigned char w;
} reg24;
union
{
struct REG25 r;
unsigned char w;
} reg25;
union
{
struct REG26 r;
unsigned char w;
} reg26;
union
{
struct REG27 r;
unsigned char w;
} reg27;
union
{
struct REG28 r;
unsigned char w;
} reg28;
union
{
struct REG29 r;
unsigned char w;
} reg29;
|