sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgCrc.h
Go to the documentation of this file.
1 
32 #ifndef SBG_CRC_H
33 #define SBG_CRC_H
34 
35 //----------------------------------------------------------------------//
36 //- Header (open extern C block) -//
37 //----------------------------------------------------------------------//
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <sbgCommon.h>
43 
44 //----------------------------------------------------------------------//
45 //- Types definitions -//
46 //----------------------------------------------------------------------//
47 
49 typedef uint32_t SbgCrc32;
50 
52 typedef uint16_t SbgCrc16;
53 
54 //----------------------------------------------------------------------//
55 //- 32 bits Ethernet CRC -//
56 //----------------------------------------------------------------------//
57 
63 
71 SBG_COMMON_LIB_API void sbgCrc32Update(SbgCrc32 *pInstance, const void *pData, size_t dataSize);
72 
78 SBG_INLINE uint32_t sbgCrc32Get(const SbgCrc32 *pInstance)
79 {
80  return *pInstance;
81 }
82 
90 SBG_COMMON_LIB_API uint32_t sbgCrc32Compute(const void *pData, size_t dataSize);
91 
92 //----------------------------------------------------------------------//
93 //- CRC-16 operations -//
94 //----------------------------------------------------------------------//
95 
100 SBG_COMMON_LIB_API void sbgCrc16Initialize(SbgCrc16 *pInstance);
101 
108 SBG_COMMON_LIB_API void sbgCrc16Update(SbgCrc16 *pInstance, const void *pData, size_t dataSize);
109 
115 SBG_INLINE uint16_t sbgCrc16Get(const SbgCrc16 *pInstance)
116 {
117  return *pInstance;
118 }
119 
126 SBG_COMMON_LIB_API uint16_t sbgCrc16Compute(const void *pData, size_t dataSize);
127 
128 //----------------------------------------------------------------------//
129 //- Footer (close extern C block) -//
130 //----------------------------------------------------------------------//
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* SBG_CRC_H */
Main header for the SBG Systems common C library.
SBG_INLINE uint32_t sbgCrc32Get(const SbgCrc32 *pInstance)
Definition: sbgCrc.h:78
SBG_COMMON_LIB_API uint16_t sbgCrc16Compute(const void *pData, size_t dataSize)
SBG_COMMON_LIB_API void sbgCrc32Initialize(SbgCrc32 *pInstance)
SBG_INLINE uint16_t sbgCrc16Get(const SbgCrc16 *pInstance)
Definition: sbgCrc.h:115
SBG_COMMON_LIB_API void sbgCrc16Initialize(SbgCrc16 *pInstance)
SBG_COMMON_LIB_API uint32_t sbgCrc32Compute(const void *pData, size_t dataSize)
SBG_COMMON_LIB_API void sbgCrc32Update(SbgCrc32 *pInstance, const void *pData, size_t dataSize)
SBG_COMMON_LIB_API void sbgCrc16Update(SbgCrc16 *pInstance, const void *pData, size_t dataSize)
uint32_t SbgCrc32
Definition: sbgCrc.h:49
#define SBG_INLINE
Definition: sbgDefines.h:227
#define SBG_COMMON_LIB_API
Definition: sbgDefines.h:79