IOReg< P > Class Template Reference

IO register to be specialized for a certain class/hardware. More...

#include <rwmem.h>

Inheritance diagram for IOReg< P >:
Inheritance graph
[legend]
Collaboration diagram for IOReg< P >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef unsigned char(P::* getter_t )()
typedef void(P::* setter_t )(unsigned char)

Public Member Functions

 IOReg (TraceValueRegister *registry, const std::string &tracename, P *_p, getter_t _g=0, setter_t _s=0)
void hardwareChange (unsigned char val)
void releaseTraceValue (void)

Protected Member Functions

unsigned char get () const
void set (unsigned char val)

Private Attributes

P * p
getter_t g
setter_t s

Detailed Description

template<class P>
class IOReg< P >

IO register to be specialized for a certain class/hardware.

The template parameter class P specifies the class type in which the io register resides.

Definition at line 160 of file rwmem.h.


Member Typedef Documentation

template<class P>
typedef unsigned char(P::* IOReg< P >::getter_t)()

Definition at line 163 of file rwmem.h.

template<class P>
typedef void(P::* IOReg< P >::setter_t)(unsigned char)

Definition at line 164 of file rwmem.h.


Constructor & Destructor Documentation

template<class P>
IOReg< P >::IOReg ( TraceValueRegister registry,
const std::string &  tracename,
P *  _p,
getter_t  _g = 0,
setter_t  _s = 0 
) [inline]

Creates an IO control register for controlling hardware units

Parameters:
_p,: pointer to object this will be part of
_g,: pointer to get method
_s,: pointer to set method

Definition at line 169 of file rwmem.h.


Member Function Documentation

template<class P>
unsigned char IOReg< P >::get (  )  const [inline, protected, virtual]

This function as the oppposite to get() is expected to read the real byte.

Implements RWMemoryMember.

Definition at line 197 of file rwmem.h.

template<class P>
void IOReg< P >::hardwareChange ( unsigned char  val  )  [inline]

Reflects a value change from hardware (for example timer count occured)

Parameters:
val the new register value

Definition at line 186 of file rwmem.h.

Referenced by HWStackSram::Pop(), HWStackSram::Push(), PinAtPort::SetAlternatePort(), HWStackSram::SetSph(), and HWStackSram::SetSpl().

Here is the caller graph for this function:

template<class P>
void IOReg< P >::releaseTraceValue ( void   )  [inline]

Releases the TraceValue to hide this IOReg from registry

Definition at line 188 of file rwmem.h.

Referenced by HWTimer16::HWTimer16(), HWTimer8::HWTimer8(), and HWUsart::HWUsart().

Here is the caller graph for this function:

template<class P>
void IOReg< P >::set ( unsigned char  nv  )  [inline, protected, virtual]

This function is the function which will be called by the above access operators and is expected to do the real work when writing a byte.

Implements RWMemoryMember.

Definition at line 205 of file rwmem.h.


Member Data Documentation

template<class P>
getter_t IOReg< P >::g [private]

Definition at line 215 of file rwmem.h.

Referenced by IOReg< HWTimer8_0C >::get().

template<class P>
P* IOReg< P >::p [private]

Definition at line 214 of file rwmem.h.

Referenced by IOReg< HWTimer8_0C >::get(), and IOReg< HWTimer8_0C >::set().

template<class P>
setter_t IOReg< P >::s [private]

Definition at line 216 of file rwmem.h.

Referenced by IOReg< HWTimer8_0C >::set().


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