simulavr  1.1.0
HWEeprom Class Reference

#include <hweeprom.h>

Inheritance diagram for HWEeprom:

Public Types

enum  { DEVMODE_NORMAL = 0, DEVMODE_AT90S, DEVMODE_EXTENDED }
 
enum  { OPSTATE_READY, OPSTATE_ENABLED, OPSTATE_WRITE }
 
enum  {
  CTRL_MODE_ERASEWRITE = 0, CTRL_READ = 1, CTRL_WRITE = 2, CTRL_ENABLE = 4,
  CTRL_IRQ = 8, CTRL_MODE_ERASE = 16, CTRL_MODE_WRITE = 32, CTRL_MODES = 48
}
 

Public Member Functions

 HWEeprom (AvrDevice *core, HWIrqSystem *irqs, unsigned int size, unsigned int irqVec, int devMode=DEVMODE_NORMAL)
 
virtual ~HWEeprom ()
 
virtual unsigned int CpuCycle ()
 
void Reset ()
 
void ClearIrqFlag (unsigned int vector)
 
void WriteMem (const unsigned char *, unsigned int offset, unsigned int size)
 
void WriteAtAddress (unsigned int, unsigned char)
 
unsigned char ReadFromAddress (unsigned int)
 
void SetEearl (unsigned char)
 
void SetEearh (unsigned char)
 
void SetEedr (unsigned char)
 
void SetEecr (unsigned char)
 
unsigned char GetEearl ()
 
unsigned char GetEearh ()
 
unsigned char GetEecr ()
 
unsigned char GetEedr ()
 
- Public Member Functions inherited from Hardware
 Hardware (AvrDevice *core)
 
virtual ~Hardware ()
 
virtual bool IsLevelInterrupt (unsigned int vector)
 
virtual bool LevelInterruptPending (unsigned int vector)
 
- Public Member Functions inherited from Memory
 Memory (int size)
 
virtual ~Memory ()
 
std::string GetSymbolAtAddress (unsigned int add)
 
unsigned int GetAddressAtSymbol (const std::string &s)
 
void AddSymbol (std::pair< unsigned int, std::string > p)
 
unsigned int GetSize ()
 
- Public Member Functions inherited from TraceValueRegister
 TraceValueRegister (TraceValueRegister *parent, const std::string &name)
 Create a TraceValueRegister, with a scope prefix built on parent scope + name. More...
 
 TraceValueRegister ()
 Create a TraceValueRegister, with a empty scope name, single device application. More...
 
virtual ~TraceValueRegister ()
 
const std::string GetTraceValuePrefix (void)
 Returns the scope prefix. More...
 
const std::string GetScopeName (void)
 Returns the scope name. More...
 
void RegisterTraceValue (TraceValue *t)
 Registers a TraceValue for this register. More...
 
void UnregisterTraceValue (TraceValue *t)
 Unregisters a TraceValue, remove it from register. More...
 
TraceValueRegisterGetScopeGroupByName (const std::string &name)
 Get a here registered TraceValueRegister by it's name. More...
 
virtual TraceValueGetTraceValueByName (const std::string &name)
 Get a here registered TraceValue by it's name. More...
 
TraceValueRegisterFindScopeGroupByName (const std::string &name)
 Seek for a TraceValueRegister by it's name. More...
 
TraceValueFindTraceValueByName (const std::string &name)
 Seek for a TraceValue by it's name. More...
 
TraceSetGetAllTraceValues (void)
 Get all here registered TraceValue's only (not with descending values) More...
 
TraceSetGetAllTraceValuesRecursive (void)
 Get all here registered TraceValue's with descending values. More...
 

Public Attributes

IOReg< HWEepromeearh_reg
 
IOReg< HWEepromeearl_reg
 
IOReg< HWEepromeedr_reg
 
IOReg< HWEepromeecr_reg
 
- Public Attributes inherited from Memory
unsigned char * myMemory
 
std::multimap< unsigned int, std::string > sym
 

Protected Attributes

AvrDevicecore
 
unsigned int eear
 
unsigned int eear_mask
 
unsigned char eecr
 
unsigned char eecr_mask
 
unsigned char eedr
 
HWIrqSystemirqSystem
 
unsigned int irqVectorNo
 
int opEnableCycles
 
int cpuHoldCycles
 
int opState
 
