Extends BasicTimerUnit to provide common support to all types of 8Bit timer units. More...
#include <hwtimer.h>
Public Member Functions | |
HWTimer8 (AvrDevice *core, PrescalerMultiplexer *p, int unit, IRQLine *tov, IRQLine *tcompA, PinAtPort *outA, IRQLine *tcompB, PinAtPort *outB) | |
void | Reset () |
Perform a reset of this unit. | |
Public Attributes | |
IOReg< HWTimer8 > | tcnt_reg |
counter register | |
IOReg< HWTimer8 > | ocra_reg |
output compare A register | |
IOReg< HWTimer8 > | ocrb_reg |
output compare B register | |
Protected Member Functions | |
void | ChangeWGM (WGMtype mode) |
Change WGM mode, set counter limits. | |
void | SetCompareRegister (int idx, unsigned char val) |
Setter method for compare register. | |
unsigned char | GetCompareRegister (int idx) |
Getter method for compare register. | |
void | Set_TCNT (unsigned char val) |
Register access to set counter register high byte. | |
unsigned char | Get_TCNT () |
Register access to read counter register high byte. | |
void | Set_OCRA (unsigned char val) |
Register access to set output compare register A. | |
unsigned char | Get_OCRA () |
Register access to read output compare register A. | |
void | Set_OCRB (unsigned char val) |
Register access to set output compare register B. | |
unsigned char | Get_OCRB () |
Register access to read output compare register B. |
Extends BasicTimerUnit to provide common support to all types of 8Bit timer units.
Definition at line 183 of file hwtimer.h.
HWTimer8::HWTimer8 | ( | AvrDevice * | core, | |
PrescalerMultiplexer * | p, | |||
int | unit, | |||
IRQLine * | tov, | |||
IRQLine * | tcompA, | |||
PinAtPort * | outA, | |||
IRQLine * | tcompB, | |||
PinAtPort * | outB | |||
) |
Definition at line 568 of file hwtimer.cpp.
References BasicTimerUnit::compare_output, BasicTimerUnit::compareEnable, ocra_reg, ocrb_reg, IOReg< P >::releaseTraceValue(), Reset(), BasicTimerUnit::timerCompare, BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_FASTPWM_8BIT, BasicTimerUnit::WGM_NORMAL, BasicTimerUnit::WGM_PCPWM_8BIT, BasicTimerUnit::wgmfunc, BasicTimerUnit::WGMfunc_ctc(), BasicTimerUnit::WGMfunc_fastpwm(), BasicTimerUnit::WGMfunc_normal(), and BasicTimerUnit::WGMfunc_pcpwm().
void HWTimer8::ChangeWGM | ( | WGMtype | mode | ) | [protected] |
Change WGM mode, set counter limits.
Definition at line 612 of file hwtimer.cpp.
References BasicTimerUnit::compare, BasicTimerUnit::count_down, BasicTimerUnit::limit_max, BasicTimerUnit::limit_top, BasicTimerUnit::updown_counting, BasicTimerUnit::wgm, BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_FASTPWM_8BIT, BasicTimerUnit::WGM_NORMAL, and BasicTimerUnit::WGM_PCPWM_8BIT.
Referenced by HWTimer8_0C::HWTimer8_0C(), HWTimer8_1C::Set_TCCR(), and HWTimer8_2C::Set_WGM().
unsigned char HWTimer8::Get_OCRA | ( | ) | [inline, protected] |
Register access to read output compare register A.
Definition at line 202 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer8::Get_OCRB | ( | ) | [inline, protected] |
Register access to read output compare register B.
Definition at line 207 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer8::Get_TCNT | ( | ) | [inline, protected] |
Register access to read counter register high byte.
Definition at line 197 of file hwtimer.h.
References BasicTimerUnit::vtcnt.
unsigned char HWTimer8::GetCompareRegister | ( | int | idx | ) | [protected] |
Getter method for compare register.
Definition at line 651 of file hwtimer.cpp.
References BasicTimerUnit::compare, BasicTimerUnit::compare_dbl, and BasicTimerUnit::WGMisPWM().
Referenced by Get_OCRA(), and Get_OCRB().
void HWTimer8::Reset | ( | void | ) | [virtual] |
Perform a reset of this unit.
Reimplemented from BasicTimerUnit.
Reimplemented in HWTimer8_0C, HWTimer8_1C, and HWTimer8_2C.
Definition at line 608 of file hwtimer.cpp.
Referenced by HWTimer8().
void HWTimer8::Set_OCRA | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register A.
Definition at line 200 of file hwtimer.h.
References SetCompareRegister().
void HWTimer8::Set_OCRB | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register B.
Definition at line 205 of file hwtimer.h.
References SetCompareRegister().
void HWTimer8::Set_TCNT | ( | unsigned char | val | ) | [inline, protected] |
Register access to set counter register high byte.
Definition at line 195 of file hwtimer.h.
References BasicTimerUnit::SetCounter().
void HWTimer8::SetCompareRegister | ( | int | idx, | |
unsigned char | val | |||
) | [protected] |
Setter method for compare register.
Definition at line 638 of file hwtimer.cpp.
References BasicTimerUnit::compare, BasicTimerUnit::compare_dbl, BasicTimerUnit::limit_top, BasicTimerUnit::wgm, BasicTimerUnit::WGM_CTC_OCRA, and BasicTimerUnit::WGMisPWM().
Referenced by Set_OCRA(), and Set_OCRB().
output compare A register
Definition at line 211 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer8().
output compare B register
Definition at line 212 of file hwtimer.h.
Referenced by AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer8().
counter register
Definition at line 210 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_at90s4433::AvrDevice_at90s4433(), AvrDevice_at90s8515::AvrDevice_at90s8515(), AvrDevice_atmega128::AvrDevice_atmega128(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_atmega8::AvrDevice_atmega8(), and AvrDevice_attiny2313::AvrDevice_attiny2313().