Software timer
[Kernel]


数据结构

struct   tagSwTmrCtrl
  Software timer control structure 更多...

宏定义

#define  LOS_ERRNO_SWTMR_PTR_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x00)
  Software timer error code: The timeout handling function is NULL.
#define  LOS_ERRNO_SWTMR_INTERVAL_NOT_SUITED   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x01)
  Software timer error code: The expiration time is 0.
#define  LOS_ERRNO_SWTMR_MODE_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x02)
  Software timer error code: Invalid software timer mode.
#define  LOS_ERRNO_SWTMR_RET_PTR_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x03)
  Software timer error code: The passed-in software timer ID is NULL.
#define  LOS_ERRNO_SWTMR_MAXSIZE   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x04)
  Software timer error code: The number of software timers exceeds the configured permitted maximum number.
#define  LOS_ERRNO_SWTMR_ID_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x05)
  Software timer error code: Invalid software timer ID.
#define  LOS_ERRNO_SWTMR_NOT_CREATED   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x06)
  Software timer error code: The software timer is not created.
#define  LOS_ERRNO_SWTMR_NO_MEMORY   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x07)
  Software timer error code: Insufficient memory for software timer linked list creation.
#define  LOS_ERRNO_SWTMR_MAXSIZE_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x08)
  Software timer error code: Invalid configured number of software timers.
#define  LOS_ERRNO_SWTMR_HWI_ACTIVE   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x09)
  Software timer error code: The software timer is being used during an interrupt.
#define  LOS_ERRNO_SWTMR_HANDLER_POOL_NO_MEM   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0a)
  Software timer error code: Insufficient memory allocated by membox.
#define  LOS_ERRNO_SWTMR_QUEUE_CREATE_FAILED   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0b)
  Software timer error code: The software timer queue fails to be created.
#define  LOS_ERRNO_SWTMR_TASK_CREATE_FAILED   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0c)
  Software timer error code: The software timer task fails to be created.
#define  LOS_ERRNO_SWTMR_NOT_STARTED   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0d)
  Software timer error code: The software timer is not started.
#define  LOS_ERRNO_SWTMR_STATUS_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0e)
  Software timer error code: Invalid software timer state.
#define  LOS_ERRNO_SWTMR_SORTLIST_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x0f)
  This error code is not in use temporarily.
#define  LOS_ERRNO_SWTMR_TICK_PTR_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x10)
  Software timer error code: The passed-in number of remaining Ticks configured on the software timer is NULL.

类型定义

typedef VOID(*  SWTMR_PROC_FUNC )(UINT32 uwPar)
  Define the type of a callback function that handles software timer timeout.
typedef struct tagSwTmrCtrl  SWTMR_CTRL_S
  Software timer control structure

枚举

enum   enSwTmrType {
  LOS_SWTMR_MODE_ONCE,
  LOS_SWTMR_MODE_PERIOD,
  LOS_SWTMR_MODE_NO_SELFDELETE,
  LOS_SWTMR_MODE_OPP
}
  Software timer mode 更多...

函数

UINT32  LOS_SwtmrStart (UINT16 usSwTmrID)
  Start a software timer.
UINT32  LOS_SwtmrStop (UINT16 usSwTmrID)
  Stop a software timer.
UINT32  LOS_SwtmrTimeGet (UINT16 usSwTmrID, UINT32 *uwTick)
  Obtain the number of remaining Ticks configured on a software timer.
UINT32  LOS_SwtmrCreate (UINT32 uwInterval, UINT8 ucMode, SWTMR_PROC_FUNC pfnHandler, UINT16 *pusSwTmrID, UINT32 uwArg, UINT8 ucRouses, UINT8 ucSensitive)
  Create a software timer.
UINT32  LOS_SwtmrDelete (UINT16 usSwTmrID)
  Delete a software timer.