Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
RPMsg multiple instance APIs

RPMsg multiple instance API. More...

Data Structures

struct  rpmsg_mi_cb
 Event callback structure. More...
 
struct  rpmsg_mi_ept
 Endpoint instance. More...
 
struct  rpmsg_mi_ept_cfg
 Endpoint configuration. More...
 
struct  rpmsg_mi_ctx
 Struct describing the context of the RPMsg instance. More...
 
struct  rpmsg_mi_ctx_shm_cfg
 
struct  rpmsg_mi_ctx_cfg
 Configuration of the RPMsg instance. More...
 

Macros

#define VDEV_START_ADDR   CONFIG_RPMSG_MULTI_INSTANCE_SHM_BASE_ADDRESS
 
#define VDEV_SIZE   CONFIG_RPMSG_MULTI_INSTANCE_SHM_SIZE
 
#define SHM_START_ADDR   VDEV_START_ADDR
 
#define SHM_SIZE   VDEV_SIZE
 
#define VRING_ALIGNMENT   (4)
 
#define VDEV_STATUS_SIZE   (0x4)
 

Functions

int rpmsg_mi_ctx_init (struct rpmsg_mi_ctx *ctx, const struct rpmsg_mi_ctx_cfg *cfg)
 Initialization of RPMsg instance. More...
 
int rpmsg_mi_ept_register (struct rpmsg_mi_ctx *ctx, struct rpmsg_mi_ept *ept, struct rpmsg_mi_ept_cfg *cfg)
 Register IPC endpoint. More...
 
int rpmsg_mi_send (struct rpmsg_mi_ept *ept, const void *data, size_t len)
 Send data using given IPC endpoint. More...
 

Detailed Description

RPMsg multiple instance API.

Macro Definition Documentation

◆ SHM_SIZE

#define SHM_SIZE   VDEV_SIZE

◆ SHM_START_ADDR

#define SHM_START_ADDR   VDEV_START_ADDR

◆ VDEV_SIZE

#define VDEV_SIZE   CONFIG_RPMSG_MULTI_INSTANCE_SHM_SIZE

◆ VDEV_START_ADDR

#define VDEV_START_ADDR   CONFIG_RPMSG_MULTI_INSTANCE_SHM_BASE_ADDRESS

◆ VDEV_STATUS_SIZE

#define VDEV_STATUS_SIZE   (0x4)

#include <include/ipc/rpmsg_multi_instance.h>

Size of status region.

◆ VRING_ALIGNMENT

#define VRING_ALIGNMENT   (4)

#include <include/ipc/rpmsg_multi_instance.h>

Alignment of vring buffer.

Function Documentation

◆ rpmsg_mi_ctx_init()

int rpmsg_mi_ctx_init ( struct rpmsg_mi_ctx ctx,
const struct rpmsg_mi_ctx_cfg cfg 
)

#include <include/ipc/rpmsg_multi_instance.h>

Initialization of RPMsg instance.

Each instance has an automatically allocated area of shared memory.

Parameters
ctxPointer to the RPMsg instance.
cfgPointer to the configuration structure.
Return values
0if the operation was successful. -EINVAL when the incorrect parameters have been passed. -EIO when the configuration is not correct. -ENODEV failed to get TX or RX IPM handle. -ENOMEM when there is not enough memory to register virqueue. < 0 on other negative errno code, reported by rpmsg.

◆ rpmsg_mi_ept_register()

int rpmsg_mi_ept_register ( struct rpmsg_mi_ctx ctx,
struct rpmsg_mi_ept ept,
struct rpmsg_mi_ept_cfg cfg 
)

#include <include/ipc/rpmsg_multi_instance.h>

Register IPC endpoint.

Registers IPC endpoint to enable communication with a remote device.

Parameters
ctxPointer to the RPMsg instance.
eptPointer to endpoint object.
cfgPointer to the endpoint configuration.
Return values
-EINVALOne of the parameters is incorrect.
othererrno code reported by rpmsg.

◆ rpmsg_mi_send()

int rpmsg_mi_send ( struct rpmsg_mi_ept ept,
const void data,
size_t  len 
)

#include <include/ipc/rpmsg_multi_instance.h>

Send data using given IPC endpoint.

Note: It is not possible to send a message of zero length.

Parameters
eptEndpoint object.
dataPointer to the buffer to send through RPMsg.
lenNumber of bytes to send.
Return values
Numberof bytes it has sent or negative error value on failure.