nRF RPC IPC Service transport

The nRF RPC IPC Service transport allows you to use the Remote procedure call library (nRF RPC) library to execute procedures on remote processors.

This feature is used in the Bluetooth Low Energy Remote Procedure Call library and also in the nRF5340: nRF RPC Entropy sample.

API documentation

Header file: include/nrf_rpc/nrf_rpc_ipc.h
Source file: subsys/nrf_rpc/nrf_rpc_ipc.c
group nrf_rpc_ipc

nRF RPC IPC Service transport.

Defines

NRF_RPC_IPC_TRANSPORT_DECLARE(_name)

Extern nRF RPC IPC Service transport declaration.

Can be used in header files. It is useful when several nRF RPC group are defined amongst different source files but they can share the same transport instance.

Parameters
  • _name[in] Name of the nRF RPC transport.

NRF_RPC_IPC_TRANSPORT(_name, _ipc, _ept_name)

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
  • _name[in] nRF RPC IPC Service transport instance name.

  • _ipc[in] The instance used for the IPC Service to transfer data between CPUs.

  • _ept_name[in] IPC Service endpoint name. The endpoint must have the same name on the corresponding remote CPU.

Variables

const struct nrf_rpc_tr_api nrf_rpc_ipc_service_api
struct nrf_rpc_ipc_endpoint
#include <nrf_rpc_ipc.h>

nRF RPC IPC transport endpoint configuration.

Public Members

struct ipc_ept_cfg ept_cfg

IPC Service endpoint configuration.

struct ipc_ept ept

IPC Service endpoint structure.

struct k_event ept_bond

IPC Service endpoint bond event.

struct nrf_rpc_ipc
#include <nrf_rpc_ipc.h>

nRF RPC IPC Service transport instance.

Public Members

struct nrf_rpc_ipc_endpoint endpoint

Endpoint configuration.

nrf_rpc_tr_receive_handler_t receive_cb

Data received callback. It is called when data was received on given endpoint.

void *context

User context.

bool used

Indicates if transport is already initialized.