Basic handler for one external IRQ, handles control register. More...
#include <externalirq.h>
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) |
Protected Member Functions | |
void | setHandlerIndex (ExternalIRQHandler *h, int idx) |
register handler and index for signaling interrupt | |
void | fireInterrupt (void) |
fire a interrupt | |
virtual void | ResetMode (void) |
Reset mode. | |
virtual void | ChangeMode (unsigned char m) |
Handle change of control register. | |
virtual bool | fireAgain (void) |
does the interrupt source fire again? (for interrupt on level) | |
virtual bool | mustSetFlagOnFire (void) |
does fire interrupt set the interrupt flag? (level interrupt does this not!) | |
Protected Attributes | |
int | handlerIndex |
my own index on handler instance | |
ExternalIRQHandler * | handler |
reference to IRQ handler | |
int | bitshift |
how many bits to shift to get mode from control register | |
unsigned char | mask |
mask for extract mode from control register | |
unsigned char | mode |
control mode from control register | |
Friends | |
class | ExternalIRQHandler |
Basic handler for one external IRQ, handles control register.
Definition at line 77 of file externalirq.h.
ExternalIRQ::ExternalIRQ | ( | IOSpecialReg * | ctrl, | |
int | ctrlOffset, | |||
int | ctrlBits | |||
) |
Definition at line 141 of file externalirq.cpp.
References bitshift, IOSpecialReg::connectSRegClient(), handler, handlerIndex, and mask.
virtual void ExternalIRQ::ChangeMode | ( | unsigned char | m | ) | [inline, protected, virtual] |
Handle change of control register.
Reimplemented in ExternalIRQSingle.
Definition at line 93 of file externalirq.h.
References mode.
Referenced by set_from_reg().
virtual bool ExternalIRQ::fireAgain | ( | void | ) | [inline, protected, virtual] |
does the interrupt source fire again? (for interrupt on level)
Reimplemented in ExternalIRQSingle.
Definition at line 95 of file externalirq.h.
void ExternalIRQ::fireInterrupt | ( | void | ) | [inline, protected] |
fire a interrupt
Definition at line 89 of file externalirq.h.
References ExternalIRQHandler::fireInterrupt(), handler, and handlerIndex.
Referenced by ExternalIRQPort::PinStateHasChanged(), and ExternalIRQSingle::PinStateHasChanged().
unsigned char ExternalIRQ::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 155 of file externalirq.cpp.
virtual bool ExternalIRQ::mustSetFlagOnFire | ( | void | ) | [inline, protected, virtual] |
does fire interrupt set the interrupt flag? (level interrupt does this not!)
Reimplemented in ExternalIRQSingle.
Definition at line 97 of file externalirq.h.
virtual void ExternalIRQ::ResetMode | ( | void | ) | [inline, protected, virtual] |
Reset mode.
Definition at line 91 of file externalirq.h.
References mode.
Referenced by ExternalIRQPort::ExternalIRQPort(), and ExternalIRQSingle::ExternalIRQSingle().
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
reg | caller register instance | |
nv | the value, which is written to IO register (but maybe changed by other clients) |
Implements IOSpecialRegClient.
Definition at line 150 of file externalirq.cpp.
References bitshift, ChangeMode(), and mask.
void ExternalIRQ::setHandlerIndex | ( | ExternalIRQHandler * | h, | |
int | idx | |||
) | [inline, protected] |
register handler and index for signaling interrupt
Definition at line 87 of file externalirq.h.
References handler, and handlerIndex.
Referenced by ExternalIRQHandler::registerIrq().
friend class ExternalIRQHandler [friend] |
Definition at line 99 of file externalirq.h.
int ExternalIRQ::bitshift [protected] |
how many bits to shift to get mode from control register
Definition at line 82 of file externalirq.h.
Referenced by ExternalIRQ(), get_from_client(), and set_from_reg().
ExternalIRQHandler* ExternalIRQ::handler [protected] |
reference to IRQ handler
Definition at line 81 of file externalirq.h.
Referenced by ExternalIRQ(), fireInterrupt(), and setHandlerIndex().
int ExternalIRQ::handlerIndex [protected] |
my own index on handler instance
Definition at line 80 of file externalirq.h.
Referenced by ExternalIRQ(), fireInterrupt(), and setHandlerIndex().
unsigned char ExternalIRQ::mask [protected] |
mask for extract mode from control register
Definition at line 83 of file externalirq.h.
Referenced by ExternalIRQ(), get_from_client(), and set_from_reg().
unsigned char ExternalIRQ::mode [protected] |
control mode from control register
Definition at line 84 of file externalirq.h.
Referenced by ChangeMode(), ExternalIRQSingle::ChangeMode(), ExternalIRQSingle::fireAgain(), get_from_client(), ExternalIRQSingle::mustSetFlagOnFire(), ExternalIRQPort::PinStateHasChanged(), ExternalIRQSingle::PinStateHasChanged(), and ResetMode().