summaryrefslogtreecommitdiff
path: root/components/drivers/include/ipc
diff options
context:
space:
mode:
authorWBI\nxf44444 <[email protected]>2022-01-26 01:43:05 +0800
committerWBI\nxf44444 <[email protected]>2022-01-26 01:43:05 +0800
commit8b0f50b7e211ee32ab08ba085ecd74588c3a3c63 (patch)
tree75440be5ecd30cc1403a9387851c0530ed057981 /components/drivers/include/ipc
parent3be35fecae513b07c35bd6f3992bf7824434bdd6 (diff)
parent32a5668593c578b85560338c29d76f3a252c8dbc (diff)
Update i2c driver, add read ACK and BUS status check
Diffstat (limited to 'components/drivers/include/ipc')
-rw-r--r--components/drivers/include/ipc/completion.h2
-rw-r--r--components/drivers/include/ipc/dataqueue.h2
-rw-r--r--components/drivers/include/ipc/pipe.h8
-rw-r--r--components/drivers/include/ipc/poll.h2
-rw-r--r--components/drivers/include/ipc/ringblk_buf.h11
-rw-r--r--components/drivers/include/ipc/ringbuffer.h10
-rw-r--r--components/drivers/include/ipc/waitqueue.h4
-rw-r--r--components/drivers/include/ipc/workqueue.h35
8 files changed, 36 insertions, 38 deletions
diff --git a/components/drivers/include/ipc/completion.h b/components/drivers/include/ipc/completion.h
index acfcaa3995..087a9be813 100644
--- a/components/drivers/include/ipc/completion.h
+++ b/components/drivers/include/ipc/completion.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/components/drivers/include/ipc/dataqueue.h b/components/drivers/include/ipc/dataqueue.h
index 76203c404d..5dd94e55c0 100644
--- a/components/drivers/include/ipc/dataqueue.h
+++ b/components/drivers/include/ipc/dataqueue.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/components/drivers/include/ipc/pipe.h b/components/drivers/include/ipc/pipe.h
index 93ba95cd2c..7d271c3a04 100644
--- a/components/drivers/include/ipc/pipe.h
+++ b/components/drivers/include/ipc/pipe.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -15,12 +15,6 @@
#include <rtthread.h>
#include <rtdevice.h>
-#ifndef RT_PIPE_BUFSZ
-#define PIPE_BUFSZ 512
-#else
-#define PIPE_BUFSZ RT_PIPE_BUFSZ
-#endif
-
struct rt_pipe_device
{
struct rt_device parent;
diff --git a/components/drivers/include/ipc/poll.h b/components/drivers/include/ipc/poll.h
index 8c68a96af8..1574215c77 100644
--- a/components/drivers/include/ipc/poll.h
+++ b/components/drivers/include/ipc/poll.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/components/drivers/include/ipc/ringblk_buf.h b/components/drivers/include/ipc/ringblk_buf.h
index 94fc2cfff3..7a3c930f73 100644
--- a/components/drivers/include/ipc/ringblk_buf.h
+++ b/components/drivers/include/ipc/ringblk_buf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -71,14 +71,21 @@ struct rt_rbb
rt_size_t blk_max_num;
/* saved the initialized and put status blocks */
rt_slist_t blk_list;
+ /* point to tail node */
+ rt_slist_t *tail;
+ /* free node list */
+ rt_slist_t free_list;
};
typedef struct rt_rbb *rt_rbb_t;
/* rbb (ring block buffer) API */
void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t block_set, rt_size_t blk_max_num);
+rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb);
+
+#ifdef RT_USING_HEAP
rt_rbb_t rt_rbb_create(rt_size_t buf_size, rt_size_t blk_max_num);
void rt_rbb_destroy(rt_rbb_t rbb);
-rt_size_t rt_rbb_get_buf_size(rt_rbb_t rbb);
+#endif
/* rbb block API */
rt_rbb_blk_t rt_rbb_blk_alloc(rt_rbb_t rbb, rt_size_t blk_size);
diff --git a/components/drivers/include/ipc/ringbuffer.h b/components/drivers/include/ipc/ringbuffer.h
index 2afd2ca213..7da50225b3 100644
--- a/components/drivers/include/ipc/ringbuffer.h
+++ b/components/drivers/include/ipc/ringbuffer.h
@@ -1,10 +1,11 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
+ * 2021-08-14 Jackistang add comments for function interface.
*/
#ifndef RINGBUFFER_H__
#define RINGBUFFER_H__
@@ -80,6 +81,13 @@ struct rt_ringbuffer* rt_ringbuffer_create(rt_uint16_t length);
void rt_ringbuffer_destroy(struct rt_ringbuffer *rb);
#endif
+/**
+ * @brief Get the buffer size of the ring buffer object.
+ *
+ * @param rb A pointer to the ring buffer object.
+ *
+ * @return Buffer size.
+ */
rt_inline rt_uint16_t rt_ringbuffer_get_size(struct rt_ringbuffer *rb)
{
RT_ASSERT(rb != RT_NULL);
diff --git a/components/drivers/include/ipc/waitqueue.h b/components/drivers/include/ipc/waitqueue.h
index e26ec1e896..fbf5f93142 100644
--- a/components/drivers/include/ipc/waitqueue.h
+++ b/components/drivers/include/ipc/waitqueue.h
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
- * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon
+ * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon
* to blocked thread.
*/
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h
index 23e256c420..b2224bdcf4 100644
--- a/components/drivers/include/ipc/workqueue.h
+++ b/components/drivers/include/ipc/workqueue.h
@@ -1,10 +1,12 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
+ * 2021-08-01 Meco Man remove rt_delayed_work_init() and rt_delayed_work structure
+ * 2021-08-14 Jackistang add comments for rt_work_init()
*/
#ifndef WORKQUEUE_H__
#define WORKQUEUE_H__
@@ -29,6 +31,7 @@ enum
struct rt_workqueue
{
rt_list_t work_list;
+ rt_list_t delayed_list;
struct rt_work *work_current; /* current work */
struct rt_semaphore sem;
@@ -47,42 +50,28 @@ struct rt_work
struct rt_workqueue *workqueue;
};
-struct rt_delayed_work
-{
- struct rt_work work;
-};
-
#ifdef RT_USING_HEAP
/**
* WorkQueue for DeviceDriver
*/
+void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data), void *work_data);
struct rt_workqueue *rt_workqueue_create(const char *name, rt_uint16_t stack_size, rt_uint8_t priority);
rt_err_t rt_workqueue_destroy(struct rt_workqueue *queue);
rt_err_t rt_workqueue_dowork(struct rt_workqueue *queue, struct rt_work *work);
-rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t time);
+rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *work, rt_tick_t ticks);
rt_err_t rt_workqueue_cancel_work(struct rt_workqueue *queue, struct rt_work *work);
rt_err_t rt_workqueue_cancel_work_sync(struct rt_workqueue *queue, struct rt_work *work);
+rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue);
+rt_err_t rt_workqueue_urgent_work(struct rt_workqueue *queue, struct rt_work *work);
#ifdef RT_USING_SYSTEM_WORKQUEUE
-rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time);
+rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t ticks);
+rt_err_t rt_work_urgent(struct rt_work *work);
rt_err_t rt_work_cancel(struct rt_work *work);
-#endif
+#endif /* RT_USING_SYSTEM_WORKQUEUE */
-rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data),
- void *work_data)
-{
- rt_list_init(&(work->list));
- work->work_func = work_func;
- work->work_data = work_data;
- work->workqueue = RT_NULL;
- work->flags = 0;
- work->type = 0;
-}
-void rt_delayed_work_init(struct rt_delayed_work *work, void (*work_func)(struct rt_work *work,
- void *work_data), void *work_data);
-int rt_work_sys_workqueue_init(void);
-#endif
+#endif /* RT_USING_HEAP */
#endif