mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
88a9f4b8f9
Enforce ztimer_clock_t to be active (i.e. clock->users > 0) before ztimer_now() can be called.
279 lines
7.4 KiB
Plaintext
279 lines
7.4 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.
|
|
#
|
|
|
|
config HAVE_ZTIMER_PERIPH_LPTIMER
|
|
bool
|
|
help
|
|
Indicates that ZTIMER_PERIPH_LPTIMER configuration is available.
|
|
|
|
menu "ztimer - High level timer abstraction layer"
|
|
|
|
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
|
bool "Override default backend selection"
|
|
|
|
config MODULE_ZTIMER_NO_PERIPH_RTT
|
|
bool "Disable ztimer_periph_rtt auto-inclusion"
|
|
help
|
|
This module disables the auto-inclusion of ztimer_periph_rtt as a backend
|
|
for ztimer_msec and ztimer_sec.
|
|
|
|
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
|
|
|
|
config MODULE_ZTIMER_PERIPH_LPTIMER
|
|
bool "Low-power Timer peripheral"
|
|
select MODULE_ZTIMER_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_PERIPH_TIMER
|
|
select MODULE_ZTIMER
|
|
|
|
config MODULE_ZTIMER_USEC
|
|
bool
|
|
|
|
config MODULE_ZTIMER_MSEC
|
|
bool "Milliseconds"
|
|
select MODULE_ZTIMER
|
|
|
|
choice ZTIMER_MSEC_BACKEND
|
|
bool "Backend"
|
|
depends on MODULE_ZTIMER_MSEC
|
|
default ZTIMER_MSEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER
|
|
default ZTIMER_MSEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
|
|
default ZTIMER_MSEC_BACKEND_TIMER
|
|
|
|
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
|
|
|
|
config ZTIMER_MSEC_BACKEND_LPTIMER
|
|
bool "Low Power Timer"
|
|
depends on HAVE_ZTIMER_PERIPH_LPTIMER
|
|
select MODULE_ZTIMER_PERIPH_LPTIMER
|
|
|
|
endchoice
|
|
|
|
config MODULE_ZTIMER_SEC
|
|
bool "Seconds"
|
|
select MODULE_ZTIMER
|
|
|
|
choice
|
|
bool "Backend"
|
|
depends on MODULE_ZTIMER_SEC
|
|
default ZTIMER_SEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER
|
|
default ZTIMER_SEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
|
|
default ZTIMER_SEC_BACKEND_TIMER
|
|
|
|
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
|
|
|
|
config ZTIMER_SEC_BACKEND_LPTIMER
|
|
bool "Low Power Timer"
|
|
depends on HAVE_ZTIMER_PERIPH_LPTIMER
|
|
select MODULE_ZTIMER_PERIPH_LPTIMER
|
|
|
|
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_ZTIMER_XTIMER_COMPAT
|
|
bool "map xtimer calls to ztimer"
|
|
select MODULE_DIV
|
|
select MODULE_ZTIMER_USEC
|
|
select MODULE_ZTIMER_PERIPH_TIMER
|
|
help
|
|
This is a wrapper of xtimer API on ztimer_usec.
|
|
|
|
config MODULE_XTIMER_ON_ZTIMER
|
|
bool "ztimer_usec as timer backend for xtimer"
|
|
select MODULE_ZTIMER_USEC
|
|
select MODULE_ZTIMER_PERIPH_TIMER
|
|
endchoice
|
|
|
|
config MODULE_ZTIMER64_XTIMER_COMPAT
|
|
bool "map xtimer calls to ztimer64"
|
|
select MODULE_DIV
|
|
select MODULE_ZTIMER64
|
|
select MODULE_ZTIMER64_USEC
|
|
help
|
|
This is a wrapper of xtimer API on ztimer64_usec.
|
|
|
|
config MODULE_EVTIMER_ON_ZTIMER
|
|
bool "Use ztimer_msec as timer backend for evtimer"
|
|
depends on MODULE_ZTIMER_MSEC
|
|
|
|
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_AUTO_ADJUST
|
|
bool "Auto adjust ztimer set and sleep values"
|
|
select MODULE_ZTIMER_OVERHEAD
|
|
|
|
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.
|
|
|
|
menuconfig MODULE_ZTIMER_ONDEMAND
|
|
bool "Run ztimer clocks only on demand"
|
|
help
|
|
This ztimer extensions keeps track of ztimer users and may disable
|
|
underlying peripherals if not users are requiring a ztimer clock.
|
|
|
|
if MODULE_ZTIMER_ONDEMAND
|
|
|
|
config MODULE_ZTIMER_ONDEMAND_STRICT
|
|
bool "Strict ztimer on demand"
|
|
help
|
|
Enforce ztimer clocks to be running before calling ztimer_now().
|
|
|
|
config MODULE_ZTIMER_ONDEMAND_TIMER
|
|
bool "Run Timer only on demand"
|
|
depends on MODULE_ZTIMER_PERIPH_TIMER
|
|
help
|
|
Turn off the underlying Timer peripheral if related ztimer clocks
|
|
have no users.
|
|
|
|
config MODULE_ZTIMER_ONDEMAND_RTT
|
|
bool "Run RTT only on demand"
|
|
depends on MODULE_ZTIMER_PERIPH_RTT
|
|
help
|
|
Turn off the underlying RTT peripheral if related ztimer clocks
|
|
have no users.
|
|
|
|
config MODULE_ZTIMER_ONDEMAND_RTC
|
|
bool "Run RTC only on demand"
|
|
depends on MODULE_ZTIMER_PERIPH_RTC
|
|
help
|
|
Turn off the underlying RTC peripheral if related ztimer clocks
|
|
have no users.
|
|
|
|
endif # MODULE_ZTIMER_ONDEMAND
|
|
|
|
config MODULE_ZTIMER_INIT
|
|
bool
|
|
|
|
config MODULE_ZTIMER_CORE
|
|
bool
|
|
|
|
config MODULE_ZTIMER_EXTEND
|
|
bool
|
|
|
|
endif # MODULE_ZTIMER
|
|
|
|
endmenu
|