Extends BasicTimerUnit to provide common support to all types of 16Bit timer units. More...
#include <hwtimer.h>
Public Member Functions | |
HWTimer16 (AvrDevice *core, PrescalerMultiplexer *p, int unit, IRQLine *tov, IRQLine *tcompA, PinAtPort *outA, IRQLine *tcompB, PinAtPort *outB, IRQLine *tcompC, PinAtPort *outC, IRQLine *ticap, ICaptureSource *icapsrc) | |
void | Reset (void) |
Perform a reset of this unit. | |
Public Attributes | |
IOReg< HWTimer16 > | tcnt_h_reg |
counter register, high byte | |
IOReg< HWTimer16 > | tcnt_l_reg |
counter register, low byte | |
IOReg< HWTimer16 > | ocra_h_reg |
output compare A register, high byte | |
IOReg< HWTimer16 > | ocra_l_reg |
output compare A register, low byte | |
IOReg< HWTimer16 > | ocrb_h_reg |
output compare B register, high byte | |
IOReg< HWTimer16 > | ocrb_l_reg |
output compare B register, low byte | |
IOReg< HWTimer16 > | ocrc_h_reg |
output compare C register, high byte | |
IOReg< HWTimer16 > | ocrc_l_reg |
output compare C register, low byte | |
IOReg< HWTimer16 > | icr_h_reg |
input capture register, high byte | |
IOReg< HWTimer16 > | icr_l_reg |
input capture register, low byte | |
Protected Member Functions | |
void | SetCompareRegister (int idx, bool high, unsigned char val) |
Setter method for compare register. | |
unsigned char | GetCompareRegister (int idx, bool high) |
Getter method for compare register. | |
void | SetComplexRegister (bool is_icr, bool high, unsigned char val) |
Setter method for TCNT and ICR register. | |
unsigned char | GetComplexRegister (bool is_icr, bool high) |
Getter method for TCNT and ICR register. | |
void | ChangeWGM (WGMtype mode) |
Change WGM mode, set counter limits. | |
void | Set_TCNTH (unsigned char val) |
Register access to set counter register high byte. | |
unsigned char | Get_TCNTH () |
Register access to read counter register high byte. | |
void | Set_TCNTL (unsigned char val) |
Register access to set counter register low byte. | |
unsigned char | Get_TCNTL () |
Register access to read counter register low byte. | |
void | Set_OCRAH (unsigned char val) |
Register access to set output compare register A high byte. | |
unsigned char | Get_OCRAH () |
Register access to read output compare register A high byte. | |
void | Set_OCRAL (unsigned char val) |
Register access to set output compare register A low byte. | |
unsigned char | Get_OCRAL () |
Register access to read output compare register A low byte. | |
void | Set_OCRBH (unsigned char val) |
Register access to set output compare register B high byte. | |
unsigned char | Get_OCRBH () |
Register access to read output compare register B high byte. | |
void | Set_OCRBL (unsigned char val) |
Register access to set output compare register B low byte. | |
unsigned char | Get_OCRBL () |
Register access to read output compare register B low byte. | |
void | Set_OCRCH (unsigned char val) |
Register access to set output compare register C high byte. | |
unsigned char | Get_OCRCH () |
Register access to read output compare register C high byte. | |
void | Set_OCRCL (unsigned char val) |
Register access to set output compare register C low byte. | |
unsigned char | Get_OCRCL () |
Register access to read output compare register C low byte. | |
void | Set_ICRH (unsigned char val) |
Register access to set input capture register high byte. | |
unsigned char | Get_ICRH () |
Register access to read input capture register high byte. | |
void | Set_ICRL (unsigned char val) |
Register access to set input capture register low byte. | |
unsigned char | Get_ICRL () |
Register access to read input capture register low byte. | |
Protected Attributes | |
unsigned char | accessTempRegister |
the high byte temporary register for read/write access to TCNT and ICR |
Extends BasicTimerUnit to provide common support to all types of 16Bit timer units.
Definition at line 227 of file hwtimer.h.
HWTimer16::HWTimer16 | ( | AvrDevice * | core, | |
PrescalerMultiplexer * | p, | |||
int | unit, | |||
IRQLine * | tov, | |||
IRQLine * | tcompA, | |||
PinAtPort * | outA, | |||
IRQLine * | tcompB, | |||
PinAtPort * | outB, | |||
IRQLine * | tcompC, | |||
PinAtPort * | outC, | |||
IRQLine * | ticap, | |||
ICaptureSource * | icapsrc | |||
) |
Definition at line 658 of file hwtimer.cpp.
References BasicTimerUnit::compare_output, BasicTimerUnit::compareEnable, ocra_h_reg, ocra_l_reg, ocrb_h_reg, ocrb_l_reg, ocrc_h_reg, ocrc_l_reg, IOReg< P >::releaseTraceValue(), Reset(), BasicTimerUnit::timerCompare, BasicTimerUnit::WGM_CTC_ICR, BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_FASTPWM_10BIT, BasicTimerUnit::WGM_FASTPWM_8BIT, BasicTimerUnit::WGM_FASTPWM_9BIT, BasicTimerUnit::WGM_FASTPWM_ICR, BasicTimerUnit::WGM_FASTPWM_OCRA, BasicTimerUnit::WGM_NORMAL, BasicTimerUnit::WGM_PCPWM_10BIT, BasicTimerUnit::WGM_PCPWM_8BIT, BasicTimerUnit::WGM_PCPWM_9BIT, BasicTimerUnit::WGM_PCPWM_ICR, BasicTimerUnit::WGM_PCPWM_OCRA, BasicTimerUnit::WGM_PFCPWM_ICR, BasicTimerUnit::WGM_PFCPWM_OCRA, BasicTimerUnit::wgmfunc, BasicTimerUnit::WGMfunc_ctc(), BasicTimerUnit::WGMfunc_fastpwm(), BasicTimerUnit::WGMfunc_normal(), BasicTimerUnit::WGMfunc_pcpwm(), and BasicTimerUnit::WGMfunc_pfcpwm().
void HWTimer16::ChangeWGM | ( | WGMtype | mode | ) | [protected] |
Change WGM mode, set counter limits.
Definition at line 809 of file hwtimer.cpp.
References BasicTimerUnit::compare, BasicTimerUnit::count_down, BasicTimerUnit::icapRegister, BasicTimerUnit::limit_max, BasicTimerUnit::limit_top, BasicTimerUnit::updown_counting, BasicTimerUnit::wgm, BasicTimerUnit::WGM_CTC_ICR, BasicTimerUnit::WGM_CTC_OCRA, BasicTimerUnit::WGM_FASTPWM_10BIT, BasicTimerUnit::WGM_FASTPWM_8BIT, BasicTimerUnit::WGM_FASTPWM_9BIT, BasicTimerUnit::WGM_FASTPWM_ICR, BasicTimerUnit::WGM_FASTPWM_OCRA, BasicTimerUnit::WGM_NORMAL, BasicTimerUnit::WGM_PCPWM_10BIT, BasicTimerUnit::WGM_PCPWM_8BIT, BasicTimerUnit::WGM_PCPWM_9BIT, BasicTimerUnit::WGM_PCPWM_ICR, BasicTimerUnit::WGM_PCPWM_OCRA, BasicTimerUnit::WGM_PFCPWM_ICR, and BasicTimerUnit::WGM_PFCPWM_OCRA.
Referenced by HWTimer16_3C::Set_TCCRA(), HWTimer16_2C3::Set_TCCRA(), HWTimer16_3C::Set_TCCRB(), HWTimer16_2C3::Set_TCCRB(), HWTimer16_2C2::Set_WGM(), and HWTimer16_1C::Set_WGM().
unsigned char HWTimer16::Get_ICRH | ( | ) | [inline, protected] |
Register access to read input capture register high byte.
Definition at line 284 of file hwtimer.h.
References GetComplexRegister().
unsigned char HWTimer16::Get_ICRL | ( | ) | [inline, protected] |
Register access to read input capture register low byte.
Definition at line 288 of file hwtimer.h.
References GetComplexRegister().
unsigned char HWTimer16::Get_OCRAH | ( | ) | [inline, protected] |
Register access to read output compare register A high byte.
Definition at line 257 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_OCRAL | ( | ) | [inline, protected] |
Register access to read output compare register A low byte.
Definition at line 261 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_OCRBH | ( | ) | [inline, protected] |
Register access to read output compare register B high byte.
Definition at line 266 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_OCRBL | ( | ) | [inline, protected] |
Register access to read output compare register B low byte.
Definition at line 270 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_OCRCH | ( | ) | [inline, protected] |
Register access to read output compare register C high byte.
Definition at line 275 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_OCRCL | ( | ) | [inline, protected] |
Register access to read output compare register C low byte.
Definition at line 279 of file hwtimer.h.
References GetCompareRegister().
unsigned char HWTimer16::Get_TCNTH | ( | ) | [inline, protected] |
Register access to read counter register high byte.
Definition at line 248 of file hwtimer.h.
References GetComplexRegister().
unsigned char HWTimer16::Get_TCNTL | ( | ) | [inline, protected] |
Register access to read counter register low byte.
Definition at line 252 of file hwtimer.h.
References GetComplexRegister().
unsigned char HWTimer16::GetCompareRegister | ( | int | idx, | |
bool | high | |||
) | [protected] |
Getter method for compare register.
Definition at line 764 of file hwtimer.cpp.
References BasicTimerUnit::compare, BasicTimerUnit::compare_dbl, and BasicTimerUnit::WGMisPWM().
Referenced by Get_OCRAH(), Get_OCRAL(), Get_OCRBH(), Get_OCRBL(), Get_OCRCH(), and Get_OCRCL().
unsigned char HWTimer16::GetComplexRegister | ( | bool | is_icr, | |
bool | high | |||
) | [protected] |
Getter method for TCNT and ICR register.
Definition at line 795 of file hwtimer.cpp.
References accessTempRegister, BasicTimerUnit::icapRegister, and BasicTimerUnit::vtcnt.
Referenced by Get_ICRH(), Get_ICRL(), Get_TCNTH(), and Get_TCNTL().
void HWTimer16::Reset | ( | void | ) | [virtual] |
Perform a reset of this unit.
Reimplemented from BasicTimerUnit.
Reimplemented in HWTimer16_1C, HWTimer16_2C2, HWTimer16_2C3, and HWTimer16_3C.
Definition at line 739 of file hwtimer.cpp.
References accessTempRegister.
Referenced by HWTimer16().
void HWTimer16::Set_ICRH | ( | unsigned char | val | ) | [inline, protected] |
Register access to set input capture register high byte.
Definition at line 282 of file hwtimer.h.
References SetComplexRegister().
void HWTimer16::Set_ICRL | ( | unsigned char | val | ) | [inline, protected] |
Register access to set input capture register low byte.
Definition at line 286 of file hwtimer.h.
References SetComplexRegister().
void HWTimer16::Set_OCRAH | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register A high byte.
Definition at line 255 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_OCRAL | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register A low byte.
Definition at line 259 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_OCRBH | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register B high byte.
Definition at line 264 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_OCRBL | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register B low byte.
Definition at line 268 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_OCRCH | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register C high byte.
Definition at line 273 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_OCRCL | ( | unsigned char | val | ) | [inline, protected] |
Register access to set output compare register C low byte.
Definition at line 277 of file hwtimer.h.
References SetCompareRegister().
void HWTimer16::Set_TCNTH | ( | unsigned char | val | ) | [inline, protected] |
Register access to set counter register high byte.
Definition at line 246 of file hwtimer.h.
References SetComplexRegister().
void HWTimer16::Set_TCNTL | ( | unsigned char | val | ) | [inline, protected] |
Register access to set counter register low byte.
Definition at line 250 of file hwtimer.h.
References SetComplexRegister().
void HWTimer16::SetCompareRegister | ( | int | idx, | |
bool | high, | |||
unsigned char | val | |||
) | [protected] |
Setter method for compare register.
Definition at line 745 of file hwtimer.cpp.
References accessTempRegister, BasicTimerUnit::compare, BasicTimerUnit::compare_dbl, BasicTimerUnit::limit_top, BasicTimerUnit::wgm, BasicTimerUnit::WGM_CTC_OCRA, and BasicTimerUnit::WGMisPWM().
Referenced by Set_OCRAH(), Set_OCRAL(), Set_OCRBH(), Set_OCRBL(), Set_OCRCH(), and Set_OCRCL().
void HWTimer16::SetComplexRegister | ( | bool | is_icr, | |
bool | high, | |||
unsigned char | val | |||
) | [protected] |
Setter method for TCNT and ICR register.
Definition at line 776 of file hwtimer.cpp.
References accessTempRegister, avr_warning, BasicTimerUnit::icapRegister, BasicTimerUnit::limit_top, BasicTimerUnit::SetCounter(), BasicTimerUnit::wgm, BasicTimerUnit::WGM_FASTPWM_ICR, and BasicTimerUnit::WGMuseICR().
Referenced by Set_ICRH(), Set_ICRL(), Set_TCNTH(), and Set_TCNTL().
unsigned char HWTimer16::accessTempRegister [protected] |
the high byte temporary register for read/write access to TCNT and ICR
Definition at line 231 of file hwtimer.h.
Referenced by GetComplexRegister(), Reset(), SetCompareRegister(), and SetComplexRegister().
input capture register, high byte
Definition at line 299 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().
input capture register, low byte
Definition at line 300 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().
output compare A register, high byte
Definition at line 293 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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer16().
output compare A register, low byte
Definition at line 294 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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer16().
output compare B register, high byte
Definition at line 295 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), 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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer16().
output compare B register, low byte
Definition at line 296 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), 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(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and HWTimer16().
output compare C register, high byte
Definition at line 297 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega128::AvrDevice_atmega128(), and HWTimer16().
output compare C register, low byte
Definition at line 298 of file hwtimer.h.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega128::AvrDevice_atmega128(), and HWTimer16().
counter register, high byte
Definition at line 291 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().
counter register, low byte
Definition at line 292 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().