simulavr
1.1.0
|
Interface class to connect hardware units to control registers. More...
#include <rwmem.h>
Public Member Functions | |
virtual | ~IOSpecialRegClient () |
Protected Member Functions | |
virtual unsigned char | set_from_reg (const IOSpecialReg *reg, unsigned char nv)=0 |
virtual unsigned char | get_from_client (const IOSpecialReg *reg, unsigned char v)=0 |
Friends | |
class | IOSpecialReg |
Interface class to connect hardware units to control registers.
This interface gives hardware, theres functionality depends on IO registers, which are not special for this hardware (maybe only a reset bit for a prescaler) the possibillity to react on write access to such register and to reflect some internal states to bits of such register, like async state on some timers, which are set to be clocked from external clock.
To use this interface, let your hardware class inherit from this interface and implement set_from_reg and get_from_client. The simplest body for both functions would be "return nv;" and "return v;", means to change or reflect nothing. But in every case your hardware is informed on reading or writing to that IO register.
|
inlinevirtual |
|
protectedpure virtual |
Informs your class, that a read access from IO register happens
v | the internal saved register value (but maybe changed by other clients) |
Implemented in HWTimerTinyX5, HWAd_SFIOR, ExternalIRQ, TimerIRQRegister, ExternalIRQHandler, HWAcomp, and HWPrescaler.
|
protectedpure 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) |
Implemented in HWTimerTinyX5, HWAd_SFIOR, HWPrescalerAsync, ExternalIRQ, TimerIRQRegister, ExternalIRQHandler, HWAcomp, and HWPrescaler.
|
friend |