at42qt1481 ATMEL Corporation, at42qt1481 Datasheet - Page 64

no-image

at42qt1481

Manufacturer Part Number
at42qt1481
Description
48-key Qmatrix Ic
Manufacturer
ATMEL Corporation
Datasheet
Appendix A.
64
AT42QT1481
16-bit CRC Algorithm
A CRC calculator for Microsoft Windows is available free of charge from Atmel.
// 16 bits crc calculation. Initial crc entry value must be 0.
// The message is not augmented with 'zero' bits.
// polynomial = X16 + X12 + X5 + 1
// data is an 8 bit number, unsigned
// crc is a 16 bit number, unsigned
// repeat this function for each data block byte, folding the result
//
unsigned long sixteen_bit_crc(unsigned long crc, unsigned char data)
{ unsigned char index;// shift counter
}
crc ^= (unsigned long)(data) << 8;
index = 8;
do
{ if(crc & 0x8000)
} while(--index);
return crc;
{ crc= (crc << 1) ^ 0x1021;
}
else
{ crc= crc << 1;
}
back into the call parameter crc
// loop 8 times
9621B–AT42–06/11

Related parts for at42qt1481