Make types copyable

pull/4/head
Diego Barrios Romero 2018-11-16 17:47:48 +01:00
parent a7c3f0c83a
commit 4674d06546
3 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,7 @@ use interface::{ ReadData, WriteData };
use super::{ decimal_to_packed_bcd, hours_to_register };
/// Parameters for setting Alarm1 on a date
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DateAlarm1 {
/// Date (day of month) [1-31]
pub date: u8,
@ -19,7 +19,7 @@ pub struct DateAlarm1 {
}
/// Parameters for setting Alarm1 on a weekday
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct WeekdayAlarm1 {
/// Weekday [1-7]
pub weekday: u8,
@ -32,7 +32,7 @@ pub struct WeekdayAlarm1 {
}
/// Alarm1 trigger rate
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Alarm1Matching {
/// Alarm once per second.
OncePerSecond,
@ -48,7 +48,7 @@ pub enum Alarm1Matching {
/// Parameters for setting Alarm2 on a date
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DateAlarm2 {
/// Date (day of month) [1-31]
pub date: u8,
@ -59,7 +59,7 @@ pub struct DateAlarm2 {
}
/// Parameters for setting Alarm2 on a weekday
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct WeekdayAlarm2 {
/// Weekday [1-7]
pub weekday: u8,
@ -70,7 +70,7 @@ pub struct WeekdayAlarm2 {
}
/// Alarm2 trigger rate
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Alarm2Matching {
/// Alarm once per minute. (00 seconds of every minute)
OncePerMinute,

View File

@ -6,7 +6,7 @@ use super::{ decimal_to_packed_bcd, packed_bcd_to_decimal, hours_to_register };
use interface::{ ReadData, WriteData };
/// Date and time
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DateTime {
/// Year [2000-2099]
pub year : u16,
@ -25,7 +25,7 @@ pub struct DateTime {
}
/// Hours in either 12-hour (AM/PM) or 24-hour format
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Hours {
/// AM [1-12]
AM(u8),

View File

@ -452,7 +452,7 @@ pub enum Error<E> {
}
/// Square-wave output frequency
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum SqWFreq {
/// 1 Hz (default)
_1Hz,
@ -467,7 +467,7 @@ pub enum SqWFreq {
/// Temperature conversion rate
///
/// This is only available on the DS3232 and DS3234 devices.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum TempConvRate {
/// Once every 64 seconds (default)
_64s,