SASC-NG
DVBSoftCAM

cMapEeprom Class Reference

#include <cpu.h>

Inheritance diagram for cMapEeprom:

List of all members.

Public Member Functions

 cMapEeprom (unsigned short Offset, const char *Filename, int OtpSize, int InFileOffset=0)
virtual ~cMapEeprom ()
virtual unsigned char Get (unsigned short ea)
virtual void Set (unsigned short ea, unsigned char val)
virtual bool IsFine (void)

Detailed Description

Definition at line 75 of file cpu.h.


Constructor & Destructor Documentation

cMapEeprom::cMapEeprom ( unsigned short  Offset,
const char *  Filename,
int  OtpSize,
int  InFileOffset = 0 
)

Definition at line 98 of file cpu.c.

References cFileMap::Addr(), FILEMAP_DOMAIN, filemaps, cFileMaps::GetFileMap(), L_SYS_EMU, cFileMap::Map(), PRINTF, and cFileMap::Size().

{
  offset=Offset; otpSize=OtpSize; addr=0;
  fm=filemaps.GetFileMap(Filename,FILEMAP_DOMAIN,true);
  if(fm && fm->Map()) {
    addr=fm->Addr()+InFileOffset;
    size=fm->Size()-InFileOffset;
    PRINTF(L_SYS_EMU,"mapeeprom: new map off=%04x size=%04x otp=%04x",offset,size,otpSize);
    }
}
cMapEeprom::~cMapEeprom ( ) [virtual]

Definition at line 109 of file cpu.c.

References cFileMap::Unmap().

{
  if(fm) fm->Unmap();
}

Member Function Documentation

unsigned char cMapEeprom::Get ( unsigned short  ea) [virtual]

Implements cMap.

Definition at line 119 of file cpu.c.

{
  return (ea>=offset && ea<offset+size) ? addr[ea-offset] : 0;
}
bool cMapEeprom::IsFine ( void  ) [virtual]

Implements cMap.

Definition at line 114 of file cpu.c.

{
  return (addr!=0);
}
void cMapEeprom::Set ( unsigned short  ea,
unsigned char  val 
) [virtual]

Implements cMap.

Definition at line 124 of file cpu.c.

References LOGLBPUT.

{
  if(ea>=offset && ea<offset+otpSize) {
    if(addr[ea-offset]==0) {
      addr[ea-offset]=val;
      LOGLBPUT("[OTP-SET] ");
      }
    LOGLBPUT("[OTP] ");
    }
  if(ea>=offset+otpSize && ea<offset+size) {
    addr[ea-offset]=val;
    LOGLBPUT("[EEP] ");
    }
}

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