-
-
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
- Loading branch information
Showing
14 changed files
with
158 additions
and
20 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
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,5 +1,6 @@ | ||
rsource "display/Kconfig" | ||
rsource "input/Kconfig" | ||
rsource "rtc/Kconfig" | ||
|
||
menu "Drivers" | ||
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) |
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
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,6 @@ | ||
# Copyright (c) 2024, Daniel Kampert | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
zephyr_sources(microcrystal_rv8263c8.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,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_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" | ||
|
||
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,79 @@ | ||
/* microcrystal_rv8263c8.c - Driver for Micro Crystal RV-8263-C8 RTC. */ | ||
|
||
/* | ||
* Copyright (c) 2024, Daniel Kampert | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/device.h> | ||
#include <zephyr/devicetree.h> | ||
#include <zephyr/drivers/i2c.h> | ||
#include <zephyr/drivers/gpio.h> | ||
#include <zephyr/drivers/rtc.h> | ||
#include <zephyr/pm/device.h> | ||
#include <zephyr/pm/device_runtime.h> | ||
#include <zephyr/logging/log.h> | ||
#include <zephyr/sys/byteorder.h> | ||
|
||
#include "microcrystal_rv8263c8.h" | ||
|
||
#define RV8263C8_REGISTER_CONTROL1 0x00 | ||
#define RV8263C8_REGISTER_CONTROL2 0x01 | ||
#define RV8263C8_REGISTER_OFFSET 0x02 | ||
#define RV8263C8_REGISTER_RAM 0x03 | ||
#define RV8263C8_REGISTER_SECONDS 0x04 | ||
#define RV8263C8_REGISTER_MINUTES 0x05 | ||
#define RV8263C8_REGISTER_HOURS 0x06 | ||
#define RV8263C8_REGISTER_DATE 0x07 | ||
#define RV8263C8_REGISTER_WEEKDAY 0x08 | ||
#define RV8263C8_REGISTER_MONTH 0x09 | ||
#define RV8263C8_REGISTER_YEAR 0x0A | ||
#define RV8263C8_REGISTER_SECONDS_ALARM 0x0B | ||
#define RV8263C8_REGISTER_MINUTES_ALARM 0x0C | ||
#define RV8263C8_REGISTER_HOURS_ALARM 0x0D | ||
#define RV8263C8_REGISTER_DATE_ALARM 0x0E | ||
#define RV8263C8_REGISTER_WEEKDAY_ALARM 0x0F | ||
#define RV8263C8_REGISTER_TIMER_VALUE 0x10 | ||
#define RV8263C8_REGISTER_TIMER_MODE 0x11 | ||
|
||
#define DT_DRV_COMPAT microcrystal_rv_8263_c8 | ||
|
||
LOG_MODULE_REGISTER(microcrystal_rv8263c8, CONFIG_MICROCRYSTAL_RV_8263_C8_LOG_LEVEL); | ||
|
||
struct rv8263c8_config { | ||
struct i2c_dt_spec i2c_bus; | ||
}; | ||
|
||
struct rv8263c8_data { | ||
struct k_spinlock lock; | ||
}; | ||
|
||
static const struct rtc_driver_api rv8263c8_driver_api = { | ||
.set_time = NULL, | ||
.get_time = NULL, | ||
}; | ||
|
||
static int rv8263c8_init(const struct device *dev) | ||
{ | ||
int err; | ||
const struct rv8263c8_config *config = dev->config; | ||
|
||
if (!i2c_is_ready_dt(&config->i2c_bus)) { | ||
LOG_ERR("I2C bus not ready"); | ||
return -ENODEV; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
#define RV8263C8_DEFINE(inst) \ | ||
static struct rv8263c8_data rv8263c8_data_##inst; \ | ||
static const struct rv8263c8_config rv8263c8_config_##inst = { \ | ||
.i2c_bus = I2C_DT_SPEC_INST_GET(inst), \ | ||
}; \ | ||
DEVICE_DT_INST_DEFINE(inst, &rv8263c8_init, NULL, &rv8263c8_data_##inst, \ | ||
&rv8263c8_config_##inst, POST_KERNEL, CONFIG_RTC_INIT_PRIORITY, \ | ||
&rv8263c8_driver_api); | ||
|
||
DT_INST_FOREACH_STATUS_OKAY(RV8263C8_DEFINE) |
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,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 |
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,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: |
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