IOSpecialRegClient Class Reference

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

#include <rwmem.h>

Inheritance diagram for IOSpecialRegClient:
Inheritance graph
[legend]

List of all members.

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 233 of file rwmem.h.


Member Function Documentation

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

Implemented in ExternalIRQHandler, ExternalIRQ, TimerIRQRegister, and HWPrescaler.

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

Implemented in ExternalIRQHandler, ExternalIRQ, TimerIRQRegister, HWPrescaler, and HWPrescalerAsync.


Friends And Related Function Documentation

friend class IOSpecialReg [friend]

Definition at line 236 of file rwmem.h.


The documentation for this class was generated from the following file:
Generated on Sun Feb 12 16:52:43 2012 for Simulavr by  doxygen 1.6.3