Timer unit with 8Bit counter and 2 output compare unit. More...
#include <hwtimer.h>


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_2C > | tccra_reg |
| control register A | |
| IOReg< HWTimer8_2C > | tccrb_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 | |
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.
| 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.
| unsigned char HWTimer8_2C::Get_TCCRA | ( | ) | [inline, protected] |
| unsigned char HWTimer8_2C::Get_TCCRB | ( | ) | [inline, protected] |
| void HWTimer8_2C::Reset | ( | void | ) | [virtual] |
| 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.

| 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().

| 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().


control register A
Definition at line 420 of file hwtimer.h.
Referenced by AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega668base::AvrDevice_atmega668base(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
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().
control register B
Definition at line 421 of file hwtimer.h.
Referenced by AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega668base::AvrDevice_atmega668base(), and AvrDevice_attiny2313::AvrDevice_attiny2313().
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().
1.6.3