HWTimer16_2C2 Class Reference

Timer unit with 16Bit counter and 2 output compare units and 2 config registers. More...

#include <hwtimer.h>

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

List of all members.

Public Member Functions

 HWTimer16_2C2 (AvrDevice *core, PrescalerMultiplexer *p, int unit, IRQLine *tov, IRQLine *tcompA, PinAtPort *outA, IRQLine *tcompB, PinAtPort *outB, IRQLine *ticap, ICaptureSource *icapsrc, bool is_at8515)
void Reset (void)
 Perform a reset of this unit.

Public Attributes

IOReg< HWTimer16_2C2tccra_reg
 control register A
IOReg< HWTimer16_2C2tccrb_reg
 control register B

Protected Member Functions

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

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
bool at8515_mode
 signals, that this timer units is used in AT90S8515

Detailed Description

Timer unit with 16Bit counter and 2 output compare units and 2 config registers.

This timer unit is used by following devices: ATMega16, AT90S8515.

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

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

On AT90S8515 FOCx bits are not available, WGMxy bits are named PWMxy!

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

  +-----+-----+---+-----+-----+----+----+----+
  |ICNCx|ICESx| - |WGMx3|WGMx2|CSx2|CSx1|CSx0|
  +-----+-----+---+-----+-----+----+----+----+ 

On AT90S8515 WGMx3 bit is not available, WGMx2 bit is named CTCx!

Definition at line 509 of file hwtimer.h.


Constructor & Destructor Documentation

HWTimer16_2C2::HWTimer16_2C2 ( AvrDevice core,
PrescalerMultiplexer p,
int  unit,
IRQLine tov,
IRQLine tcompA,
PinAtPort outA,
IRQLine tcompB,
PinAtPort outB,
IRQLine ticap,
ICaptureSource icapsrc,
bool  is_at8515 
)

Definition at line 1075 of file hwtimer.cpp.


Member Function Documentation

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

Register access to read control register A.

Definition at line 525 of file hwtimer.h.

References tccra_val.

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

Register access to read control register B.

Definition at line 530 of file hwtimer.h.

References tccrb_val.

void HWTimer16_2C2::Reset ( void   )  [virtual]

Perform a reset of this unit.

Reimplemented from HWTimer16.

Definition at line 1148 of file hwtimer.cpp.

References tccra_val, tccrb_val, and wgm_raw.

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

Register access to set control register A.

Definition at line 1116 of file hwtimer.cpp.

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

Here is the call graph for this function:

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

Register access to set control register B.

Definition at line 1135 of file hwtimer.cpp.

References at8515_mode, BasicTimerUnit::icapNoiseCanceler, BasicTimerUnit::icapRisingEdge, Set_WGM(), BasicTimerUnit::SetClockMode(), tccrb_val, and wgm_raw.

Here is the call graph for this function:

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

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

Definition at line 1093 of file hwtimer.cpp.

References at8515_mode, HWTimer16::ChangeWGM(), BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_NORMAL, BasicTimerUnit::WGM_PCPWM_10BIT, BasicTimerUnit::WGM_PCPWM_8BIT, BasicTimerUnit::WGM_PCPWM_9BIT, and wgm_raw.

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

signals, that this timer units is used in AT90S8515

Definition at line 513 of file hwtimer.h.

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

unsigned char HWTimer16_2C2::tccra_val [protected]

register value TCCRA

Definition at line 519 of file hwtimer.h.

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

unsigned char HWTimer16_2C2::tccrb_val [protected]

register value TCCRB

Definition at line 520 of file hwtimer.h.

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

int HWTimer16_2C2::wgm_raw [private]

this is the wgm raw value from register

Definition at line 512 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:08 2012 for Simulavr by  doxygen 1.6.3