mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #20142 from maribu/periph_timer_query_freq-atmega
cpu/atmega_common: implement periph_timer_query_freqs
This commit is contained in:
commit
481e3a95d4
@ -25,9 +25,10 @@ config CPU_COMMON_ATMEGA
|
|||||||
select HAS_PERIPH_GPIO_LL_IRQ_UNMASK
|
select HAS_PERIPH_GPIO_LL_IRQ_UNMASK
|
||||||
select HAS_PERIPH_PM
|
select HAS_PERIPH_PM
|
||||||
select HAS_PERIPH_RTC_MS
|
select HAS_PERIPH_RTC_MS
|
||||||
|
select HAS_PERIPH_RTT_OVERFLOW
|
||||||
select HAS_PERIPH_RTT_SET_COUNTER
|
select HAS_PERIPH_RTT_SET_COUNTER
|
||||||
select HAS_PERIPH_TIMER_PERIODIC
|
select HAS_PERIPH_TIMER_PERIODIC
|
||||||
select HAS_PERIPH_RTT_OVERFLOW
|
select HAS_PERIPH_TIMER_QUERY_FREQS
|
||||||
select HAS_PERIPH_WDT
|
select HAS_PERIPH_WDT
|
||||||
select HAS_PUF_SRAM
|
select HAS_PUF_SRAM
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@ FEATURES_PROVIDED += periph_gpio_ll_irq_level_triggered_low
|
|||||||
FEATURES_PROVIDED += periph_gpio_ll_irq_unmask
|
FEATURES_PROVIDED += periph_gpio_ll_irq_unmask
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
FEATURES_PROVIDED += periph_rtc_ms
|
FEATURES_PROVIDED += periph_rtc_ms
|
||||||
|
FEATURES_PROVIDED += periph_rtt_overflow
|
||||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||||
FEATURES_PROVIDED += periph_timer_periodic
|
FEATURES_PROVIDED += periph_timer_periodic
|
||||||
FEATURES_PROVIDED += periph_rtt_overflow
|
FEATURES_PROVIDED += periph_timer_query_freqs
|
||||||
FEATURES_PROVIDED += periph_wdt
|
FEATURES_PROVIDED += periph_wdt
|
||||||
FEATURES_PROVIDED += puf_sram
|
FEATURES_PROVIDED += puf_sram
|
||||||
ifneq (atmega8, $(CPU_FAM))
|
ifneq (atmega8, $(CPU_FAM))
|
||||||
|
@ -318,6 +318,24 @@ void timer_start(tim_t tim)
|
|||||||
ctx[tim].dev->CRB = ctx[tim].mode;
|
ctx[tim].dev->CRB = ctx[tim].mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uword_t timer_query_freqs_numof(tim_t dev)
|
||||||
|
{
|
||||||
|
(void) dev;
|
||||||
|
|
||||||
|
return ARRAY_SIZE(prescalers);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t timer_query_freqs(tim_t dev, uword_t index)
|
||||||
|
{
|
||||||
|
(void)dev;
|
||||||
|
|
||||||
|
if (index >= ARRAY_SIZE(prescalers)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CLOCK_CORECLOCK >> prescalers[index];
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TIMER_NUMOF
|
#ifdef TIMER_NUMOF
|
||||||
static inline void _isr(tim_t tim, int chan)
|
static inline void _isr(tim_t tim, int chan)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user