![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Pure C interface for stk::time::PeriodicTrigger. More...
Classes | |
| struct | stk_periodic_trigger_mem_t |
| Opaque memory container for a stk_periodic_trigger_t instance. More... | |
Macros | |
| #define | STK_PERIODIC_TRIGGER_IMPL_SIZE 16 |
| A memory size (multiples of size_t) required for PeriodicTrigger instance. | |
Typedefs | |
| typedef struct stk_periodic_trigger_mem_t | stk_periodic_trigger_mem_t |
| Opaque memory container for a stk_periodic_trigger_t instance. | |
| typedef struct stk_periodic_trigger_t | stk_periodic_trigger_t |
| Opaque handle to a stk::time::PeriodicTrigger instance. | |
Functions | |
| stk_periodic_trigger_t * | stk_periodic_trigger_create (stk_periodic_trigger_mem_t *memory, uint32_t memory_size, uint32_t period, bool started) |
| Construct PeriodicTrigger instance in the supplied memory buffer. | |
| void | stk_periodic_trigger_destroy (stk_periodic_trigger_t *trig) |
| Destroy instance (calls the C++ destructor in-place). | |
| bool | stk_periodic_trigger_poll (stk_periodic_trigger_t *trig) |
| Check whether the scheduled trigger time has been reached. | |
| void | stk_periodic_trigger_set_period (stk_periodic_trigger_t *trig, uint32_t period) |
| Change the trigger period while preserving phase. | |
| void | stk_periodic_trigger_restart (stk_periodic_trigger_t *trig) |
| Reset and start the trigger from the current tick count. | |
| uint32_t | stk_periodic_trigger_get_period (const stk_periodic_trigger_t *trig) |
| Get currently configured trigger period. | |
Pure C interface for stk::time::PeriodicTrigger.
Typical usage:
| #define STK_PERIODIC_TRIGGER_IMPL_SIZE 16 |
A memory size (multiples of size_t) required for PeriodicTrigger instance.
Definition at line 287 of file stk_c_time.h.
| typedef struct stk_periodic_trigger_mem_t stk_periodic_trigger_mem_t |
Opaque memory container for a stk_periodic_trigger_t instance.
static or on the stack (not on the heap). | typedef struct stk_periodic_trigger_t stk_periodic_trigger_t |
Opaque handle to a stk::time::PeriodicTrigger instance.
Definition at line 298 of file stk_c_time.h.
| stk_periodic_trigger_t * stk_periodic_trigger_create | ( | stk_periodic_trigger_mem_t * | memory, |
| uint32_t | memory_size, | ||
| uint32_t | period, | ||
| bool | started ) |
Construct PeriodicTrigger instance in the supplied memory buffer.
| [in] | memory | Pointer to the caller-supplied memory container. |
| [in] | memory_size | Size of the container in bytes (must be >= sizeof(stk_periodic_trigger_mem_t)). |
| [in] | period | Trigger period in ticks. Must be > 0. |
| [in] | started | true to create instance in a started state, false otherwise. |
NULL if memory is NULL or memory_size is too small. Definition at line 340 of file stk_c_time.cpp.
References stk_periodic_trigger_mem_t::data, and STK_ASSERT.
| void stk_periodic_trigger_destroy | ( | stk_periodic_trigger_t * | trig | ) |
Destroy instance (calls the C++ destructor in-place).
| [in] | trig | Trigger handle. May be NULL (no-op). |
Definition at line 353 of file stk_c_time.cpp.
| uint32_t stk_periodic_trigger_get_period | ( | const stk_periodic_trigger_t * | trig | ) |
Get currently configured trigger period.
| [in] | trig | Trigger handle. |
Definition at line 380 of file stk_c_time.cpp.
References stk::time::PeriodicTrigger::GetPeriod(), stk_periodic_trigger_t::handle, and STK_ASSERT.
| bool stk_periodic_trigger_poll | ( | stk_periodic_trigger_t * | trig | ) |
Check whether the scheduled trigger time has been reached.
| [in] | trig | Trigger handle (must be started). |
true once when the current tick count reaches or exceeds the scheduled trigger time, false otherwise. true is returned per call. If multiple full periods have elapsed since the previous call, subsequent calls will continue advancing one period at a time until the schedule catches up. Definition at line 359 of file stk_c_time.cpp.
References stk_periodic_trigger_t::handle, stk::time::PeriodicTrigger::Poll(), and STK_ASSERT.
| void stk_periodic_trigger_restart | ( | stk_periodic_trigger_t * | trig | ) |
Reset and start the trigger from the current tick count.
| [in] | trig | Trigger handle. |
Definition at line 373 of file stk_c_time.cpp.
References stk_periodic_trigger_t::handle, stk::time::PeriodicTrigger::Restart(), and STK_ASSERT.
| void stk_periodic_trigger_set_period | ( | stk_periodic_trigger_t * | trig, |
| uint32_t | period ) |
Change the trigger period while preserving phase.
| [in] | trig | Trigger handle. |
| [in] | period | New trigger period in ticks. Must be > 0. |
Definition at line 366 of file stk_c_time.cpp.
References stk_periodic_trigger_t::handle, stk::time::PeriodicTrigger::SetPeriod(), and STK_ASSERT.