-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename display driver to match it with the vendor_type scheme of the other drivers - Remove Funkytown song from Buzzer driver - Disable selecting of the step counter and battery arc in digital watchface - Reorganize Kconfig and move the application configuration into the "Applications" menu
- Loading branch information
Showing
27 changed files
with
840 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
add_subdirectory(display) | ||
add_subdirectory(input) | ||
add_subdirectory(rtc) | ||
|
||
add_subdirectory_ifdef(CONFIG_SENSOR sensor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
rsource "display/Kconfig" | ||
rsource "input/Kconfig" | ||
|
||
menu "Drivers" | ||
rsource "sensor/Kconfig" | ||
endmenu | ||
rsource "rtc/Kconfig" | ||
rsource "sensor/Kconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
zephyr_sources(gc9a01.c) | ||
zephyr_sources(buydisplay_gc9a01.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (c) 2024, Daniel Kampert | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
add_subdirectory_ifdef(CONFIG_RV_8263_C8 rv8263c8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if RTC | ||
rsource "rv8263c8/Kconfig" | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) 2024, Daniel Kampert | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
zephyr_sources(microcrystal_rv8263c8.c) | ||
zephyr_sources(interrupt/microcrystal_rv8263c8_interrupt.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 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_MICROCRYSTAL_RV_8263_C8_ENABLED | ||
default y | ||
select I2C | ||
help | ||
Enable the driver for the RV-8263-C8 RTC. | ||
|
||
if RV_8263_C8 | ||
|
||
module = MICROCRYSTAL_RV_8263_C8 | ||
module-str = MICROCRYSTAL_RV_8263_C8 | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
config RV_8263_C8_THREAD_STACK_SIZE | ||
int "RTC delayed work thread stack size" | ||
depends on RV_8263_C8_INTERRUPT_OWN_THREAD | ||
default 1024 | ||
|
||
config RV_8263_C8_THREAD_PRIORITY | ||
int "RV-8263-C8 thread priority" | ||
depends on RV_8263_C8_INTERRUPT_OWN_THREAD | ||
default 10 | ||
|
||
choice | ||
prompt "RV-8263-C8 interrupt mode" | ||
default RV_8263_C8_INTERRUPT_NONE | ||
|
||
config RV_8263_C8_INTERRUPT_NONE | ||
bool "No interrupt" | ||
help | ||
Disable the INTERRUPT interface. | ||
|
||
config RV_8263_C8_INTERRUPT_GLOBAL_THREAD | ||
depends on GPIO | ||
select RV_8263_C8_INTERRUPT | ||
bool "Use workqueue" | ||
help | ||
Use the global workqueue to process the interrupts from the RV-8263-C8. | ||
|
||
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 | ||
|
||
config RV_8263_C8_INTERRUPT | ||
bool | ||
|
||
endif |
70 changes: 70 additions & 0 deletions
70
app/drivers/rtc/rv8263c8/interrupt/microcrystal_rv8263c8_interrupt.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* microcrystal_rv8263c8_interrupt.c - Driver for Micro Crystal RV-8263-C8 RTC. */ | ||
|
||
/* | ||
* Copyright (c) 2024, Daniel Kampert | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/logging/log.h> | ||
#include <zephyr/drivers/sensor.h> | ||
|
||
#include "../microcrystal_rv8263c8.h" | ||
#include "../private/microcrystal_rv8263c8_types.h" | ||
|
||
LOG_MODULE_REGISTER(microcrystal_rv8263c8_interrupt, CONFIG_MICROCRYSTAL_RV_8263_C8_LOG_LEVEL); | ||
|
||
#ifdef CONFIG_RV_8263_C8_TRIGGER_OWN_THREAD | ||
static K_KERNEL_STACK_DEFINE(rv8263c8_thread_stack, CONFIG_RV_8263_C8_THREAD_STACK_SIZE); | ||
static struct k_thread rv8263c8_thread; | ||
#endif | ||
|
||
/** @brief | ||
* @param p_dev | ||
* @param p_cb | ||
* @param pins | ||
*/ | ||
static void rv8263c8_gpio_on_interrupt_callback(const struct device *p_dev, struct gpio_callback *p_cb, uint32_t pins) | ||
{ | ||
ARG_UNUSED(pins); | ||
ARG_UNUSED(p_dev); | ||
} | ||
|
||
int rv8263c8_init_interrupt(const struct device *p_dev) | ||
{ | ||
struct rv8263c8_data *data = p_dev->data; | ||
const struct rv8263c8_config *config = p_dev->config; | ||
|
||
LOG_DBG("Initialize interrupts..."); | ||
|
||
if (!gpio_is_ready_dt(&config->int_gpio)) { | ||
LOG_ERR("INT GPIO device not ready!"); | ||
return -ENODEV; | ||
} | ||
|
||
if (gpio_pin_configure_dt(&config->int_gpio, GPIO_INPUT)) { | ||
return -EFAULT; | ||
} | ||
/* | ||
data->dev = p_dev; | ||
#ifdef CONFIG_RV_8263_C8_TRIGGER_OWN_THREAD | ||
k_sem_init(&data->sem, 0, K_SEM_MAX_LIMIT); | ||
k_thread_create(&bmi2_thread, bmi2_thread_stack, CONFIG_RV_8263_C8_THREAD_STACK_SIZE, | ||
bmi2_worker_thread, data, NULL, NULL, K_PRIO_COOP(CONFIG_RV_8263_C8_THREAD_PRIORITY), | ||
0, K_NO_WAIT); | ||
#else | ||
data->work.handler = bmi2_worker; | ||
#endif | ||
gpio_init_callback(&data->gpio_handler, rv8263c8_gpio_on_interrupt_callback, BIT(config->int_gpio.pin)); | ||
if (gpio_add_callback(config->int_gpio.port, &data->gpio_handler)) { | ||
return -EFAULT; | ||
} | ||
LOG_DBG("Interrupts ready!"); | ||
*/ | ||
return 0; | ||
} |
Oops, something went wrong.