mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #18783 from jue89/fix/ztimer_lptimer_kconfig
sys/ztimer: model ztimer_periph_lptimer for Kconfig
This commit is contained in:
commit
84c89f9dd7
@ -20,3 +20,4 @@ config BOARD_XG23_PK6068A
|
|||||||
|
|
||||||
# Put other features for this board (in alphabetical order)
|
# Put other features for this board (in alphabetical order)
|
||||||
select HAVE_SAUL_GPIO
|
select HAVE_SAUL_GPIO
|
||||||
|
select HAVE_ZTIMER_PERIPH_LPTIMER
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_gpio
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE)))
|
||||||
|
USEMODULE += ztimer_periph_lptimer
|
||||||
|
endif
|
||||||
|
@ -35,6 +35,16 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define PM_BLOCKER_INITIAL { 0, 0, 0 }
|
#define PM_BLOCKER_INITIAL { 0, 0, 0 }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name ztimer configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define CONFIG_ZTIMER_LPTIMER_DEV TIMER_DEV(1)
|
||||||
|
#define CONFIG_ZTIMER_LPTIMER_FREQ LFXO_FREQ
|
||||||
|
#define CONFIG_ZTIMER_LPTIMER_WIDTH 24
|
||||||
|
#define CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE EFM32_PM_MODE_EM3
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Power mode required for GPIO IRQs
|
* @brief Power mode required for GPIO IRQs
|
||||||
*
|
*
|
||||||
|
@ -61,6 +61,13 @@ extern "C" {
|
|||||||
#define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
|
#define CONFIG_ZTIMER_USEC_DEV (TIMER_DEV(0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Default width of ZTIMER_LPTIMER
|
||||||
|
*/
|
||||||
|
#ifndef CONFIG_ZTIMER_LPTIMER_WIDTH
|
||||||
|
#define CONFIG_ZTIMER_LPTIMER_WIDTH (32)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ZTIMER_USEC optimal minimum value for ztimer_set()
|
* @brief ZTIMER_USEC optimal minimum value for ztimer_set()
|
||||||
*
|
*
|
||||||
@ -114,6 +121,13 @@ extern "C" {
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The minimum pm mode required for ZTIMER_LPTIMER to run
|
||||||
|
*/
|
||||||
|
#ifndef CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE
|
||||||
|
# define CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE ZTIMER_CLOCK_NO_REQUIRED_PM_MODE
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The minimum pm mode required for ZTIMER_RTT to run
|
* @brief The minimum pm mode required for ZTIMER_RTT to run
|
||||||
*/
|
*/
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
# directory for more details.
|
# 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"
|
menu "ztimer - High level timer abstraction layer"
|
||||||
|
|
||||||
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
||||||
@ -39,6 +44,10 @@ config MODULE_ZTIMER_PERIPH_TIMER
|
|||||||
depends on HAS_PERIPH_TIMER
|
depends on HAS_PERIPH_TIMER
|
||||||
select MODULE_PERIPH_TIMER
|
select MODULE_PERIPH_TIMER
|
||||||
|
|
||||||
|
config MODULE_ZTIMER_PERIPH_LPTIMER
|
||||||
|
bool "Low-power Timer peripheral"
|
||||||
|
select MODULE_ZTIMER_PERIPH_TIMER
|
||||||
|
|
||||||
endmenu # Backends
|
endmenu # Backends
|
||||||
|
|
||||||
menu "Clocks"
|
menu "Clocks"
|
||||||
@ -62,7 +71,9 @@ config MODULE_ZTIMER_MSEC
|
|||||||
choice ZTIMER_MSEC_BACKEND
|
choice ZTIMER_MSEC_BACKEND
|
||||||
bool "Backend"
|
bool "Backend"
|
||||||
depends on MODULE_ZTIMER_MSEC
|
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_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
|
||||||
|
default ZTIMER_MSEC_BACKEND_TIMER
|
||||||
|
|
||||||
config ZTIMER_MSEC_BACKEND_TIMER
|
config ZTIMER_MSEC_BACKEND_TIMER
|
||||||
bool "Timer"
|
bool "Timer"
|
||||||
@ -73,6 +84,11 @@ config ZTIMER_MSEC_BACKEND_RTT
|
|||||||
depends on HAS_PERIPH_RTT
|
depends on HAS_PERIPH_RTT
|
||||||
select MODULE_ZTIMER_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
|
endchoice
|
||||||
|
|
||||||
config MODULE_ZTIMER_SEC
|
config MODULE_ZTIMER_SEC
|
||||||
@ -82,7 +98,9 @@ config MODULE_ZTIMER_SEC
|
|||||||
choice
|
choice
|
||||||
bool "Backend"
|
bool "Backend"
|
||||||
depends on MODULE_ZTIMER_SEC
|
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_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
|
||||||
|
default ZTIMER_SEC_BACKEND_TIMER
|
||||||
|
|
||||||
config ZTIMER_SEC_BACKEND_TIMER
|
config ZTIMER_SEC_BACKEND_TIMER
|
||||||
bool "Timer"
|
bool "Timer"
|
||||||
@ -98,6 +116,11 @@ config ZTIMER_SEC_BACKEND_RTC
|
|||||||
depends on HAS_PERIPH_RTC
|
depends on HAS_PERIPH_RTC
|
||||||
select MODULE_ZTIMER_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
|
endchoice
|
||||||
|
|
||||||
endmenu # Clocks
|
endmenu # Clocks
|
||||||
|
@ -41,6 +41,10 @@ ifneq (,$(filter ztimer_convert_%,$(USEMODULE)))
|
|||||||
USEMODULE += ztimer_convert
|
USEMODULE += ztimer_convert
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter ztimer_periph_lptimer,$(USEMODULE)))
|
||||||
|
USEMODULE += ztimer_periph_timer
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter ztimer_periph_timer,$(USEMODULE)))
|
ifneq (,$(filter ztimer_periph_timer,$(USEMODULE)))
|
||||||
FEATURES_REQUIRED += periph_timer
|
FEATURES_REQUIRED += periph_timer
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user