WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_swtmr.h
浏览该文件的文档.
1/* ---------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
3 * Description: Software Timer Manager HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
34#ifndef _LOS_SWTMR_H
35#define _LOS_SWTMR_H
36
37#include "los_base.h"
38#include "los_task.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
52#define LOS_ERRNO_SWTMR_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x00)
53
62#define LOS_ERRNO_SWTMR_INTERVAL_NOT_SUITED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x01)
63
72#define LOS_ERRNO_SWTMR_MODE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x02)
73
82#define LOS_ERRNO_SWTMR_RET_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x03)
83
93#define LOS_ERRNO_SWTMR_MAXSIZE LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x04)
94
103#define LOS_ERRNO_SWTMR_ID_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x05)
104
113#define LOS_ERRNO_SWTMR_NOT_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x06)
114
123#define LOS_ERRNO_SWTMR_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x07)
124
134#define LOS_ERRNO_SWTMR_MAXSIZE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x08)
135
144#define LOS_ERRNO_SWTMR_HWI_ACTIVE LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x09)
145
155#define LOS_ERRNO_SWTMR_HANDLER_POOL_NO_MEM LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0a)
156
165#define LOS_ERRNO_SWTMR_QUEUE_CREATE_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0b)
166
175#define LOS_ERRNO_SWTMR_TASK_CREATE_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0c)
176
185#define LOS_ERRNO_SWTMR_NOT_STARTED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0d)
186
195#define LOS_ERRNO_SWTMR_STATUS_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0e)
196
204#define LOS_ERRNO_SWTMR_SORTLIST_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0f)
205
214#define LOS_ERRNO_SWTMR_TICK_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x10)
215
224#define LOS_ERRNO_SWTMR_SORTLINK_CREATE_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x11)
225
234#define LOS_ERRNO_SWTMR_INVALID_SYNCDEL LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x12)
235
248
268
291
315
341extern UINT32 LOS_SwtmrTimeGet(UINT16 swtmrId, UINT32 *tick);
342
377extern UINT32 LOS_SwtmrCreate(UINT32 interval, UINT8 mode, SWTMR_PROC_FUNC handler, UINT16 *swtmrId, UINTPTR arg);
378
401#ifdef LOSCFG_SWTMR_SYNC_DELETE
425extern UINT32 LOS_SwtmrSyncDelete(UINT16 swtmrId);
426#endif
427
428#ifdef __cplusplus
429}
430#endif /* __cplusplus */
431
432#endif /* _LOS_SWTMR_H */
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_SwtmrStart(UINT16 swtmrId)
Start a software timer.
UINT32 LOS_SwtmrDelete(UINT16 swtmrId)
Delete a software timer.
UINT32 LOS_SwtmrStop(UINT16 swtmrId)
Stop a software timer.
enSwTmrType
Definition los_swtmr.h:240
void(* SWTMR_PROC_FUNC)(UINTPTR arg)
Define the type of a callback function that handles software timer timeout.
Definition los_swtmr.h:267
@ LOS_SWTMR_MODE_PERIOD
Definition los_swtmr.h:242
@ LOS_SWTMR_MODE_OPP
Definition los_swtmr.h:244
@ LOS_SWTMR_MODE_ONCE
Definition los_swtmr.h:241
@ LOS_SWTMR_MODE_NO_SELFDELETE
Definition los_swtmr.h:243
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned char UINT8
Definition los_typedef.h:50
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52