CNI proprietary protocol commands
05-10-2007
CNI Engineering S.r.l.
49
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
};
#define ByteCRC16(v, crc) \
(unsigned short)((crc << 8) ^
ccitt_16Table[((crc >> 8) ^ (v)) & 255])
/*
*
===== CalcCRC16Words =====
*
Calculate the CRC for a buffer of 16-bit words.
Supports both
*
Little and Big Endian formats using conditional compilation.
*
Note: minimum count is 1 (0 case not handled)
*/
CRC16 CalcCRC16Words(unsigned int count, short *buffer) {
int crc = 0;
do {
int value = *+;
#ifdef _BIG_ENDIAN
crc = ByteCRC16(value >> 8, crc);
crc = ByteCRC16(value, crc);
#else
crc = ByteCRC16(value, crc);
crc = ByteCRC16(value >> 8, crc);
#endif
}
while (--count);
return (CRC16) crc;
}
#endif /* _OPT_SIZE */
#ifdef _CRC16_BYTES
/*
*
===== CalcCRC16Bytes =====
*
Calculate the CRC for a buffer of 8-bit words.
*
Note: minimum count is 1 (0 case not handled)
Содержание RM85x
Страница 4: ......
Страница 8: ...TABLE OF CONTENTS 05 10 2007 CNI Engineering S r l iv...