SASC-NG
DVBSoftCAM

cN2CRC Class Reference

#include <nagra2.h>

List of all members.

Public Member Functions

 cN2CRC (void)
void AddCycles (unsigned int num)
unsigned char Ctrl (void)
void Ctrl (unsigned char c)
unsigned char Data (void)
void Data (unsigned char d)

Detailed Description

Definition at line 217 of file nagra2.h.


Constructor & Destructor Documentation

cN2CRC::cN2CRC ( void  )

Definition at line 175 of file nagra2.c.

{
  cycles=0; CRCpos=0; CRCtime=0; CRCin=0;
  CRCvalue=0xffff; CRCit=CRCCALC_DELAY+1; ctrl=CRC_DISABLED;
  GenTable();
}

Member Function Documentation

void cN2CRC::AddCycles ( unsigned int  num)

Definition at line 182 of file nagra2.c.

Referenced by cMapMemHW::AddCycles().

{
  cycles+=num;
}
unsigned char cN2CRC::Ctrl ( void  )

Definition at line 212 of file nagra2.c.

Referenced by cMapMemHW::Get(), and cMapMemHW::Set().

{
  Update();
  unsigned char r=ctrl;
  if(CRCit<CRCCALC_DELAY) r|=CRC_BUSY; else r&=~CRC_BUSY;
  return r|0x80;
}
void cN2CRC::Ctrl ( unsigned char  c)

Definition at line 220 of file nagra2.c.

{
  if(ctrl&CRC_DISABLED) {
    if(!(c&CRC_DISABLED)) {
      CRCvalue=0xffff; CRCpos=0; CRCtime=cycles;
      if(CRCit<=CRCCALC_DELAY) { CRCtime++; CRCit++; }
      }
    }
  else if(c&CRC_DISABLED) Update();
  ctrl=c;
}
unsigned char cN2CRC::Data ( void  )

Definition at line 232 of file nagra2.c.

Referenced by cMapMemHW::Get(), and cMapMemHW::Set().

{
  Update();
  return (CRCvalue^0xffff)>>((CRCpos++&1)<<3);
}
void cN2CRC::Data ( unsigned char  d)

Definition at line 238 of file nagra2.c.

{
  Update();
  if(CRCit>CRCCALC_DELAY && !(ctrl&CRC_DISABLED)) {
    CRCin=d;
    CRCit=0; CRCtime=cycles;
    }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines