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