mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
d0758b5a7e
To avoid confusions between `auto_init_ztimer` and `ztimer_auto_init` rename `ztimer_auto_init` to `ztimer_init`. This allows for similar handling as `saul_init_devs` and `auto_init_devs`. Dependencies are therefore done against the USEMODULE and not DEFAULT_MODULE or checking DISABLE_MODULE. For this, both `ztimer_init` and `auto_init_ztimer` are added to DEFAULT_MODULE and both need disabling if the user does not want that module in. With this, the comment in Kconfig no longer applies.
206 lines
5.1 KiB
Plaintext
206 lines
5.1 KiB
Plaintext
# Copyright (c) 2021 HAW Hamburg
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
#
|
|
|
|
menu "ztimer - High level timer abstraction layer"
|
|
|
|
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
|
bool "Override default backend selection"
|
|
|
|
menu "Backends"
|
|
visible if ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
|
|
|
config MODULE_ZTIMER_PERIPH_RTC
|
|
bool "RTC peripheral"
|
|
depends on HAS_PERIPH_RTC
|
|
select MODULE_PERIPH_RTC
|
|
|
|
config MODULE_ZTIMER_PERIPH_RTT
|
|
bool "RTT peripheral"
|
|
depends on HAS_PERIPH_RTT
|
|
select MODULE_PERIPH_RTT
|
|
|
|
config MODULE_ZTIMER_PERIPH_PTP
|
|
bool "PTP peripheral"
|
|
depends on HAS_PERIPH_PTP_TIMER
|
|
select MODULE_PERIPH_PTP_TIMER
|
|
|
|
config MODULE_ZTIMER_PERIPH_TIMER
|
|
bool "Timer peripheral"
|
|
depends on HAS_PERIPH_TIMER
|
|
select MODULE_PERIPH_TIMER
|
|
|
|
endmenu # Backends
|
|
|
|
menu "Clocks"
|
|
|
|
# TODO: this extra indirection in the entry point for ztimer_usec is required
|
|
# to allow xtimer compatibility modules to depend on ztimer being there while
|
|
# still selecting ztimer_usec.
|
|
config ZTIMER_USEC
|
|
bool "Microseconds"
|
|
select MODULE_ZTIMER_USEC
|
|
select MODULE_ZTIMER
|
|
|
|
config MODULE_ZTIMER_USEC
|
|
bool
|
|
select MODULE_ZTIMER_PERIPH_TIMER
|
|
|
|
config MODULE_ZTIMER_MSEC
|
|
bool "Milliseconds"
|
|
select MODULE_ZTIMER
|
|
|
|
choice
|
|
bool "Backend"
|
|
depends on MODULE_ZTIMER_MSEC
|
|
default ZTIMER_MSEC_BACKEND_RTT
|
|
|
|
config ZTIMER_MSEC_BACKEND_TIMER
|
|
bool "Timer"
|
|
select MODULE_ZTIMER_PERIPH_TIMER
|
|
|
|
config ZTIMER_MSEC_BACKEND_RTT
|
|
bool "RTT"
|
|
depends on HAS_PERIPH_RTT
|
|
select MODULE_ZTIMER_PERIPH_RTT
|
|
|
|
endchoice
|
|
|
|
config MODULE_ZTIMER_SEC
|
|
bool "Seconds"
|
|
select MODULE_ZTIMER
|
|
|
|
choice
|
|
bool "Backend"
|
|
depends on MODULE_ZTIMER_SEC
|
|
default ZTIMER_SEC_BACKEND_RTT
|
|
|
|
config ZTIMER_SEC_BACKEND_TIMER
|
|
bool "Timer"
|
|
select MODULE_ZTIMER_PERIPH_TIMER
|
|
|
|
config ZTIMER_SEC_BACKEND_RTT
|
|
bool "RTT"
|
|
depends on HAS_PERIPH_RTT
|
|
select MODULE_ZTIMER_PERIPH_RTT
|
|
|
|
config ZTIMER_SEC_BACKEND_RTC
|
|
bool "RTC"
|
|
depends on HAS_PERIPH_RTC
|
|
select MODULE_ZTIMER_PERIPH_RTC
|
|
|
|
endchoice
|
|
|
|
endmenu # Clocks
|
|
|
|
menu "Frequency conversion"
|
|
depends on MODULE_ZTIMER
|
|
|
|
config MODULE_ZTIMER_CONVERT_MULDIV64
|
|
bool "64-bits arithmetic conversion"
|
|
select MODULE_ZTIMER_CONVERT
|
|
help
|
|
muldiv64 is very precise, but the overhead is the highest. On MCUs
|
|
without hardware division this might not be a good choice.
|
|
|
|
config MODULE_ZTIMER_CONVERT_FRAC
|
|
bool "Fractional conversion"
|
|
select MODULE_ZTIMER_CONVERT
|
|
select MODULE_FRAC
|
|
help
|
|
Frac can be used for arbitrary frequency conversions, but trades in
|
|
precision to gain speed. In cases where shift conversion cannot be used,
|
|
this is likely the best trade off.
|
|
|
|
config MODULE_ZTIMER_CONVERT_SHIFT
|
|
bool "Shift conversion"
|
|
select MODULE_ZTIMER_CONVERT
|
|
help
|
|
Shift conversion is both fast and super precise, but cannot work for
|
|
arbitrary frequencies. It's kind of a software prescaler for the
|
|
underlying clock. So if the hardware clock frequency and the target
|
|
clock frequency differ by a factor that is a power of two, this is the
|
|
best choice - otherwise it is simply not usable.
|
|
|
|
config MODULE_ZTIMER_CONVERT
|
|
bool
|
|
|
|
endmenu # Frequency conversion
|
|
|
|
|
|
menu "xtimer and evtimer compatibility"
|
|
|
|
choice
|
|
bool "xtimer compatibility"
|
|
depends on MODULE_XTIMER && MODULE_ZTIMER
|
|
|
|
config MODULE_XTIMER_ON_ZTIMER
|
|
bool "ztimer_usec as timer backend for xtimer"
|
|
select MODULE_ZTIMER_USEC
|
|
|
|
config MODULE_ZTIMER_XTIMER_COMPAT
|
|
bool "map xtimer calls to ztimer"
|
|
select MODULE_DIV
|
|
select MODULE_ZTIMER_USEC
|
|
help
|
|
This is a wrapper of xtimer API on ztimer_usec and is currently
|
|
incomplete. Unless doing testing, use xtimer on ztimer.
|
|
|
|
endchoice
|
|
|
|
comment "The ztimer xtimer compatibility module is incomplete, consider using MODULE_XTIMER_ON_ZTIMER instead."
|
|
depends on MODULE_ZTIMER_XTIMER_COMPAT
|
|
|
|
config MODULE_EVTIMER_ON_ZTIMER
|
|
bool "Use ztimer_msec as timer backend for evtimer"
|
|
depends on MODULE_ZTIMER_MSEC
|
|
select MODULE_ZTIMER_NOW64
|
|
|
|
endmenu # xtimer compatibility
|
|
|
|
config MODULE_ZTIMER
|
|
bool
|
|
depends on TEST_KCONFIG
|
|
select MODULE_ZTIMER_CORE
|
|
select MODULE_ZTIMER_CONVERT_FRAC
|
|
select MODULE_ZTIMER_CONVERT_SHIFT
|
|
select MODULE_ZTIMER_EXTEND
|
|
|
|
if MODULE_ZTIMER
|
|
|
|
config MODULE_AUTO_INIT_ZTIMER
|
|
bool "Auto initialize ztimer"
|
|
depends on MODULE_AUTO_INIT
|
|
select MODULE_ZTIMER_INIT
|
|
default y
|
|
|
|
config MODULE_ZTIMER_NOW64
|
|
bool "Use a 64-bits result for ztimer_now()"
|
|
|
|
config MODULE_ZTIMER_OVERHEAD
|
|
bool "Overhead measurement functionalities"
|
|
|
|
config MODULE_ZTIMER_MOCK
|
|
bool "Mock backend (for testing only)"
|
|
help
|
|
This ztimer module implements a virtual clock that can be used for
|
|
unittests. It can be manually adjusted to different timestamps and
|
|
manually fired to simulate different scenarios and test the ztimer
|
|
implementation using this as a backing timer.
|
|
|
|
config MODULE_ZTIMER_INIT
|
|
bool
|
|
|
|
config MODULE_ZTIMER_CORE
|
|
bool
|
|
|
|
config MODULE_ZTIMER_EXTEND
|
|
bool
|
|
|
|
endif # MODULE_ZTIMER
|
|
|
|
endmenu
|