Skip to content
Permalink
Browse files

drivers: counter: enable counter for STM32WB

Add specific LL functions for STM32WB series for RTC control

Signed-off-by: Rick Conrey <rick.conrey@witiproducts.com>
  • Loading branch information...
Rick Conrey authored and MaureenHelm committed Jul 3, 2019
1 parent 30ac164 commit f8424c6d06ae4f21c2c80c1960d05a9c082aef3b
Showing with 8 additions and 1 deletion.
  1. +8 −1 drivers/counter/counter_ll_stm32_rtc.c
@@ -28,7 +28,8 @@ LOG_MODULE_REGISTER(counter_rtc_stm32, CONFIG_COUNTER_LOG_LEVEL);
#define RTC_EXTI_LINE LL_EXTI_LINE_18
#elif defined(CONFIG_SOC_SERIES_STM32F4X) \
|| defined(CONFIG_SOC_SERIES_STM32F3X) \
|| defined(CONFIG_SOC_SERIES_STM32F7X)
|| defined(CONFIG_SOC_SERIES_STM32F7X) \
|| defined(CONFIG_SOC_SERIES_STM32WBX)
#define RTC_EXTI_LINE LL_EXTI_LINE_17
#endif

@@ -262,9 +263,15 @@ static int rtc_stm32_init(struct device *dev)

#if defined(CONFIG_COUNTER_RTC_STM32_CLOCK_LSI)

#if defined(CONFIG_SOC_SERIES_STM32WBX)
LL_RCC_LSI1_Enable();
while (LL_RCC_LSI1_IsReady() != 1) {
}
#else
LL_RCC_LSI_Enable();
while (LL_RCC_LSI_IsReady() != 1) {
}
#endif /* CONFIG_SOC_SERIES_STM32WBX */

LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSI);

0 comments on commit f8424c6

Please sign in to comment.
You can’t perform that action at this time.