#include <mn_itimer.hpp>

+ Inheritance diagram for mn::ITimer:

Public Member Functions

virtual int create ()=0
 
virtual int destroy (unsigned int timeout=(unsigned int) 0xffffffffUL)=0
 
virtual int active (unsigned int timeout=(unsigned int) 0xffffffffUL)=0
 
virtual int inactive (unsigned int timeout=(unsigned int) 0xffffffffUL)=0
 
virtual int reset (unsigned int timeout=(unsigned int) 0xffffffffUL)=0
 
virtual bool set_period (unsigned int uiNewPeriod, unsigned int timeout=(unsigned int) 0xffffffffUL)=0
 
virtual unsigned int get_period ()=0
 
virtual void * get_handle ()=0
 
virtual void set_id (int nId)=0
 
virtual bool is_running ()=0
 
virtual operator bool ()
 

Protected Member Functions

virtual void on_timer ()=0
 
virtual void on_enter ()=0
 
virtual void on_exit ()=0
 

Detailed Description

Basic Interface for all timers in the library

Member Function Documentation

◆ active()

virtual int mn::ITimer::active ( unsigned int  timeout = (unsigned int) 0xffffffffUL)
pure virtual

Start the timer.

Parameters
timeoutHow long to wait
Returns
ERR_TIMER_OK All okay, no error ERR_TIMER_NOTCREATED the timer are not created, plaese call create() first ERR_TIMER_AKTIVATE if it will not (i.e. timeout).

Implemented in mn::esp32::basic_esp32_timer.

◆ create()

virtual int mn::ITimer::create ( )
pure virtual

Create the timer

Note
Timers are not active after they are created, you need to activate them via active, reset, etc.
Returns
ERR_TIMER_OK No error, ERR_TIMER_ALREADYINIT The timer are allready created and ERR_TIMER_CANTCREATE on error on create the FreeRTOS Timer

Implemented in mn::esp32::basic_esp32_timer.

◆ destroy()

virtual int mn::ITimer::destroy ( unsigned int  timeout = (unsigned int) 0xffffffffUL)
pure virtual

destroy the timer

Parameters
timeoutHow long to wait
Returns
ERR_TIMER_OK No error, ERR_TIMER_NOTCREATED the timer are not created, plaese call create() first

Implemented in mn::esp32::basic_esp32_timer.

◆ get_handle()

virtual void* mn::ITimer::get_handle ( )
pure virtual

Get the timer handle

Returns
The timer handle

Implemented in mn::esp32::basic_esp32_timer.

◆ get_period()

virtual unsigned int mn::ITimer::get_period ( )
pure virtual

Get the timer's period

Returns
The timer's period

Implemented in mn::esp32::basic_esp32_timer.

◆ inactive()

virtual int mn::ITimer::inactive ( unsigned int  timeout = (unsigned int) 0xffffffffUL)
pure virtual

Stop the timer

Parameters
timeoutHow long to wait
Returns
ERR_TIMER_OK All okay, no error ERR_TIMER_NOTCREATED the timer are not created, plaese call create() first ERR_TIMER_INAKTIVATE if it will not (i.e. timeout).

Implemented in mn::esp32::basic_esp32_timer.

◆ is_running()

virtual bool mn::ITimer::is_running ( )
pure virtual

Queries a timer to see if it is active or dormant.

Returns
false will be returned if the timer is dormant. And true will be returned if the timer is active.

Implemented in mn::esp32::basic_esp32_timer.

◆ on_enter()

virtual void mn::ITimer::on_enter ( )
protectedpure virtual

call befor on_timer

Implemented in mn::esp32::basic_esp32_timer.

◆ on_exit()

virtual void mn::ITimer::on_exit ( )
protectedpure virtual

call after on_timer

Implemented in mn::esp32::basic_esp32_timer.

◆ on_timer()

virtual void mn::ITimer::on_timer ( )
protectedpure virtual

Implementation of your actual timer code. You must override this function.

Implemented in mn::esp32::basic_esp32_timer.

◆ operator bool()

virtual mn::ITimer::operator bool ( )
inlinevirtual

Reimplemented in mn::esp32::basic_esp32_timer.

◆ reset()

virtual int mn::ITimer::reset ( unsigned int  timeout = (unsigned int) 0xffffffffUL)
pure virtual

Reset the timer

Parameters
timeoutHow long to wait
Returns
ERR_TIMER_OK All okay, no error ERR_TIMER_NOTCREATED the timer are not created, plaese call create() first ERR_TIMER_RESET if it will not (i.e. timeout).

Implemented in mn::esp32::basic_esp32_timer.

◆ set_id()

virtual void mn::ITimer::set_id ( int  nId)
pure virtual

◆ set_period()

virtual bool mn::ITimer::set_period ( unsigned int  uiNewPeriod,
unsigned int  timeout = (unsigned int) 0xffffffffUL 
)
pure virtual

Change a timer's period.

Parameters
uiNewPeriodThe new period in ticks.
timeoutHow long to wait
Returns
true no error, false if it will not (i.e. timeout).

Implemented in mn::esp32::basic_esp32_timer.


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