FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
timer::RTTRawTime< T > Class Template Reference

Utility class to avoid costly instantiation of time::RTTTime from an interrupt routine. More...

#include <fastarduino/realtime_timer.h>

Public Member Functions

 RTTRawTime (uint32_t millis, T counter, T max_counter)
 Create a new RTTRawTime from millis milliseconds, and values from Timer counter value that will allow microseconds calculation later on. More...
 
time::RTTTime as_real_time () const
 Convert this RTTRawTime instance to a fully usable time::RTTTime. More...
 

Static Public Attributes

static constexpr RTTRawTime< T > EMPTY_TIME {}
 A constant to signify "no time". More...
 

Detailed Description

template<typename T>
class timer::RTTRawTime< T >

Utility class to avoid costly instantiation of time::RTTTime from an interrupt routine.

It can be later (outside an ISR) converted into a real time::RTTTime.

It is usually created from raw Timer registers values. This type shall usually not be directly used as RTTRawTime<T> but actually obtained from an RTT<NTIMER> instance, as RTT::RAW_TIME.

Template Parameters
Tthe type of registers for the Timer providing raw values, either uint8_t or uint16_t
See also
time::RTTTime
RTT::RAW_TIME

Definition at line 135 of file realtime_timer.h.

Constructor & Destructor Documentation

◆ RTTRawTime()

template<typename T >
timer::RTTRawTime< T >::RTTRawTime ( uint32_t  millis,
counter,
max_counter 
)
inline

Create a new RTTRawTime from millis milliseconds, and values from Timer counter value that will allow microseconds calculation later on.

Parameters
millisthe milliseconds elapsed as accounted by an RTT instance
counterthe counter of the Timer used by the RTT instance
max_counterthe maximum counter value for the Timer

Definition at line 152 of file realtime_timer.h.

Member Function Documentation

◆ as_real_time()

template<typename T >
time::RTTTime timer::RTTRawTime< T >::as_real_time ( ) const
inline

Convert this RTTRawTime instance to a fully usable time::RTTTime.

This method performs potentially costly computation and hence should not be used inside an ISR.

Definition at line 167 of file realtime_timer.h.

Member Data Documentation

◆ EMPTY_TIME

template<typename T >
constexpr RTTRawTime<T> timer::RTTRawTime< T >::EMPTY_TIME {}
staticconstexpr

A constant to signify "no time".

This constant takes no code to build, compared with RTTRawTime{0, 0, 0}.

Definition at line 160 of file realtime_timer.h.

◆ millis_

template<typename T >
uint32_t timer::RTTRawTime< T >::millis_

Definition at line 182 of file realtime_timer.h.

◆ counter_

template<typename T >
T timer::RTTRawTime< T >::counter_

Definition at line 183 of file realtime_timer.h.

◆ max_counter_

template<typename T >
T timer::RTTRawTime< T >::max_counter_

Definition at line 184 of file realtime_timer.h.

◆ buffer_

template<typename T >
uint8_t timer::RTTRawTime< T >::buffer_[sizeof(uint32_t)+2 *sizeof(T)]

Definition at line 186 of file realtime_timer.h.


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