|
simulavr
1.1.0
|
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem. More...
#include <timerirq.h>
Public Member Functions | |
| TimerIRQRegister (AvrDevice *core, HWIrqSystem *irqsys, int regidx=-1) | |
| void | registerLine (int idx, IRQLine *irq) |
| void | registerLine (int idx, const IRQLine &irq) |
| IRQLine * | getLine (const std::string &name) |
| void | fireInterrupt (int irqvector) |
| virtual void | ClearIrqFlag (unsigned int vector) |
| virtual void | Reset (void) |
| virtual unsigned char | set_from_reg (const IOSpecialReg *reg, unsigned char nv) |
| virtual unsigned char | get_from_client (const IOSpecialReg *reg, unsigned char v) |
Public Member Functions inherited from Hardware | |
| Hardware (AvrDevice *core) | |
| virtual | ~Hardware () |
| virtual unsigned int | CpuCycle (void) |
| virtual bool | IsLevelInterrupt (unsigned int vector) |
| virtual bool | LevelInterruptPending (unsigned int vector) |
Public Member Functions inherited from IOSpecialRegClient | |
| virtual | ~IOSpecialRegClient () |
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... | |
| 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 | |
| IOSpecialReg | timsk_reg |
| the TIMSKx register More... | |
| IOSpecialReg | tifr_reg |
| the TIFRx register More... | |
Private Attributes | |
| HWIrqSystem * | irqsystem |
| pointer to irq system More... | |
| std::vector< IRQLine > | lines |
| list with IRQ lines More... | |
| std::map< std::string, int > | name2line |
| mapping IRQ line name to index More... | |
| std::map< int, int > | vector2line |
| mapping IRQ vector to index More... | |
| unsigned char | irqmask |
| mask register value; More... | |
| unsigned char | irqflags |
| flag register value; More... | |
| unsigned char | bitmask |
| mask for used bits in registers More... | |
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... | |
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.
Definition at line 61 of file timerirq.h.
| TimerIRQRegister::TimerIRQRegister | ( | AvrDevice * | core, |
| HWIrqSystem * | irqsys, | ||
| int | regidx = -1 |
||
| ) |
Definition at line 72 of file timerirq.cpp.
References bitmask, IOSpecialReg::connectSRegClient(), Reset(), tifr_reg, and timsk_reg.
|
virtual |
This signals the hardware that the given IRQ vector has been handled by the AVR core.
Reimplemented from Hardware.
Definition at line 124 of file timerirq.cpp.
References HWIrqSystem::ClearIrqFlag(), IOSpecialReg::hardwareChange(), irqflags, irqsystem, tifr_reg, and vector2line.
Referenced by set_from_reg().
| void TimerIRQRegister::fireInterrupt | ( | int | irqvector | ) |
Definition at line 116 of file timerirq.cpp.
References IOSpecialReg::hardwareChange(), irqflags, irqmask, irqsystem, HWIrqSystem::SetIrqFlag(), tifr_reg, and vector2line.
Referenced by IRQLine::fireInterrupt().
|
virtual |
Informs your class, that a read access from IO register happens
| v | the internal saved register value (but maybe changed by other clients) |
Implements IOSpecialRegClient.
Definition at line 168 of file timerirq.cpp.
| IRQLine * TimerIRQRegister::getLine | ( | const std::string & | name | ) |
Definition at line 109 of file timerirq.cpp.
References avr_error, lines, and name2line.
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().
| void TimerIRQRegister::registerLine | ( | int | idx, |
| IRQLine * | irq | ||
| ) |
Definition at line 88 of file timerirq.cpp.
References bitmask, HWIrqSystem::DebugVerifyInterruptVector(), IRQLine::irqreg, irqsystem, IRQLine::irqvector, lines, IRQLine::name, name2line, and vector2line.
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().
| void TimerIRQRegister::registerLine | ( | int | idx, |
| const IRQLine & | irq | ||
| ) |
Definition at line 98 of file timerirq.cpp.
References bitmask, HWIrqSystem::DebugVerifyInterruptVector(), IRQLine::irqreg, irqsystem, IRQLine::irqvector, lines, IRQLine::name, name2line, and vector2line.
|
virtual |
Implement the hardware's reset functionality here. The default is no action on reset.
Reimplemented from Hardware.
Definition at line 131 of file timerirq.cpp.
References irqflags, irqmask, IOSpecialReg::Reset(), tifr_reg, and timsk_reg.
Referenced by TimerIRQRegister().
|
virtual |
Informs your class, that a write access to IO register is happen
| reg | caller register instance |
| nv | the value, which is written to IO register (but maybe changed by other clients) |
Implements IOSpecialRegClient.
Definition at line 138 of file timerirq.cpp.
References bitmask, ClearIrqFlag(), irqflags, irqmask, irqsystem, lines, HWIrqSystem::SetIrqFlag(), and timsk_reg.
|
private |
mask for used bits in registers
Definition at line 70 of file timerirq.h.
Referenced by registerLine(), set_from_reg(), and TimerIRQRegister().
|
private |
flag register value;
Definition at line 69 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), get_from_client(), Reset(), and set_from_reg().
|
private |
mask register value;
Definition at line 68 of file timerirq.h.
Referenced by fireInterrupt(), get_from_client(), Reset(), and set_from_reg().
|
private |
pointer to irq system
Definition at line 64 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), registerLine(), and set_from_reg().
|
private |
list with IRQ lines
Definition at line 65 of file timerirq.h.
Referenced by getLine(), registerLine(), and set_from_reg().
|
private |
mapping IRQ line name to index
Definition at line 66 of file timerirq.h.
Referenced by getLine(), and registerLine().
| IOSpecialReg TimerIRQRegister::tifr_reg |
the TIFRx register
Definition at line 74 of file timerirq.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(), AvrDevice_attinyX5::AvrDevice_attinyX5(), ClearIrqFlag(), fireInterrupt(), Reset(), and TimerIRQRegister().
| IOSpecialReg TimerIRQRegister::timsk_reg |
the TIMSKx register
Definition at line 73 of file timerirq.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(), AvrDevice_attinyX5::AvrDevice_attinyX5(), get_from_client(), Reset(), set_from_reg(), and TimerIRQRegister().
|
private |
mapping IRQ vector to index
Definition at line 67 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), and registerLine().