CMS 3D CMS Logo

Public Member Functions | Private Attributes

ESCrcKchipFast Class Reference

#include <ESCrcKchipFast.h>

List of all members.

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 4 of file ESCrcKchipFast.h.


Constructor & Destructor Documentation

ESCrcKchipFast::ESCrcKchipFast ( ) [inline]

Definition at line 12 of file ESCrcKchipFast.h.

References init(), and reset().

                       {
         init();
         reset() ;
      };
ESCrcKchipFast::~ESCrcKchipFast ( ) [inline]

Definition at line 44 of file ESCrcKchipFast.h.

{ } ;

Member Function Documentation

void ESCrcKchipFast::add ( unsigned int  data) [inline]

Definition at line 25 of file ESCrcKchipFast.h.

References crc, and i.

                                  {
        for (int i=0;i<16;i++)
          {
            if ((crc&0x0001) == (data&0x0001))
              crc=crc>>1;
            else
              crc=(crc>>1)^0x8408; // flipped 0x1021;
            data=(data>>1);
          }
      };
uint32_t ESCrcKchipFast::get_crc ( ) [inline]

Definition at line 36 of file ESCrcKchipFast.h.

References crc.

Referenced by isCrcOk().

                         {
        return crc ;
      };
void ESCrcKchipFast::init ( void  ) [inline]

Definition at line 17 of file ESCrcKchipFast.h.

References crc.

Referenced by ESCrcKchipFast().

                  {
        crc = 0x0ffff ;
      }
bool ESCrcKchipFast::isCrcOk ( unsigned int  crcin = 0x0000) [inline]

Definition at line 40 of file ESCrcKchipFast.h.

References get_crc().

                                              {
          return ((get_crc()==crcin) ? true : false );
      };
void ESCrcKchipFast::reset ( void  ) [inline]

Definition at line 21 of file ESCrcKchipFast.h.

References crc.

Referenced by ESCrcKchipFast().

                   {
        crc = 0x0ffff ;
      } ;

Member Data Documentation

uint32_t ESCrcKchipFast::crc [private]

Definition at line 8 of file ESCrcKchipFast.h.

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