nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ NRF_RPC_IPC_TRANSPORT

#define NRF_RPC_IPC_TRANSPORT ( _name,
_ipc,
_ept_name )

#include <include/nrf_rpc/nrf_rpc_ipc.h>

Value:
static struct nrf_rpc_ipc _name##_instance = { \
.ipc = _ipc, \
.endpoint.ept_cfg.name = _ept_name, \
}; \
\
const struct nrf_rpc_tr _name = { \
.ctx = &_name##_instance \
}
const struct nrf_rpc_tr_api nrf_rpc_ipc_service_api
nRF RPC IPC Service transport instance.
Definition nrf_rpc_ipc.h:50

Defines the nRF IPC Transport instance.

It creates the nRF RPC IPC Service transport instance. The _ipc parameter defines the destination remote CPU. A single instance of this transport can be shared between several nRF RPC groups. Thus, a single endpoint is shared by multiple nRF RPC groups. It is also allowed to share a single IPC instance with a different endpoint name between groups.

Example:

  • Two groups share the same IPC instance and the same endpoint:

    NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_1");

    NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_1, NULL, NULL, NULL);

  • Two groups share the same IPC instance but endpoint is different for each group:

    NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_1"); NRF_RPC_IPC_TRANSPORT(nrf_rpc_2, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_2");

    NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_2, NULL, NULL, NULL);

  • Each group use different IPC instance, for example each IPC instance defined communication with different remote CPUs:

    NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept"); NRF_RPC_IPC_TRANSPORT(nrf_rpc_2, DEVICE_DT_GET(DT_NODELABEL(ipc1)), "nrf_rpc_ept");

    NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_2, NULL, NULL, NULL);

Parameters
[in]_namenRF RPC IPC Service transport instance name.
[in]_ipcThe instance used for the IPC Service to transfer data between CPUs.
[in]_ept_nameIPC Service endpoint name. The endpoint must have the same name on the corresponding remote CPU.