zephyr/drivers/counter/Kconfig.stm32_rtc
Dawid Niedzwiecki 49f9aa7d12 counter: stm32 rtc: handle sub second registers
Add support for using the sub second registers. It allows reading and
setting alarm with the sub second tick resolution.

The RTC module is configured to get as high frequency as possible, which
equals the source clock (RTCCLK) divided by 2. To get such frequency,
the asynchronous prescaler is set to 1.

According to RM, setting the asynchronous prescaler to a high value
minimize consumption, so the change increase the power consumption.

Use a config to enable the sub second support.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-09-26 15:05:35 +02:00

57 lines
1.4 KiB
Plaintext

# STM32 Cube LL RTC
# Copyright (c) 2018, Linaro Limited
# SPDX-License-Identifier: Apache-2.0
menuconfig COUNTER_RTC_STM32
bool "STM32 Counter RTC driver"
default y if !RTC
depends on DT_HAS_ST_STM32_RTC_ENABLED
select USE_STM32_LL_RTC
select USE_STM32_LL_PWR
select USE_STM32_LL_RCC
select USE_STM32_LL_EXTI
help
Build RTC driver for STM32 SoCs.
Tested on STM32 C0, F0, F2, F3, F4, F7, G0, G4, H7, L1, L4, L5, U5 series
if COUNTER_RTC_STM32
choice COUNTER_RTC_STM32_CLOCK_SRC
bool "RTC clock source"
optional
depends on COUNTER_RTC_STM32
config COUNTER_RTC_STM32_CLOCK_LSI
bool "LSI"
select DEPRECATED
help
Use LSI as RTC clock
Deprecated in favor of device tree secondary domain clock
config COUNTER_RTC_STM32_CLOCK_LSE
bool "LSE"
select DEPRECATED
help
Use LSE as RTC clock
Deprecated in favor of device tree secondary domain clock
endchoice #COUNTER_RTC_STM32_CLOCK_SRC
config COUNTER_RTC_STM32_SAVE_VALUE_BETWEEN_RESETS
bool "Save rtc time value between resets"
default n
help
Keep the counter value after each reset.
config COUNTER_RTC_STM32_SUBSECONDS
bool "Use the subseconds as a basic tick."
depends on !SOC_SERIES_STM32F1X
help
Use the subseconds as the basic time tick. It increases resolution
of the counter. The frequency of the time is RTC Source Clock divided
by 2. It is the clock after the first asynchronous prescaler.
The config increases power consumption.
endif # COUNTER_RTC_STM32