mirror of https://github.com/eldruin/ds323x-rs
Make types copyable
parent
a7c3f0c83a
commit
4674d06546
|
@ -6,7 +6,7 @@ use interface::{ ReadData, WriteData };
|
||||||
use super::{ decimal_to_packed_bcd, hours_to_register };
|
use super::{ decimal_to_packed_bcd, hours_to_register };
|
||||||
|
|
||||||
/// Parameters for setting Alarm1 on a date
|
/// Parameters for setting Alarm1 on a date
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct DateAlarm1 {
|
pub struct DateAlarm1 {
|
||||||
/// Date (day of month) [1-31]
|
/// Date (day of month) [1-31]
|
||||||
pub date: u8,
|
pub date: u8,
|
||||||
|
@ -19,7 +19,7 @@ pub struct DateAlarm1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parameters for setting Alarm1 on a weekday
|
/// Parameters for setting Alarm1 on a weekday
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct WeekdayAlarm1 {
|
pub struct WeekdayAlarm1 {
|
||||||
/// Weekday [1-7]
|
/// Weekday [1-7]
|
||||||
pub weekday: u8,
|
pub weekday: u8,
|
||||||
|
@ -32,7 +32,7 @@ pub struct WeekdayAlarm1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Alarm1 trigger rate
|
/// Alarm1 trigger rate
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum Alarm1Matching {
|
pub enum Alarm1Matching {
|
||||||
/// Alarm once per second.
|
/// Alarm once per second.
|
||||||
OncePerSecond,
|
OncePerSecond,
|
||||||
|
@ -48,7 +48,7 @@ pub enum Alarm1Matching {
|
||||||
|
|
||||||
|
|
||||||
/// Parameters for setting Alarm2 on a date
|
/// Parameters for setting Alarm2 on a date
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct DateAlarm2 {
|
pub struct DateAlarm2 {
|
||||||
/// Date (day of month) [1-31]
|
/// Date (day of month) [1-31]
|
||||||
pub date: u8,
|
pub date: u8,
|
||||||
|
@ -59,7 +59,7 @@ pub struct DateAlarm2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parameters for setting Alarm2 on a weekday
|
/// Parameters for setting Alarm2 on a weekday
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct WeekdayAlarm2 {
|
pub struct WeekdayAlarm2 {
|
||||||
/// Weekday [1-7]
|
/// Weekday [1-7]
|
||||||
pub weekday: u8,
|
pub weekday: u8,
|
||||||
|
@ -70,7 +70,7 @@ pub struct WeekdayAlarm2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Alarm2 trigger rate
|
/// Alarm2 trigger rate
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
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,
|
||||||
|
|
|
@ -6,7 +6,7 @@ use super::{ decimal_to_packed_bcd, packed_bcd_to_decimal, hours_to_register };
|
||||||
use interface::{ ReadData, WriteData };
|
use interface::{ ReadData, WriteData };
|
||||||
|
|
||||||
/// Date and time
|
/// Date and time
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct DateTime {
|
pub struct DateTime {
|
||||||
/// Year [2000-2099]
|
/// Year [2000-2099]
|
||||||
pub year : u16,
|
pub year : u16,
|
||||||
|
@ -25,7 +25,7 @@ pub struct DateTime {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Hours in either 12-hour (AM/PM) or 24-hour format
|
/// Hours in either 12-hour (AM/PM) or 24-hour format
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum Hours {
|
pub enum Hours {
|
||||||
/// AM [1-12]
|
/// AM [1-12]
|
||||||
AM(u8),
|
AM(u8),
|
||||||
|
|
|
@ -452,7 +452,7 @@ pub enum Error<E> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Square-wave output frequency
|
/// Square-wave output frequency
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum SqWFreq {
|
pub enum SqWFreq {
|
||||||
/// 1 Hz (default)
|
/// 1 Hz (default)
|
||||||
_1Hz,
|
_1Hz,
|
||||||
|
@ -467,7 +467,7 @@ pub enum SqWFreq {
|
||||||
/// Temperature conversion rate
|
/// Temperature conversion rate
|
||||||
///
|
///
|
||||||
/// This is only available on the DS3232 and DS3234 devices.
|
/// This is only available on the DS3232 and DS3234 devices.
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum TempConvRate {
|
pub enum TempConvRate {
|
||||||
/// Once every 64 seconds (default)
|
/// Once every 64 seconds (default)
|
||||||
_64s,
|
_64s,
|
||||||
|
|
Loading…
Reference in New Issue