#include <mn_itimer.hpp>
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()
|
pure virtual |
Start the timer.
- Parameters
-
timeout How 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()
|
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()
|
pure virtual |
destroy the timer
- Parameters
-
timeout How 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()
|
pure virtual |
◆ get_period()
|
pure virtual |
◆ inactive()
|
pure virtual |
Stop the timer
- Parameters
-
timeout How 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()
|
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()
|
protectedpure virtual |
call befor on_timer
Implemented in mn::esp32::basic_esp32_timer.
◆ on_exit()
|
protectedpure virtual |
call after on_timer
Implemented in mn::esp32::basic_esp32_timer.
◆ on_timer()
|
protectedpure virtual |
Implementation of your actual timer code. You must override this function.
Implemented in mn::esp32::basic_esp32_timer.
◆ operator bool()
|
inlinevirtual |
Reimplemented in mn::esp32::basic_esp32_timer.
◆ reset()
|
pure virtual |
Reset the timer
- Parameters
-
timeout How 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()
|
pure virtual |
Implemented in mn::esp32::basic_esp32_timer.
◆ set_period()
|
pure virtual |
Change a timer's period.
- Parameters
-
uiNewPeriod The new period in ticks. timeout How 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: