diff --git a/cpu/native/Makefile.features b/cpu/native/Makefile.features index 14f89d59fb..3527cf2d2d 100644 --- a/cpu/native/Makefile.features +++ b/cpu/native/Makefile.features @@ -18,6 +18,7 @@ FEATURES_PROVIDED += periph_hwrng FEATURES_PROVIDED += periph_pm FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_timer_periodic +FEATURES_PROVIDED += periph_timer_query_freqs ifeq ($(OS) $(OS_ARCH),Linux x86_64) FEATURES_PROVIDED += rust_target endif diff --git a/cpu/native/include/periph_conf.h b/cpu/native/include/periph_conf.h index eaf611029d..0df89b2c53 100644 --- a/cpu/native/include/periph_conf.h +++ b/cpu/native/include/periph_conf.h @@ -49,7 +49,8 @@ extern "C" { * @name Timer peripheral configuration * @{ */ -#define TIMER_NUMOF (1U) +#define TIMER_NUMOF (1U) +#define TIMER_CHANNEL_NUMOF (1U) /**< Number of timer channels */ /** * @brief xtimer configuration diff --git a/cpu/native/periph/timer.c b/cpu/native/periph/timer.c index e275dc5574..8bfc4dd0ee 100644 --- a/cpu/native/periph/timer.c +++ b/cpu/native/periph/timer.c @@ -75,6 +75,28 @@ void native_isr_timer(void) _callback(_cb_arg, 0); } +uword_t timer_query_freqs_numof(tim_t dev) +{ + (void)dev; + + assert(TIMER_DEV(dev) < TIMER_NUMOF); + + return 1; +} + +uint32_t timer_query_freqs(tim_t dev, uword_t index) +{ + (void)dev; + + assert(TIMER_DEV(dev) < TIMER_NUMOF); + + if (index > 0) { + return 0; + } + + return NATIVE_TIMER_SPEED; +} + int timer_init(tim_t dev, uint32_t freq, timer_cb_t cb, void *arg) { (void)freq;