Timer unit with 16Bit counter and 2 output compare units and 2 config registers. More...
#include <hwtimer.h>
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_2C2 > | tccra_reg |
control register A | |
IOReg< HWTimer16_2C2 > | tccrb_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 |
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.
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.
unsigned char HWTimer16_2C2::Get_TCCRA | ( | ) | [inline, protected] |
unsigned char HWTimer16_2C2::Get_TCCRB | ( | ) | [inline, protected] |
void HWTimer16_2C2::Reset | ( | void | ) | [virtual] |
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().
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.
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().
bool HWTimer16_2C2::at8515_mode [private] |
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().
control register A
Definition at line 533 of file hwtimer.h.
Referenced by AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), and AvrDevice_atmega8::AvrDevice_atmega8().
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().
control register B
Definition at line 534 of file hwtimer.h.
Referenced by AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), and AvrDevice_atmega8::AvrDevice_atmega8().
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().