simulavr  1.1.0
TimerTinyX5_OCR Class Reference

PWM output unit for timer 1 on ATtiny25/45/85. More...

#include <hwtimer.h>

Public Member Functions

 TimerTinyX5_OCR (const PinAtPort &pinOut, const PinAtPort &pinOutInv)
 
void Reset ()
 Reset internal states on device reset. More...
 
void DTClockCycle ()
 Run one clock cycle from dead time prescaler. More...
 
void TimerEvent (bool isCompareEvent)
 OCR event. More...
 
void ForceEvent ()
 Manual change of OCR unit by force bit. More...
 
void SetDeadTime (int highTime, int lowTime)
 Configure dead time counter. More...
 
void SetOCRMode (bool isPWM, int comMode)
 Configure OCR mode. More...
 

Private Member Functions

void SetPWM (bool isCompareEvent)
 Calculate output pin value (before dead time generator) More...
 
void SetDeadTime (bool pwmValue)
 Calculate output pin value after dead time generator. More...
 

Private Attributes

PinAtPort outPin
 normal output pin for OCR unit More...
 
PinAtPort outPinInv
 inverted output pin for OCR unit More...
 
int ocrComMode
 COM mode. More...
 
bool ocrPWM
 flag, if OCR unit is in PWM mode More...
 
bool ocrOut
 OCR status before dead time generator. More...
 
int dtHigh
 dead time raise delay More...
 
int dtLow
 dead time fall delay More...
 
int dtCounter
 dead time counter More...
 

Detailed Description

PWM output unit for timer 1 on ATtiny25/45/85.

Supports the different output control modes for a OCR unit on timer 1 in ATtiny25/45/85 devices, contains also implementation of dead time generator

Definition at line 702 of file hwtimer.h.

Constructor & Destructor Documentation

◆ TimerTinyX5_OCR()

TimerTinyX5_OCR::TimerTinyX5_OCR ( const PinAtPort pinOut,
const PinAtPort pinOutInv 
)

Definition at line 1745 of file hwtimer.cpp.

References HWTimerTinyX5::Reset().

Member Function Documentation

◆ DTClockCycle()

void TimerTinyX5_OCR::DTClockCycle ( )

Run one clock cycle from dead time prescaler.

Definition at line 1761 of file hwtimer.cpp.

Referenced by HWTimerTinyX5::TimerCounter().

◆ ForceEvent()

void TimerTinyX5_OCR::ForceEvent ( )
inline

Manual change of OCR unit by force bit.

Definition at line 733 of file hwtimer.h.

Referenced by HWTimerTinyX5::TransferInputValues().

◆ Reset()

void TimerTinyX5_OCR::Reset ( void  )

Reset internal states on device reset.

Definition at line 1752 of file hwtimer.cpp.

Referenced by HWTimerTinyX5::Reset().

◆ SetDeadTime() [1/2]

void TimerTinyX5_OCR::SetDeadTime ( bool  pwmValue)
private

Calculate output pin value after dead time generator.

Definition at line 1872 of file hwtimer.cpp.

Referenced by HWTimerTinyX5::TransferInputValues().

◆ SetDeadTime() [2/2]

void TimerTinyX5_OCR::SetDeadTime ( int  highTime,
int  lowTime 
)
inline

Configure dead time counter.

Definition at line 736 of file hwtimer.h.

◆ SetOCRMode()

void TimerTinyX5_OCR::SetOCRMode ( bool  isPWM,
int  comMode 
)

Configure OCR mode.

Definition at line 1774 of file hwtimer.cpp.

Referenced by HWTimerTinyX5::TransferInputValues().

◆ SetPWM()

void TimerTinyX5_OCR::SetPWM ( bool  isCompareEvent)
private

Calculate output pin value (before dead time generator)

Definition at line 1801 of file hwtimer.cpp.

◆ TimerEvent()

void TimerTinyX5_OCR::TimerEvent ( bool  isCompareEvent)
inline

OCR event.

Definition at line 730 of file hwtimer.h.

Referenced by HWTimerTinyX5::TimerCounter().

Member Data Documentation

◆ dtCounter

int TimerTinyX5_OCR::dtCounter
private

dead time counter

Definition at line 712 of file hwtimer.h.

◆ dtHigh

int TimerTinyX5_OCR::dtHigh
private

dead time raise delay

Definition at line 710 of file hwtimer.h.

◆ dtLow

int TimerTinyX5_OCR::dtLow
private

dead time fall delay

Definition at line 711 of file hwtimer.h.

◆ ocrComMode

int TimerTinyX5_OCR::ocrComMode
private

COM mode.

Definition at line 707 of file hwtimer.h.

◆ ocrOut

bool TimerTinyX5_OCR::ocrOut
private

OCR status before dead time generator.

Definition at line 709 of file hwtimer.h.

◆ ocrPWM

bool TimerTinyX5_OCR::ocrPWM
private

flag, if OCR unit is in PWM mode

Definition at line 708 of file hwtimer.h.

◆ outPin

PinAtPort TimerTinyX5_OCR::outPin
private

normal output pin for OCR unit

Definition at line 704 of file hwtimer.h.

◆ outPinInv

PinAtPort TimerTinyX5_OCR::outPinInv
private

inverted output pin for OCR unit

Definition at line 705 of file hwtimer.h.


The documentation for this class was generated from the following files: