simulavr  1.1.0
IOSpecialRegClient Class Referenceabstract

Interface class to connect hardware units to control registers. More...

#include <rwmem.h>

Inheritance diagram for IOSpecialRegClient:

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
 

Detailed Description

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.

Definition at line 398 of file rwmem.h.

Constructor & Destructor Documentation

◆ ~IOSpecialRegClient()

virtual IOSpecialRegClient::~IOSpecialRegClient ( )
inlinevirtual

Definition at line 415 of file rwmem.h.

Member Function Documentation

◆ get_from_client()

virtual unsigned char IOSpecialRegClient::get_from_client ( const IOSpecialReg reg,
unsigned char  v 
)
protectedpure 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

Implemented in HWTimerTinyX5, HWAd_SFIOR, ExternalIRQ, TimerIRQRegister, ExternalIRQHandler, HWAcomp, and HWPrescaler.

◆ set_from_reg()

virtual unsigned char IOSpecialRegClient::set_from_reg ( const IOSpecialReg reg,
unsigned char  nv 
)
protectedpure 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

Implemented in HWTimerTinyX5, HWAd_SFIOR, HWPrescalerAsync, ExternalIRQ, TimerIRQRegister, ExternalIRQHandler, HWAcomp, and HWPrescaler.

Friends And Related Function Documentation

◆ IOSpecialReg

friend class IOSpecialReg
friend

Definition at line 401 of file rwmem.h.


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