HWEeprom Class Reference

#include <hweeprom.h>

Inheritance diagram for HWEeprom:
Inheritance graph
[legend]
Collaboration diagram for HWEeprom:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { DEVMODE_NORMAL = 0, 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 (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 Attributes

IOReg< HWEepromeearh_reg
IOReg< HWEepromeearl_reg
IOReg< HWEepromeedr_reg
IOReg< HWEepromeecr_reg

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

Detailed Description

Definition at line 35 of file hweeprom.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
DEVMODE_NORMAL 
DEVMODE_EXTENDED 

Definition at line 56 of file hweeprom.h.

anonymous enum
Enumerator:
OPSTATE_READY 
OPSTATE_ENABLED 
OPSTATE_WRITE 

Definition at line 61 of file hweeprom.h.

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 67 of file hweeprom.h.


Constructor & Destructor Documentation

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

Definition at line 101 of file hweeprom.cpp.

References avr_free(), and Memory::myMemory.

Here is the call graph for this function:


Member Function Documentation

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 267 of file hweeprom.cpp.

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

Here is the call graph for this function:

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 211 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.

Here is the call graph for this function:

unsigned char HWEeprom::GetEearh (  )  [inline]

Definition at line 95 of file hweeprom.h.

References eear.

unsigned char HWEeprom::GetEearl (  )  [inline]

Definition at line 94 of file hweeprom.h.

References eear.

unsigned char HWEeprom::GetEecr (  )  [inline]

Definition at line 96 of file hweeprom.h.

References eecr.

unsigned char HWEeprom::GetEedr (  )  [inline]

Definition at line 97 of file hweeprom.h.

References eedr.

unsigned char HWEeprom::ReadFromAddress ( unsigned int  addr  ) 

Definition at line 276 of file hweeprom.cpp.

References Memory::myMemory.

Referenced by GdbServer::gdb_read_memory().

Here is the caller graph for this function:

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 91 of file hweeprom.cpp.

References cpuHoldCycles, eecr, eedr, and opEnableCycles.

Referenced by HWEeprom().

Here is the caller graph for this function:

void HWEeprom::SetEearh ( unsigned char  val  ) 

Definition at line 112 of file hweeprom.cpp.

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

void HWEeprom::SetEearl ( unsigned char  val  ) 

Definition at line 106 of file hweeprom.cpp.

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

void HWEeprom::SetEecr ( unsigned char  newval  ) 
void HWEeprom::SetEedr ( unsigned char  val  ) 

Definition at line 118 of file hweeprom.cpp.

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

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

Definition at line 272 of file hweeprom.cpp.

References Memory::myMemory.

Referenced by GdbServer::gdb_write_memory().

Here is the caller graph for this function:

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

Write memory data to memory

Implements Memory.

Definition at line 280 of file hweeprom.cpp.

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

Referenced by AvrDevice::Load().

Here is the caller graph for this function:


Member Data Documentation

AvrDevice* HWEeprom::core [protected]

Definition at line 37 of file hweeprom.h.

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

int HWEeprom::cpuHoldCycles [protected]

Definition at line 46 of file hweeprom.h.

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

unsigned int HWEeprom::eear [protected]

Definition at line 38 of file hweeprom.h.

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

unsigned int HWEeprom::eear_mask [protected]

Definition at line 39 of file hweeprom.h.

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

unsigned char HWEeprom::eecr [protected]

Definition at line 40 of file hweeprom.h.

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

unsigned char HWEeprom::eecr_mask [protected]

Definition at line 41 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

unsigned char HWEeprom::eedr [protected]

Definition at line 42 of file hweeprom.h.

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

Definition at line 51 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

Definition at line 50 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

Definition at line 43 of file hweeprom.h.

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

unsigned int HWEeprom::irqVectorNo [protected]

Definition at line 44 of file hweeprom.h.

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

unsigned int HWEeprom::opAddr [protected]

Definition at line 49 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().

int HWEeprom::opEnableCycles [protected]

Definition at line 45 of file hweeprom.h.

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

int HWEeprom::opMode [protected]

Definition at line 48 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().

int HWEeprom::opState [protected]

Definition at line 47 of file hweeprom.h.

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

Definition at line 52 of file hweeprom.h.

Referenced by HWEeprom(), and SetEecr().

Definition at line 53 of file hweeprom.h.

Referenced by CpuCycle(), and SetEecr().


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 16:51:35 2012 for Simulavr by  doxygen 1.6.3