mirror of
https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32.git
synced 2025-01-21 10:51:20 +08:00
de7bad9245
2、【创建】Eclipse工程,并支持IAR插件调试 3、【创建】Keil工程,位于/RVMDK目录下 4、【创建】IAR工程,位于/EWARM目录下 5、【添加】RT-Thread1.1.1操作系统支持 6、【添加】LED1、LED2系统运行指示灯 7、【修改】Readdme.md文件 Signed-off-by: armink <armink.ztl@gmail.com>
44 lines
1.4 KiB
C
44 lines
1.4 KiB
C
#ifndef __MQUEUE_H__
|
|
#define __MQUEUE_H__
|
|
|
|
#include <rtthread.h>
|
|
#include <pthread.h>
|
|
|
|
struct mqdes
|
|
{
|
|
/* reference count and unlinked */
|
|
rt_uint16_t refcount;
|
|
rt_uint16_t unlinked;
|
|
|
|
/* RT-Thread message queue */
|
|
rt_mq_t mq;
|
|
/* next posix mqueue */
|
|
struct mqdes* next;
|
|
};
|
|
typedef struct mqdes* mqd_t;
|
|
|
|
struct mq_attr
|
|
{
|
|
long mq_flags; /* Message queue flags. */
|
|
long mq_maxmsg; /* Maximum number of messages. */
|
|
long mq_msgsize; /* Maximum message size. */
|
|
long mq_curmsgs; /* Number of messages currently queued. */
|
|
};
|
|
|
|
int mq_close(mqd_t mqdes);
|
|
int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat);
|
|
int mq_notify(mqd_t mqdes, const struct sigevent *notification);
|
|
mqd_t mq_open(const char *name, int oflag, ...);
|
|
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio);
|
|
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio);
|
|
int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat,
|
|
struct mq_attr *omqstat);
|
|
ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len,
|
|
unsigned *msg_prio, const struct timespec *abs_timeout);
|
|
int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio,
|
|
const struct timespec *abs_timeout);
|
|
|
|
int mq_unlink(const char *name);
|
|
|
|
#endif
|