los_swtmr.h文件参考

浏览该文件的源代码。


数据结构

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.
#define  OS_ERRNO_SWTMR_ROUSES_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x11)
#define  OS_ERRNO_SWTMR_ALIGN_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_SWTMR, 0x12)
#define  OS_SWTMR_BIT_ALREADY_ALIGNED   (1 << 31)
#define  OS_SWTMR_BIT_CAN_ALIGNED   (1 << 30)
#define  OS_SWTMR_BIT_MULTIPLE   (1 << 29)
#define  SET_ALIGN_SWTMR_ALREADY_ALIGNED(num)   ((num) = 0x80000000 | ((num) & 0x7FFFFFFF))
#define  SET_ALIGN_SWTMR_ALREADY_NOT_ALIGNED(num)   ((num) = ((num) & 0x7FFFFFFF))
#define  SET_ALIGN_SWTMR_CAN_ALIGNED(num)   ((num) = 0x40000000| (num & 0xBFFFFFFF))
#define  SET_ALIGN_SWTMR_CAN_NOT_ALIGNED(num)   ((num) = (num & 0xBFFFFFFF))
#define  SET_ALIGN_SWTMR_CAN_MULTIPLE(num)   ((num)= 0x20000000|(num & 0xDFFFFFFF) )
#define  SET_ALIGN_SWTMR_CAN_NOT_MULTIPLE(num)   ((num)= (num & 0xDFFFFFFF) )
#define  SET_ALIGN_SWTMR_DIVISOR_TIMERS(num, value)   (num = (value & 0x00FFFFFF) | (num & 0xFF000000))
#define  GET_ALIGN_SWTMR_DIVISOR_TIMERS(num)   (num & 0x00FFFFFF)
#define  CHECK_ALIGN_SWTMR_CAN_MULTI_ALIGN(num)   ((num & 0xE0000000) == 0x60000000)
#define  CHECK_ALIGN_SWTMR_CAN_PERIODIC_ALIGN(num)   ((num & 0xE0000000) == 0x40000000)
#define  CHECK_ALIGN_SWTMR_ALREADY_ALIGN(num)   ((num & 0xC0000000) == 0xC0000000)

类型定义

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   enSwTmrRousesType {
  OS_SWTMR_ROUSES_IGNORE,
  OS_SWTMR_ROUSES_ALLOW
}
enum   enSwTmrAlignSensitive {
  OS_SWTMR_ALIGN_SENSITIVE,
  OS_SWTMR_ALIGN_INSENSITIVE
}
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.