simulavr
1.1.0
|
#include <hweeprom.h>
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 () |
![]() | |
Hardware (AvrDevice *core) | |
virtual | ~Hardware () |
virtual bool | IsLevelInterrupt (unsigned int vector) |
virtual bool | LevelInterruptPending (unsigned int vector) |
![]() | |
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 () |
![]() | |
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... | |
TraceValueRegister * | GetScopeGroupByName (const std::string &name) |
Get a here registered TraceValueRegister by it's name. More... | |
virtual TraceValue * | GetTraceValueByName (const std::string &name) |
Get a here registered TraceValue by it's name. More... | |
TraceValueRegister * | FindScopeGroupByName (const std::string &name) |
Seek for a TraceValueRegister by it's name. More... | |
TraceValue * | FindTraceValueByName (const std::string &name) |
Seek for a TraceValue by it's name. More... | |
TraceSet * | GetAllTraceValues (void) |
Get all here registered TraceValue's only (not with descending values) More... | |
TraceSet * | GetAllTraceValuesRecursive (void) |
Get all here registered TraceValue's with descending values. More... | |
Public Attributes | |
IOReg< HWEeprom > | eearh_reg |
IOReg< HWEeprom > | eearl_reg |
IOReg< HWEeprom > | eedr_reg |
IOReg< HWEeprom > | eecr_reg |
![]() | |
unsigned char * | myMemory |
std::multimap< unsigned int, std::string > | sym |
Protected Attributes | |
AvrDevice * | core |
unsigned int | eear |
unsigned int | eear_mask |
unsigned char | eecr |
unsigned char | eecr_mask |
unsigned char | eedr |
HWIrqSystem * | irqSystem |
unsigned int | irqVectorNo |
int | opEnableCycles |
int | cpuHoldCycles |
int | opState |
int | opMode |
unsigned int | opAddr |
SystemClockOffset | eraseWriteDelayTime |
SystemClockOffset | eraseDelayTime |
SystemClockOffset | writeDelayTime |
SystemClockOffset | writeDoneTime |
![]() | |
unsigned int | size |
Additional Inherited Members | |
![]() | |
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... | |
Definition at line 35 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 68 of file hweeprom.h.
anonymous enum |
Enumerator | |
---|---|
DEVMODE_NORMAL | |
DEVMODE_AT90S | |
DEVMODE_EXTENDED |
Definition at line 56 of file hweeprom.h.
anonymous enum |
Enumerator | |
---|---|
OPSTATE_READY | |
OPSTATE_ENABLED | |
OPSTATE_WRITE |
Definition at line 62 of file hweeprom.h.
HWEeprom::HWEeprom | ( | AvrDevice * | core, |
HWIrqSystem * | irqs, | ||
unsigned int | size, | ||
unsigned int | irqVec, | ||
int | devMode = DEVMODE_NORMAL |
||
) |
Definition at line 35 of file hweeprom.cpp.
References HWIrqSystem::DebugVerifyInterruptVector(), DEVMODE_AT90S, DEVMODE_NORMAL, eear, eear_mask, eecr, eecr_mask, eraseDelayTime, eraseWriteDelayTime, irqSystem, irqVectorNo, Memory::myMemory, opState, OPSTATE_READY, Reset(), Memory::size, and writeDelayTime.
|
virtual |
Definition at line 107 of file hweeprom.cpp.
References avr_free(), and Memory::myMemory.
|
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.
|
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.
|
inline |
Definition at line 96 of file hweeprom.h.
|
inline |
Definition at line 95 of file hweeprom.h.
|
inline |
Definition at line 97 of file hweeprom.h.
References eecr.
|
inline |
Definition at line 98 of file hweeprom.h.
References eedr.
unsigned char HWEeprom::ReadFromAddress | ( | unsigned int | addr | ) |
Definition at line 284 of file hweeprom.cpp.
References Memory::myMemory.
|
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().
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.
void HWEeprom::SetEearl | ( | unsigned char | val | ) |
Definition at line 112 of file hweeprom.cpp.
References core, eear, eear_mask, AvrDevice::trace_on, and traceOut.
void HWEeprom::SetEecr | ( | unsigned char | newval | ) |
Definition at line 132 of file hweeprom.cpp.
References AvrDevice::AddToCycleList(), core, cpuHoldCycles, CTRL_ENABLE, CTRL_MODE_ERASE, CTRL_MODE_ERASEWRITE, CTRL_MODE_WRITE, CTRL_MODES, CTRL_READ, CTRL_WRITE, eear, eecr, eecr_mask, eedr, eraseDelayTime, eraseWriteDelayTime, SystemClock::GetCurrentTime(), SystemClock::Instance(), Memory::myMemory, opAddr, opEnableCycles, opMode, opState, OPSTATE_ENABLED, OPSTATE_READY, OPSTATE_WRITE, Memory::size, AvrDevice::trace_on, traceOut, writeDelayTime, and writeDoneTime.
void HWEeprom::SetEedr | ( | unsigned char | val | ) |
Definition at line 126 of file hweeprom.cpp.
References core, eedr, AvrDevice::trace_on, and traceOut.
void HWEeprom::WriteAtAddress | ( | unsigned int | addr, |
unsigned char | val | ||
) |
Definition at line 280 of file hweeprom.cpp.
References Memory::myMemory.
|
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().
|
protected |
Definition at line 37 of file hweeprom.h.
Referenced by CpuCycle(), SetEearh(), SetEearl(), SetEecr(), and SetEedr().
|
protected |
Definition at line 46 of file hweeprom.h.
Referenced by CpuCycle(), Reset(), and SetEecr().
|
protected |
Definition at line 38 of file hweeprom.h.
Referenced by HWEeprom(), SetEearh(), SetEearl(), and SetEecr().
|
protected |
Definition at line 39 of file hweeprom.h.
Referenced by HWEeprom(), SetEearh(), and SetEearl().
Definition at line 101 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and AvrDevice_attinyX5::AvrDevice_attinyX5().
Definition at line 101 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and AvrDevice_attinyX5::AvrDevice_attinyX5().
|
protected |
Definition at line 40 of file hweeprom.h.
Referenced by CpuCycle(), GetEecr(), HWEeprom(), Reset(), and SetEecr().
|
protected |
Definition at line 41 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
Definition at line 101 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and AvrDevice_attinyX5::AvrDevice_attinyX5().
|
protected |
Definition at line 42 of file hweeprom.h.
Referenced by CpuCycle(), GetEedr(), Reset(), SetEecr(), and SetEedr().
Definition at line 101 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and AvrDevice_attinyX5::AvrDevice_attinyX5().
|
protected |
Definition at line 51 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
|
protected |
Definition at line 50 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
|
protected |
Definition at line 43 of file hweeprom.h.
Referenced by ClearIrqFlag(), CpuCycle(), and HWEeprom().
|
protected |
Definition at line 44 of file hweeprom.h.
Referenced by ClearIrqFlag(), CpuCycle(), and HWEeprom().
|
protected |
Definition at line 49 of file hweeprom.h.
Referenced by CpuCycle(), and SetEecr().
|
protected |
Definition at line 45 of file hweeprom.h.
Referenced by CpuCycle(), Reset(), and SetEecr().
|
protected |
Definition at line 48 of file hweeprom.h.
Referenced by CpuCycle(), and SetEecr().
|
protected |
Definition at line 47 of file hweeprom.h.
Referenced by CpuCycle(), HWEeprom(), and SetEecr().
|
protected |
Definition at line 52 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
|
protected |
Definition at line 53 of file hweeprom.h.
Referenced by CpuCycle(), and SetEecr().