tinyOS  v1.00
tMBox.h
Go to the documentation of this file.
1 
14 #ifndef TMBOX_H
15 #define TMBOX_H
16 
17 #include "tConfig.h"
18 
19 #if !defined(TINYOS_ENABLE_MBOX) || TINYOS_ENABLE_MBOX == 1
20 
21 #include "tEvent.h"
22 
23 #define tMBOXSendNormal 0x00
24 #define tMBOXSendFront 0x01
26 // 邮箱类型
27 typedef struct _tMbox {
30  uint32_t count;
31  uint32_t read;
32  uint32_t write;
33  uint32_t maxCount;
35  void **msgBuffer;
36 } tMbox;
37 
38 // 邮箱状态类型
39 typedef struct _tMboxInfo {
40  uint32_t count;
41  uint32_t maxCount;
42  uint32_t taskCount;
43 } tMboxInfo;
44 
45 void tMboxInit (tMbox *mbox, void **msgBuffer, uint32_t maxCount);
46 uint32_t tMboxWait (tMbox *mbox, void **msg, uint32_t waitTicks);
47 uint32_t tMboxNoWaitGet (tMbox *mbox, void **msg);
48 uint32_t tMboxNotify (tMbox *mbox, void *msg, uint32_t notifyOption);
49 void tMboxFlush (tMbox *mbox);
50 uint32_t tMboxDestroy (tMbox *mbox);
51 void tMboxGetInfo (tMbox *mbox, tMboxInfo *info);
52 
53 #endif // TINYOS_ENABLE_MBOX
54 
55 #endif /* TMBOX_H */
56 
uint32_t taskCount
Definition: tMBox.h:42
Definition: tMBox.h:27
void tMboxGetInfo(tMbox *mbox, tMboxInfo *info)
Definition: tMBox.c:192
uint32_t maxCount
Definition: tMBox.h:41
uint32_t tMboxNotify(tMbox *mbox, void *msg, uint32_t notifyOption)
Definition: tMBox.c:108
struct _tMbox tMbox
uint32_t maxCount
Definition: tMBox.h:33
Definition: tEvent.h:32
struct _tMboxInfo tMboxInfo
uint32_t count
Definition: tMBox.h:30
uint32_t count
Definition: tMBox.h:40
void tMboxFlush(tMbox *mbox)
Definition: tMBox.c:154
void ** msgBuffer
Definition: tMBox.h:35
void tMboxInit(tMbox *mbox, void **msgBuffer, uint32_t maxCount)
Definition: tMBox.c:25
uint32_t read
Definition: tMBox.h:31
uint32_t tMboxDestroy(tMbox *mbox)
Definition: tMBox.c:172
uint32_t tMboxWait(tMbox *mbox, void **msg, uint32_t waitTicks)
Definition: tMBox.c:42
uint32_t write
Definition: tMBox.h:32
tEvent event
Definition: tMBox.h:28
uint32_t tMboxNoWaitGet(tMbox *mbox, void **msg)
Definition: tMBox.c:79