TimerIRQRegister Class Reference

Provices flag and mask register for timer interrupts and connects irq lines to irqsystem. More...

#include <timerirq.h>

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

List of all members.

Public Member Functions

 TimerIRQRegister (AvrDevice *core, HWIrqSystem *irqsys, int regidx=-1)
void registerLine (int idx, IRQLine *irq)
IRQLinegetLine (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

HWIrqSystemirqsystem
 pointer to irq system
AvrDevicecore
 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

Detailed Description

Provices flag and mask register for timer interrupts and connects irq lines to irqsystem.

Definition at line 59 of file timerirq.h.


Constructor & Destructor Documentation

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.

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char TimerIRQRegister::get_from_client ( const IOSpecialReg reg,
unsigned char  v 
) [virtual]

Informs your class, that a read access from IO register happens

Parameters:
v the internal saved register value (but maybe changed by other clients)
Returns:
v, if nothing is changed or your changed value

Implements IOSpecialRegClient.

Definition at line 148 of file timerirq.cpp.

References irqflags, irqmask, and timsk_reg.

IRQLine * TimerIRQRegister::getLine ( const std::string &  name  ) 
void TimerIRQRegister::registerLine ( int  idx,
IRQLine irq 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
reg caller register instance
nv the value, which is written to IO register (but maybe changed by other clients)
Returns:
nv, if nothing is changed or your changed value

Implements IOSpecialRegClient.

Definition at line 118 of file timerirq.cpp.

References bitmask, ClearIrqFlag(), irqflags, irqmask, irqsystem, lines, HWIrqSystem::SetIrqFlag(), and timsk_reg.

Here is the call graph for this function:


Member Data Documentation

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().

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().

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().

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().


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