结构体 | |
struct | tagSwTmrCtrl |
类型定义 | |
typedef VOID(* | SWTMR_PROC_FUNC) (UINTPTR arg) |
Define the type of a callback function that handles software timer timeout. 更多... | |
typedef struct tagSwTmrCtrl | SWTMR_CTRL_S |
枚举 | |
enum | enSwTmrType { LOS_SWTMR_MODE_ONCE , LOS_SWTMR_MODE_PERIOD , LOS_SWTMR_MODE_NO_SELFDELETE , LOS_SWTMR_MODE_OPP } |
函数 | |
UINT32 | LOS_SwtmrStart (UINT16 swtmrID) |
Start a software timer. 更多... | |
UINT32 | LOS_SwtmrStop (UINT16 swtmrID) |
Stop a software timer. 更多... | |
UINT32 | LOS_SwtmrTimeGet (UINT16 swtmrID, UINT32 *tick) |
Obtain the number of remaining Ticks configured on a software timer. 更多... | |
UINT32 | LOS_SwtmrCreate (UINT32 interval, UINT8 mode, SWTMR_PROC_FUNC handler, UINT16 *swtmrID, UINTPTR arg) |
Create a software timer. 更多... | |
UINT32 | LOS_SwtmrDelete (UINT16 swtmrID) |
Delete a software timer. 更多... | |
typedef struct tagSwTmrCtrl SWTMR_CTRL_S |
Software timer control structure | 软件定时器控制块
变量前缀 uc:UINT8 us:UINT16 uw:UINT32 代表的意思
typedef VOID(* SWTMR_PROC_FUNC) (UINTPTR arg) |
Define the type of a callback function that handles software timer timeout.
arg | [IN] the parameter of the callback function that handles software timer timeout. |
None. |
在文件 los_swtmr.h 第 260 行定义.
enum enSwTmrType |
Software timer mode
在文件 los_swtmr.h 第 231 行定义.
UINT32 LOS_SwtmrCreate | ( | UINT32 | interval, |
UINT8 | mode, | ||
SWTMR_PROC_FUNC | handler, | ||
UINT16 * | swtmrID, | ||
UINTPTR | arg | ||
) |
Create a software timer.
interval | [IN] Timing duration of the software timer to be created (unit: tick). |
mode | [IN] Software timer mode. Pass in one of the modes specified by enSwTmrType. There are three types of modes, one-off, periodic, and continuously periodic after one-off, of which the third mode is not supported temporarily. |
handler | [IN] Callback function that handles software timer timeout. |
swtmrID | [OUT] Software timer ID created by LOS_SwtmrCreate. |
arg | [IN] Parameter passed in when the callback function that handles software timer timeout is called. |
#LOS_ERRNO_SWTMR_INTERVAL_NOT_SUITED | The software timer timeout interval is 0. |
#LOS_ERRNO_SWTMR_MODE_INVALID | Invalid software timer mode. |
#LOS_ERRNO_SWTMR_PTR_NULL | The callback function that handles software timer timeout is NULL. |
#LOS_ERRNO_SWTMR_RET_PTR_NULL | The passed-in software timer ID is NULL. |
#LOS_ERRNO_SWTMR_MAXSIZE | The number of software timers exceeds the configured permitted maximum number. |
#LOS_OK | The software timer is successfully created. |
Create a software timer.
在文件 los_swtmr.c 第 712 行定义.
Delete a software timer.
swtmrID | [IN] Software timer ID created by LOS_SwtmrCreate. The value of ID should be in [0, LOSCFG_BASE_CORE_SWTMR_LIMIT - 1]. |
#LOS_ERRNO_SWTMR_ID_INVALID | Invalid software timer ID. |
#LOS_ERRNO_SWTMR_NOT_CREATED | The software timer is not created. |
#LOS_ERRNO_SWTMR_STATUS_INVALID | Invalid software timer state. |
#LOS_OK | The software timer is successfully deleted. |
Delete a software timer.
在文件 los_swtmr.c 第 889 行定义.
Start a software timer.
swtmrID | [IN] Software timer ID created by LOS_SwtmrCreate. The value of ID should be in [0, LOSCFG_BASE_CORE_SWTMR_LIMIT - 1]. |
#LOS_ERRNO_SWTMR_ID_INVALID | Invalid software timer ID. |
#LOS_ERRNO_SWTMR_NOT_CREATED | The software timer is not created. |
#LOS_ERRNO_SWTMR_STATUS_INVALID | Invalid software timer state. |
#LOS_OK | The software timer is successfully started. |
Start a software timer.
在文件 los_swtmr.c 第 764 行定义.
Stop a software timer.
swtmrID | [IN] Software timer ID created by LOS_SwtmrCreate. The value of ID should be in [0, LOSCFG_BASE_CORE_SWTMR_LIMIT - 1]. |
#LOS_ERRNO_SWTMR_ID_INVALID | Invalid software timer ID. |
#LOS_ERRNO_SWTMR_NOT_CREATED | The software timer is not created. |
#LOS_ERRNO_SWTMR_NOT_STARTED | The software timer is not started. |
#LOS_ERRNO_SWTMR_STATUS_INVALID | Invalid software timer state. |
#LOS_OK | The software timer is successfully stopped. |
Stop a software timer.
在文件 los_swtmr.c 第 808 行定义.
Obtain the number of remaining Ticks configured on a software timer.
swtmrID | [IN] Software timer ID created by LOS_SwtmrCreate. The value of ID should be in [0, LOSCFG_BASE_CORE_SWTMR_LIMIT - 1]. |
tick | [OUT] Number of remaining Ticks configured on the software timer. |
#LOS_ERRNO_SWTMR_ID_INVALID | Invalid software timer ID. |
#LOS_ERRNO_SWTMR_NOT_CREATED | The software timer is not created. |
#LOS_ERRNO_SWTMR_NOT_STARTED | The software timer is not started. |
#LOS_ERRNO_SWTMR_STATUS_INVALID | Invalid software timer state. |
#LOS_OK | The number of remaining Ticks is successfully obtained. |
Obtain the number of remaining Ticks configured on a software timer.
在文件 los_swtmr.c 第 848 行定义.