Zephyr API 3.6.99
Loading...
Searching...
No Matches
mbox.h File Reference
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/syscalls/mbox.h>

Go to the source code of this file.

Data Structures

struct  mbox_msg
 Message struct (to hold data and its size). More...
 
struct  mbox_dt_spec
 MBOX specification from DT. More...
 

Macros

#define MBOX_DT_SPEC_GET(node_id, name)
 Structure initializer for struct mbox_dt_spec from devicetree.
 
#define MBOX_DT_SPEC_INST_GET(inst, name)
 Instance version of MBOX_DT_CHANNEL_GET()
 

Typedefs

typedef uint32_t mbox_channel_id_t
 Type for MBOX channel identifiers.
 

Functions

static bool mbox_is_ready_dt (const struct mbox_dt_spec *spec)
 Validate if MBOX device instance from a struct mbox_dt_spec is ready.
 
int mbox_send (const struct device *dev, mbox_channel_id_t channel_id, const struct mbox_msg *msg)
 Try to send a message over the MBOX device.
 
static int mbox_send_dt (const struct mbox_dt_spec *spec, const struct mbox_msg *msg)
 Try to send a message over the MBOX device from a struct mbox_dt_spec.
 
static int mbox_register_callback (const struct device *dev, mbox_channel_id_t channel_id, mbox_callback_t cb, void *user_data)
 Register a callback function on a channel for incoming messages.
 
static int mbox_register_callback_dt (const struct mbox_dt_spec *spec, mbox_callback_t cb, void *user_data)
 Register a callback function on a channel for incoming messages from a struct mbox_dt_spec.
 
int mbox_mtu_get (const struct device *dev)
 Return the maximum number of bytes possible in an outbound message.
 
static int mbox_mtu_get_dt (const struct mbox_dt_spec *spec)
 Return the maximum number of bytes possible in an outbound message from struct mbox_dt_spec.
 
int mbox_set_enabled (const struct device *dev, mbox_channel_id_t channel_id, bool enabled)
 Enable (disable) interrupts and callbacks for inbound channels.
 
static int mbox_set_enabled_dt (const struct mbox_dt_spec *spec, bool enabled)
 Enable (disable) interrupts and callbacks for inbound channels from a struct mbox_dt_spec.
 
uint32_t mbox_max_channels_get (const struct device *dev)
 Return the maximum number of channels.
 
static int mbox_max_channels_get_dt (const struct mbox_dt_spec *spec)
 Return the maximum number of channels from a struct mbox_dt_spec.