Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Icmsg IPC library API

Icmsg IPC library API . More...

Data Structures

struct  icmsg_config_t
 
struct  icmsg_data_t
 

Enumerations

enum  icmsg_state { ICMSG_STATE_OFF , ICMSG_STATE_BUSY , ICMSG_STATE_READY }
 

Functions

int icmsg_open (const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data, const struct ipc_service_cb *cb, void *ctx)
 Open an icmsg instance.
 
int icmsg_close (const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data)
 Close an icmsg instance.
 
int icmsg_send (const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data, const void *msg, size_t len)
 Send a message to the remote icmsg instance.
 

Detailed Description

Icmsg IPC library API .

Enumeration Type Documentation

◆ icmsg_state

#include <zephyr/ipc/icmsg.h>

Enumerator
ICMSG_STATE_OFF 
ICMSG_STATE_BUSY 
ICMSG_STATE_READY 

Function Documentation

◆ icmsg_close()

int icmsg_close ( const struct icmsg_config_t * conf,
struct icmsg_data_t * dev_data )

#include <zephyr/ipc/icmsg.h>

Close an icmsg instance.

Closing an icmsg instance results in releasing all resources used by given instance including the shared memory regions and mbox devices.

Parameters
[in]confStructure containing configuration parameters for the icmsg instance being closed. Its content must be the same as used for creating this instance with icmsg_open.
[in,out]dev_dataStructure containing run-time data used by the icmsg instance.
Return values
0on success.
othererrno codes from dependent modules.

◆ icmsg_open()

int icmsg_open ( const struct icmsg_config_t * conf,
struct icmsg_data_t * dev_data,
const struct ipc_service_cb * cb,
void * ctx )

#include <zephyr/ipc/icmsg.h>

Open an icmsg instance.

Open an icmsg instance to be able to send and receive messages to a remote instance. This function is blocking until the handshake with the remote instance is completed. This function is intended to be called late in the initialization process, possibly from a thread which can be safely blocked while handshake with the remote instance is being performed.

Parameters
[in]confStructure containing configuration parameters for the icmsg instance.
[in,out]dev_dataStructure containing run-time data used by the icmsg instance.
[in]cbStructure containing callback functions to be called on events generated by this icmsg instance. The pointed memory must be preserved while the icmsg instance is active.
[in]ctxPointer to context passed as an argument to callbacks.
Return values
0on success.
-EALREADYwhen the instance is already opened.
othererrno codes from dependent modules.

◆ icmsg_send()

int icmsg_send ( const struct icmsg_config_t * conf,
struct icmsg_data_t * dev_data,
const void * msg,
size_t len )

#include <zephyr/ipc/icmsg.h>

Send a message to the remote icmsg instance.

Parameters
[in]confStructure containing configuration parameters for the icmsg instance.
[in,out]dev_dataStructure containing run-time data used by the icmsg instance.
[in]msgPointer to a buffer containing data to send.
[in]lenSize of data in the msg buffer.
Return values
Numberof sent bytes.
-EBUSYwhen the instance has not finished handshake with the remote instance.
-ENODATAwhen the requested data to send is empty.
-EBADMSGwhen the requested data to send is too big.
-ENOBUFSwhen there are no TX buffers available.
othererrno codes from dependent modules.