TuyaOS
tal_sw_timer.h
浏览该文件的文档.
1
10#ifndef __TAL_SW_TIMER_H__
11#define __TAL_SW_TIMER_H__
12
13#include "tuya_cloud_types.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef PVOID_T TIMER_ID; // 定时器ID
20typedef VOID_T (* TAL_TIMER_CB)(TIMER_ID timer_id, VOID_T *arg);
21
25typedef enum {
26 TAL_TIMER_ONCE = 0,
27 TAL_TIMER_CYCLE,
29
39OPERATE_RET tal_sw_timer_init(VOID_T);
40
52OPERATE_RET tal_sw_timer_create(TAL_TIMER_CB func, VOID_T *arg, TIMER_ID *timer_id);
53
63OPERATE_RET tal_sw_timer_delete(TIMER_ID timer_id);
64
74OPERATE_RET tal_sw_timer_stop(TIMER_ID timer_id);
75
85BOOL_T tal_sw_timer_is_running(TIMER_ID timer_id);
86
95OPERATE_RET tal_sw_timer_remain_time_get(TIMER_ID timer_id, UINT_T *remain_time);
96
108OPERATE_RET tal_sw_timer_start(TIMER_ID timer_id, TIME_MS time_ms, TIMER_TYPE timer_type);
109
110
120OPERATE_RET tal_sw_timer_trigger(TIMER_ID timer_id);
121
122
132OPERATE_RET tal_sw_timer_release(VOID_T);
133
134
145
146
147
148#ifdef __cplusplus
149}
150#endif /* __cplusplus */
151
152#endif
153
154
155
156
157
158
159
160
INT_T tal_sw_timer_get_num(VOID_T)
Get timer node currently
OPERATE_RET tal_sw_timer_create(TAL_TIMER_CB func, VOID_T *arg, TIMER_ID *timer_id)
create a software timer
BOOL_T tal_sw_timer_is_running(TIMER_ID timer_id)
Identify the software timer is running
OPERATE_RET tal_sw_timer_start(TIMER_ID timer_id, TIME_MS time_ms, TIMER_TYPE timer_type)
Start the software timer
OPERATE_RET tal_sw_timer_remain_time_get(TIMER_ID timer_id, UINT_T *remain_time)
Identify the software timer is running
OPERATE_RET tal_sw_timer_stop(TIMER_ID timer_id)
Stop the software timer
TIMER_TYPE
the type of timer
Definition: tal_sw_timer.h:25
OPERATE_RET tal_sw_timer_release(VOID_T)
Release all resource of the software timer
OPERATE_RET tal_sw_timer_trigger(TIMER_ID timer_id)
Trigger the software timer
OPERATE_RET tal_sw_timer_init(VOID_T)
Initializing the software timer
OPERATE_RET tal_sw_timer_delete(TIMER_ID timer_id)
Delete the software timer