tinyOS  v1.00
事件标志组

tinyOS的事件标志实现 More...

Data Structures

struct  _tFlagGroup
 
struct  _tFlagGroupInfo
 

Macros

#define TFLAGGROUP_CLEAR   (0x0 << 0)
 
#define TFLAGGROUP_SET   (0x1 << 0)
 
#define TFLAGGROUP_ANY   (0x0 << 1)
 
#define TFLAGGROUP_ALL   (0x1 << 1)
 
#define TFLAGGROUP_SET_ALL   (TFLAGGROUP_SET | TFLAGGROUP_ALL)
 
#define TFLAGGROUP_SET_ANY   (TFLAGGROUP_SET | TFLAGGROUP_ANY)
 
#define TFLAGGROUP_CLEAR_ALL   (TFLAGGROUP_CLEAR | TFLAGGROUP_ALL)
 
#define TFLAGGROUP_CLEAR_ANY   (TFLAGGROUP_CLEAR | TFLAGGROUP_ANY)
 
#define TFLAGGROUP_CONSUME   (0x1 << 7)
 

Typedefs

typedef struct _tFlagGroup tFlagGroup
 
typedef struct _tFlagGroupInfo tFlagGroupInfo
 

Functions

void tFlagGroupInit (tFlagGroup *flagGroup, uint32_t flags)
 
uint32_t tFlagGroupWait (tFlagGroup *flagGroup, uint32_t waitType, uint32_t requestFlag, uint32_t *resultFlag, uint32_t waitTicks)
 
uint32_t tFlagGroupNoWaitGet (tFlagGroup *flagGroup, uint32_t waitType, uint32_t requestFlag, uint32_t *resultFlag)
 
void tFlagGroupNotify (tFlagGroup *flagGroup, uint8_t isSet, uint32_t flags)
 
void tFlagGroupGetInfo (tFlagGroup *flagGroup, tFlagGroupInfo *info)
 
uint32_t tFlagGroupDestroy (tFlagGroup *flagGroup)
 

Detailed Description

tinyOS的事件标志实现

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

Macro Definition Documentation

◆ TFLAGGROUP_ALL

#define TFLAGGROUP_ALL   (0x1 << 1)

Definition at line 38 of file tFlagGroup.h.

◆ TFLAGGROUP_ANY

#define TFLAGGROUP_ANY   (0x0 << 1)

Definition at line 37 of file tFlagGroup.h.

◆ TFLAGGROUP_CLEAR

#define TFLAGGROUP_CLEAR   (0x0 << 0)

Definition at line 35 of file tFlagGroup.h.

◆ TFLAGGROUP_CLEAR_ALL

#define TFLAGGROUP_CLEAR_ALL   (TFLAGGROUP_CLEAR | TFLAGGROUP_ALL)

Definition at line 42 of file tFlagGroup.h.

◆ TFLAGGROUP_CLEAR_ANY

#define TFLAGGROUP_CLEAR_ANY   (TFLAGGROUP_CLEAR | TFLAGGROUP_ANY)

Definition at line 43 of file tFlagGroup.h.

◆ TFLAGGROUP_CONSUME

#define TFLAGGROUP_CONSUME   (0x1 << 7)

Definition at line 45 of file tFlagGroup.h.

◆ TFLAGGROUP_SET

#define TFLAGGROUP_SET   (0x1 << 0)

Definition at line 36 of file tFlagGroup.h.

◆ TFLAGGROUP_SET_ALL

#define TFLAGGROUP_SET_ALL   (TFLAGGROUP_SET | TFLAGGROUP_ALL)

Definition at line 40 of file tFlagGroup.h.

◆ TFLAGGROUP_SET_ANY

#define TFLAGGROUP_SET_ANY   (TFLAGGROUP_SET | TFLAGGROUP_ANY)

Definition at line 41 of file tFlagGroup.h.

Typedef Documentation

◆ tFlagGroup

typedef struct _tFlagGroup tFlagGroup

◆ tFlagGroupInfo

Function Documentation

◆ tFlagGroupDestroy()

uint32_t tFlagGroupDestroy ( tFlagGroup flagGroup)

销毁事件标志组

Parameters
flagGroup事件标志组
Returns
因销毁该存储控制块而唤醒的任务数量

Definition at line 191 of file tFlagGroup.c.

Here is the call graph for this function:

◆ tFlagGroupGetInfo()

void tFlagGroupGetInfo ( tFlagGroup flagGroup,
tFlagGroupInfo info 
)

查询事件标志组的状态信息

Parameters
flagGroup事件标志组
info状态查询存储的位置

Definition at line 176 of file tFlagGroup.c.

Here is the call graph for this function:

◆ tFlagGroupInit()

void tFlagGroupInit ( tFlagGroup flagGroup,
uint32_t  flags 
)

初始化事件标志组

Parameters
flagGroup等待初始化的事件标志组
flags初始事件标志

Definition at line 24 of file tFlagGroup.c.

Here is the call graph for this function:

◆ tFlagGroupNotify()

void tFlagGroupNotify ( tFlagGroup flagGroup,
uint8_t  isSet,
uint32_t  flags 
)

通知事件标志组相应的事件标志设置或者清0。如果等待队列中有任务,则对任务进行处理

Parameters
flagGroup事件标志组
isSet事件标志是否置位
flags哪些事件标志位发生了变化

Definition at line 131 of file tFlagGroup.c.

Here is the call graph for this function:

◆ tFlagGroupNoWaitGet()

uint32_t tFlagGroupNoWaitGet ( tFlagGroup flagGroup,
uint32_t  waitType,
uint32_t  requestFlag,
uint32_t *  resultFlag 
)

无阻塞获取事件标志组中特定的标志,当条件不满足时,立即退出

Parameters
flagGroup获取的事件标志组
waitType获取的事件类型
requstFlag请求的事件标志
resultFlag等待标志结果
获取结果,tErrorResourceUnavaliable.tErrorNoError

Definition at line 114 of file tFlagGroup.c.

Here is the call graph for this function:

◆ tFlagGroupWait()

uint32_t tFlagGroupWait ( tFlagGroup flagGroup,
uint32_t  waitType,
uint32_t  requestFlag,
uint32_t *  resultFlag,
uint32_t  waitTicks 
)

获取事件标志组中特定的标志

Parameters
flagGroup获取的事件标志组
waitType获取的事件类型
requstFlag请求的事件标志
resultFlag等待标志结果
watiTicks当条件不满足时,最大等待多少个ticks时间
获取结果,tErrorResourceUnavaliable.tErrorNoError

Definition at line 78 of file tFlagGroup.c.

Here is the call graph for this function: