RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
mailbox.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2023-09-23 GuEe-GUI first version
9 */
10
11#ifndef __MAILBOX_H__
12#define __MAILBOX_H__
13
14#include <rtdef.h>
15#include <drivers/ofw.h>
16
17struct rt_mbox_chan;
18struct rt_mbox_client;
20
32
34{
36 void (*release)(struct rt_mbox_chan *);
37 rt_err_t (*send)(struct rt_mbox_chan *, const void *data);
39 int (*ofw_parse)(struct rt_mbox_controller *, struct rt_ofw_cell_args *);
40};
41
54
56{
57 struct rt_device *dev;
58
59 void (*rx_callback)(struct rt_mbox_client *, void *data);
60 void (*tx_prepare)(struct rt_mbox_client *, const void *data);
61 void (*tx_done)(struct rt_mbox_client *, const void *data, rt_err_t err);
62};
63
66
67rt_err_t rt_mbox_send(struct rt_mbox_chan *chan, const void *data,
68 rt_uint32_t timeout_ms);
69void rt_mbox_send_done(struct rt_mbox_chan *chan, rt_err_t err);
71rt_err_t rt_mbox_recv(struct rt_mbox_chan *chan, void *data);
72
76
77#endif /* __MAILBOX_H__ */
rt_err_t rt_mbox_controller_unregister(struct rt_mbox_controller *ctrl)
rt_err_t rt_mbox_controller_register(struct rt_mbox_controller *ctrl)
rt_err_t rt_mbox_release(struct rt_mbox_chan *chan)
rt_err_t rt_mbox_send(struct rt_mbox_chan *chan, const void *data, rt_uint32_t timeout_ms)
rt_bool_t rt_mbox_peek(struct rt_mbox_chan *chan)
void rt_mbox_send_done(struct rt_mbox_chan *chan, rt_err_t err)
struct rt_mbox_chan * rt_mbox_request_by_index(struct rt_mbox_client *client, int index)
rt_err_t rt_mbox_recv(struct rt_mbox_chan *chan, void *data)
struct rt_mbox_chan * rt_mbox_request_by_name(struct rt_mbox_client *client, char *name)
int rt_bool_t
rt_base_t rt_err_t
rt_ubase_t rt_size_t
struct rt_list_node rt_list_t
unsigned int rt_uint32_t
struct rt_mbox_client * client
struct rt_timer timer
struct rt_mbox_controller * ctrl
rt_bool_t complete
struct rt_spinlock lock
void(* tx_done)(struct rt_mbox_client *, const void *data, rt_err_t err)
void(* tx_prepare)(struct rt_mbox_client *, const void *data)
struct rt_device * dev
void(* rx_callback)(struct rt_mbox_client *, void *data)
void(* release)(struct rt_mbox_chan *)
rt_bool_t(* peek)(struct rt_mbox_chan *)
int(* ofw_parse)(struct rt_mbox_controller *, struct rt_ofw_cell_args *)
rt_err_t(* send)(struct rt_mbox_chan *, const void *data)
rt_err_t(* request)(struct rt_mbox_chan *)
const struct rt_mbox_controller_ops * ops
struct rt_device * dev
struct rt_mbox_chan * chans