drivers/rtc: Enable RTC driver for STM32F4 series
Enable RTC driver for STM32F4 series. Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
This commit is contained in:
parent
73e8454d17
commit
10c763cfbc
6 changed files with 29 additions and 11 deletions
|
@ -15,7 +15,7 @@ config RTC_STM32
|
|||
select USE_STM32_LL_EXTI
|
||||
select NEWLIB_LIBC
|
||||
help
|
||||
Build RTC driver for STM32x4 SoCs. Tested on STM32L4 series.
|
||||
Build RTC driver for STM32 SoCs. Tested on STM32 F4, L4 series.
|
||||
|
||||
choice RTC_STM32_CLOCK_SRC
|
||||
bool "RTC clock source"
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
#include <board.h>
|
||||
#include <rtc.h>
|
||||
|
||||
#if defined(CONFIG_SOC_SERIES_STM32L4X)
|
||||
#define EXTI_LINE LL_EXTI_LINE_18
|
||||
#elif defined(CONFIG_SOC_SERIES_STM32F4X)
|
||||
#define EXTI_LINE LL_EXTI_LINE_17
|
||||
#endif
|
||||
|
||||
#define EPOCH_OFFSET 946684800
|
||||
|
||||
struct rtc_stm32_config {
|
||||
|
@ -193,7 +199,7 @@ void rtc_stm32_isr(void *arg)
|
|||
LL_RTC_DisableIT_ALRA(RTC);
|
||||
}
|
||||
|
||||
LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_18);
|
||||
LL_EXTI_ClearFlag_0_31(EXTI_LINE);
|
||||
}
|
||||
|
||||
static int rtc_stm32_init(struct device *dev)
|
||||
|
@ -245,8 +251,8 @@ static int rtc_stm32_init(struct device *dev)
|
|||
|
||||
LL_RTC_EnableShadowRegBypass(RTC);
|
||||
|
||||
LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_18);
|
||||
LL_EXTI_EnableRisingTrig_0_31(LL_EXTI_LINE_18);
|
||||
LL_EXTI_EnableIT_0_31(EXTI_LINE);
|
||||
LL_EXTI_EnableRisingTrig_0_31(EXTI_LINE);
|
||||
|
||||
rtc_stm32_irq_config(dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue