nRF5 SDK v13.0.0
Macros | Enumerations | Functions

Hardware access layer for accessing the SYSTICK peripheral. More...

Macros

#define NRF_SYSTICK_VAL_MASK   SysTick_VAL_CURRENT_Msk
 Mask of usable bits in the SysTick value.
 

Enumerations

enum  nrf_systick_csr_flags_t {
  NRF_SYSTICK_CSR_COUNTFLAG_MASK = SysTick_CTRL_COUNTFLAG_Msk,
  NRF_SYSTICK_CSR_CLKSOURCE_MASK = SysTick_CTRL_CLKSOURCE_Msk,
  NRF_SYSTICK_CSR_CLKSOURCE_REF = 0U << SysTick_CTRL_CLKSOURCE_Pos,
  NRF_SYSTICK_CSR_CLKSOURCE_CPU = 1U << SysTick_CTRL_CLKSOURCE_Pos,
  NRF_SYSTICK_CSR_TICKINT_MASK = SysTick_CTRL_TICKINT_Msk,
  NRF_SYSTICK_CSR_TICKINT_ENABLE = 1U << SysTick_CTRL_TICKINT_Pos,
  NRF_SYSTICK_CSR_TICKINT_DISABLE = 0U << SysTick_CTRL_TICKINT_Pos,
  NRF_SYSTICK_CSR_ENABLE_MASK = SysTick_CTRL_ENABLE_Msk,
  NRF_SYSTICK_CSR_ENABLE = 1U << SysTick_CTRL_ENABLE_Pos,
  NRF_SYSTICK_CSR_DISABLE = 0U << SysTick_CTRL_ENABLE_Pos
}
 Flags used by SysTick configuration. More...
 

Functions

__STATIC_INLINE uint32_t nrf_systick_csr_get (void)
 Get Configuration and Status Register. More...
 
__STATIC_INLINE void nrf_systick_csr_set (uint32_t val)
 Set Configuration and Status Register. More...
 
__STATIC_INLINE uint32_t nrf_systick_load_get (void)
 Get the current reload value. More...
 
__STATIC_INLINE void nrf_systick_load_set (uint32_t val)
 Configure the reload value. More...
 
__STATIC_INLINE uint32_t nrf_systick_val_get (void)
 Read the SysTick current value. More...
 
__STATIC_INLINE void nrf_systick_val_clear (void)
 Clear the SysTick current value. More...
 
__STATIC_INLINE uint32_t nrf_systick_calib_get (void)
 Read the calibration register. More...
 

Detailed Description

Hardware access layer for accessing the SYSTICK peripheral.

SYSTICK is ARM peripheral, not Nordic design. It means that it has no Nordic-typical interface with Tasks and Events.

Its usage is limited here to implement simple delays. Also keep in mind that this timer would be stopped when CPU is sleeping (WFE/WFI instruction is successfully executed).

Enumeration Type Documentation

Flags used by SysTick configuration.

See Also
nrf_systick_csr_set
nrf_systick_csr_get
Enumerator
NRF_SYSTICK_CSR_COUNTFLAG_MASK 

Status flag: Returns 1 if timer counted to 0 since the last read of this register.

NRF_SYSTICK_CSR_CLKSOURCE_MASK 

Configuration bit: Select the SysTick clock source.

NRF_SYSTICK_CSR_CLKSOURCE_REF 

Configuration value: Select reference clock.

NRF_SYSTICK_CSR_CLKSOURCE_CPU 

Configuration value: Select CPU clock.

NRF_SYSTICK_CSR_TICKINT_MASK 

Configuration bit: Enables SysTick exception request.

NRF_SYSTICK_CSR_TICKINT_ENABLE 

Configuration value: Counting down to zero does not assert the SysTick exception request.

NRF_SYSTICK_CSR_TICKINT_DISABLE 

Configuration value: Counting down to zero to asserts the SysTick exception request.

NRF_SYSTICK_CSR_ENABLE_MASK 

Configuration bit: Enable the SysTick timer.

NRF_SYSTICK_CSR_ENABLE 

Configuration value: Counter enabled.

NRF_SYSTICK_CSR_DISABLE 

Configuration value: Counter disabled.

Function Documentation

__STATIC_INLINE uint32_t nrf_systick_calib_get ( void  )

Read the calibration register.

Returns
The calibration register value
__STATIC_INLINE uint32_t nrf_systick_csr_get ( void  )

Get Configuration and Status Register.

Returns
Values composed by nrf_systick_csr_flags_t.
Note
The NRF_SYSTICK_CSR_COUNTFLAG_MASK value is cleared when CSR register is read.
__STATIC_INLINE void nrf_systick_csr_set ( uint32_t  val)

Set Configuration and Status Register.

Parameters
[in]valThe value composed from nrf_systick_csr_flags_t.
__STATIC_INLINE uint32_t nrf_systick_load_get ( void  )

Get the current reload value.

Returns
The reload register value.
__STATIC_INLINE void nrf_systick_load_set ( uint32_t  val)

Configure the reload value.

Parameters
[in]valThe value to set in the reload register.
__STATIC_INLINE void nrf_systick_val_clear ( void  )

Clear the SysTick current value.

Note
The SysTick does not allow setting current value. Any write to VAL register would clear the timer.
__STATIC_INLINE uint32_t nrf_systick_val_get ( void  )

Read the SysTick current value.

Returns
The current SysTick value
See Also
NRF_SYSTICK_VAL_MASK

Documentation feedback | Developer Zone | Subscribe | Updated