HWTimer8_2C Class Reference

Timer unit with 8Bit counter and 2 output compare unit. More...

#include <hwtimer.h>

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

List of all members.

Public Member Functions

 HWTimer8_2C (AvrDevice *core, PrescalerMultiplexer *p, int unit, IRQLine *tov, IRQLine *tcompA, PinAtPort *outA, IRQLine *tcompB, PinAtPort *outB)
void Reset (void)
 Perform a reset of this unit.

Public Attributes

IOReg< HWTimer8_2Ctccra_reg
 control register A
IOReg< HWTimer8_2Ctccrb_reg
 control register B

Protected Member Functions

void Set_TCCRA (unsigned char val)
 Register access to set control register.
unsigned char Get_TCCRA ()
 Register access to read control register.
void Set_TCCRB (unsigned char val)
 Register access to set control register.
unsigned char Get_TCCRB ()
 Register access to read control register.

Protected Attributes

unsigned char tccra_val
 register value TCCRA
unsigned char tccrb_val
 register value TCCRB

Private Member Functions

void Set_WGM (int val)
 Handle special WGM setting, translate wgm raw value to wgm value.

Private Attributes

int wgm_raw
 this is the wgm raw value from register

Detailed Description

Timer unit with 8Bit counter and 2 output compare unit.

This timer unit is used by following devices: ATMega48/88/168/328.

TCCRxA register contains the following configuration bits (x=timer):

  +------+------+------+------+---+---+-----+-----+
  |COMxA1|COMxA0|COMxB1|COMxB0| - | - |WGMx1|WGMx0|
  +------+------+------+------+---+---+-----+-----+ 

TCCRxB register contains the following configuration bits (x=timer):

  +-----+-----+---+---+-----+----+----+----+
  |FOCxA|FOCxB| - | - |WGMx2|CSx2|CSx1|CSx0|
  +-----+-----+---+---+-----+----+----+----+ 

Definition at line 397 of file hwtimer.h.


Constructor & Destructor Documentation

HWTimer8_2C::HWTimer8_2C ( AvrDevice core,
PrescalerMultiplexer p,
int  unit,
IRQLine tov,
IRQLine tcompA,
PinAtPort outA,
IRQLine tcompB,
PinAtPort outB 
)

Definition at line 942 of file hwtimer.cpp.


Member Function Documentation

unsigned char HWTimer8_2C::Get_TCCRA (  )  [inline, protected]

Register access to read control register.

Definition at line 412 of file hwtimer.h.

References tccra_val.

unsigned char HWTimer8_2C::Get_TCCRB (  )  [inline, protected]

Register access to read control register.

Definition at line 417 of file hwtimer.h.

References tccrb_val.

void HWTimer8_2C::Reset ( void   )  [virtual]

Perform a reset of this unit.

Reimplemented from HWTimer8.

Definition at line 1005 of file hwtimer.cpp.

References tccra_val, tccrb_val, and wgm_raw.

void HWTimer8_2C::Set_TCCRA ( unsigned char  val  )  [protected]

Register access to set control register.

Definition at line 976 of file hwtimer.cpp.

References Set_WGM(), BasicTimerUnit::SetCompareOutputMode(), tccra_val, and wgm_raw.

Here is the call graph for this function:

void HWTimer8_2C::Set_TCCRB ( unsigned char  val  )  [protected]

Register access to set control register.

Definition at line 987 of file hwtimer.cpp.

References Set_WGM(), BasicTimerUnit::SetClockMode(), BasicTimerUnit::SetCompareOutput(), tccrb_val, wgm_raw, and BasicTimerUnit::WGMisPWM().

Here is the call graph for this function:

void HWTimer8_2C::Set_WGM ( int  val  )  [private]

Handle special WGM setting, translate wgm raw value to wgm value.

Definition at line 956 of file hwtimer.cpp.

References HWTimer8::ChangeWGM(), BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_FASTPWM_8BIT, BasicTimerUnit::WGM_FASTPWM_OCRA, BasicTimerUnit::WGM_NORMAL, BasicTimerUnit::WGM_PCPWM_8BIT, BasicTimerUnit::WGM_PCPWM_OCRA, wgm_raw, and BasicTimerUnit::WGM_RESERVED.

Referenced by Set_TCCRA(), and Set_TCCRB().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

unsigned char HWTimer8_2C::tccra_val [protected]

register value TCCRA

Definition at line 406 of file hwtimer.h.

Referenced by Get_TCCRA(), Reset(), and Set_TCCRA().

unsigned char HWTimer8_2C::tccrb_val [protected]

register value TCCRB

Definition at line 407 of file hwtimer.h.

Referenced by Get_TCCRB(), Reset(), and Set_TCCRB().

int HWTimer8_2C::wgm_raw [private]

this is the wgm raw value from register

Definition at line 400 of file hwtimer.h.

Referenced by Reset(), Set_TCCRA(), Set_TCCRB(), and Set_WGM().


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