SYSTICK HAL

group nrf_systick_hal

Hardware access layer (HAL) for managing the SYSTICK peripheral.

SYSTICK is a peripheral designed by ARM. This means that it does not feature the typical Nordic interface with Tasks and Events.

Its usage is limited here to the implementation of simple delays. Moreover, keep in mind that this timer will be stopped when CPU is sleeping (WFE/WFI instruction is successfully executed).

Defines

NRF_SYSTICK_VAL_MASK

Mask of usable bits in the SysTick value.

Enums

enum nrf_systick_csr_flags_t

Flags used by SysTick configuration.

Values:

enumerator NRF_SYSTICK_CSR_COUNTFLAG_MASK

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

enumerator NRF_SYSTICK_CSR_CLKSOURCE_MASK

Configuration bit: Select the SysTick clock source.

enumerator NRF_SYSTICK_CSR_CLKSOURCE_REF

Configuration value: Select reference clock.

enumerator NRF_SYSTICK_CSR_CLKSOURCE_CPU

Configuration value: Select CPU clock.

enumerator NRF_SYSTICK_CSR_TICKINT_MASK

Configuration bit: Enables SysTick exception request.

enumerator NRF_SYSTICK_CSR_TICKINT_ENABLE

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

enumerator NRF_SYSTICK_CSR_TICKINT_DISABLE

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

enumerator NRF_SYSTICK_CSR_ENABLE_MASK

Configuration bit: Enable the SysTick timer.

enumerator NRF_SYSTICK_CSR_ENABLE

Configuration value: Counter enabled.

enumerator NRF_SYSTICK_CSR_DISABLE

Configuration value: Counter disabled.

Functions

NRF_STATIC_INLINE uint32_t nrf_systick_csr_get(void)

Function for getting Configuration and Status Register.

Note

The NRF_SYSTICK_CSR_COUNTFLAG_MASK value is cleared when CSR register is read.

Returns:

Values composed by nrf_systick_csr_flags_t.

NRF_STATIC_INLINE void nrf_systick_csr_set(uint32_t val)

Function for setting Configuration and Status Register.

Parameters:
NRF_STATIC_INLINE uint32_t nrf_systick_load_get(void)

Function for getting the current reload value.

Returns:

The reload register value.

NRF_STATIC_INLINE void nrf_systick_load_set(uint32_t val)

Function for configuring the reload value.

Parameters:
  • val[in] The value to be set in the reload register.

NRF_STATIC_INLINE uint32_t nrf_systick_val_get(void)

Function for reading the SysTick current value.

Returns:

The current SysTick value

NRF_STATIC_INLINE void nrf_systick_val_clear(void)

Function for clearing the SysTick current value.

Note

The SysTick does not allow setting current value. Any write to VAL register would clear the timer.

NRF_STATIC_INLINE uint32_t nrf_systick_calib_get(void)

Function for reading the calibration register.

Returns:

The calibration register value.