The `z_nrf_grtc_timer_get_ticks()` function converts system ticks to GRTC ticks. It gets the current system tick to calculate an absolute GRTC value. The same does the test function to provide an argument to be converted. If the system tick occurs between those `sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will take into account the newer tick while the test estimate bases on the old tick value. Due to that the maximum result error is 1 system tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC ticks. Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
61 lines
1.8 KiB
Plaintext
61 lines
1.8 KiB
Plaintext
# Timer driver configuration options
|
|
# Copyright (c) 2024 Nordic Semiconductor ASA
|
|
|
|
menuconfig NRF_GRTC_TIMER
|
|
bool "nRF GRTC Timer"
|
|
default y
|
|
depends on DT_HAS_NORDIC_NRF_GRTC_ENABLED
|
|
select TICKLESS_CAPABLE
|
|
select TIMER_HAS_64BIT_CYCLE_COUNTER
|
|
select NRFX_GRTC
|
|
help
|
|
This module implements a kernel device driver for the nRF Global Real
|
|
Time Counter NRF_GRTC and provides the standard "system clock driver"
|
|
interfaces.
|
|
|
|
if NRF_GRTC_TIMER
|
|
|
|
config NRF_GRTC_SLEEP_ALLOWED
|
|
def_bool y
|
|
depends on POWEROFF
|
|
help
|
|
This feature allows GRTC SYSCOUNTER to go to sleep state.
|
|
|
|
config NRF_GRTC_TIMER_APP_DEFINED_INIT
|
|
bool "Application defines GRTC initialization"
|
|
help
|
|
Application defines the initialization procedure and time of the GRTC
|
|
drivers, rather than leaving it up to SYS_INIT.
|
|
|
|
config NRF_GRTC_START_SYSCOUNTER
|
|
bool "Start SYSCOUNTER on driver init"
|
|
select NRF_GRTC_TIMER_CLOCK_MANAGEMENT
|
|
help
|
|
Start the SYSCOUNTER when initializing the GRTC. This should only be
|
|
handled by one processor in the system.
|
|
|
|
config NRF_GRTC_TIMER_CLOCK_MANAGEMENT
|
|
bool
|
|
help
|
|
Compile additional driver code for enabling management functionality of
|
|
the GRTC. Usually this is only needed by the processor that is starting
|
|
the SYSCOUNTER, but can be shared by multiple processors in the system.
|
|
|
|
config NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY
|
|
int
|
|
default 1000
|
|
depends on NRF_GRTC_SLEEP_ALLOWED
|
|
help
|
|
The value (in us) ensures that the wakeup event will not fire
|
|
too early. In other words, applying SYSCOUNTER sleep state for less than
|
|
NRF_GRTC_SYSCOUNTER_SLEEP_MINIMUM_LATENCY period makes no sense.
|
|
|
|
config NRF_GRTC_TIMER_AUTO_KEEP_ALIVE
|
|
bool
|
|
default y if NRF_GRTC_START_SYSCOUNTER
|
|
help
|
|
This feature prevents the SYSCOUNTER from sleeping when any core is in
|
|
active state.
|
|
|
|
endif # NRF_GRTC_TIMER
|