CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ESCrcKchipFast Class Reference

#include <ESCrcKchipFast.h>

Public Member Functions

void add (unsigned int data)
 
 ESCrcKchipFast ()
 
uint32_t get_crc ()
 
void init ()
 
bool isCrcOk (unsigned int crcin=0x0000)
 
void reset ()
 
 ~ESCrcKchipFast ()
 

Private Attributes

uint32_t crc
 

Detailed Description

Definition at line 6 of file ESCrcKchipFast.h.

Constructor & Destructor Documentation

ESCrcKchipFast::ESCrcKchipFast ( )
inline

Definition at line 14 of file ESCrcKchipFast.h.

References init(), and reset().

14  {
15  init();
16  reset() ;
17  };
ESCrcKchipFast::~ESCrcKchipFast ( )
inline

Definition at line 46 of file ESCrcKchipFast.h.

46 { } ;

Member Function Documentation

void ESCrcKchipFast::add ( unsigned int  data)
inline

Definition at line 27 of file ESCrcKchipFast.h.

References mps_fire::i.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

27  {
28  for (int i=0;i<16;i++)
29  {
30  if ((crc&0x0001) == (data&0x0001))
31  crc=crc>>1;
32  else
33  crc=(crc>>1)^0x8408; // flipped 0x1021;
34  data=(data>>1);
35  }
36  };
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
uint32_t ESCrcKchipFast::get_crc ( )
inline

Definition at line 38 of file ESCrcKchipFast.h.

References crc.

Referenced by isCrcOk().

38  {
39  return crc ;
40  };
void ESCrcKchipFast::init ( void  )
inline

Definition at line 19 of file ESCrcKchipFast.h.

Referenced by ESCrcKchipFast().

19  {
20  crc = 0x0ffff ;
21  }
bool ESCrcKchipFast::isCrcOk ( unsigned int  crcin = 0x0000)
inline

Definition at line 42 of file ESCrcKchipFast.h.

References get_crc().

42  {
43  return ((get_crc()==crcin) ? true : false );
44  };
uint32_t get_crc()
void ESCrcKchipFast::reset ( void  )
inline

Definition at line 23 of file ESCrcKchipFast.h.

Referenced by ESCrcKchipFast().

23  {
24  crc = 0x0ffff ;
25  } ;

Member Data Documentation

uint32_t ESCrcKchipFast::crc
private

Definition at line 10 of file ESCrcKchipFast.h.

Referenced by get_crc().