diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf index c2368b48..5685a1bb 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf +++ b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf @@ -1,9 +1,7 @@ CONFIG_ZSWATCH_PCB_REV=5 CONFIG_BT_DIS_HW_REV_STR="5" -#--------------- # FLASH -#----------------- CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_STREAM_FLASH=y @@ -49,3 +47,4 @@ CONFIG_NVS=y CONFIG_DEBUG_COREDUMP_BACKEND_OTHER=y +CONFIG_RTC=y \ No newline at end of file diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay index ed16b9ff..eafc1eca 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay +++ b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay @@ -181,6 +181,12 @@ }; &i2c1 { + rtc: rv-8263-c8@A2 { + compatible = "microcrystal,rv-8263-c8"; + reg = <0xA2>; + status = "okay"; + }; + bmi270: bmi270@68 { compatible = "bosch,bmi270-plus"; reg = <0x68>; diff --git a/app/drivers/CMakeLists.txt b/app/drivers/CMakeLists.txt index 31f019e0..5c438f54 100644 --- a/app/drivers/CMakeLists.txt +++ b/app/drivers/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(display) add_subdirectory(input) +add_subdirectory(rtc) add_subdirectory_ifdef(CONFIG_SENSOR sensor) \ No newline at end of file diff --git a/app/drivers/Kconfig b/app/drivers/Kconfig index aa785211..e5128844 100644 --- a/app/drivers/Kconfig +++ b/app/drivers/Kconfig @@ -1,5 +1,6 @@ rsource "display/Kconfig" rsource "input/Kconfig" +rsource "rtc/Kconfig" menu "Drivers" rsource "sensor/Kconfig" diff --git a/app/drivers/display/gc9a01/CMakeLists.txt b/app/drivers/display/gc9a01/CMakeLists.txt index a58a904e..860978b4 100644 --- a/app/drivers/display/gc9a01/CMakeLists.txt +++ b/app/drivers/display/gc9a01/CMakeLists.txt @@ -1 +1 @@ -zephyr_sources(gc9a01.c) \ No newline at end of file +zephyr_sources(buydisplay_gc9a01.c) \ No newline at end of file diff --git a/app/drivers/display/gc9a01/gc9a01.c b/app/drivers/display/gc9a01/buydisplay_gc9a01.c similarity index 100% rename from app/drivers/display/gc9a01/gc9a01.c rename to app/drivers/display/gc9a01/buydisplay_gc9a01.c diff --git a/app/drivers/rtc/CMakeLists.txt b/app/drivers/rtc/CMakeLists.txt new file mode 100644 index 00000000..88205b5a --- /dev/null +++ b/app/drivers/rtc/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2024, Daniel Kampert +# +# SPDX-License-Identifier: Apache-2.0 +# + +add_subdirectory_ifdef(CONFIG_RV8263C8 rv8263c8) \ No newline at end of file diff --git a/app/drivers/rtc/Kconfig b/app/drivers/rtc/Kconfig new file mode 100644 index 00000000..903dd8f1 --- /dev/null +++ b/app/drivers/rtc/Kconfig @@ -0,0 +1,3 @@ +if RTC + rsource "rv8263c8/Kconfig" +endif \ No newline at end of file diff --git a/app/drivers/rtc/rv8263c8/CMakeLists.txt b/app/drivers/rtc/rv8263c8/CMakeLists.txt new file mode 100644 index 00000000..089d3e28 --- /dev/null +++ b/app/drivers/rtc/rv8263c8/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2024, Daniel Kampert +# +# SPDX-License-Identifier: Apache-2.0 +# + +zephyr_sources(microcrystal_rv8263c8.c) \ No newline at end of file diff --git a/app/drivers/rtc/rv8263c8/Kconfig b/app/drivers/rtc/rv8263c8/Kconfig new file mode 100644 index 00000000..3f466126 --- /dev/null +++ b/app/drivers/rtc/rv8263c8/Kconfig @@ -0,0 +1,21 @@ +# RV-8263-C8 RTC configuration options. + +# Copyright (c) 240, Daniel Kampert +# +# SPDX-License-Identifier: Apache-2.0 + +menuconfig RV_8263_C8 + bool "RV-8263-C8 RTC" + depends on DT_HAS_MICRO_CRYSTAL_RV_8263_C8_ENABLED + default y + select I2C + help + Enable the driver for the RV-8263-C8 RTC. + +if RV_8263_C8 + +module = MICRO_CRYSTAL_RV_8263_C8 +module-str = MICRO_CRYSTAL_RV_8263_C8 +source "subsys/logging/Kconfig.template.log_config" + +endif \ No newline at end of file diff --git a/app/drivers/rtc/rv8263c8/microcrystal_rv8263c8.c b/app/drivers/rtc/rv8263c8/microcrystal_rv8263c8.c new file mode 100644 index 00000000..e69de29b diff --git a/app/drivers/rtc/rv8263c8/microcrystal_rv8263c8.h b/app/drivers/rtc/rv8263c8/microcrystal_rv8263c8.h new file mode 100644 index 00000000..7651c51f --- /dev/null +++ b/app/drivers/rtc/rv8263c8/microcrystal_rv8263c8.h @@ -0,0 +1,9 @@ +/* microcrystal_rv8263c8.h - Driver for Micro Crystal RV-8263-C8 RTC. */ + +/* + * Copyright (c 2024, Daniel Kampert + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once \ No newline at end of file diff --git a/app/dts/bindings/rtc/microcrystal,rv-8263-c8.yml b/app/dts/bindings/rtc/microcrystal,rv-8263-c8.yml new file mode 100644 index 00000000..ae935f5a --- /dev/null +++ b/app/dts/bindings/rtc/microcrystal,rv-8263-c8.yml @@ -0,0 +1,9 @@ +description: | + The RV-8263-C8 is a CMOS real-time clock/calendar module optimized for low power consumption. An Offset + register makes it possible to compensate for the frequency deviation of the clock of 32.768 kHz + +compatible: "microcrystal,rv-8263-c8" + +include: [rtc-device.yaml, i2c-device.yaml] + +#properties: \ No newline at end of file