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

This module defines Low Power Timer Abstraction Layer for the 802.15.4 driver. More...

Functions

void nrf_802154_lp_timer_init (void)
 Initialize the Timer.
 
void nrf_802154_lp_timer_deinit (void)
 Uninitialize the Timer.
 
void nrf_802154_lp_timer_critical_section_enter (void)
 Enter critical section of the timer. More...
 
void nrf_802154_lp_timer_critical_section_exit (void)
 Exit critical section of the timer. More...
 
uint32_t nrf_802154_lp_timer_time_get (void)
 Get current time. More...
 
uint32_t nrf_802154_lp_timer_granularity_get (void)
 Get granularity of currently used timer. More...
 
void nrf_802154_lp_timer_start (uint32_t t0, uint32_t dt)
 Start one-shot timer that expires at specified time. More...
 
void nrf_802154_lp_timer_stop (void)
 Stop currently running timer.
 
bool nrf_802154_lp_timer_is_running (void)
 Check if timer is currently running. More...
 
void nrf_802154_lp_timer_sync_start_now (void)
 Start one-shot synchronization timer that expires at nearest possible timepoint. More...
 
void nrf_802154_lp_timer_sync_start_at (uint32_t t0, uint32_t dt)
 Start one-shot synchronization timer that expires at specified time. More...
 
void nrf_802154_lp_timer_sync_stop (void)
 Stop currently running synchronization timer.
 
uint32_t nrf_802154_lp_timer_sync_event_get (void)
 Get event used to synchronize this timer with HP Timer. More...
 
uint32_t nrf_802154_lp_timer_sync_time_get (void)
 Get timestamp of the synchronization event. More...
 
void nrf_802154_lp_timer_fired (void)
 Callback executed when timer expires.
 
void nrf_802154_lp_timer_synchronized (void)
 Callback executed when synchronization timer expires.
 

Detailed Description

This module defines Low Power Timer Abstraction Layer for the 802.15.4 driver.

Low Power Timer Abstraction Layer interface for the 802.15.4 driver.

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

Note
Most of Low Power Timer Abstraction Layer API should not be called directly by 802.15.4 driver modules. This API is used by the Timer Scheduler module included in the driver and other modules should use Timer Scheduler API. Exception from above rule are initialization and deinitialization functions
See also
nrf_802154_lp_timer_init()
nrf_802154_lp_timer_deinit() and critical section management
nrf_802154_lp_timer_critical_section_enter()
nrf_802154_lp_timer_critical_section_exit() as these functions are called from nrf_802154_critical_section module and from global initialization functions
nrf_802154_init()
nrf_802154_deinit().

Function Documentation

void nrf_802154_lp_timer_critical_section_enter ( void  )

Enter critical section of the timer.

In critical section timer cannot execute

See also
nrf_802154_lp_timer_fired() function.
Note
Critical section cannot be nested.
void nrf_802154_lp_timer_critical_section_exit ( void  )

Exit critical section of the timer.

In critical section timer cannot execute

See also
nrf_802154_lp_timer_fired() function.
Note
Critical section cannot be nested.
uint32_t nrf_802154_lp_timer_granularity_get ( void  )

Get granularity of currently used timer.

This function may be used to round up/down time calculations.

Returns
Timer granularity in microseconds [us].
bool nrf_802154_lp_timer_is_running ( void  )

Check if 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 
)

Start one-shot timer that expires at specified time.

Start one-shot timer that will expire dt microseconds after t0 time. If timer is running when this function is called, previously running timer will be stopped automatically.

On timer expiration

See also
nrf_802154_lp_timer_fired function will be called. Timer automatically stops after expiration.
Parameters
[in]t0Number of microseconds representing timer start time.
[in]dtTime of timer expiration as time elapsed from t0 [us].
uint32_t nrf_802154_lp_timer_sync_event_get ( void  )

Get event used to synchronize this timer with HP Timer.

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

Start one-shot synchronization timer that expires at specified time.

Start one-shot synchronization timer that will expire dt microseconds after t0 time.

On timer expiration nrf_802154_lp_timer_synchronized function will be called and event returned by nrf_802154_lp_timer_sync_event_get will be triggered.

Parameters
[in]t0Number of microseconds representing timer start time.
[in]dtTime of timer expiration as time elapsed from t0 [us].
void nrf_802154_lp_timer_sync_start_now ( void  )

Start one-shot synchronization timer that expires at nearest possible timepoint.

On timer expiration nrf_802154_lp_timer_synchronized function will be called and event returned by nrf_802154_lp_timer_sync_event_get will be triggered.

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

Get timestamp of the synchronization event.

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

Get current time.

Prior to getting current time, Timer must be initialized

See also
nrf_802154_lp_timer_init(). There are no other requirements that must be fulfilled before using this function.
Returns
Current time in microseconds [us].

Documentation feedback | Developer Zone | Subscribe | Updated