?

Log in

No account? Create an account

Previous Entry | Next Entry

registers...

I spent some time tonight looking at how the registers in this scanner are accessed and modified. I had to delve into the SANE plustek driver to figure out how to deal with the registers as the data was not in the Nat Semi manual. It seems that you build a buffer consisting of commands and data, and send it down the pipe to the scanner. The first 4 bytes of the buffer seem to be the command, with the rest (up to 60 more bytes) being data. byte 1 has 3 meanings (so far)

0: write
1: read
2: increment register?

Byte 2 simply contains the hex for the address that you intend to modify. Bytes 3 and 4 are the length of the data to transfer in or out. 3 is most significant byte, 4 is least. After that comes the data. In a write you send the 4 bytes plus data, repeating as needed til the entire buffer is sent. In a read you send the 4 byte command and then read in data that is sent back.

The next step is to actually code the read/write functions into my driver now that I know how they work.

But first, I must play Mario Kart :)