F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
lib_crc.h
Go to the documentation of this file.
1  /*******************************************************************\
2  * *
3  * Library : lib_crc *
4  * File : lib_crc.h *
5  * Author : Lammert Bies 1999-2008 *
6  * E-mail : info@lammertbies.nl *
7  * Language : ANSI C *
8  * *
9  * *
10  * Description *
11  * =========== *
12  * *
13  * The file lib_crc.h contains public definitions and proto- *
14  * types for the CRC functions present in lib_crc.c. *
15  * *
16  * *
17  * Dependencies *
18  * ============ *
19  * *
20  * none *
21  * *
22  * *
23  * Modification history *
24  * ==================== *
25  * *
26  * Date Version Comment *
27  * *
28  * 2008-04-20 1.16 Added CRC-CCITT routine for Kermit *
29  * *
30  * 2007-04-01 1.15 Added CRC16 calculation for Modbus *
31  * *
32  * 2007-03-28 1.14 Added CRC16 routine for Sick devices *
33  * *
34  * 2005-12-17 1.13 Added CRC-CCITT with initial 0x1D0F *
35  * *
36  * 2005-02-14 1.12 Added CRC-CCITT with initial 0x0000 *
37  * *
38  * 2005-02-05 1.11 Fixed bug in CRC-DNP routine *
39  * *
40  * 2005-02-04 1.10 Added CRC-DNP routines *
41  * *
42  * 2005-01-07 1.02 Changes in tst_crc.c *
43  * *
44  * 1999-02-21 1.01 Added FALSE and TRUE mnemonics *
45  * *
46  * 1999-01-22 1.00 Initial source *
47  * *
48  \*******************************************************************/
49 
50 #ifndef UTILS_HASH_LIB_CRC_HPP
51 #define UTILS_HASH_LIB_CRC_HPP
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 #define CRC_VERSION "1.16"
58 
59 
60 
61 #define CRC_FALSE 0
62 #define CRC_TRUE 1
63 
64 
65 
66 unsigned short update_crc_16( unsigned short crc, char c );
67 unsigned long update_crc_32( unsigned long crc, char c );
68 unsigned short update_crc_ccitt( unsigned short crc, char c );
69 unsigned short update_crc_dnp( unsigned short crc, char c );
70 unsigned short update_crc_kermit( unsigned short crc, char c );
71 unsigned short update_crc_sick( unsigned short crc, char c, char prev_byte );
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif // UTILS_HASH_LIB_CRC_HPP
unsigned short update_crc_ccitt(unsigned short crc, char c)
Definition: lib_crc.c:131
unsigned short update_crc_kermit(unsigned short crc, char c)
Definition: lib_crc.c:217
unsigned short update_crc_sick(unsigned short crc, char c, char prev_byte)
Definition: lib_crc.c:159
unsigned long update_crc_32(unsigned long crc, char c)
Definition: lib_crc.c:271
unsigned short update_crc_dnp(unsigned short crc, char c)
Definition: lib_crc.c:244
unsigned short update_crc_16(unsigned short crc, char c)
Definition: lib_crc.c:188