APIs for creating and working with Timers.
Typedefs | |
typedef void(* | cy_timer_callback_t) (cy_timer_callback_arg_t arg) |
The callback function to be called by a timer. | |
Enumerations | |
enum | cy_timer_trigger_type_t { CY_TIMER_TYPE_PERIODIC , CY_TIMER_TYPE_ONCE } |
The type of timer. More... | |
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. More... | |
cy_rslt_t | cy_rtos_timer_start (cy_timer_t *timer, cy_time_t num_ms) |
Sends a request to start the timer. More... | |
cy_rslt_t | cy_rtos_timer_stop (cy_timer_t *timer) |
Sends a request to stop the timer. More... | |
cy_rslt_t | cy_rtos_timer_is_running (cy_timer_t *timer, bool *state) |
Returns state of a timer. More... | |
cy_rslt_t | cy_rtos_timer_deinit (cy_timer_t *timer) |
Deinit the timer. More... | |
#define | cy_rtos_init_timer(timer, type, fun, arg) cy_rtos_timer_init(timer, type, fun, arg) |
Create a new timer. More... | |
#define | cy_rtos_start_timer(timer, num_ms) cy_rtos_timer_start(timer, num_ms) |
Sends a request to start the timer. More... | |
#define | cy_rtos_stop_timer(timer) cy_rtos_timer_stop(timer) |
Sends a request to stop the timer. More... | |
#define | cy_rtos_is_running_timer(timer, state) cy_rtos_timer_is_running(timer, state) |
Returns state of a timer. More... | |
#define | cy_rtos_deinit_timer(timer) cy_rtos_timer_deinit(timer) |
Deinit the timer. More... | |
#define cy_rtos_init_timer | ( | timer, | |
type, | |||
fun, | |||
arg | |||
) | cy_rtos_timer_init(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 |
#define cy_rtos_start_timer | ( | timer, | |
num_ms | |||
) | cy_rtos_timer_start(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 |
#define cy_rtos_stop_timer | ( | timer | ) | cy_rtos_timer_stop(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 |
#define cy_rtos_is_running_timer | ( | timer, | |
state | |||
) | cy_rtos_timer_is_running(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 |
#define cy_rtos_deinit_timer | ( | timer | ) | cy_rtos_timer_deinit(timer) |
Deinit the timer.
This function deinitializes the timer and frees all consumed resources.
[in] | timer | Pointer to the timer handle |
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 |
cy_rslt_t cy_rtos_timer_start | ( | 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 |
cy_rslt_t cy_rtos_timer_stop | ( | 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 |
cy_rslt_t cy_rtos_timer_is_running | ( | 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 |
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 |