ubinos
msgq.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Sung Ho Park
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef UBIK_MSGQ_H_
8 #define UBIK_MSGQ_H_
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
118 #include <ubinos_config.h>
119 #include <ubinos/type.h>
120 
121 #include "task.h"
122 
124 #define MSGQ_OPT__IGNOREOVERFLOW 0x80
125 
127 typedef struct __msgq_tip_t
128 {
129  unsigned int type :8;
130  unsigned int valid :1;
131  unsigned int reserved :7;
132  unsigned int reserved2 :16;
134 
137 
155 int msgq_create(msgq_pt * msgq_p, unsigned int msgsize, unsigned int maxcount);
156 
178 int msgq_create_ext(msgq_pt * msgq_p, unsigned int msgsize,
179  unsigned int maxcount, unsigned int option);
180 
194 int msgq_delete(msgq_pt * msgq_p);
195 
212 int msgq_receive(msgq_pt msgq, unsigned char * msg);
213 
234 int msgq_receive_timed(msgq_pt msgq, unsigned char * msg, unsigned int tick);
235 
256 int msgq_receive_timedms(msgq_pt msgq, unsigned char * msg,
257  unsigned int timems);
258 
274 int msgq_send(msgq_pt msgq, unsigned char * msg);
275 
287 int msgq_clear(msgq_pt msgq);
288 
305 
320 int msgq_getcount(msgq_pt msgq, unsigned int * count_p);
321 
322 #ifdef __cplusplus
323 }
324 #endif
325 
326 #endif /* UBIK_MSGQ_H_ */
int msgq_receive_timed(msgq_pt msgq, unsigned char *msg, unsigned int tick)
int msgq_clear(msgq_pt msgq)
int msgq_delete(msgq_pt *msgq_p)
struct __msgq_tip_t _msgq_tip_t
int msgq_create_ext(msgq_pt *msgq_p, unsigned int msgsize, unsigned int maxcount, unsigned int option)
int msgq_send(msgq_pt msgq, unsigned char *msg)
int msgq_setsender(msgq_pt msgq, task_pt task)
_msgq_tip_t * msgq_pt
Definition: msgq.h:136
int msgq_create(msgq_pt *msgq_p, unsigned int msgsize, unsigned int maxcount)
int msgq_receive(msgq_pt msgq, unsigned char *msg)
int msgq_receive_timedms(msgq_pt msgq, unsigned char *msg, unsigned int timems)
int msgq_getcount(msgq_pt msgq, unsigned int *count_p)
Definition: msgq.h:128
unsigned int reserved2
Definition: msgq.h:132
unsigned int reserved
Definition: msgq.h:131
unsigned int type
Definition: msgq.h:129
unsigned int valid
Definition: msgq.h:130
Definition: task.h:342
ubik task API
ubinos basic data type