44#include "nrfx_config.h"
49#include "hal/nrf_ipc.h"
52#define LOG_MODULE "IPC"
53#define LOG_LEVEL LOG_LEVEL_DBG
63#define IPC_APP_TO_NET_CHANNEL 0
64#define IPC_NET_TO_APP_CHANNEL 1
66static struct process *ipc_process;
84 ipc_process = callback_proc;
86#if defined(NRF5340_XXAA_APPLICATION)
92 nrf_ipc_send_config_set(NRF_IPC, 0,
93 (1UL << IPC_APP_TO_NET_CHANNEL));
94 nrf_ipc_receive_config_set(NRF_IPC, 0,
95 (1UL << IPC_NET_TO_APP_CHANNEL));
96#elif defined(NRF5340_XXAA_NETWORK)
102 nrf_ipc_send_config_set(NRF_IPC, 0,
103 (1UL << IPC_NET_TO_APP_CHANNEL));
104 nrf_ipc_receive_config_set(NRF_IPC, 0,
105 (1UL << IPC_APP_TO_NET_CHANNEL));
109 nrf_ipc_event_clear(NRF_IPC, nrf_ipc_receive_event_get(0));
110 nrf_ipc_int_enable(NRF_IPC, (1UL << 0));
112 NVIC_ClearPendingIRQ(IPC_IRQn);
113 NVIC_EnableIRQ(IPC_IRQn);
115 LOG_DBG(
"IPC initialized\n");
127 nrf_ipc_task_trigger(NRF_IPC, nrf_ipc_send_task_get(0));
139 if(nrf_ipc_event_check(NRF_IPC, nrf_ipc_receive_event_get(0))) {
140 nrf_ipc_event_clear(NRF_IPC, nrf_ipc_receive_event_get(0));
142 if(ipc_process != NULL) {
void nrf_ipc_init(struct process *callback_proc)
Initialize the IPC transport layer.
void nrf_ipc_signal(void)
Send an IPC signal to the other core.
void process_poll(struct process *p)
Request a process to be polled.
Header file for the logging system.
IPC protocol definitions for nRF5340 dual-core communication.