HWPrescaler Class Reference

Prescaler unit for support timers with clock. More...

#include <timerprescaler.h>

Inheritance diagram for HWPrescaler:
Inheritance graph
[legend]
Collaboration diagram for HWPrescaler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HWPrescaler (AvrDevice *core, const std::string &tracename)
 Creates HWPrescaler instance without reset feature.
 HWPrescaler (AvrDevice *core, const std::string &tracename, IOSpecialReg *ioreg, int resetBit)
 Creates HWPrescaler instance with reset but without sync reset feature.
 HWPrescaler (AvrDevice *core, const std::string &tracename, IOSpecialReg *ioreg, int resetBit, int resetSyncBit)
 Creates HWPrescaler instance with reset and sync reset feature.
virtual unsigned int CpuCycle ()
 Count functionality for prescaler.
unsigned short GetValue ()
 Get method for current prescaler counter value.
void Reset ()
 Reset method, sets prescaler counter to 0.

Protected Member Functions

unsigned char set_from_reg (const IOSpecialReg *reg, unsigned char nv)
 IO register interface set method, see IOSpecialRegClient.
unsigned char get_from_client (const IOSpecialReg *reg, unsigned char v)
 IO register interface get method, see IOSpecialRegClient.

Protected Attributes

IOSpecialRegresetRegister
 instance of IO register with reset bits
unsigned short preScaleValue
 prescaler counter value
bool countEnable

Private Attributes

int _resetBit
 holds bit position for reset bit on IO register
int _resetSyncBit
 holds sync bit position for prescaler reset synchronisation

Detailed Description

Prescaler unit for support timers with clock.

This is a prescaler unit without external clock input, features reset and reset sync bit. Size of prescaler is 10 bit.

Definition at line 37 of file timerprescaler.h.


Constructor & Destructor Documentation

HWPrescaler::HWPrescaler ( AvrDevice core,
const std::string &  tracename 
)

Creates HWPrescaler instance without reset feature.

Definition at line 29 of file timerprescaler.cpp.

References AvrDevice::AddToCycleList(), AvrDevice::coreTraceGroup, preScaleValue, resetRegister, and trace_direct().

Here is the call graph for this function:

HWPrescaler::HWPrescaler ( AvrDevice core,
const std::string &  tracename,
IOSpecialReg ioreg,
int  resetBit 
)

Creates HWPrescaler instance with reset but without sync reset feature.

Definition at line 40 of file timerprescaler.cpp.

References AvrDevice::AddToCycleList(), IOSpecialReg::connectSRegClient(), AvrDevice::coreTraceGroup, preScaleValue, resetRegister, and trace_direct().

Here is the call graph for this function:

HWPrescaler::HWPrescaler ( AvrDevice core,
const std::string &  tracename,
IOSpecialReg ioreg,
int  resetBit,
int  resetSyncBit 
)

Creates HWPrescaler instance with reset and sync reset feature.

Definition at line 55 of file timerprescaler.cpp.

References AvrDevice::AddToCycleList(), IOSpecialReg::connectSRegClient(), AvrDevice::coreTraceGroup, preScaleValue, resetRegister, and trace_direct().

Here is the call graph for this function:


Member Function Documentation

virtual unsigned int HWPrescaler::CpuCycle ( void   )  [inline, virtual]

Count functionality for prescaler.

Reimplemented from Hardware.

Reimplemented in HWPrescalerAsync.

Definition at line 67 of file timerprescaler.h.

References countEnable, and preScaleValue.

unsigned char HWPrescaler::get_from_client ( const IOSpecialReg reg,
unsigned char  v 
) [inline, protected, virtual]

IO register interface get method, see IOSpecialRegClient.

Implements IOSpecialRegClient.

Definition at line 50 of file timerprescaler.h.

unsigned short HWPrescaler::GetValue (  )  [inline]

Get method for current prescaler counter value.

Definition at line 75 of file timerprescaler.h.

References preScaleValue.

Referenced by PrescalerMultiplexerExt::isClock(), and PrescalerMultiplexer::isClock().

Here is the caller graph for this function:

void HWPrescaler::Reset ( void   )  [inline, virtual]

Reset method, sets prescaler counter to 0.

Reimplemented from Hardware.

Definition at line 77 of file timerprescaler.h.

References preScaleValue.

Referenced by set_from_reg().

Here is the caller graph for this function:

unsigned char HWPrescaler::set_from_reg ( const IOSpecialReg reg,
unsigned char  nv 
) [protected, virtual]

IO register interface set method, see IOSpecialRegClient.

Implements IOSpecialRegClient.

Reimplemented in HWPrescalerAsync.

Definition at line 71 of file timerprescaler.cpp.

References _resetBit, _resetSyncBit, countEnable, Reset(), and resetRegister.

Here is the call graph for this function:


Member Data Documentation

int HWPrescaler::_resetBit [private]

holds bit position for reset bit on IO register

Definition at line 40 of file timerprescaler.h.

Referenced by set_from_reg().

holds sync bit position for prescaler reset synchronisation

Definition at line 41 of file timerprescaler.h.

Referenced by set_from_reg().

bool HWPrescaler::countEnable [protected]

enables counting of prescaler (for reset sync)

Definition at line 46 of file timerprescaler.h.

Referenced by CpuCycle(), HWPrescalerAsync::CpuCycle(), and set_from_reg().

unsigned short HWPrescaler::preScaleValue [protected]

prescaler counter value

Definition at line 45 of file timerprescaler.h.

Referenced by CpuCycle(), HWPrescalerAsync::CpuCycle(), GetValue(), HWPrescaler(), and Reset().

instance of IO register with reset bits

Definition at line 44 of file timerprescaler.h.

Referenced by HWPrescaler(), and set_from_reg().


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 16:51:44 2012 for Simulavr by  doxygen 1.6.3