#include <hweeprom.h>
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< HWEeprom > | eearh_reg |
IOReg< HWEeprom > | eearl_reg |
IOReg< HWEeprom > | eedr_reg |
IOReg< HWEeprom > | eecr_reg |
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 |
Definition at line 35 of file hweeprom.h.
anonymous enum |
Definition at line 56 of file hweeprom.h.
anonymous enum |
Definition at line 61 of file hweeprom.h.
anonymous enum |
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.
HWEeprom::HWEeprom | ( | AvrDevice * | core, | |
HWIrqSystem * | irqs, | |||
unsigned int | size, | |||
unsigned int | irqVec, | |||
int | devMode = DEVMODE_NORMAL | |||
) |
Definition at line 36 of file hweeprom.cpp.
References HWIrqSystem::DebugVerifyInterruptVector(), DEVMODE_NORMAL, eear, eear_mask, eecr, eecr_mask, eraseDelayTime, eraseWriteDelayTime, irqSystem, irqVectorNo, Memory::myMemory, opState, OPSTATE_READY, Reset(), and writeDelayTime.
HWEeprom::~HWEeprom | ( | ) | [virtual] |
Definition at line 101 of file hweeprom.cpp.
References avr_free(), and Memory::myMemory.
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.
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.
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().
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().
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 | ) |
Definition at line 124 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 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().
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().
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().
Definition at line 100 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), and AvrDevice_atmega8::AvrDevice_atmega8().
Definition at line 100 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
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().
Definition at line 100 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
unsigned char HWEeprom::eedr [protected] |
Definition at line 42 of file hweeprom.h.
Referenced by CpuCycle(), GetEedr(), Reset(), SetEecr(), and SetEedr().
Definition at line 100 of file hweeprom.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
SystemClockOffset HWEeprom::eraseDelayTime [protected] |
Definition at line 51 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
SystemClockOffset HWEeprom::eraseWriteDelayTime [protected] |
Definition at line 50 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
HWIrqSystem* HWEeprom::irqSystem [protected] |
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().
SystemClockOffset HWEeprom::writeDelayTime [protected] |
Definition at line 52 of file hweeprom.h.
Referenced by HWEeprom(), and SetEecr().
SystemClockOffset HWEeprom::writeDoneTime [protected] |
Definition at line 53 of file hweeprom.h.
Referenced by CpuCycle(), and SetEecr().