10 const uint16_t chipID,
33 sw.lsData1 = lsDatas >> 48;
34 tw.lsData2 = lsDatas & 0x0000ffffffffffff;
36 fw.msData1 = msDatas >> 48;
37 sw.msData2 = msDatas & 0x0000ffffffffffff;
68 uint16_t mask = 0x0001;
70 uint16_t crc_temp = crc_in;
71 unsigned char datalen = 16;
72 for (
int i = 0;
i < datalen;
i++) {
77 if ((crc_temp & mask) ^
d)
78 crc_temp = crc_temp >> 1 ^ 0x8408;
80 crc_temp = crc_temp >> 1;
87 uint16_t vfatBlockWords[12];
92 vfatBlockWords[8] = (0xffff000000000000 &
msData()) >> 48;
93 vfatBlockWords[7] = (0x0000ffff00000000 &
msData()) >> 32;
94 vfatBlockWords[6] = (0x00000000ffff0000 &
msData()) >> 16;
95 vfatBlockWords[5] = (0x000000000000ffff &
msData());
96 vfatBlockWords[4] = (0xffff000000000000 &
lsData()) >> 48;
97 vfatBlockWords[3] = (0x0000ffff00000000 &
lsData()) >> 32;
98 vfatBlockWords[2] = (0x00000000ffff0000 &
lsData()) >> 16;
99 vfatBlockWords[1] = (0x000000000000ffff &
lsData());
101 uint16_t crc_fin = 0xffff;
102 for (
int i = 11;
i >= 1;
i--) {
103 crc_fin =
crc_cal(crc_fin, vfatBlockWords[
i]);