|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Typedefs | |
| typedef enum cy_timer_trigger_type | cy_timer_trigger_type_t |
| typedef void(* | cy_timer_callback_t) (cy_timer_callback_arg_t arg) |
Enumerations | |
| enum | cy_timer_trigger_type { CY_TIMER_TYPE_PERIODIC , CY_TIMER_TYPE_ONCE } |
| cy_rslt_t | cy_rtos_timer_init (cy_timer_t *timer, cy_timer_trigger_type_t type, cy_timer_callback_t fun, cy_timer_callback_arg_t arg) |
| cy_rslt_t | cy_rtos_timer_start (const cy_timer_t *timer, cy_time_t num_ms) |
| cy_rslt_t | cy_rtos_timer_stop (const cy_timer_t *timer) |
| cy_rslt_t | cy_rtos_timer_is_running (const cy_timer_t *timer, bool *state) |
| cy_rslt_t | cy_rtos_timer_deinit (cy_timer_t *timer) |
| #define | cy_rtos_init_timer(timer, type, fun, arg) |
| #define | cy_rtos_start_timer(timer, num_ms) |
| #define | cy_rtos_stop_timer(timer) |
| #define | cy_rtos_is_running_timer(timer, state) |
| #define | cy_rtos_deinit_timer(timer) |
APIs for creating and working with Timers.
| #define cy_rtos_deinit_timer | ( | timer | ) |
Deinit the timer.
This function deinitializes the timer and frees all consumed resources.
| [in] | timer | Pointer to the timer handle |
Definition at line 1654 of file cyabs_rtos.h.
| #define cy_rtos_init_timer | ( | timer, | |
| type, | |||
| fun, | |||
| arg ) |
Create a new timer.
This function initializes a timer object.
| [out] | timer | Pointer to the timer handle to initialize |
| [in] | type | Type of timer (periodic or once) |
| [in] | fun | The function |
| [in] | arg | Argument to pass along to the callback function |
Definition at line 1601 of file cyabs_rtos.h.
| #define cy_rtos_is_running_timer | ( | timer, | |
| state ) |
Returns state of a timer.
| [in] | timer | Pointer to the timer handle |
| [out] | state | Return value for state, true if running, false otherwise |
Definition at line 1640 of file cyabs_rtos.h.
| #define cy_rtos_start_timer | ( | timer, | |
| num_ms ) |
Sends a request to start the timer. Depending on the priorities of threads in the system, it may be necessary for high priority items to wait before the timer actually starts running.
| [in] | timer | Pointer to the timer handle |
| [in] | num_ms | The number of milliseconds to wait before the timer fires |
Definition at line 1615 of file cyabs_rtos.h.
| #define cy_rtos_stop_timer | ( | timer | ) |
Sends a request to stop the timer. Depending on the priorities of threads in the system, it may be necessary for high priority items to wait before the timer is actually stopped.
| [in] | timer | Pointer to the timer handle |
Definition at line 1628 of file cyabs_rtos.h.
| typedef void(* cy_timer_callback_t) (cy_timer_callback_arg_t arg) |
The callback function to be called by a timer
Definition at line 186 of file cyabs_rtos.h.
| typedef enum cy_timer_trigger_type cy_timer_trigger_type_t |
The type of timer
The type of timer
| Enumerator | |
|---|---|
| CY_TIMER_TYPE_PERIODIC | called periodically until stopped |
| CY_TIMER_TYPE_ONCE | called once only |
Definition at line 161 of file cyabs_rtos.h.
| cy_rslt_t cy_rtos_timer_deinit | ( | cy_timer_t * | timer | ) |
Deinit the timer.
This function deinitializes the timer and frees all consumed resources.
| [in] | timer | Pointer to the timer handle |
< not allowed in this context (ISR, scheduler not running or locked, not a thread created by cy_rtos_thread_create())
< the timer host rejected the command
Definition at line 1471 of file cyabs_rtos_stk.cpp.
References CY_RTOS_BAD_PARAM, CY_RTOS_STK_ERR_CONTEXT, CY_RTOS_STK_ERR_TIMER_HOST, cy_timer_t::id, stk::time::TimerHost::RES_INACTIVE, stk::time::TimerHost::RES_OK, stk::time::TimerHost::StopSync(), and TimerOf().
| cy_rslt_t cy_rtos_timer_init | ( | cy_timer_t * | timer, |
| cy_timer_trigger_type_t | type, | ||
| cy_timer_callback_t | fun, | ||
| cy_timer_callback_arg_t | arg ) |
Create a new timer.
This function initializes a timer object.
| [out] | timer | Pointer to the timer handle to initialize |
| [in] | type | Type of timer (periodic or once) |
| [in] | fun | The function |
| [in] | arg | Argument to pass along to the callback function |
< kernel is not initialized (see cy_rtos_stk_kernel_init())
Definition at line 1401 of file cyabs_rtos_stk.cpp.
References CY_RTOS_BAD_PARAM, CY_RTOS_STK_ERR_KERNEL_STATE, CY_TIMER_TYPE_ONCE, cy_timer_t::id, stk::IKernel::KSTATE_INACTIVE, and cy_timer_t::storage.
| cy_rslt_t cy_rtos_timer_is_running | ( | const cy_timer_t * | timer, |
| bool * | state ) |
Returns state of a timer.
| [in] | timer | Pointer to the timer handle |
| [out] | state | Return value for state, true if running, false otherwise |
< the timer host rejected the command
Definition at line 1445 of file cyabs_rtos_stk.cpp.
References stk::time::TimerHost::TimerInfo::active, CY_RTOS_BAD_PARAM, CY_RTOS_STK_ERR_TIMER_HOST, stk::time::Timer::IsActive(), stk::time::TimerHost::QuerySync(), stk::time::TimerHost::RES_OK, stk::time::TimerHost::RES_QUEUED, and TimerOf().
| cy_rslt_t cy_rtos_timer_start | ( | const cy_timer_t * | timer, |
| cy_time_t | num_ms ) |
Sends a request to start the timer. Depending on the priorities of threads in the system, it may be necessary for high priority items to wait before the timer actually starts running.
| [in] | timer | Pointer to the timer handle |
| [in] | num_ms | The number of milliseconds to wait before the timer fires |
Definition at line 1420 of file cyabs_rtos_stk.cpp.
References CY_RTOS_BAD_PARAM, CY_RTOS_NEVER_TIMEOUT, MsToTicks(), stk::time::TimerHost::RestartSync(), and TimerOf().
| cy_rslt_t cy_rtos_timer_stop | ( | const cy_timer_t * | timer | ) |
Sends a request to stop the timer. Depending on the priorities of threads in the system, it may be necessary for high priority items to wait before the timer is actually stopped.
| [in] | timer | Pointer to the timer handle |
Definition at line 1435 of file cyabs_rtos_stk.cpp.
References CY_RTOS_BAD_PARAM, stk::time::TimerHost::StopSync(), and TimerOf().