|
StateOS
|
timers (one-shot, periodic) More...
Macros | |
| #define | OS_TMR(tmr, proc) |
| define and initialize a timer object | |
| #define | static_TMR(tmr, proc) |
| static alias of OS_TMR() | |
| #define | OS_TMR_DEF(tmr) |
| define and initialize complete timer object | |
| #define | static_TMR_DEF(tmr) |
| static alias of OS_TMR_DEF() | |
| #define | OS_TMR_START(tmr, delay, period) |
| define, initialize and start complete timer object | |
| #define | static_TMR_START(tmr, delay, period) |
| static alias of OS_TMR_START() | |
| #define | OS_TMR_UNTIL(tmr, time) |
| define, initialize and start complete timer object | |
| #define | static_TMR_UNTIL(tmr, time) |
| static alias of OS_TMR_UNTIL() | |
| #define | TMR_INIT(proc) |
| create and initialize a timer object | |
| #define | TMR_CREATE(proc) |
| create and initialize a timer object | |
| #define | TMR_NEW TMR_CREATE |
| alias of TMR_CREATE() | |
Functions | |
| tmr_t * | tmr_thisISR (void) |
| return current timer object | |
| void | tmr_init (tmr_t *tmr, fun_t *proc) |
| initialize a timer object | |
| tmr_t * | tmr_create (fun_t *proc) |
| create and initialize a new timer object | |
| tmr_t * | tmr_new (fun_t *proc) |
| alias of tmr_create() | |
| void | tmr_reset (tmr_t *tmr) |
| reset the timer object and wake up all waiting tasks with 'E_STOPPED' event value | |
| void | tmr_kill (tmr_t *tmr) |
| alias of tmr_reset() | |
| void | tmr_destroy (tmr_t *tmr) |
| reset the timer object, wake up all waiting tasks with 'E_DELETED' event value and free allocated resource | |
| void | tmr_delete (tmr_t *tmr) |
| alias of tmr_destroy() | |
| void | tmr_start (tmr_t *tmr, cnt_t delay, cnt_t period) |
| start/restart periodic timer for given duration of time | |
| void | tmr_startFor (tmr_t *tmr, cnt_t delay) |
| start/restart one-shot timer for given duration of time | |
| void | tmr_startPeriodic (tmr_t *tmr, cnt_t period) |
| start/restart periodic timer for given duration of time | |
| void | tmr_startFrom (tmr_t *tmr, cnt_t delay, cnt_t period, fun_t *proc) |
| start/restart periodic timer for given duration of time | |
| void | tmr_startNext (tmr_t *tmr, cnt_t delay) |
| restart the timer for given duration of time from the end of the previous countdown | |
| void | tmr_startUntil (tmr_t *tmr, cnt_t time) |
| start/restart one-shot timer until given timepoint | |
| void | tmr_stop (tmr_t *tmr) |
| stop timer | |
| int | tmr_take (tmr_t *tmr) |
| check if the timer finishes countdown | |
| int | tmr_expired (tmr_t *tmr) |
| alias of tmr_take() | |
| int | tmr_tryWait (tmr_t *tmr) |
| alias of tmr_take() | |
| int | tmr_takeISR (tmr_t *tmr) |
| ISR alias of tmr_take(). | |
| int | tmr_waitFor (tmr_t *tmr, cnt_t delay) |
| wait for given duration of time until the timer finishes countdown | |
| int | tmr_waitNext (tmr_t *tmr, cnt_t delay) |
| wait for given duration of time from the end of the previous countdown | |
| int | tmr_waitUntil (tmr_t *tmr, cnt_t time) |
| wait until given timepoint until the timer finishes countdown | |
| int | tmr_wait (tmr_t *tmr) |
| wait indefinitely until the timer finishes countdown | |
| void | tmr_flipISR (fun_t *proc) |
| change callback procedure for current periodic timer (available in next period) | |
| void | tmr_delayISR (cnt_t delay) |
| change delay time for current timer | |
| cnt_t | tmr_overrunISR (void) |
| return the number of periods skipped by the current periodic timer | |
timers (one-shot, periodic)
| #define OS_TMR | ( | tmr, | |
| proc ) |
define and initialize a timer object
| tmr | name of a pointer to timer object |
| proc | callback procedure
|
| #define static_TMR | ( | tmr, | |
| proc ) |
static alias of OS_TMR()
| #define OS_TMR_DEF | ( | tmr | ) |
define and initialize complete timer object
timer callback procedure (function body) must be defined immediately below
| tmr | name of a pointer to timer object |
| #define static_TMR_DEF | ( | tmr | ) |
static alias of OS_TMR_DEF()
| #define OS_TMR_START | ( | tmr, | |
| delay, | |||
| period ) |
define, initialize and start complete timer object
timer callback procedure (function body) must be defined immediately below
| tmr | name of a pointer to timer object |
| delay | duration of time (maximum number of ticks to countdown) for first expiration
|
| period | duration of time (maximum number of ticks to countdown) for all next expirations
|
| #define static_TMR_START | ( | tmr, | |
| delay, | |||
| period ) |
static alias of OS_TMR_START()
| #define OS_TMR_UNTIL | ( | tmr, | |
| time ) |
define, initialize and start complete timer object
timer callback procedure (function body) must be defined immediately below
| tmr | name of a pointer to timer object |
| time | timepoint value |
| #define static_TMR_UNTIL | ( | tmr, | |
| time ) |
static alias of OS_TMR_UNTIL()
| #define TMR_INIT | ( | proc | ) |
create and initialize a timer object
| proc | callback procedure
|
| #define TMR_CREATE | ( | proc | ) |
|
inline |
return current timer object
| void tmr_init | ( | tmr_t * | tmr, |
| fun_t * | proc ) |
initialize a timer object
| tmr | pointer to timer object |
| proc | callback procedure
|
| tmr_t * tmr_create | ( | fun_t * | proc | ) |
create and initialize a new timer object
| proc | callback procedure
|
| NULL | object not created (not enough free memory) |
| void tmr_reset | ( | tmr_t * | tmr | ) |
reset the timer object and wake up all waiting tasks with 'E_STOPPED' event value
| tmr | pointer to timer object |
| void tmr_destroy | ( | tmr_t * | tmr | ) |
reset the timer object, wake up all waiting tasks with 'E_DELETED' event value and free allocated resource
| tmr | pointer to timer object |
| void tmr_start | ( | tmr_t * | tmr, |
| cnt_t | delay, | ||
| cnt_t | period ) |
start/restart periodic timer for given duration of time
when the timer has finished the countdown, the callback procedure is launched
do this periodically if period > 0
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to countdown) for first expiration
|
| period | duration of time (maximum number of ticks to countdown) for all next expirations
|
|
inline |
start/restart one-shot timer for given duration of time
when the timer has finished the countdown, the callback procedure is launched
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to countdown)
|
|
inline |
start/restart periodic timer for given duration of time
when the timer has finished the countdown, the callback procedure is launched
do this periodically
| tmr | pointer to timer object |
| period | duration of time (maximum number of ticks to countdown)
|
| void tmr_startFrom | ( | tmr_t * | tmr, |
| cnt_t | delay, | ||
| cnt_t | period, | ||
| fun_t * | proc ) |
start/restart periodic timer for given duration of time
when the timer has finished the countdown, the callback procedure is launched
do this periodically if period > 0
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to countdown) for first expiration
|
| period | duration of time (maximum number of ticks to countdown) for all next expirations
|
| proc | callback procedure
|
| void tmr_startNext | ( | tmr_t * | tmr, |
| cnt_t | delay ) |
restart the timer for given duration of time from the end of the previous countdown
when the timer has finished the countdown, the callback procedure is launched
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to countdown)
|
| void tmr_startUntil | ( | tmr_t * | tmr, |
| cnt_t | time ) |
start/restart one-shot timer until given timepoint
when the timer has finished the countdown, the callback procedure is launched
| tmr | pointer to timer object |
| time | timepoint value |
|
inline |
stop timer
| tmr | pointer to timer object |
| int tmr_take | ( | tmr_t * | tmr | ) |
check if the timer finishes countdown
| tmr | pointer to timer object |
| E_SUCCESS | timer object successfully finished countdown |
| E_FAILURE | timer has not yet been started |
| E_TIMEOUT | timer object has not yet completed counting, try again |
| int tmr_waitFor | ( | tmr_t * | tmr, |
| cnt_t | delay ) |
wait for given duration of time until the timer finishes countdown
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to wait for the timer finishes countdown)
|
| E_SUCCESS | timer object successfully finished countdown |
| E_FAILURE | timer has not yet been started |
| E_STOPPED | timer object was reseted before the specified timeout expired |
| E_DELETED | timer object was deleted before the specified timeout expired |
| E_TIMEOUT | timer object has not finished countdown before the specified timeout expired |
| int tmr_waitNext | ( | tmr_t * | tmr, |
| cnt_t | delay ) |
wait for given duration of time from the end of the previous countdown
until the timer finishes countdown
| tmr | pointer to timer object |
| delay | duration of time (maximum number of ticks to wait for the timer finishes countdown)
|
| E_SUCCESS | timer object successfully finished countdown |
| E_FAILURE | timer has not yet been started |
| E_STOPPED | timer object was reseted before the specified timeout expired |
| E_DELETED | timer object was deleted before the specified timeout expired |
| E_TIMEOUT | timer object has not finished countdown before the specified timeout expired |
| int tmr_waitUntil | ( | tmr_t * | tmr, |
| cnt_t | time ) |
wait until given timepoint until the timer finishes countdown
| tmr | pointer to timer object |
| time | timepoint value |
| E_SUCCESS | timer object successfully finished countdown |
| E_FAILURE | timer has not yet been started |
| E_STOPPED | timer object was reseted before the specified timeout expired |
| E_DELETED | timer object was deleted before the specified timeout expired |
| E_TIMEOUT | timer object has not finished countdown before the specified timeout expired |
|
inline |
wait indefinitely until the timer finishes countdown
| tmr | pointer to timer object |
| E_SUCCESS | timer object successfully finished countdown |
| E_FAILURE | timer has not yet been started |
| E_STOPPED | timer object was reseted before the countdown ended |
| E_DELETED | timer object was deleted before the countdown ended |
|
inline |
change callback procedure for current periodic timer (available in next period)
| proc | new callback procedure
|
|
inline |
change delay time for current timer
| delay | duration of time (maximum number of ticks to countdown)
|
|
inline |
return the number of periods skipped by the current periodic timer
since the previous callback procedure (the timer was late by at least one period)