I'm looking for some advice on writing a C function to calculate a 16 bit CRC for an LTO RFID chip.
The spec says:
For commands and data that are protected by the 16-bit CRC, the generator polynomial shall be G(x) = x16 + x12 + x5 + 1 The CRC bytes shall be generated by processing all bytes through a generator circuit. See figure F.11. Registers R0 to R15 shall be 1 bit wide where R0 shall be the least significant bit and R15 the most significant bit. These registers shall be set to (6363) prior to the beginning of processing. The bytes shall be fed sequentially into the encoder, least significant bit first. After the bytes have been processed, the content of R0 is CRC0 and shall be the least significant bit. The content of R15 is CRC15 and shall be the most significant bit.
But I've just a humble self taught C programmer and that means nothing to me.
Can anybody help me with some code, or an explanation of the formula?