Icmsg IPC library API.
More...
Icmsg IPC library API.
◆ icmsg_state
◆ icmsg_close()
#include <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] | conf | Structure 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_data | Structure containing run-time data used by the icmsg instance. |
- Return values
-
0 | on success. |
other | errno codes from dependent modules. |
◆ icmsg_open()
#include <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 pefromed.
- Parameters
-
[in] | conf | Structure containing configuration parameters for the icmsg instance. |
[in,out] | dev_data | Structure containing run-time data used by the icmsg instance. |
[in] | cb | Structure 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] | ctx | Pointer to context passed as an argument to callbacks. |
- Return values
-
0 | on success. |
-EALREADY | when the instance is already opened. |
other | errno codes from dependent modules. |
◆ icmsg_send()
#include <include/zephyr/ipc/icmsg.h>
Send a message to the remote icmsg instance.
- Parameters
-
[in] | conf | Structure containing configuration parameters for the icmsg instance. |
[in,out] | dev_data | Structure containing run-time data used by the icmsg instance. |
[in] | msg | Pointer to a buffer containing data to send. |
[in] | len | Size of data in the msg buffer. |
- Return values
-
Number | of sent bytes. |
-EBUSY | when the instance has not finished handshake with the remote instance. |
-ENODATA | when the requested data to send is empty. |
-EBADMSG | when the requested data to send is too big. |
-ENOBUFS | when there are no TX buffers available. |
other | errno codes from dependent modules. |