Skip to content

Commit 9e7504b

Browse files
committed
drivers: rtc: Driver implementation for stm32u5
- this illustrates RTC API proposal - this driver use stm32 hal API Signed-off-by: FAURANT Nicolas <[email protected]>
1 parent b3399ee commit 9e7504b

File tree

7 files changed

+1035
-0
lines changed

7 files changed

+1035
-0
lines changed

drivers/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_subdirectory_ifdef(CONFIG_LED_STRIP led_strip)
2828
add_subdirectory_ifdef(CONFIG_MODEM modem)
2929
add_subdirectory_ifdef(CONFIG_PINMUX pinmux)
3030
add_subdirectory_ifdef(CONFIG_PWM pwm)
31+
add_subdirectory_ifdef(CONFIG_RTC rtc)
3132
add_subdirectory_ifdef(CONFIG_SENSOR sensor)
3233
add_subdirectory_ifdef(CONFIG_SPI spi)
3334
add_subdirectory_ifdef(CONFIG_WATCHDOG watchdog)

drivers/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,6 @@ source "drivers/pinctrl/Kconfig"
127127

128128
source "drivers/mbox/Kconfig"
129129

130+
source "drivers/rtc/Kconfig"
131+
130132
endmenu

drivers/rtc/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources_ifdef(CONFIG_RTC_STM32 rtc_hal_stm32u5.c)
6+

drivers/rtc/Kconfig

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# RTC driver configuration options
2+
3+
# Copyright (c) 2015 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
#
7+
# RTC drivers
8+
#
9+
menuconfig RTC
10+
bool "RTC drivers"
11+
help
12+
Enable RTC (Real Time Clock) driver configuration.
13+
14+
if RTC
15+
16+
module = RTC
17+
module-str = RTC
18+
19+
source "drivers/rtc/Kconfig.stm32"
20+
21+
endif # RTC

drivers/rtc/Kconfig.stm32

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2021 LACROIX Group
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config RTC_STM32
5+
bool "Enable support for rtc driver"
6+
select USE_STM32_HAL_RTC
7+
select USE_STM32_HAL_RTC_EX
8+
select USE_STM32_HAL_RCC
9+
select USE_STM32_HAL_RCC_EX
10+
select USE_STM32_LL_RTC
11+
select USE_STM32_HAL_PWR
12+
select USE_STM32_HAL_PWR_EX
13+
select USE_STM32_HAL_CORTEX
14+
15+
16+
# Todo: remove USE_STM32_LL_RCC & USE_STM32_HAL_RCC_EX for the final server

0 commit comments

Comments
 (0)