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) |
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 Attributes | |
IOSpecialReg | timsk_reg |
the TIMSKx register | |
IOSpecialReg | tifr_reg |
the TIFRx register | |
Private Attributes | |
HWIrqSystem * | irqsystem |
pointer to irq system | |
AvrDevice * | core |
pointer to device | |
std::vector< IRQLine * > | lines |
list with IRQ lines | |
std::map< std::string, int > | name2line |
mapping IRQ line name to index | |
std::map< int, int > | vector2line |
mapping IRQ vector to index | |
unsigned char | irqmask |
mask register value; | |
unsigned char | irqflags |
flag register value; | |
unsigned char | bitmask |
mask for used bits in registers |
Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.
Definition at line 59 of file timerirq.h.
TimerIRQRegister::TimerIRQRegister | ( | AvrDevice * | core, | |
HWIrqSystem * | irqsys, | |||
int | regidx = -1 | |||
) |
Definition at line 62 of file timerirq.cpp.
References bitmask, IOSpecialReg::connectSRegClient(), Reset(), tifr_reg, and timsk_reg.
void TimerIRQRegister::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 104 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 96 of file timerirq.cpp.
References IOSpecialReg::hardwareChange(), irqflags, irqmask, irqsystem, HWIrqSystem::SetIrqFlag(), tifr_reg, and vector2line.
Referenced by IRQLine::fireInterrupt().
unsigned char TimerIRQRegister::get_from_client | ( | const IOSpecialReg * | reg, | |
unsigned char | v | |||
) | [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 148 of file timerirq.cpp.
IRQLine * TimerIRQRegister::getLine | ( | const std::string & | name | ) |
Definition at line 89 of file timerirq.cpp.
References avr_error, lines, and name2line.
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().
void TimerIRQRegister::registerLine | ( | int | idx, | |
IRQLine * | irq | |||
) |
Definition at line 79 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_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().
void TimerIRQRegister::Reset | ( | void | ) | [virtual] |
Implement the hardware's reset functionality here. The default is no action on reset.
Reimplemented from Hardware.
Definition at line 111 of file timerirq.cpp.
References irqflags, irqmask, IOSpecialReg::Reset(), tifr_reg, and timsk_reg.
Referenced by TimerIRQRegister().
unsigned char TimerIRQRegister::set_from_reg | ( | const IOSpecialReg * | reg, | |
unsigned char | nv | |||
) | [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 118 of file timerirq.cpp.
References bitmask, ClearIrqFlag(), irqflags, irqmask, irqsystem, lines, HWIrqSystem::SetIrqFlag(), and timsk_reg.
unsigned char TimerIRQRegister::bitmask [private] |
mask for used bits in registers
Definition at line 69 of file timerirq.h.
Referenced by registerLine(), set_from_reg(), and TimerIRQRegister().
AvrDevice* TimerIRQRegister::core [private] |
pointer to device
Definition at line 63 of file timerirq.h.
unsigned char TimerIRQRegister::irqflags [private] |
flag register value;
Definition at line 68 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), get_from_client(), Reset(), and set_from_reg().
unsigned char TimerIRQRegister::irqmask [private] |
mask register value;
Definition at line 67 of file timerirq.h.
Referenced by fireInterrupt(), get_from_client(), Reset(), and set_from_reg().
HWIrqSystem* TimerIRQRegister::irqsystem [private] |
pointer to irq system
Definition at line 62 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), registerLine(), and set_from_reg().
std::vector<IRQLine*> TimerIRQRegister::lines [private] |
list with IRQ lines
Definition at line 64 of file timerirq.h.
Referenced by getLine(), registerLine(), and set_from_reg().
std::map<std::string, int> TimerIRQRegister::name2line [private] |
mapping IRQ line name to index
Definition at line 65 of file timerirq.h.
Referenced by getLine(), and registerLine().
the TIFRx register
Definition at line 73 of file timerirq.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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), ClearIrqFlag(), fireInterrupt(), Reset(), and TimerIRQRegister().
the TIMSKx register
Definition at line 72 of file timerirq.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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), get_from_client(), Reset(), set_from_reg(), and TimerIRQRegister().
std::map<int, int> TimerIRQRegister::vector2line [private] |
mapping IRQ vector to index
Definition at line 66 of file timerirq.h.
Referenced by ClearIrqFlag(), fireInterrupt(), and registerLine().