nRF5 SDK v13.0.0
Modules | Data Structures | Functions

Modules

 SysTick driver configuration
 

Data Structures

struct  nrf_drv_systick_state_t
 The value type that holds the SysTick state. More...
 

Functions

void nrf_drv_systick_init (void)
 Configure and start the timer. More...
 
void nrf_drv_systick_get (nrf_drv_systick_state_t *p_state)
 Get current SysTick state. More...
 
bool nrf_drv_systick_test (nrf_drv_systick_state_t const *p_state, uint32_t us)
 Test if specified time is up in relation to remembered state. More...
 
void nrf_drv_systick_delay_ticks (uint32_t ticks)
 Blocking delay in CPU ticks. More...
 
void nrf_drv_systick_delay_us (uint32_t us)
 Blocking delay in us. More...
 
void nrf_drv_systick_delay_ms (uint32_t ms)
 Blocking delay in ms. More...
 

Detailed Description

This library configures SysTick as a free-running timer. This timer is used to generate delays and pool for timeouts. Only relatively short timeouts are supported. The SysTick works on 64MHz and is 24-bits wide. It means that it overflows around 4 times per second and around 250 ms would be the highest supported time in the library. But it would be really hard to detect if overflow was generated without using interrupts. For safely we would limit the maximum delay range by half.

Function Documentation

void nrf_drv_systick_delay_ms ( uint32_t  ms)

Blocking delay in ms.

This delay function removes the limits of the highest possible delay value.

Parameters
[in]msNumber of milliseconds to delay.
void nrf_drv_systick_delay_ticks ( uint32_t  ticks)

Blocking delay in CPU ticks.

Parameters
[in]ticksNumber of CPU ticks to delay.
void nrf_drv_systick_delay_us ( uint32_t  us)

Blocking delay in us.

Parameters
[in]usNumber of microseconds to delay.
void nrf_drv_systick_get ( nrf_drv_systick_state_t p_state)

Get current SysTick state.

Function gets current state of the SysTick timer. It can be used to check time-out by nrf_drv_systick_test.

Parameters
[out]p_stateThe pointer to the state variable to be filled
void nrf_drv_systick_init ( void  )

Configure and start the timer.

Function configures SysTick as a free-running timer without interrupt.

bool nrf_drv_systick_test ( nrf_drv_systick_state_t const *  p_state,
uint32_t  us 
)

Test if specified time is up in relation to remembered state.

Parameters
[in]p_stateRemembered state set by nrf_drv_systick_get
[in]usRequired time-out.
Return values
trueIf current time is higher than specified state plus given time-out.
falseIf current time is lower than specified state plus given time-out

Documentation feedback | Developer Zone | Subscribe | Updated