![]() |
SuperTinyKernel™ RTOS 1.06.0
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Public Member Functions | |
| CTimerWrapper () | |
| void | Initialize (stk_timer_callback_t callback, void *user_data) |
| void | SetHostHandle (stk_timerhost_t *host_handle) |
| void | Reset () |
| stk_timer_callback_t | GetCallback () const |
| void * | GetUserData () const |
| stk_timerhost_t * | GetHostHandle () const |
| void | OnExpired (TimerHost *) |
| bool | IsActive () const |
| Ticks | GetDeadline () const |
| Ticks | GetTimestamp () const |
| uint32_t | GetPeriod () const |
| uint32_t | GetRemainingTime () const |
| Get remaining ticks until the timer next expires. | |
Private Types | |
| typedef DListEntry< Timer, _ClosedLoop > | DLEntryType |
| Convenience alias for this entry type. Used to avoid repeating the full template spelling. | |
| typedef DListHead< Timer, _ClosedLoop > | DLHeadType |
| Convenience alias for the corresponding list head type. | |
Private Member Functions | |
| STK_NONCOPYABLE_CLASS (Timer) | |
| DLHeadType * | GetHead () const |
| Get the list head this entry currently belongs to. | |
| DLEntryType * | GetNext () const |
| Get the next entry in the list. | |
| DLEntryType * | GetPrev () const |
| Get the previous entry in the list. | |
| bool | IsLinked () const |
| Check whether this entry is currently a member of any list. | |
| operator Timer * () | |
| Implicit conversion to a mutable pointer to the host object (T). | |
| operator const Timer * () const | |
| Implicit conversion to a const pointer to the host object (T). | |
| void | Link (DLHeadType *head, DLEntryType *next, DLEntryType *prev) |
| Wire this entry into a list between prev and next. | |
| void | Unlink () |
| Remove this entry from its current list. | |
Private Attributes | |
| stk_timerhost_t * | m_host_handle |
| C-level host, forwarded to the callback. | |
| stk_timer_callback_t | m_callback |
| void * | m_user_data |
| Ticks | m_deadline |
| absolute expiration time (ticks) | |
| Ticks | m_timestamp |
| time at which timer expired (ticks), updated by TimerHost | |
| uint32_t | m_period |
| reload period in ticks (0 = one-shot) | |
| volatile bool | m_active |
| true if active | |
| volatile bool | m_pending |
| true if pending to be handled | |
| DLHeadType * | m_head |
Owning list head, or NULL when the entry is not linked. | |
| DLEntryType * | m_next |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop). | |
| DLEntryType * | m_prev |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop). | |
Definition at line 40 of file stk_c_time.cpp.
|
inherited |
Convenience alias for this entry type. Used to avoid repeating the full template spelling.
Definition at line 70 of file stk_linked_list.h.
|
inherited |
Convenience alias for the corresponding list head type.
Definition at line 75 of file stk_linked_list.h.
|
inline |
Definition at line 43 of file stk_c_time.cpp.
References m_callback, m_host_handle, and m_user_data.
|
inline |
Definition at line 67 of file stk_c_time.cpp.
References m_callback.
|
inlineinherited |
Definition at line 154 of file stk_time_timer.h.
References m_deadline.
Referenced by stk_timer_get_deadline().
|
inlineinherited |
Get the list head this entry currently belongs to.
NULL if the entry is not linked. Definition at line 80 of file stk_linked_list.h.
|
inline |
Definition at line 69 of file stk_c_time.cpp.
References m_host_handle.
|
inlineinherited |
Get the next entry in the list.
NULL if this is the last entry (open list) or the first entry (closed loop, where next wraps to first). _ClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 88 of file stk_linked_list.h.
|
inlineinherited |
Definition at line 156 of file stk_time_timer.h.
References m_period.
Referenced by stk_timer_get_period().
|
inlineinherited |
Get the previous entry in the list.
NULL if this is the first entry (open list) or the last entry (closed loop, where prev wraps to last). _ClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 96 of file stk_linked_list.h.
|
inlineinherited |
Get remaining ticks until the timer next expires.
Definition at line 371 of file stk_time_timer.h.
References stk::GetTicks(), m_active, and m_deadline.
Referenced by stk_timer_get_remaining_time().
|
inlineinherited |
Definition at line 155 of file stk_time_timer.h.
References m_timestamp.
Referenced by stk_timer_get_timestamp().
|
inline |
Definition at line 68 of file stk_c_time.cpp.
References m_user_data.
|
inline |
Definition at line 46 of file stk_c_time.cpp.
References m_callback, m_user_data, and STK_ASSERT.
|
inlineinherited |
Definition at line 153 of file stk_time_timer.h.
References m_active.
Referenced by osTimerDelete(), osTimerStop(), stk_timer_destroy(), and stk_timer_is_active().
|
inlineinherited |
Check whether this entry is currently a member of any list.
true if linked (m_head != NULL); false otherwise. Definition at line 101 of file stk_linked_list.h.
|
inlineprivateinherited |
Wire this entry into a list between prev and next.
| [in] | head | The owning DListHead. Stored as a back-pointer for IsLinked() and ownership checks. |
| [in] | next | The entry that will follow this one, or NULL if this becomes the last entry. |
| [in] | prev | The entry that will precede this one, or NULL if this becomes the first entry. |
Definition at line 137 of file stk_linked_list.h.
|
inlinevirtual |
Implements stk::time::TimerHost::Timer.
Definition at line 71 of file stk_c_time.cpp.
References m_callback, m_host_handle, m_user_data, and stk::time::TimerHost::Timer::TimerHost.
|
inlineinherited |
Implicit conversion to a const pointer to the host object (T).
Definition at line 115 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a mutable pointer to the host object (T).
Definition at line 108 of file stk_linked_list.h.
|
inline |
Definition at line 60 of file stk_c_time.cpp.
References m_callback, m_host_handle, and m_user_data.
Referenced by stk_timer_destroy().
|
inline |
Definition at line 57 of file stk_c_time.cpp.
References m_host_handle.
Referenced by stk_timer_restart(), stk_timer_start(), and stk_timer_start_or_reset().
|
privateinherited |
|
inlineprivateinherited |
Remove this entry from its current list.
Definition at line 157 of file stk_linked_list.h.
|
privateinherited |
true if active
Definition at line 172 of file stk_time_timer.h.
Referenced by GetRemainingTime(), IsActive(), stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::Reset(), stk::time::TimerHost::SetPeriod(), stk::time::TimerHost::Start(), stk::time::TimerHost::Stop(), Timer(), and stk::time::TimerHost::UpdateTime().
|
private |
Definition at line 79 of file stk_c_time.cpp.
Referenced by CTimerWrapper(), GetCallback(), Initialize(), OnExpired(), and Reset().
|
privateinherited |
absolute expiration time (ticks)
Definition at line 169 of file stk_time_timer.h.
Referenced by GetDeadline(), GetRemainingTime(), stk::time::TimerHost::ProcessCommands(), Timer(), and stk::time::TimerHost::UpdateTime().
|
privateinherited |
Owning list head, or NULL when the entry is not linked.
Definition at line 170 of file stk_linked_list.h.
|
private |
C-level host, forwarded to the callback.
Definition at line 78 of file stk_c_time.cpp.
Referenced by CTimerWrapper(), GetHostHandle(), OnExpired(), Reset(), and SetHostHandle().
|
privateinherited |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop).
Definition at line 171 of file stk_linked_list.h.
|
privateinherited |
true if pending to be handled
Definition at line 173 of file stk_time_timer.h.
Referenced by stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::ProcessTimers(), Timer(), and stk::time::TimerHost::UpdateTime().
|
privateinherited |
reload period in ticks (0 = one-shot)
Definition at line 171 of file stk_time_timer.h.
Referenced by GetPeriod(), stk::time::TimerHost::ProcessCommands(), stk::time::TimerHost::Reset(), stk::time::TimerHost::SetPeriod(), Timer(), and stk::time::TimerHost::UpdateTime().
|
privateinherited |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop).
Definition at line 172 of file stk_linked_list.h.
|
privateinherited |
time at which timer expired (ticks), updated by TimerHost
Definition at line 170 of file stk_time_timer.h.
Referenced by GetTimestamp(), Timer(), and stk::time::TimerHost::UpdateTime().
|
private |
Definition at line 80 of file stk_c_time.cpp.
Referenced by CTimerWrapper(), GetUserData(), Initialize(), OnExpired(), and Reset().