Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
MBOX Driver Backend API

Data Structures

struct  mbox_driver_api
  Driver Operations MBOX driver operations More...

Typedefs

typedef void(* mbox_callback_t) (const struct device *dev, mbox_channel_id_t channel_id, void *user_data, struct mbox_msg *data)
 Callback API for incoming MBOX messages.
typedef int(* mbox_send_t) (const struct device *dev, mbox_channel_id_t channel_id, const struct mbox_msg *msg)
 Callback API to send MBOX messages.
typedef int(* mbox_mtu_get_t) (const struct device *dev)
 Callback API to get maximum data size.
typedef int(* mbox_register_callback_t) (const struct device *dev, mbox_channel_id_t channel_id, mbox_callback_t cb, void *user_data)
 Callback API upon registration.
typedef int(* mbox_set_enabled_t) (const struct device *dev, mbox_channel_id_t channel_id, bool enabled)
 Callback API upon enablement of interrupts.
typedef uint32_t(* mbox_max_channels_get_t) (const struct device *dev)
 Callback API to get maximum number of channels.

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a MBOX driver.

Typedef Documentation

◆ mbox_callback_t

typedef void(* mbox_callback_t) (const struct device *dev, mbox_channel_id_t channel_id, void *user_data, struct mbox_msg *data)

#include <zephyr/drivers/mbox.h>

Callback API for incoming MBOX messages.

These callbacks execute in interrupt context. Therefore, use only interrupt-safe APIs. Registration of callbacks is done via mbox_register_callback()

The data parameter must be NULL in signalling mode.

Parameters
devMBOX device instance
channel_idChannel ID
user_dataPointer to some private data provided at registration time
dataMessage struct

◆ mbox_max_channels_get_t

typedef uint32_t(* mbox_max_channels_get_t) (const struct device *dev)

#include <zephyr/drivers/mbox.h>

Callback API to get maximum number of channels.

Parameters
devMBOX device instance
Returns
See return values for mbox_max_channels_get()
See also
mbox_max_channels_get()

◆ mbox_mtu_get_t

typedef int(* mbox_mtu_get_t) (const struct device *dev)

#include <zephyr/drivers/mbox.h>

Callback API to get maximum data size.

Parameters
devMBOX device instance
Returns
See the return values for mbox_mtu_get()
See also
mbox_mtu_get()

◆ mbox_register_callback_t

typedef int(* mbox_register_callback_t) (const struct device *dev, mbox_channel_id_t channel_id, mbox_callback_t cb, void *user_data)

#include <zephyr/drivers/mbox.h>

Callback API upon registration.

Parameters
devMBOX device instance
channel_idChannel ID
cbCallback function to execute on incoming message interrupts.
user_dataApplication-specific data pointer which will be passed to the callback function when executed.
Returns
See return values for mbox_register_callback()
See also
mbox_register_callback()

◆ mbox_send_t

typedef int(* mbox_send_t) (const struct device *dev, mbox_channel_id_t channel_id, const struct mbox_msg *msg)

#include <zephyr/drivers/mbox.h>

Callback API to send MBOX messages.

Parameters
devMBOX device instance
channel_idChannel ID
msgMessage struct
Returns
See the return values for mbox_send()
See also
mbox_send()

◆ mbox_set_enabled_t

typedef int(* mbox_set_enabled_t) (const struct device *dev, mbox_channel_id_t channel_id, bool enabled)

#include <zephyr/drivers/mbox.h>

Callback API upon enablement of interrupts.

Parameters
devMBOX device instance
channel_idChannel ID
enabledSet to 0 to disable and to nonzero to enable.
Returns
See return values for mbox_set_enabled()
See also
mbox_set_enabled()