tinyOS  v1.00
软定时器

tinyOS的定时器实现 More...

Data Structures

struct  _tTimer
 
struct  _tTimerInfo
 

Macros

#define TIMER_CONFIG_TYPE_HARD   (1 << 0)
 
#define TIMER_CONFIG_TYPE_SOFT   (0 << 0)
 

Typedefs

typedef enum _tTimerState tTimerState
 
typedef struct _tTimer tTimer
 
typedef struct _tTimerInfo tTimerInfo
 软硬定时器 More...
 

Enumerations

enum  _tTimerState {
  tTimerCreated, tTimerStarted, tTimerRunning, tTimerStopped,
  tTimerDestroyed
}
 

Functions

void tTimerInit (tTimer *timer, uint32_t delayTicks, uint32_t durationTicks, void(*timerFunc)(void *arg), void *arg, uint32_t config)
 
void tTimerStart (tTimer *timer)
 
void tTimerStop (tTimer *timer)
 
void tTimerDestroy (tTimer *timer)
 
void tTimerGetInfo (tTimer *timer, tTimerInfo *info)
 
void tTimerModuleTickNotify (void)
 
void tTimerModuleInit (void)
 
void tTimerInitTask (void)
 

Detailed Description

tinyOS的定时器实现

Author
01课堂 lishutong
Date
2017-06-01
Version
1.0

Macro Definition Documentation

◆ TIMER_CONFIG_TYPE_HARD

#define TIMER_CONFIG_TYPE_HARD   (1 << 0)

Definition at line 60 of file tTimer.h.

◆ TIMER_CONFIG_TYPE_SOFT

#define TIMER_CONFIG_TYPE_SOFT   (0 << 0)

Definition at line 61 of file tTimer.h.

Typedef Documentation

◆ tTimer

typedef struct _tTimer tTimer

◆ tTimerInfo

typedef struct _tTimerInfo tTimerInfo

软硬定时器

◆ tTimerState

typedef enum _tTimerState tTimerState

Enumeration Type Documentation

◆ _tTimerState

Enumerator
tTimerCreated 

定时器已经创建

tTimerStarted 

定时器已经启动

tTimerRunning 

定时器正在执行回调函数

tTimerStopped 

定时器已经停止

tTimerDestroyed 

定时器已经销毁

Definition at line 24 of file tTimer.h.

Function Documentation

◆ tTimerDestroy()

void tTimerDestroy ( tTimer timer)

销毁定时器 timer 销毁的定时器

Definition at line 118 of file tTimer.c.

Here is the call graph for this function:

◆ tTimerGetInfo()

void tTimerGetInfo ( tTimer timer,
tTimerInfo info 
)

查询状态信息

Parameters
timer查询的定时器
info状态查询存储的位置

Definition at line 128 of file tTimer.c.

Here is the call graph for this function:

◆ tTimerInit()

void tTimerInit ( tTimer timer,
uint32_t  delayTicks,
uint32_t  durationTicks,
void(*)(void *arg)  timerFunc,
void *  arg,
uint32_t  config 
)

初始化定时器

Parameters
timer等待初始化的定时器
delayTicks定时器初始启动的延时ticks数。
durationTicks给周期性定时器用的周期tick数,一次性定时器无效
timerFunc定时器回调函数
arg传递给定时器回调函数的参数
timerFunc定时器回调函数
config定时器的初始配置

Definition at line 34 of file tTimer.c.

Here is the call graph for this function:

◆ tTimerInitTask()

void tTimerInitTask ( void  )

初始化软定时器任务

Definition at line 224 of file tTimer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tTimerModuleInit()

void tTimerModuleInit ( void  )

定时器模块初始化

Definition at line 214 of file tTimer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tTimerModuleTickNotify()

void tTimerModuleTickNotify ( void  )

通知定时模块,系统节拍tick增加

Definition at line 199 of file tTimer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tTimerStart()

void tTimerStart ( tTimer timer)

启动定时器

Parameters
timer等待启动的定时器

Definition at line 56 of file tTimer.c.

Here is the call graph for this function:

◆ tTimerStop()

void tTimerStop ( tTimer timer)

终止定时器

Parameters
timer等待启动的定时器

Definition at line 88 of file tTimer.c.

Here is the call graph for this function:
Here is the caller graph for this function: