sbgCrc.h
Go to the documentation of this file.
1 
21 #ifndef __SBG_CRC_H__
22 #define __SBG_CRC_H__
23 
24 //----------------------------------------------------------------------//
25 //- Header (open extern C block) -//
26 //----------------------------------------------------------------------//
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <sbgCommon.h>
32 
33 //----------------------------------------------------------------------//
34 //- Types definitions -//
35 //----------------------------------------------------------------------//
36 
38 typedef uint32 SbgCrc32;
39 
41 typedef uint16 SbgCrc16;
42 
43 //----------------------------------------------------------------------//
44 //- 32 bits Ethernet CRC -//
45 //----------------------------------------------------------------------//
46 
51 void sbgCrc32Initialize(SbgCrc32 *pInstance);
52 
60 void sbgCrc32Update(SbgCrc32 *pInstance, const void *pData, size_t dataSize);
61 
67 SBG_INLINE uint32 sbgCrc32Get(const SbgCrc32 *pInstance)
68 {
69  return *pInstance;
70 }
71 
79 uint32 sbgCrc32Compute(const void *pData, size_t dataSize);
80 
81 //----------------------------------------------------------------------//
82 //- CRC-16 operations -//
83 //----------------------------------------------------------------------//
84 
89 void sbgCrc16Initialize(SbgCrc16 *pInstance);
90 
97 void sbgCrc16Update(SbgCrc16 *pInstance, const void *pData, size_t dataSize);
98 
104 SBG_INLINE uint16 sbgCrc16Get(const SbgCrc16 *pInstance)
105 {
106  return *pInstance;
107 }
108 
115 uint16 sbgCrc16Compute(const void *pData, size_t dataSize);
116 
117 //----------------------------------------------------------------------//
118 //- Footer (close extern C block) -//
119 //----------------------------------------------------------------------//
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
unsigned int uint32
Definition: sbgTypes.h:58
uint16 SbgCrc16
Definition: sbgCrc.h:41
SBG_INLINE uint32 sbgCrc32Get(const SbgCrc32 *pInstance)
Definition: sbgCrc.h:67
void sbgCrc16Initialize(SbgCrc16 *pInstance)
Definition: sbgCrc.c:196
void sbgCrc16Update(SbgCrc16 *pInstance, const void *pData, size_t dataSize)
Definition: sbgCrc.c:212
void sbgCrc32Update(SbgCrc32 *pInstance, const void *pData, size_t dataSize)
Definition: sbgCrc.c:108
SBG_INLINE uint16 sbgCrc16Get(const SbgCrc16 *pInstance)
Definition: sbgCrc.h:104
void sbgCrc32Initialize(SbgCrc32 *pInstance)
Definition: sbgCrc.c:91
#define SBG_INLINE
Definition: sbgDefines.h:94
Main header file for SBG Systems common C library.
uint32 SbgCrc32
Definition: sbgCrc.h:38
uint16 sbgCrc16Compute(const void *pData, size_t dataSize)
Definition: sbgCrc.c:243
uint32 sbgCrc32Compute(const void *pData, size_t dataSize)
Definition: sbgCrc.c:168
unsigned short uint16
Definition: sbgTypes.h:57


sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20