nRF5 SDK for Thread and Zigbee v4.0.0
Functions
Low Power Timer Abstraction Layer for the 802.15.4 driver

Module that defines the Low Power Timer Abstraction Layer for the 802.15.4 driver. More...

Functions

void nrf_802154_lp_timer_init (void)
 Initializes the Timer.
 
void nrf_802154_lp_timer_deinit (void)
 Deinitializes the Timer.
 
void nrf_802154_lp_timer_critical_section_enter (void)
 Enters the critical section of the timer. More...
 
void nrf_802154_lp_timer_critical_section_exit (void)
 Exits the critical section of the timer. More...
 
uint32_t nrf_802154_lp_timer_time_get (void)
 Gets the current time. More...
 
uint32_t nrf_802154_lp_timer_granularity_get (void)
 Gets the granularity of the timer. More...
 
void nrf_802154_lp_timer_start (uint32_t t0, uint32_t dt)
 Starts a one-shot timer that expires at the specified time. More...
 
void nrf_802154_lp_timer_stop (void)
 Stops the currently running timer.
 
bool nrf_802154_lp_timer_is_running (void)
 Checks if the timer is currently running. More...
 
void nrf_802154_lp_timer_sync_start_now (void)
 Starts a one-shot synchronization timer that expires at the nearest possible timepoint. More...
 
void nrf_802154_lp_timer_sync_start_at (uint32_t t0, uint32_t dt)
 Starts a one-shot synchronization timer that expires at the specified time. More...
 
void nrf_802154_lp_timer_sync_stop (void)
 Stops the currently running synchronization timer.
 
uint32_t nrf_802154_lp_timer_sync_event_get (void)
 Gets the event used to synchronize this timer with the HP Timer. More...
 
uint32_t nrf_802154_lp_timer_sync_time_get (void)
 Gets the timestamp of the synchronization event. More...
 
void nrf_802154_lp_timer_fired (void)
 Callback function executed when the timer expires.
 
void nrf_802154_lp_timer_synchronized (void)
 Callback function executed when the synchronization timer expires.
 

Detailed Description

Module that defines the Low Power Timer Abstraction Layer for the 802.15.4 driver.

Low Power Timer Abstraction Layer interface for the 802.15.4 driver.

The Low Power Timer Abstraction Layer is an abstraction layer of the timer that is meant to be used by the nRF 802.15.4 driver. This timer is intended to provide low latency (max. 100 microseconds) to allow the implementation of the following features in the driver code:

Note
Most of the Low Power Timer Abstraction Layer API is not intended to be called directly by the 802.15.4 driver modules. This API is used by the Timer Scheduler module included in the driver. Other modules should use the Timer Scheduler API. The exception are initialization and deinitialization functions nrf_802154_lp_timer_init() and nrf_802154_lp_timer_deinit(), as well as critical section management nrf_802154_lp_timer_critical_section_enter() and nrf_802154_lp_timer_critical_section_exit(), as these functions are called from the nrf_802154_critical_section module and from the global initialization and deinitialization functions nrf_802154_init() and nrf_802154_deinit().

Function Documentation

void nrf_802154_lp_timer_critical_section_enter ( void  )

Enters the critical section of the timer.

In the critical section, the timer cannot execute the nrf_802154_lp_timer_fired() function.

Note
The critical section cannot be nested.
void nrf_802154_lp_timer_critical_section_exit ( void  )

Exits the critical section of the timer.

In the critical section, the timer cannot execute the nrf_802154_lp_timer_fired() function.

Note
The critical section cannot be nested.
uint32_t nrf_802154_lp_timer_granularity_get ( void  )

Gets the granularity of the timer.

This function can be used to round up or round down the time calculations.

Returns
Timer granularity in microseconds.
bool nrf_802154_lp_timer_is_running ( void  )

Checks if the timer is currently running.

Return values
trueTimer is running.
falseTimer is not running.
void nrf_802154_lp_timer_start ( uint32_t  t0,
uint32_t  dt 
)

Starts a one-shot timer that expires at the specified time.

This function starts a one-shot timer that will expire dt microseconds after t0 time. If the timer is running when this function is called, the running timer is stopped automatically.

On timer expiration, the nrf_802154_lp_timer_fired function will be called. The timer stops automatically after the expiration.

Parameters
[in]t0Number of microseconds representing timer start time.
[in]dtTime of the timer expiration as time elapsed from t0, in microseconds.
uint32_t nrf_802154_lp_timer_sync_event_get ( void  )

Gets the event used to synchronize this timer with the HP Timer.

Returns
Address of the peripheral register corresponding to the event to be used for the timer synchronization.
void nrf_802154_lp_timer_sync_start_at ( uint32_t  t0,
uint32_t  dt 
)

Starts a one-shot synchronization timer that expires at the specified time.

This function starts a one-shot synchronization timer that expires dt microseconds after t0 time.

On timer expiration, nrf_802154_lp_timer_synchronized function is called and the event returned by nrf_802154_lp_timer_sync_event_get is triggered.

Parameters
[in]t0Number of microseconds that represents the timer start time.
[in]dtTime of the timer expiration as time elapsed from t0, in microseconds.
void nrf_802154_lp_timer_sync_start_now ( void  )

Starts a one-shot synchronization timer that expires at the nearest possible timepoint.

On timer expiration, the nrf_802154_lp_timer_synchronized function is called and the event returned by nrf_802154_lp_timer_sync_event_get is triggered.

Note
nrf_802154_lp_timer_synchronized may be called multiple times.
uint32_t nrf_802154_lp_timer_sync_time_get ( void  )

Gets the timestamp of the synchronization event.

Returns
Timestamp of the synchronization event.
uint32_t nrf_802154_lp_timer_time_get ( void  )

Gets the current time.

Precondition
Before getting the current time, the timer must be initialized with nrf_802154_lp_timer_init(). This is the only requirement that must be met before using this function.
Returns
Current time in microseconds.

Documentation feedback | Developer Zone | Subscribe | Updated