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::ESCrcKchipFast ( )
inline

Definition at line 14 of file ESCrcKchipFast.h.

14  {
15  init();
16  reset() ;
17  };

References init(), and reset().

◆ ~ESCrcKchipFast()

ESCrcKchipFast::~ESCrcKchipFast ( )
inline

Definition at line 46 of file ESCrcKchipFast.h.

46 { } ;

Member Function Documentation

◆ add()

void ESCrcKchipFast::add ( unsigned int  data)
inline

Definition at line 27 of file ESCrcKchipFast.h.

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  };

References crc, data, and mps_fire::i.

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

◆ get_crc()

uint32_t ESCrcKchipFast::get_crc ( )
inline

Definition at line 38 of file ESCrcKchipFast.h.

38  {
39  return crc ;
40  };

References crc.

Referenced by isCrcOk().

◆ init()

void ESCrcKchipFast::init ( void  )
inline

Definition at line 19 of file ESCrcKchipFast.h.

19  {
20  crc = 0x0ffff ;
21  }

References crc.

Referenced by ESCrcKchipFast().

◆ isCrcOk()

bool ESCrcKchipFast::isCrcOk ( unsigned int  crcin = 0x0000)
inline

Definition at line 42 of file ESCrcKchipFast.h.

42  {
43  return ((get_crc()==crcin) ? true : false );
44  };

References get_crc().

◆ reset()

void ESCrcKchipFast::reset ( void  )
inline

Definition at line 23 of file ESCrcKchipFast.h.

23  {
24  crc = 0x0ffff ;
25  } ;

References crc.

Referenced by ESCrcKchipFast().

Member Data Documentation

◆ crc

uint32_t ESCrcKchipFast::crc
private

Definition at line 10 of file ESCrcKchipFast.h.

Referenced by add(), get_crc(), init(), and reset().

mps_fire.i
i
Definition: mps_fire.py:355
ESCrcKchipFast::init
void init()
Definition: ESCrcKchipFast.h:19
ESCrcKchipFast::get_crc
uint32_t get_crc()
Definition: ESCrcKchipFast.h:38
ESCrcKchipFast::crc
uint32_t crc
Definition: ESCrcKchipFast.h:10
ESCrcKchipFast::reset
void reset()
Definition: ESCrcKchipFast.h:23
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79