int opMode
 
unsigned int opAddr
 
SystemClockOffset eraseWriteDelayTime
 
SystemClockOffset eraseDelayTime
 
SystemClockOffset writeDelayTime
 
SystemClockOffset writeDoneTime
 
- Protected Attributes inherited from Memory
unsigned int size
 

Additional Inherited Members

- Protected Member Functions inherited from TraceValueRegister
virtual size_t _tvr_getValuesCount (void)
 Get the count of all TraceValues, that are registered here and descending. More...
 
virtual void _tvr_insertTraceValuesToSet (TraceSet &t)
 Insert all TraceValues into TraceSet, that registered here and descending. More...
 

Detailed Description

Definition at line 35 of file hweeprom.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
CTRL_MODE_ERASEWRITE 
CTRL_READ 
CTRL_WRITE 
CTRL_ENABLE 
CTRL_IRQ 
CTRL_MODE_ERASE 
CTRL_MODE_WRITE 
CTRL_MODES 

Definition at line 68 of file hweeprom.h.

◆ anonymous enum

anonymous enum
Enumerator
DEVMODE_NORMAL 
DEVMODE_AT90S 
DEVMODE_EXTENDED 

Definition at line 56 of file hweeprom.h.

◆ anonymous enum

anonymous enum
Enumerator
OPSTATE_READY 
OPSTATE_ENABLED 
OPSTATE_WRITE 

Definition at line 62 of file hweeprom.h.

Constructor & Destructor Documentation

◆ HWEeprom()

HWEeprom::HWEeprom ( AvrDevice core,
HWIrqSystem irqs,
unsigned int  size,
unsigned int  irqVec,
int  devMode = DEVMODE_NORMAL 
)

◆ ~HWEeprom()

HWEeprom::~HWEeprom ( )
virtual

Definition at line 107 of file hweeprom.cpp.

References avr_free(), and Memory::myMemory.

Member Function Documentation

◆ ClearIrqFlag()

void HWEeprom::ClearIrqFlag ( unsigned int  vector)
virtual

This signals the hardware that the given IRQ vector has been handled by the AVR core.

Reimplemented from Hardware.

Definition at line 275 of file hweeprom.cpp.

References HWIrqSystem::ClearIrqFlag(), irqSystem, and irqVectorNo.

◆ CpuCycle()

unsigned int HWEeprom::CpuCycle ( void  )
virtual

Called for each AVR cycle when this hardware has registered itself as a receiver for AVR clocks. Returns nonzero if instructions should not be executed (e.g. a Flash write is in progress).

Reimplemented from Hardware.

Definition at line 219 of file hweeprom.cpp.

References core, cpuHoldCycles, CTRL_ENABLE, CTRL_IRQ, CTRL_MODE_ERASE, CTRL_MODE_ERASEWRITE, CTRL_MODE_WRITE, CTRL_MODES, CTRL_WRITE, eecr, eedr, SystemClock::Instance(), irqSystem, irqVectorNo, Memory::myMemory, opAddr, opEnableCycles, opMode, opState, OPSTATE_ENABLED, OPSTATE_READY, OPSTATE_WRITE, AvrDevice::RemoveFromCycleList(), HWIrqSystem::SetIrqFlag(), Memory::size, AvrDevice::trace_on, traceOut, and writeDoneTime.

◆ GetEearh()

unsigned char HWEeprom::GetEearh ( )
inline

Definition at line 96 of file hweeprom.h.

◆ GetEearl()

unsigned char HWEeprom::GetEearl ( )
inline

Definition at line 95 of file hweeprom.h.

◆ GetEecr()

unsigned char HWEeprom::GetEecr ( )
inline

Definition at line 97 of file hweeprom.h.

References eecr.

◆ GetEedr()

unsigned char HWEeprom::GetEedr ( )
inline

Definition at line 98 of file hweeprom.h.

References eedr.

◆ ReadFromAddress()

unsigned char HWEeprom::ReadFromAddress ( unsigned int  addr)

Definition at line 284 of file hweeprom.cpp.

References Memory::myMemory.

◆ Reset()

void HWEeprom::Reset ( void  )
virtual

Implement the hardware's reset functionality here. The default is no action on reset.

Reimplemented from Hardware.

Definition at line 97 of file hweeprom.cpp.

