ExternalIRQHandler Class Reference

Handler for external IRQ's to communicate with IRQ system and mask/flag registers. More...

#include <externalirq.h>

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

List of all members.

Public Member Functions

 ExternalIRQHandler (AvrDevice *core, HWIrqSystem *irqsys, IOSpecialReg *mask, IOSpecialReg *flag)
 ~ExternalIRQHandler ()
void registerIrq (int vector, int irqBit, ExternalIRQ *extirq)
virtual void ClearIrqFlag (unsigned int vector)
virtual void Reset (void)
virtual bool IsLevelInterrupt (unsigned int vector)
virtual bool LevelInterruptPending (unsigned int vector)
virtual unsigned char set_from_reg (const IOSpecialReg *reg, unsigned char nv)
virtual unsigned char get_from_client (const IOSpecialReg *reg, unsigned char v)

Protected Member Functions

void fireInterrupt (int idx)
 fire a interupt from IRQ with index

Protected Attributes

HWIrqSystemirqsystem
 pointer to irq system
IOSpecialRegmask_reg
 the interrupt mask register
IOSpecialRegflag_reg
 the interrupt flag register
std::vector< ExternalIRQ * > extirqs
 list with external IRQ's
unsigned char irq_mask
 mask register value for registered IRQ's
unsigned char irq_flag
 flag register value for registered IRQ's
unsigned char reg_mask
 mask for relevant bits in flag and mask register
std::vector< int > vectors
 mapping index to vector
std::vector< int > irqbits
 mapping index to mask bit
std::map< int, int > vector2idx
 mapping irq vector to index

Friends

class ExternalIRQ

Detailed Description

Handler for external IRQ's to communicate with IRQ system and mask/flag registers.

Definition at line 41 of file externalirq.h.


Constructor & Destructor Documentation

ExternalIRQHandler::ExternalIRQHandler ( AvrDevice core,
HWIrqSystem irqsys,
IOSpecialReg mask,
IOSpecialReg flag 
)

Definition at line 29 of file externalirq.cpp.

References IOSpecialReg::connectSRegClient(), flag_reg, mask_reg, reg_mask, and Reset().

Here is the call graph for this function:

ExternalIRQHandler::~ExternalIRQHandler ( void   ) 

Definition at line 48 of file externalirq.cpp.

References extirqs.


Member Function Documentation

void ExternalIRQHandler::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 76 of file externalirq.cpp.

References HWIrqSystem::ClearIrqFlag(), extirqs, flag_reg, IOSpecialReg::hardwareChangeMask(), irq_flag, irq_mask, irqbits, irqsystem, reg_mask, HWIrqSystem::SetIrqFlag(), vector2idx, and vectors.

Here is the call graph for this function:

void ExternalIRQHandler::fireInterrupt ( int  idx  )  [protected]

fire a interupt from IRQ with index

Definition at line 67 of file externalirq.cpp.

References extirqs, flag_reg, IOSpecialReg::hardwareChangeMask(), irq_flag, irq_mask, irqbits, irqsystem, reg_mask, HWIrqSystem::SetIrqFlag(), and vectors.

Referenced by ExternalIRQ::fireInterrupt().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char ExternalIRQHandler::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 131 of file externalirq.cpp.

References irq_flag, irq_mask, mask_reg, and reg_mask.

bool ExternalIRQHandler::IsLevelInterrupt ( unsigned int  vector  )  [virtual]

Does the hardware have a level interrupt (triggered otherwise, the default!)

Reimplemented from Hardware.

Definition at line 91 of file externalirq.cpp.

References extirqs, and vector2idx.

bool ExternalIRQHandler::LevelInterruptPending ( unsigned int  vector  )  [virtual]

Check a level interrupt on the time, where interrupt routine will be called

Reimplemented from Hardware.

Definition at line 97 of file externalirq.cpp.

References extirqs, irq_mask, irqbits, and vector2idx.

void ExternalIRQHandler::registerIrq ( int  vector,
int  irqBit,
ExternalIRQ extirq 
)
void ExternalIRQHandler::Reset ( void   )  [virtual]

Implement the hardware's reset functionality here. The default is no action on reset.

Reimplemented from Hardware.

Definition at line 103 of file externalirq.cpp.

References extirqs, irq_flag, and irq_mask.

Referenced by ExternalIRQHandler().

Here is the caller graph for this function:

unsigned char ExternalIRQHandler::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 110 of file externalirq.cpp.

References extirqs, irq_flag, irq_mask, irqbits, irqsystem, mask_reg, reg_mask, HWIrqSystem::SetIrqFlag(), and vectors.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class ExternalIRQ [friend]

Definition at line 57 of file externalirq.h.


Member Data Documentation

std::vector<ExternalIRQ*> ExternalIRQHandler::extirqs [protected]

the interrupt flag register

Definition at line 46 of file externalirq.h.

Referenced by ClearIrqFlag(), ExternalIRQHandler(), and fireInterrupt().

unsigned char ExternalIRQHandler::irq_flag [protected]

flag register value for registered IRQ's

Definition at line 49 of file externalirq.h.

Referenced by ClearIrqFlag(), fireInterrupt(), get_from_client(), Reset(), and set_from_reg().

unsigned char ExternalIRQHandler::irq_mask [protected]

mask register value for registered IRQ's

Definition at line 48 of file externalirq.h.

Referenced by ClearIrqFlag(), fireInterrupt(), get_from_client(), LevelInterruptPending(), Reset(), and set_from_reg().

std::vector<int> ExternalIRQHandler::irqbits [protected]

mapping index to mask bit

Definition at line 52 of file externalirq.h.

Referenced by ClearIrqFlag(), fireInterrupt(), LevelInterruptPending(), registerIrq(), and set_from_reg().

pointer to irq system

Definition at line 44 of file externalirq.h.

Referenced by ClearIrqFlag(), fireInterrupt(), registerIrq(), and set_from_reg().

the interrupt mask register

Definition at line 45 of file externalirq.h.

Referenced by ExternalIRQHandler(), get_from_client(), and set_from_reg().

unsigned char ExternalIRQHandler::reg_mask [protected]

mask for relevant bits in flag and mask register

Definition at line 50 of file externalirq.h.

Referenced by ClearIrqFlag(), ExternalIRQHandler(), fireInterrupt(), get_from_client(), registerIrq(), and set_from_reg().

std::map<int, int> ExternalIRQHandler::vector2idx [protected]

mapping irq vector to index

Definition at line 53 of file externalirq.h.

Referenced by ClearIrqFlag(), IsLevelInterrupt(), LevelInterruptPending(), and registerIrq().

std::vector<int> ExternalIRQHandler::vectors [protected]

mapping index to vector

Definition at line 51 of file externalirq.h.

Referenced by ClearIrqFlag(), fireInterrupt(), registerIrq(), and set_from_reg().


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