mirror of https://github.com/eldruin/ds323x-rs
Rename defmt feature
parent
3cd6bb82c1
commit
57e0744c95
|
@ -21,7 +21,7 @@ include = [
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
defmt = ["dep:defmt", "rtcc/defmt"]
|
defmt-03 = ["dep:defmt", "rtcc/defmt-03"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
embedded-hal = "1.0.0"
|
embedded-hal = "1.0.0"
|
||||||
|
|
|
@ -15,7 +15,7 @@ use crate::{
|
||||||
/// - Second, minute and hour: 0
|
/// - Second, minute and hour: 0
|
||||||
/// - Day: 1
|
/// - Day: 1
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct DayAlarm1 {
|
pub struct DayAlarm1 {
|
||||||
/// Day of the month [1-31]
|
/// Day of the month [1-31]
|
||||||
pub day: u8,
|
pub day: u8,
|
||||||
|
@ -35,7 +35,7 @@ pub struct DayAlarm1 {
|
||||||
/// - Second, minute and hour: 0
|
/// - Second, minute and hour: 0
|
||||||
/// - Weekday: 1
|
/// - Weekday: 1
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct WeekdayAlarm1 {
|
pub struct WeekdayAlarm1 {
|
||||||
/// Weekday [1-7]
|
/// Weekday [1-7]
|
||||||
pub weekday: u8,
|
pub weekday: u8,
|
||||||
|
@ -49,7 +49,7 @@ pub struct WeekdayAlarm1 {
|
||||||
|
|
||||||
/// Alarm1 trigger rate
|
/// Alarm1 trigger rate
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub enum Alarm1Matching {
|
pub enum Alarm1Matching {
|
||||||
/// Alarm once per second.
|
/// Alarm once per second.
|
||||||
OncePerSecond,
|
OncePerSecond,
|
||||||
|
@ -71,7 +71,7 @@ pub enum Alarm1Matching {
|
||||||
/// - Minute and hour: 0
|
/// - Minute and hour: 0
|
||||||
/// - Day: 1
|
/// - Day: 1
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct DayAlarm2 {
|
pub struct DayAlarm2 {
|
||||||
/// Day of month [1-31]
|
/// Day of month [1-31]
|
||||||
pub day: u8,
|
pub day: u8,
|
||||||
|
@ -89,7 +89,7 @@ pub struct DayAlarm2 {
|
||||||
/// - Minute and hour: 0
|
/// - Minute and hour: 0
|
||||||
/// - Weekday: 1
|
/// - Weekday: 1
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct WeekdayAlarm2 {
|
pub struct WeekdayAlarm2 {
|
||||||
/// Weekday [1-7]
|
/// Weekday [1-7]
|
||||||
pub weekday: u8,
|
pub weekday: u8,
|
||||||
|
@ -101,7 +101,7 @@ pub struct WeekdayAlarm2 {
|
||||||
|
|
||||||
/// Alarm2 trigger rate
|
/// Alarm2 trigger rate
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub enum Alarm2Matching {
|
pub enum Alarm2Matching {
|
||||||
/// Alarm once per minute. (00 seconds of every minute)
|
/// Alarm once per minute. (00 seconds of every minute)
|
||||||
OncePerMinute,
|
OncePerMinute,
|
||||||
|
|
|
@ -5,14 +5,14 @@ use embedded_hal::{i2c, spi};
|
||||||
|
|
||||||
/// I2C interface
|
/// I2C interface
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct I2cInterface<I2C> {
|
pub struct I2cInterface<I2C> {
|
||||||
pub(crate) i2c: I2C,
|
pub(crate) i2c: I2C,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SPI interface
|
/// SPI interface
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct SpiInterface<SPI> {
|
pub struct SpiInterface<SPI> {
|
||||||
pub(crate) spi: SPI,
|
pub(crate) spi: SPI,
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,7 @@ pub const SPI_MODE_3: Mode = MODE_3;
|
||||||
|
|
||||||
/// All possible errors in this crate
|
/// All possible errors in this crate
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub enum Error<E> {
|
pub enum Error<E> {
|
||||||
/// I²C/SPI bus error
|
/// I²C/SPI bus error
|
||||||
Comm(E),
|
Comm(E),
|
||||||
|
@ -392,7 +392,7 @@ pub enum Error<E> {
|
||||||
|
|
||||||
/// Square-wave output frequency
|
/// Square-wave output frequency
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub enum SqWFreq {
|
pub enum SqWFreq {
|
||||||
/// 1 Hz (default)
|
/// 1 Hz (default)
|
||||||
_1Hz,
|
_1Hz,
|
||||||
|
@ -408,7 +408,7 @@ pub enum SqWFreq {
|
||||||
///
|
///
|
||||||
/// This is only available on the DS3232 and DS3234 devices.
|
/// This is only available on the DS3232 and DS3234 devices.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub enum TempConvRate {
|
pub enum TempConvRate {
|
||||||
/// Once every 64 seconds (default)
|
/// Once every 64 seconds (default)
|
||||||
_64s,
|
_64s,
|
||||||
|
@ -481,7 +481,7 @@ pub mod ic {
|
||||||
|
|
||||||
/// DS3231, DS3232 and DS3234 RTC driver
|
/// DS3231, DS3232 and DS3234 RTC driver
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
|
||||||
pub struct Ds323x<DI, IC> {
|
pub struct Ds323x<DI, IC> {
|
||||||
iface: DI,
|
iface: DI,
|
||||||
control: u8,
|
control: u8,
|
||||||
|
|
Loading…
Reference in New Issue