Lines Matching defs:regs
74 static SANE_Status low_write_all_regs (SANE_Int devnum, SANE_Byte * regs);
81 static void low_rewind (Lexmark_Device * dev, SANE_Byte * regs);
86 SANE_Byte * regs,
98 SANE_Byte * regs, Lexmark_Device * dev);
127 rts88xx_is_color (SANE_Byte * regs)
129 if ((regs[0x2f] & 0x11) == 0x11)
135 rts88xx_set_gray_scan (SANE_Byte * regs)
137 regs[0x2f] = (regs[0x2f] & 0x0f) | 0x20;
142 rts88xx_set_color_scan (SANE_Byte * regs)
144 regs[0x2f] = (regs[0x2f] & 0x0f) | 0x10;
149 rts88xx_set_offset (SANE_Byte * regs, SANE_Byte red, SANE_Byte green,
153 regs[0x02] = red;
154 regs[0x03] = green;
155 regs[0x04] = blue;
158 regs[0x05] = red;
159 regs[0x06] = green;
160 regs[0x07] = blue;
164 rts88xx_set_gain (SANE_Byte * regs, SANE_Byte red, SANE_Byte green,
167 regs[0x08] = red;
168 regs[0x09] = green;
169 regs[0x0a] = blue;
174 rts88xx_set_scan_frequency (SANE_Byte * regs, int frequency)
176 regs[0x64] = (regs[0x64] & 0xf0) | (frequency & 0x0f);
373 SANE_Byte regs[14] =
377 if (rts88xx_write_regs (devnum, 16, regs, 14) != SANE_STATUS_GOOD)
391 SANE_Byte regs[5] = { 0x12, 0x14, 0x16, 0x18, 0x1a };
398 if (rts88xx_write_reg (dev->devnum, regs[i], values + i) !=
956 low_start_scan (SANE_Int devnum, SANE_Byte * regs)
963 regs[0x32] = 0x00;
964 status = low_write_all_regs (devnum, regs);
967 regs[0x32] = 0x40;
968 status = low_write_all_regs (devnum, regs);
978 status = rts88xx_commit (devnum, regs[0x2c]);
1035 low_simple_scan (Lexmark_Device * dev, SANE_Byte * regs, int xoffset,
1045 xoffset, pixels, xoffset + pixels * regs[0x7a], yoffset, lines);
1048 regs[0x60] = LOBYTE (yoffset);
1049 regs[0x61] = HIBYTE (yoffset);
1052 || dev->model.motor_type == X74_MOTOR) && rts88xx_is_color (regs)
1055 regs[0x62] = LOBYTE (yend);
1056 regs[0x63] = HIBYTE (yend);
1058 regs[0x66] = LOBYTE (xoffset);
1059 regs[0x67] = HIBYTE (xoffset);
1061 regs[0x6c] = LOBYTE (xoffset + pixels * regs[0x7a]);
1062 regs[0x6d] = HIBYTE (xoffset + pixels * regs[0x7a]);
1065 if (rts88xx_is_color (regs))
1083 status = low_start_scan (dev->devnum, regs);
1112 if (regs[0xc3] & 0x80)
1258 low_write_all_regs (SANE_Int devnum, SANE_Byte * regs)
1271 command_block1[i + 4] = regs[i];
1279 command_block2[i + 4] = regs[i + 0xb4];
1287 fprintf (stderr, "0x%02x ", regs[i]);
1465 SANE_Byte * regs)
1490 regs[0x2c] = 0x00;
1491 regs[0x2d] = 0x41;
1492 regs[0x65] = 0x80;
1496 rts88xx_set_scan_frequency (regs, 0);
1497 regs[0x93] = 0x06;
1500 regs[0x8b] = 0x00;
1501 regs[0x8c] = 0x00;
1502 regs[0x93] = 0x06;
1505 rts88xx_set_scan_frequency (regs, 0);
1506 regs[0x93] = 0x06;
1509 rts88xx_set_scan_frequency (regs, 0);
1510 regs[0x8b] = 0xff;
1511 regs[0x8c] = 0x02;
1512 regs[0x93] = 0x0e;
1516 rts88xx_set_scan_frequency (regs, 0);
1520 rts88xx_set_scan_frequency (regs, 0);
1525 regs[0x2f] = 0xa1;
1528 regs[0x34] = 0x50;
1529 regs[0x35] = 0x01;
1530 regs[0x36] = 0x50;
1531 regs[0x37] = 0x01;
1532 regs[0x38] = 0x50;
1534 regs[0x39] = 0x00;
1536 regs[0x60] = LOBYTE (distance - 1);
1537 regs[0x61] = HIBYTE (distance - 1);
1538 regs[0x62] = LOBYTE (distance);
1539 regs[0x63] = HIBYTE (distance);
1541 regs[0x66] = 0x64;
1542 regs[0x67] = 0x00;
1544 regs[0x6c] = 0xc8;
1545 regs[0x6d] = 0x00;
1547 regs[0x79] = 0x40;
1548 regs[0x7a] = 0x01;
1550 regs[0xb2] = 0x04;
1552 regs[0xc3] = 0x81;
1554 regs[0xc6] = 0x09;
1556 regs[0x80] = 0x00;
1557 regs[0x81] = 0x00;
1558 regs[0x82] = 0x00;
1559 regs[0xc5] = 0x0a;
1567 regs[0xc9] = 0x3b;
1569 regs[0xca] = 0x0a;
1571 regs[0xe0] = 0x00;
1572 regs[0xe1] = 0x00;
1573 regs[0xe4] = 0x00;
1574 regs[0xe5] = 0x00;
1575 regs[0xe7] = 0x00;
1576 regs[0xe8] = 0x00;
1577 regs[0xe2] = 0x09;
1578 regs[0xe3] = 0x1a;
1579 regs[0xe6] = 0xdc;
1580 regs[0xe9] = 0x1b;
1581 regs[0xec] = 0x07;
1582 regs[0xef] = 0x03;
1585 regs[0xc5] = 0x41;
1587 regs[0xc9] = 0x39;
1589 regs[0xca] = 0x40;
1591 regs[0xe0] = 0x00;
1592 regs[0xe1] = 0x00;
1593 regs[0xe2] = 0x09;
1594 regs[0xe3] = 0x1a;
1595 regs[0xe4] = 0x00;
1596 regs[0xe5] = 0x00;
1597 regs[0xe6] = 0x64;
1598 regs[0xe7] = 0x00;
1599 regs[0xe8] = 0x00;
1600 regs[0xe9] = 0x32;
1601 regs[0xec] = 0x0c;
1602 regs[0xef] = 0x08;
1612 regs[0x32] = 0x00;
1613 low_write_all_regs (devnum, regs);
1614 regs[0x32] = 0x40;
1615 low_write_all_regs (devnum, regs);
1620 rts88xx_commit (devnum, regs[0x2c]);
1884 /* write regs out twice */
2164 /* write regs out twice */
2408 SANE_Byte * regs, Lexmark_Device * dev)
2431 regs[0x60] = LOBYTE (vert_start);
2432 regs[0x61] = HIBYTE (vert_start);
2434 regs[0x62] = LOBYTE (vert_end);
2435 regs[0x63] = HIBYTE (vert_end);
2442 regs[0x66] = LOBYTE (hor_start);
2443 regs[0x67] = HIBYTE (hor_start);
2445 regs[0x6c] = LOBYTE (hor_end);
2446 regs[0x6d] = HIBYTE (hor_end);
2729 /* write regs out twice */
4861 /*Set regs x2 */
5101 low_rewind (Lexmark_Device * dev, SANE_Byte * regs)
5117 if (rts88xx_is_color (regs))
5134 /* set regs for rewind */
5135 regs[0x2f] = 0xa1;
5136 regs[0x32] = 0x00;
5137 regs[0x39] = 0x00;
5139 /* all other regs are always the same. these ones change with parameters */
5140 /* the following 4 regs are the location 61,60 and the location+1 63,62 */
5142 regs[0x60] = LOBYTE (location);
5143 regs[0x61] = HIBYTE (location);
5144 regs[0x62] = LOBYTE (new_location);
5145 regs[0x63] = HIBYTE (new_location);
5150 regs[0xc3] = 0x81;
5151 regs[0xc6] = 0x03;
5152 regs[0xc9] = 0x39;
5153 regs[0xe0] = 0x81;
5154 regs[0xe1] = 0x16;
5155 regs[0xe2] = 0xe1;
5156 regs[0xe3] = 0x04;
5157 regs[0xe4] = 0xe7;
5158 regs[0xe5] = 0x14;
5159 regs[0xe6] = 0x64;
5160 regs[0xe7] = 0xd5;
5161 regs[0xe8] = 0x08;
5162 regs[0xe9] = 0x32;
5163 regs[0xea] = 0xed;
5164 regs[0xeb] = 0x04;
5165 regs[0xec] = 0x0c;
5166 regs[0xef] = 0x08;
5170 /* set regs for rewind */
5171 regs[0x79] = 0x40;
5172 regs[0xb2] = 0x04;
5173 regs[0xc3] = 0x81;
5174 regs[0xc6] = 0x01;
5175 regs[0xc9] = 0x3b;
5176 regs[0xe0] = 0x2b;
5177 regs[0xe1] = 0x17;
5178 regs[0xe2] = 0xe7;
5179 regs[0xe3] = 0x03;
5180 regs[0xe6] = 0xdc;
5181 regs[0xe7] = 0xb3;
5182 regs[0xe8] = 0x07;
5183 regs[0xe9] = 0x1b;
5184 regs[0xea] = 0x00;
5185 regs[0xeb] = 0x00;
5186 regs[0xec] = 0x07;
5187 regs[0xef] = 0x03;
5193 low_start_scan (dev->devnum, regs);
5477 average_area (SANE_Byte * regs, SANE_Byte * data, int width, int height,
5490 if (rts88xx_is_color (regs))
5525 SANE_Byte regs[255]; /* we have our own copy of shadow registers */
5543 regs[i] = dev->shadow_regs[i];
5546 regs[0xc3] = regs[0xc3] & 0x7f;
5549 (dev->sensor->offset_endx - dev->sensor->offset_startx) / regs[0x7a];
5565 rts88xx_set_gain (regs, 1, 1, 1);
5582 rts88xx_set_offset (regs, ro, ro, ro);
5588 low_simple_scan (dev, regs, dev->sensor->offset_startx, pixels,
5600 write_pnm_file (title, pixels, lines, rts88xx_is_color (regs), data);
5602 average = average_area (regs, data, pixels, lines, &ra, &ga, &ba);
5613 rts88xx_set_gain (regs, 6, 6, 6);
5615 low_simple_scan (dev, regs, dev->sensor->offset_startx, pixels, yoffset,
5625 average_area (regs, data, pixels, lines, &ra, &ga, &ba);
5627 write_pnm_file ("offset-final.pnm", pixels, lines, rts88xx_is_color (regs),
5667 SANE_Byte regs[255]; /* we have our own copy of shadow registers */
5683 regs[i] = dev->shadow_regs[i];
5686 regs[0xc3] = regs[0xc3] & 0x7f;
5687 sx = regs[0x67] * 256 + regs[0x66];
5688 ex = regs[0x6d] * 256 + regs[0x6c];
5689 pixels = (ex - sx) / regs[0x7a];
5696 rts88xx_set_gain (regs, red, green, blue);
5709 while (((rts88xx_is_color (regs)
5713 || (!rts88xx_is_color (regs)
5716 status = low_simple_scan (dev, regs, sx, pixels, yoffset, lines, &data);
5727 write_pnm_file (title, pixels, lines, rts88xx_is_color (regs), data);
5729 average_area (regs, data, pixels, lines, &ra, &ga, &ba);
5734 || (dev->sensor->gray_gain_target && !rts88xx_is_color (regs)))
5738 rts88xx_set_gain (regs, red, green, blue);
5763 SANE_Byte regs[255]; /* we have our own copy of shadow registers */
5780 regs[i] = dev->shadow_regs[i];
5783 sx = regs[0x67] * 256 + regs[0x66];
5784 ex = regs[0x6d] * 256 + regs[0x6c];
5788 sx, ex, regs[0x7a], regs[0x2f]);
5790 pixels = (ex - sx) / regs[0x7a];
5791 if (rts88xx_is_color (regs))
5797 lines = (8 * lines) / regs[0x7a];
5798 lineoffset = (8 * lineoffset) / regs[0x7a];
5799 linetotal = (8 * linetotal) / regs[0x7a];
5823 regs[0xc3] = regs[0xc3] | 0x80;
5826 status = low_simple_scan (dev, regs, sx, pixels, lineoffset, lines, &data);
5843 if (rts88xx_is_color (regs))
5877 write_pnm_file ("shading.pnm", pixels, lines, rts88xx_is_color (regs),
5885 if (yoffset + (8 * 4) / regs[0x7a] < lines)
5886 lines = yoffset + (8 * 4) / regs[0x7a];
5933 regs[0xc6] &= 0xF7;
5934 lines = (8 * 8) / regs[0x7a];
5940 status = low_simple_scan (dev, regs, sx, pixels, 1, lines, &data);
5951 write_pnm_file ("shading_bwd.pnm", pixels, lines, rts88xx_is_color (regs),
5971 /* we put the offset just computed in scanning regs */