diff --git a/drivers/counter/Kconfig.gecko b/drivers/counter/Kconfig.gecko index bbe56d22a56..8a5fdafab4d 100644 --- a/drivers/counter/Kconfig.gecko +++ b/drivers/counter/Kconfig.gecko @@ -18,6 +18,7 @@ config COUNTER_GECKO_STIMER default y depends on DT_HAS_SILABS_GECKO_STIMER_ENABLED select SOC_GECKO_RTCC + select SOC_GECKO_PRS help Enable the counter driver for Sleep Timer module for Silicon Labs Gecko chips. diff --git a/drivers/counter/counter_gecko_stimer.c b/drivers/counter/counter_gecko_stimer.c index 682d632e887..c5821330b16 100644 --- a/drivers/counter/counter_gecko_stimer.c +++ b/drivers/counter/counter_gecko_stimer.c @@ -18,10 +18,20 @@ #include #include #include +#include LOG_MODULE_REGISTER(counter_gecko, CONFIG_COUNTER_LOG_LEVEL); -#define STIMER_MAX_VALUE (_RTCC_CNT_MASK) +#if SL_SLEEPTIMER_PERIPHERAL == SL_SLEEPTIMER_PERIPHERAL_RTCC +#define STIMER_IRQ_HANDLER RTCC_IRQHandler +#define STIMER_MAX_VALUE _RTCC_CNT_MASK +#elif SL_SLEEPTIMER_PERIPHERAL == SL_SLEEPTIMER_PERIPHERAL_SYSRTC +#define STIMER_IRQ_HANDLER SYSRTC_APP_IRQHandler +#define STIMER_MAX_VALUE _SYSRTC_CNT_MASK +#else +#error "Unsupported sleep timer peripheral" +#endif + #define STIMER_ALARM_NUM 2 struct counter_gecko_config { @@ -270,7 +280,7 @@ BUILD_ASSERT((DT_INST_PROP(0, prescaler) > 0U) && (DT_INST_PROP(0, prescaler) <= static void counter_gecko_0_irq_config(void) { - IRQ_DIRECT_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), RTCC_IRQHandler, 0); + IRQ_DIRECT_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), STIMER_IRQ_HANDLER, 0); irq_enable(DT_INST_IRQN(0)); } diff --git a/soc/arm/silabs_exx32/Kconfig b/soc/arm/silabs_exx32/Kconfig index d2faeca4bf6..a99c060c68f 100644 --- a/soc/arm/silabs_exx32/Kconfig +++ b/soc/arm/silabs_exx32/Kconfig @@ -199,8 +199,8 @@ config SOC_GECKO_DEV_INIT config COUNTER_GECKO_STIMER bool help - Enable counter driver based on RTCC module for Silicon Labs Gecko - chips. + Enable counter driver based on the Sleep Timer driver for Silicon Labs + Gecko chips. config SOC_GECKO_CMU bool diff --git a/west.yml b/west.yml index 6a5fd35f783..6fb0fb70528 100644 --- a/west.yml +++ b/west.yml @@ -219,7 +219,7 @@ manifest: groups: - hal - name: hal_silabs - revision: fbb47a4067c460a2c26917ff34189fb4f32f654f + revision: d184c2ccc0ec5a7189d6d5cb7645c7f9bd38c2b5 path: modules/hal/silabs groups: - hal