References cpuHoldCycles, eecr, eedr, and opEnableCycles.

Referenced by HWEeprom().

◆ SetEearh()

void HWEeprom::SetEearh ( unsigned char  val)

Definition at line 118 of file hweeprom.cpp.

References avr_warning, core, eear, eear_mask, Memory::GetSize(), AvrDevice::trace_on, and traceOut.

◆ SetEearl()

void HWEeprom::SetEearl ( unsigned char  val)

Definition at line 112 of file hweeprom.cpp.

References core, eear, eear_mask, AvrDevice::trace_on, and traceOut.

◆ SetEecr()

◆ SetEedr()

void HWEeprom::SetEedr ( unsigned char  val)

Definition at line 126 of file hweeprom.cpp.

References core, eedr, AvrDevice::trace_on, and traceOut.

◆ WriteAtAddress()

void HWEeprom::WriteAtAddress ( unsigned int  addr,
unsigned char  val 
)

Definition at line 280 of file hweeprom.cpp.

References Memory::myMemory.

◆ WriteMem()

void HWEeprom::WriteMem ( const unsigned char *  ,
unsigned int  offset,
unsigned int  size 
)
virtual

Write memory data to memory

Implements Memory.

Definition at line 288 of file hweeprom.cpp.

References Memory::myMemory, and Memory::size.

Referenced by ELFLoad().

Member Data Documentation

◆ core

AvrDevice* HWEeprom::core
protected

Definition at line 37 of file hweeprom.h.

Referenced by CpuCycle(), SetEearh(), SetEearl(), SetEecr(), and SetEedr().

◆ cpuHoldCycles

int HWEeprom::cpuHoldCycles
protected

Definition at line 46 of file hweeprom.h.

Referenced by CpuCycle(), Reset(), and SetEecr().

◆ eear

unsigned int HWEeprom::eear
protected

Definition at line 38 of file hweeprom.h.

Referenced by HWEeprom(), SetEearh(), SetEearl(), and SetEecr().

◆ eear_mask

unsigned int HWEeprom::eear_mask
protected

Definition at line 39 of file hweeprom.h.

Referenced by HWEeprom(), SetEearh(), and SetEearl().

◆ eearh_reg

◆ eearl_reg

◆ eecr

unsigned char HWEeprom::eecr
protected

Definition at line 40 of file hweeprom.h.

Referenced by CpuCycle(), GetEecr(), HWEeprom(), Reset(), and SetEecr().

◆ eecr_mask

unsigned char HWEeprom::eecr_mask
protected

Definition at line 41 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

◆ eecr_reg

◆ eedr

unsigned char HWEeprom::eedr
protected

Definition at line 42 of file hweeprom.h.

Referenced by CpuCycle(), GetEedr(), Reset(), SetEecr(), and SetEedr().

◆ eedr_reg

◆ eraseDelayTime

SystemClockOffset HWEeprom::eraseDelayTime
protected

Definition at line 51 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

◆ eraseWriteDelayTime

SystemClockOffset HWEeprom::eraseWriteDelayTime
protected

Definition at line 50 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

◆ irqSystem

HWIrqSystem* HWEeprom::irqSystem
protected

Definition at line 43 of file hweeprom.h.

Referenced by ClearIrqFlag(), CpuCycle(), and HWEeprom().

◆ irqVectorNo

unsigned int HWEeprom::irqVectorNo
protected

Definition at line 44 of file hweeprom.h.

Referenced by ClearIrqFlag(), CpuCycle(), and HWEeprom().

◆ opAddr

unsigned int HWEeprom::opAddr
protected

Definition at line 49 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().

◆ opEnableCycles

int HWEeprom::opEnableCycles
protected

Definition at line 45 of file hweeprom.h.

Referenced by CpuCycle(), Reset(), and SetEecr().

◆ opMode

int HWEeprom::opMode
protected

Definition at line 48 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().

◆ opState

int HWEeprom::opState
protected

Definition at line 47 of file hweeprom.h.

Referenced by CpuCycle(), HWEeprom(), and SetEecr().

◆ writeDelayTime

SystemClockOffset HWEeprom::writeDelayTime
protected

Definition at line 52 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

◆ writeDoneTime

SystemClockOffset HWEeprom::writeDoneTime
protected

Definition at line 53 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().


The documentation for this class was generated from the following files: