distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper Struct Reference

wrapper for software timer More...

Public Member Functions

 SoftwareTimerWrapper (volatile uint32_t &value)
 SoftwareTimerWrapper's constructor. More...
 
SoftwareTimerget ()
 
bool getStateInFunction () const
 
void requestRestart (const TickClock::time_point timePoint, const TickClock::duration period={})
 Requests timer's function to restart the timer. More...
 
void requestStop ()
 Requests timer's function to stop the timer. More...
 

Private Types

using SoftwareTimerType = decltype(makeStaticSoftwareTimer(&SoftwareTimerWrapper::function, std::ref(std::declval< SoftwareTimerWrapper & >())))
 type of internal software timer More...
 

Private Member Functions

void function ()
 Function used by software timer. More...
 

Private Attributes

SoftwareTimerType softwareTimer_
 internal software timer More...
 
TickClock::time_point timePoint_
 time point used to restart timer More...
 
TickClock::duration period_
 period used to restart timer More...
 
volatile uint32_t & value_
 reference to volatile uint32_t variable which will be incremented when timer's function is executed More...
 
bool stateInFunction_
 result of SoftwareTimer::isRunning() executed at the end of timer's function More...
 
bool stopRequested_
 true if timer's function was requested to stop the timer, false otherwise More...
 

Detailed Description

wrapper for software timer

Member Typedef Documentation

◆ SoftwareTimerType

using distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::SoftwareTimerType = decltype(makeStaticSoftwareTimer(&SoftwareTimerWrapper::function, std::ref(std::declval<SoftwareTimerWrapper&>())))
private

type of internal software timer

Constructor & Destructor Documentation

◆ SoftwareTimerWrapper()

distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::SoftwareTimerWrapper ( volatile uint32_t &  value)
inlineexplicit

SoftwareTimerWrapper's constructor.

Parameters
[in,out]valueis a reference to volatile uint32_t variable which will be incremented when timer's function is executed
Here is the call graph for this function:

Member Function Documentation

◆ function()

void distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::function ( )
inlineprivate

Function used by software timer.

Here is the call graph for this function:

◆ get()

SoftwareTimer& distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::get ( )
inline
Returns
reference to internal software timer

◆ getStateInFunction()

bool distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::getStateInFunction ( ) const
inline
Returns
result of SoftwareTimer::isRunning() executed at the end of timer's function

◆ requestRestart()

void distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::requestRestart ( const TickClock::time_point  timePoint,
const TickClock::duration  period = {} 
)
inline

Requests timer's function to restart the timer.

Parameters
[in]timePointis the time point used to restart timer
[in]periodis the period used to restart timer, 0 for one-shot software timers, default - 0

◆ requestStop()

void distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::requestStop ( )
inline

Requests timer's function to stop the timer.

Member Data Documentation

◆ period_

TickClock::duration distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::period_
private

period used to restart timer

◆ softwareTimer_

SoftwareTimerType distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::softwareTimer_
private

internal software timer

◆ stateInFunction_

bool distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::stateInFunction_
private

result of SoftwareTimer::isRunning() executed at the end of timer's function

◆ stopRequested_

bool distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::stopRequested_
private

true if timer's function was requested to stop the timer, false otherwise

◆ timePoint_

TickClock::time_point distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::timePoint_
private

time point used to restart timer

◆ value_

volatile uint32_t& distortos::test::anonymous_namespace{SoftwareTimerOperationsTestCase.cpp}::SoftwareTimerWrapper::value_
private

reference to volatile uint32_t variable which will be incremented when timer's function is executed


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