Skip to content

Commit

Permalink
Merge branch 'Add-RV-8263-C8-Driver' of github.com:Kampi/ZSWatch into…
Browse files Browse the repository at this point in the history
… Add-RV-8263-C8-Driver
  • Loading branch information
Kampi committed May 30, 2024
2 parents b45bdaf + 1b31081 commit 230eb25
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 187 deletions.
5 changes: 4 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 @@ -49,4 +49,7 @@ CONFIG_DEBUG_COREDUMP_BACKEND_OTHER=y

CONFIG_RTC=y
CONFIG_RTC_ALARM=y
CONFIG_RTC_RV8263_ALARM_GLOBAL_THREAD=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 @@ -194,6 +194,7 @@
reg = <0xA2>;
status = "okay";
clkout = <0>;
int-gpios = <&gpio1 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
};

bmi270: bmi270@68 {
Expand Down
105 changes: 65 additions & 40 deletions app/drivers/rtc/rv8263c8/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,73 @@ config RTC_RV8263
Micro Crystal RV-8263-C8 RTC driver.

if RTC_RV8263
config RTC_RV8263_UPDATE_THREAD_STACK_SIZE
int "Stack size for the RV-8263-C8 update thread"
menu "RV8263 Update"
depends on RTC_UPDATE
default 512
help
Size of the stack used for the thread handling RTC updates.

config RTC_RV8263_UPDATE_THREAD_PRIORITY
int "RV-8263-C8 update thread priority"
depends on RTC_UPDATE
default 0
help
Priority level for the thread handling RTC updates.

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 interrupts 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 interrupts and dispatching callbacks.

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

config RTC_RV8263_ALARM_GLOBAL_THREAD
depends on GPIO
bool "Use workqueue"

choice
prompt "RV-8263-C8 update handling mode"
default RTC_RV8263_UPDATE_GLOBAL_THREAD

config RTC_RV8263_UPDATE_GLOBAL_THREAD
depends on GPIO
bool "Use workqueue (Default)"
help
Use the global workqueue to process the updates from the RV-8263-C8.

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 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
Size of the stack used for the thread handling RTC updates and dispatching callbacks.

config RTC_RV8263_UPDATE_THREAD_PRIORITY
int "RV-8263-C8 update thread priority"
depends on RTC_RV8263_UPDATE_OWN_THREAD
default 0
help
Priority level for the thread handling RTC updates and dispatching callbacks.
endmenu

menu "RV8263 Alarm"
depends on RTC_ALARM

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

config RTC_RV8263_ALARM_GLOBAL_THREAD
depends on GPIO
bool "Use workqueue (Default)"
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
Use the global workqueue to process the interrupts from the RV-8263-C8.
Size of the stack used for the thread handling alarms and dispatching callbacks.

config RTC_RV8263_ALARM_OWN_THREAD
depends on GPIO
bool "Use driver thread"
config RTC_RV8263_ALARM_THREAD_PRIORITY
int "RV-8263-C8 alarm thread priority"
depends on RTC_RV8263_ALARM_OWN_THREAD
default 0
help
Use a separate thread to process the interrupts from the RV-8263-C8.
endchoice
Priority level for the thread handling alarms and dispatching callbacks.
endmenu
endif
Loading

0 comments on commit 230eb25

Please sign in to comment.