base class for the timer class
More...
#include <timer.hpp>
base class for the timer class
Definition at line 24 of file timer.hpp.
◆ timer_base() [1/3]
zpp::timer_base::timer_base |
( |
| ) |
|
|
inlineprotectednoexcept |
◆ ~timer_base()
zpp::timer_base::~timer_base |
( |
| ) |
|
|
inline |
Destructor that stops the timer.
Definition at line 33 of file timer.hpp.
void stop() noexcept
Stop the timer.
References stop().
◆ timer_base() [2/3]
zpp::timer_base::timer_base |
( |
const timer_base & |
| ) |
|
|
delete |
◆ timer_base() [3/3]
◆ native_handle()
auto zpp::timer_base::native_handle |
( |
| ) |
|
|
inlinenoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ remaining_time()
std::chrono::nanoseconds zpp::timer_base::remaining_time |
( |
| ) |
|
|
inlinenoexcept |
Get remaining time.
- Returns
- the remaining time
Definition at line 97 of file timer.hpp.
99 auto t = k_timer_remaining_ticks(&m_timer);
100 return std::chrono::nanoseconds(k_ticks_to_ns_floor64(t));
◆ start() [1/2]
template<class T_Rep , class T_Period >
void zpp::timer_base::start |
( |
const std::chrono::duration< T_Rep, T_Period > & |
duration | ) |
|
|
inlinenoexcept |
Start a single shot timer with duration.
- Parameters
-
Definition at line 59 of file timer.hpp.
61 using namespace std::chrono;
63 k_timer_start(&m_timer,
to_timeout(duration), K_NO_WAIT);
constexpr k_timeout_t to_timeout(const std::chrono::duration< T_Rep, T_Period > &d) noexcept
convert a duration to tick
References zpp::to_timeout().
◆ start() [2/2]
template<class T_Rep1 , class T_Period1 , class T_Rep2 , class T_Period2 >
void zpp::timer_base::start |
( |
const std::chrono::duration< T_Rep1, T_Period1 > & |
duration, |
|
|
const std::chrono::duration< T_Rep2, T_Period2 > & |
period |
|
) |
| |
|
inlinenoexcept |
Start a timer with duration and period.
- Parameters
-
duration | The first time out |
period | the time of the repeat period |
Definition at line 45 of file timer.hpp.
48 using namespace std::chrono;
References zpp::to_timeout().
◆ status()
auto zpp::timer_base::status |
( |
| ) |
|
|
inlinenoexcept |
get the timer status
- Returns
- the timer status
Definition at line 79 of file timer.hpp.
81 return k_timer_status_get(&m_timer);
◆ stop()
void zpp::timer_base::stop |
( |
| ) |
|
|
inlinenoexcept |
◆ sync()
auto zpp::timer_base::sync |
( |
| ) |
|
|
inlinenoexcept |
sync with the timer
Definition at line 87 of file timer.hpp.
89 return k_timer_status_sync(&m_timer);
The documentation for this class was generated from the following file: