Skip to content

Commit

Permalink
- Update bosch_bmi270_types.h
Browse files Browse the repository at this point in the history
- Add RV-8263-C8 driver
- Couple smaller changes
  • Loading branch information
Kampi committed May 29, 2024
1 parent 69801cb commit 8cbe6e8
Show file tree
Hide file tree
Showing 15 changed files with 754 additions and 389 deletions.
6 changes: 5 additions & 1 deletion app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ CONFIG_NVS=y
CONFIG_DEBUG_COREDUMP_BACKEND_OTHER=y

CONFIG_RTC=y
CONFIG_RTC_ALARM=y
CONFIG_RTC_ALARM=y
CONFIG_RTC_RV8263_ALARM_OWN_THREAD=y
CONFIG_RTC_UPDATE=y
CONFIG_RTC_RV8263_UPDATE_OWN_THREAD=y
CONFIG_RTC_CALIBRATION=y
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@
compatible = "microcrystal,rv-8263-c8";
reg = <0xA2>;
status = "okay";
clkout = <7>;
clkout = <0>;
int-gpios = <&gpio1 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
};

bmi270: bmi270@68 {
Expand Down
2 changes: 1 addition & 1 deletion app/drivers/rtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# SPDX-License-Identifier: Apache-2.0
#

add_subdirectory_ifdef(CONFIG_RV_8263_C8 rv8263c8)
add_subdirectory_ifdef(CONFIG_RTC_RV8263 rv8263c8)
8 changes: 3 additions & 5 deletions app/drivers/rtc/rv8263c8/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Copyright (c) 2024, Daniel Kampert
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2024 Daniel Kampert
# Author: Daniel Kampert <DanielKampert@Kampis-Elektroecke.de>

zephyr_sources(microcrystal_rv8263c8.c)
zephyr_sources(interrupt/microcrystal_rv8263c8_interrupt.c)
zephyr_sources(microcrystal_rv8263c8.c)
113 changes: 69 additions & 44 deletions app/drivers/rtc/rv8263c8/Kconfig
Original file line number Diff line number Diff line change
@@ -1,58 +1,83 @@
# RV-8263-C8 RTC configuration options.

# Copyright (c) 240, Daniel Kampert
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Daniel Kampert
# Author: Daniel Kampert <DanielKampert@Kampis-Elektroecke.de>

menuconfig RV_8263_C8
bool "RV-8263-C8 RTC"
depends on DT_HAS_MICROCRYSTAL_RV_8263_C8_ENABLED
default y
select I2C
help
Enable the driver for the RV-8263-C8 RTC.

if RV_8263_C8
config RTC_RV8263
bool "Micro Crystal RV-8263-C8 RTC driver"
default y
depends on DT_HAS_MICROCRYSTAL_RV_8263_C8_ENABLED
select I2C
help
Micro Crystal RV-8263-C8 RTC driver.

module = MICROCRYSTAL_RV_8263_C8
module-str = MICROCRYSTAL_RV_8263_C8
source "subsys/logging/Kconfig.template.log_config"
if RTC_RV8263
menu "RV8263 Update"
depends on RTC_UPDATE

config RV_8263_C8_THREAD_STACK_SIZE
int "RTC delayed work thread stack size"
depends on RV_8263_C8_INTERRUPT_OWN_THREAD
default 1024
choice
prompt "RV-8263-C8 update handling mode"
default RTC_RV8263_UPDATE_OWN_THREAD

config RV_8263_C8_THREAD_PRIORITY
int "RV-8263-C8 thread priority"
depends on RV_8263_C8_INTERRUPT_OWN_THREAD
default 10
config RTC_RV8263_UPDATE_GLOBAL_THREAD
depends on GPIO
bool "Use workqueue"
help
Use the global workqueue to process the updates from the RV-8263-C8.

choice
prompt "RV-8263-C8 interrupt mode"
default RV_8263_C8_INTERRUPT_NONE
config RTC_RV8263_UPDATE_OWN_THREAD
depends on GPIO
bool "Use driver thread"
help
Use a separate thread to process the updates from the RV-8263-C8.
endchoice

config RV_8263_C8_INTERRUPT_NONE
bool "No interrupt"
config RTC_RV8263_UPDATE_THREAD_STACK_SIZE
int "Stack size for the RV-8263-C8 update thread"
depends on RTC_RV8263_UPDATE_OWN_THREAD
default 512
help
Disable the INTERRUPT interface.
Size of the stack used for the thread handling RTC updates and dispatching callbacks.

config RV_8263_C8_INTERRUPT_GLOBAL_THREAD
depends on GPIO
select RV_8263_C8_INTERRUPT
bool "Use workqueue"
config RTC_RV8263_UPDATE_THREAD_PRIORITY
int "RV-8263-C8 update thread priority"
depends on RTC_RV8263_UPDATE_OWN_THREAD
default 0
help
Use the global workqueue to process the interrupts from the RV-8263-C8.
Priority level for the thread handling RTC updates and dispatching callbacks.
endmenu

config RV_8263_C8_INTERRUPT_OWN_THREAD
depends on GPIO
select RV_8263_C8_INTERRUPT
bool "Use driver thread"
help
Use a separate thread to process the interrupts from the RV-8263-C8.
endchoice
menu "RV8263 Alarm"
depends on RTC_ALARM

choice
prompt "RV-8263-C8 alarm handling mode"
default RTC_RV8263_ALARM_OWN_THREAD

config RV_8263_C8_INTERRUPT
bool
config RTC_RV8263_ALARM_GLOBAL_THREAD
depends on GPIO
bool "Use workqueue"
help
Use the global workqueue to process the interrupts from the RV-8263-C8.

config RTC_RV8263_ALARM_OWN_THREAD
depends on GPIO
bool "Use driver thread"
help
Use a separate thread to process the alarms from the RV-8263-C8.
endchoice

config RTC_RV8263_ALARM_THREAD_STACK_SIZE
int "Stack size for the RV-8263-C8 interrupt thread"
depends on RTC_RV8263_ALARM_OWN_THREAD
default 512
help
Size of the stack used for the thread handling alarms and dispatching callbacks.

config RTC_RV8263_ALARM_THREAD_PRIORITY
int "RV-8263-C8 alarm thread priority"
depends on RTC_RV8263_ALARM_OWN_THREAD
default 0
help
Priority level for the thread handling alarms and dispatching callbacks.
endmenu
endif

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8cbe6e8

Please sign in to comment.