/************************************************************************* $Archive: /PACS/OnBoard/crc.h $ $Revision: 1.12 $ $Date: 2009/04/23 13:51:12 $ $Author: amazy $ $Log: crc.h,v $ Revision 1.12 2009/04/23 13:51:12 amazy 6.029 * * 5 12/11/06 11:48a Amazy * introduced checksum in DMC HK * * 4 11/12/06 11:04 Amazy * * 9 3/14/06 4:31p Pacs Egse * Version 6.001 * Cleaned and commented ************************************************************************/ #define CRC_H #ifdef CSL_SHOW_INCLUDE #pragma message( "Including " __FILE__ ) #endif #ifdef __cplusplus extern "C" { /* Assume C declarations for C++ */ #endif /* __cplusplus */ /* Functions containing the checksum algorithm for 1 byte or 2 bytes. For */ /* instance, to check "0xABCDEF", assuming the table has been already */ /* initialized, the steps to perform are: */ /* crc=0xFFFFFFFF; */ /* crc=Crc16(0xABCD,crc); */ /* crc=Crc8(0xEF,crc); */ /* Now crc contains the resulting checksum. */ extern int Crc8(int data, int crc); extern int Crc16(int data, int crc); extern int Crc32(int data, int crc); extern int GetChecksum(int* p_buffer, int size); extern int GetChecksumInPram(int* p_buffer, int size); extern void InitCrcTable(); #ifdef __cplusplus } #endif /* __cplusplus */