simulavr  1.1.0
ExternalIRQ Class Reference

Basic handler for one external IRQ, handles control register. More...

#include <externalirq.h>

Inheritance diagram for ExternalIRQ:

Public Member Functions

 ExternalIRQ (IOSpecialReg *ctrl, int ctrlOffset, int ctrlBits)
 
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 IOSpecialRegClient
virtual ~IOSpecialRegClient ()
 

Protected Member Functions

void setHandlerIndex (ExternalIRQHandler *h, int idx)
 register handler and index for signaling interrupt More...
 
void fireInterrupt (void)
 fire a interrupt More...
 
virtual void ResetMode (void)
 Reset mode. More...
 
virtual void ChangeMode (unsigned char m)
 Handle change of control register. More...
 
virtual bool fireAgain (void)
 does the interrupt source fire again? (for interrupt on level) More...
 
virtual bool mustSetFlagOnFire (void)
 does fire interrupt set the interrupt flag? (level interrupt does this not!) More...
 

Protected Attributes

int handlerIndex
 my own index on handler instance More...
 
ExternalIRQHandlerhandler
 reference to IRQ handler More...
 
int bitshift
 how many bits to shift to get mode from control register More...
 
unsigned char mask
 mask for extract mode from control register More...
 
unsigned char mode
 control mode from control register More...
 

Friends

class ExternalIRQHandler
 

Detailed Description

Basic handler for one external IRQ, handles control register.

Definition at line 77 of file externalirq.h.

Constructor & Destructor Documentation

◆ ExternalIRQ()

ExternalIRQ::ExternalIRQ ( IOSpecialReg ctrl,
int  ctrlOffset,
int  ctrlBits 
)

Definition at line 141 of file externalirq.cpp.

References IOSpecialReg::connectSRegClient().

Member Function Documentation

◆ ChangeMode()

virtual void ExternalIRQ::ChangeMode ( unsigned char  m)
inlineprotectedvirtual

Handle change of control register.

Reimplemented in ExternalIRQSingle.

Definition at line 93 of file externalirq.h.

◆ fireAgain()

virtual bool ExternalIRQ::fireAgain ( void  )
inlineprotectedvirtual

does the interrupt source fire again? (for interrupt on level)

Reimplemented in ExternalIRQSingle.

Definition at line 95 of file externalirq.h.

◆ fireInterrupt()

void ExternalIRQ::fireInterrupt ( void  )
inlineprotected

◆ get_from_client()

unsigned char ExternalIRQ::get_from_client ( const IOSpecialReg reg,
unsigned char  v 
)
virtual

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

Parameters
vthe 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 155 of file externalirq.cpp.

◆ mustSetFlagOnFire()

virtual bool ExternalIRQ::mustSetFlagOnFire ( void  )
inlineprotectedvirtual

does fire interrupt set the interrupt flag? (level interrupt does this not!)

Reimplemented in ExternalIRQSingle.

Definition at line 97 of file externalirq.h.

◆ ResetMode()

virtual void ExternalIRQ::ResetMode ( void  )
inlineprotectedvirtual

Reset mode.

Definition at line 91 of file externalirq.h.

Referenced by ExternalIRQPort::ExternalIRQPort(), and ExternalIRQSingle::ExternalIRQSingle().

◆ set_from_reg()

unsigned char ExternalIRQ::set_from_reg ( const IOSpecialReg reg,
unsigned char  nv 
)
virtual

Informs your class, that a write access to IO register is happen

Parameters
regcaller register instance
nvthe 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 150 of file externalirq.cpp.

◆ setHandlerIndex()

void ExternalIRQ::setHandlerIndex ( ExternalIRQHandler h,
int  idx 
)
inlineprotected

register handler and index for signaling interrupt

Definition at line 87 of file externalirq.h.

Referenced by ExternalIRQHandler::registerIrq().

Friends And Related Function Documentation

◆ ExternalIRQHandler

friend class ExternalIRQHandler
friend

Definition at line 99 of file externalirq.h.

Member Data Documentation

◆ bitshift

int ExternalIRQ::bitshift
protected

how many bits to shift to get mode from control register

Definition at line 82 of file externalirq.h.

◆ handler

ExternalIRQHandler* ExternalIRQ::handler
protected

reference to IRQ handler

Definition at line 81 of file externalirq.h.

◆ handlerIndex

int ExternalIRQ::handlerIndex
protected

my own index on handler instance

Definition at line 80 of file externalirq.h.

◆ mask

unsigned char ExternalIRQ::mask
protected

mask for extract mode from control register

Definition at line 83 of file externalirq.h.

◆ mode

unsigned char ExternalIRQ::mode
protected

The documentation for this class was generated from the following files: