35#ifndef NRF_802154_UTILS_H__
36#define NRF_802154_UTILS_H__
42#include <soc/nrfx_coredep.h>
52#define NRF_802154_RTC_FREQUENCY 32768UL
55#define NRF_802154_US_PER_S 1000000ULL
58#define NRF_802154_US_PER_TICK NRF_802154_RTC_TICKS_TO_US(1)
61#define NRF_802154_FREQUENCY_US_PER_S_GCD_BITS 6
64#define NRF_802154_DIVIDE_AND_CEIL(A, B) (((A) + (B)-1) / (B))
67#define NRF_802154_RTC_TICKS_TO_US(ticks) \
68 NRF_802154_DIVIDE_AND_CEIL( \
69 (ticks) * (NRF_802154_US_PER_S >> NRF_802154_FREQUENCY_US_PER_S_GCD_BITS), \
70 (NRF_802154_RTC_FREQUENCY >> NRF_802154_FREQUENCY_US_PER_S_GCD_BITS))
76#define NUMELTS(X) (sizeof((X)) / sizeof(X[0]))
83#define nrf_802154_delay_us(time_in_us) nrfx_coredep_delay_us(time_in_us)
105#define nrf_802154_mcu_critical_enter(mcu_critical_state) \
108 (mcu_critical_state) = __get_PRIMASK(); \
121#define nrf_802154_mcu_critical_exit(mcu_critical_state) \
124 __set_PRIMASK(mcu_critical_state); \
167 t1 = ((time >> 13) * 0x8637bd0) >> 28;
169 t1 = time - t1 * 15625;
194 u1 = (t1 * 0x431bde82d7b);
195 u1 += 0x7fffffffffff;
static uint64_t NRF_802154_US_TO_RTC_TICKS(uint64_t time)
Definition nrf_802154_utils.h:128
uint32_t nrf_802154_mcu_critical_state_t
Type holding MCU critical section state.
Definition nrf_802154_utils.h:90
#define NRF_802154_ASSERT(condition)
Definition nrf_802154_assert.h:45