|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Blocking variants of the timer control functions. More...
Functions | |
| stk_timer_result_t | stk_timer_start_sync (stk_timerhost_t *host, stk_timer_t *tmr, uint32_t delay, uint32_t period) |
| Start a timer and wait for the result. | |
| stk_timer_result_t | stk_timer_activate_sync (stk_timerhost_t *host, stk_timer_t *tmr) |
| Start a timer with the delay and period stored in it and wait for the result. | |
| stk_timer_result_t | stk_timer_stop_sync (stk_timerhost_t *host, stk_timer_t *tmr) |
| Stop a timer and wait for the result. | |
| stk_timer_result_t | stk_timer_restart_sync (stk_timerhost_t *host, stk_timer_t *tmr, uint32_t delay, uint32_t period) |
| Atomically stop and re-start a timer and wait for the result. | |
| stk_timer_result_t | stk_timer_reset_sync (stk_timerhost_t *host, stk_timer_t *tmr) |
| Reset a periodic timer's deadline (re-arm from now) and wait for the result. | |
| stk_timer_result_t | stk_timer_set_period_sync (stk_timerhost_t *host, stk_timer_t *tmr, uint32_t period_ticks) |
| Change the period of a running periodic timer without affecting the current deadline and wait for the result. | |
| stk_timer_result_t | stk_timer_change_sync (stk_timerhost_t *host, stk_timer_t *tmr, uint32_t delay, uint32_t period) |
| Change the delay and period of an inactive timer and wait for the result. | |
| stk_timer_result_t | stk_timer_query_sync (stk_timerhost_t *host, stk_timer_t *tmr, stk_timer_info_t *info) |
| Get a consistent snapshot of a timer (evaluated by the tick task). | |
Blocking variants of the timer control functions.
The asynchronous functions above only queue a request and report whether it was accepted. The functions below queue the same command together with a completion point and block the caller until the tick task has executed it, so the result is the exact outcome of the command (e.g. STK_TIMER_RES_ACTIVE for a timer which was already active).
| stk_timer_result_t stk_timer_activate_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr ) |
Start a timer with the delay and period stored in it and wait for the result.
| [in] | host | TimerHost that will manage this timer. |
| [in] | tmr | Timer handle. Must not be active. |
Definition at line 351 of file stk_c_time.cpp.
References stk::time::TimerHost::ActivateSync(), stk_timerhost_t::handle, stk_timer_t::SetHostHandle(), and STK_ASSERT.
| stk_timer_result_t stk_timer_change_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr, | ||
| uint32_t | delay, | ||
| uint32_t | period ) |
Change the delay and period of an inactive timer and wait for the result.
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle. Must not be active. |
| [in] | delay | New initial delay in ticks. |
| [in] | period | New reload period in ticks, 0 for a one-shot timer. |
Definition at line 397 of file stk_c_time.cpp.
References stk::time::TimerHost::ChangeSync(), stk_timerhost_t::handle, stk_timer_t::SetHostHandle(), and STK_ASSERT.
| stk_timer_result_t stk_timer_query_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr, | ||
| stk_timer_info_t * | info ) |
Get a consistent snapshot of a timer (evaluated by the tick task).
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle. |
| [out] | info | Snapshot, valid if the result is STK_TIMER_RES_OK. |
Definition at line 408 of file stk_c_time.cpp.
References stk::time::TimerHost::TimerInfo::active, stk_timer_info_t::active, stk::time::TimerHost::TimerInfo::delay, stk_timer_info_t::delay, stk_timerhost_t::handle, stk::time::TimerHost::TimerInfo::period, stk_timer_info_t::period, stk::time::TimerHost::QuerySync(), stk::time::TimerHost::TimerInfo::remaining, stk_timer_info_t::remaining, stk::time::TimerHost::RES_OK, and STK_ASSERT.
| stk_timer_result_t stk_timer_reset_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr ) |
Reset a periodic timer's deadline (re-arm from now) and wait for the result.
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle. Must be active and periodic. |
Definition at line 381 of file stk_c_time.cpp.
References stk_timerhost_t::handle, stk::time::TimerHost::ResetSync(), and STK_ASSERT.
| stk_timer_result_t stk_timer_restart_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr, | ||
| uint32_t | delay, | ||
| uint32_t | period ) |
Atomically stop and re-start a timer and wait for the result.
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle (active or inactive). |
| [in] | delay | Initial delay in ticks before the first expiration (stored in the timer). |
| [in] | period | Reload period in ticks, 0 for a one-shot timer (stored in the timer). |
Definition at line 370 of file stk_c_time.cpp.
References stk_timerhost_t::handle, stk::time::TimerHost::RestartSync(), stk_timer_t::SetHostHandle(), and STK_ASSERT.
| stk_timer_result_t stk_timer_set_period_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr, | ||
| uint32_t | period_ticks ) |
Change the period of a running periodic timer without affecting the current deadline and wait for the result.
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle. Must be active and periodic. |
| [in] | period_ticks | New reload period in ticks. Must be non-zero. |
Definition at line 389 of file stk_c_time.cpp.
References stk_timerhost_t::handle, stk::time::TimerHost::SetPeriodSync(), and STK_ASSERT.
| stk_timer_result_t stk_timer_start_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr, | ||
| uint32_t | delay, | ||
| uint32_t | period ) |
Start a timer and wait for the result.
| [in] | host | TimerHost that will manage this timer. |
| [in] | tmr | Timer handle. Must not be active. |
| [in] | delay | Initial delay in ticks before the first expiration (stored in the timer). |
| [in] | period | Reload period in ticks, 0 for a one-shot timer (stored in the timer). |
Definition at line 337 of file stk_c_time.cpp.
References stk_timerhost_t::handle, stk_timer_t::SetHostHandle(), stk::time::TimerHost::StartSync(), and STK_ASSERT.
| stk_timer_result_t stk_timer_stop_sync | ( | stk_timerhost_t * | host, |
| stk_timer_t * | tmr ) |
Stop a timer and wait for the result.
| [in] | host | TimerHost managing the timer. |
| [in] | tmr | Timer handle. |
Definition at line 362 of file stk_c_time.cpp.
References stk_timerhost_t::handle, STK_ASSERT, and stk::time::TimerHost::StopSync().