Contiki-NG
Loading...
Searching...
No Matches
nrf-ipc-mac.c File Reference

IPC MAC driver for the nRF5340 network core. More...

#include "contiki.h"
#include "net/mac/mac.h"
#include "net/netstack.h"
#include "net/packetbuf.h"
#include "nrf-ipc.h"
#include <inttypes.h>
#include <string.h>
#include "sys/log.h"

Go to the source code of this file.

Macros

#define ACK_FRAME_LEN   3
 802.15.4 ACK frame constants.
 

Functions

static void send_ack_if_needed (const uint8_t *frame, int len)
 Send a software ACK for a received frame if the ACK request bit is set.
 
static void packet_input (void)
 Called by the radio driver process when a frame has been received.
 

Detailed Description

IPC MAC driver for the nRF5340 network core.

This MAC driver runs on the network core and forwards received frames to the application core via the IPC shared memory. It replaces NULLMAC for the net core, enabling fully interrupt-driven frame reception: the radio ISR triggers the radio driver process, which reads the frame and calls this MAC's input function.

Author
Nicolas Tsiftes nicol.nosp@m.as.t.nosp@m.sifte.nosp@m.s@ri.nosp@m..se

Definition in file nrf-ipc-mac.c.

Function Documentation

◆ packet_input()

static void packet_input ( void )
static

Called by the radio driver process when a frame has been received.

The frame is in packetbuf. We send a software ACK, then forward the raw frame to the application core via shared memory.

Definition at line 135 of file nrf-ipc-mac.c.

References ACK_FRAME_LEN, nrf_ipc_shared_mem::heartbeat, NRF_IPC_MAX_FRAME_LEN, nrf_ipc_signal(), packetbuf_datalen(), packetbuf_dataptr(), nrf_ipc_shared_mem::rx, nrf_ipc_shared_mem::rx_ack, and send_ack_if_needed().