Demo HCI Implementation for WiMOD-LR Devices  V1.3.1
CRC16.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
32 //------------------------------------------------------------------------------
33 
34 #ifndef __CRC16_H__
35 #define __CRC16_H__
36 
37 //------------------------------------------------------------------------------
38 //
39 // Section Include Files
40 //
41 //------------------------------------------------------------------------------
42 
43 #include <inttypes.h>
45 typedef uint8_t UINT8;
46 typedef uint16_t UINT16;
48 //------------------------------------------------------------------------------
49 //
50 // Section Defines
51 //
52 //------------------------------------------------------------------------------
53 
54 #define CRC16_INIT_VALUE 0xFFFF
55 #define CRC16_GOOD_VALUE 0x0F47
56 #define CRC16_POLYNOM 0x8408
57 
58 //------------------------------------------------------------------------------
59 // C++ Extensions
60 //------------------------------------------------------------------------------
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 //------------------------------------------------------------------------------
65 //
66 // Section Prototypes
67 //
68 //------------------------------------------------------------------------------
69 
70 //------------------------------------------------------------------------------
72 UINT16
73 CRC16_Calc (UINT8* data,
74  UINT16 length,
75  UINT16 initVal);
76 //------------------------------------------------------------------------------
78 bool
79 CRC16_Check (UINT8* data,
80  UINT16 length,
81  UINT16 initVal);
82 
83 //------------------------------------------------------------------------------
84 // C++ Extensions
85 //------------------------------------------------------------------------------
86 #ifdef __cplusplus
87 }
88 #endif
89 //------------------------------------------------------------------------------
90 
91 #endif // __CRC16_H__
92 //------------------------------------------------------------------------------
93 // end of file
94 //------------------------------------------------------------------------------
UINT16 CRC16_Calc(UINT8 *data, UINT16 length, UINT16 initVal)
Calc CRC16.
Definition: CRC16.cpp:134
bool CRC16_Check(UINT8 *data, UINT16 length, UINT16 initVal)
Calc & Check CRC16.
Definition: CRC16.cpp:222