Contiki-NG
Loading...
Searching...
No Matches
nrf_802154_platform_sl_lptimer.c File Reference

Low Power Timer + SL Timer + Timer Coordinator backend for the nrf_802154 library on the nRF5340 network core. More...

#include "nrf_802154_sl_timer.h"
#include "platform/nrf_802154_platform_sl_lptimer.h"
#include "timer/nrf_802154_timer_coord.h"
#include "helpers/nrfx_gppi.h"
#include "hal/nrf_rtc.h"
#include "nrf.h"
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Low Power Timer + SL Timer + Timer Coordinator backend for the nrf_802154 library on the nRF5340 network core.

The open-source nrf_802154 SL ships only a Zephyr implementation of nrf_802154_sl_timer.c, so on bare-metal Contiki-NG we must provide both the SL timer service (the software timer list) and the platform low-power-timer HW backend. The structure mirrors the nRF54L15 port (arch/cpu/nrf/nrf54l15/nrf_802154_platform_sl_lptimer.c) but the HW backend is RTC-based instead of TIMER-based.

Hardware notes for the nRF5340 network core:

  • The network core has only RTC0 and RTC1 (no RTC2). RTC0 is the Contiki-NG system clock (clock-arch.c), so this backend uses RTC1. nrf_802154_project_config.h sets NRF_802154_RTC_INSTANCE_NO=1 to match (the nrf53 library default is RTC2, which does not exist on this core).
  • One lptick is one 32.768 kHz RTC tick (~30.5 us). The contract allows lpticks > 1 us; fine radio timing uses the separate high-frequency TIMER, not this timer.
  • The RTC COUNTER is 24-bit; overflow to a 64-bit lptick count is handled here. LFCLK must already be running (started by clock-arch.c for RTC0).

Definition in file nrf_802154_platform_sl_lptimer.c.