diff --git a/src/rtc.rs b/src/rtc.rs deleted file mode 100644 index 2a644c7e..00000000 --- a/src/rtc.rs +++ /dev/null @@ -1,397 +0,0 @@ -//! Real Time Clock -use crate::rcc::{RTCSrc, Rcc}; -use crate::stm32::RTC; -use crate::time::*; - -#[derive(Debug, PartialEq, Eq)] -pub enum RtcHourFormat { - H24, - H12, -} - -#[derive(Debug, PartialEq, Eq)] -pub enum RtcCalibrationFrequency { - F1Hz, - F512Hz, -} - -pub enum Event { - WakeupTimer, - AlarmA, - AlarmB, - Timestamp, -} - -#[derive(Debug, Default, PartialEq, Eq)] -pub struct Alarm { - day: Option, - hours: Option, - minutes: Option, - seconds: Option, - subseconds: u16, - subseconds_mask_bits: u8, - use_weekday: bool, -} - -impl Alarm { - pub fn new() -> Self { - Self::default() - } - - pub fn set_month_day(mut self, day: u32) -> Self { - self.use_weekday = false; - self.day = Some(day); - self - } - - pub fn set_week_day(mut self, day: u32) -> Self { - self.use_weekday = true; - self.day = Some(day); - self - } - - pub fn set_hours(mut self, val: u32) -> Self { - self.hours = Some(val); - self - } - - pub fn set_minutes(mut self, val: u32) -> Self { - self.minutes = Some(val); - self - } - - pub fn set_seconds(mut self, val: u32) -> Self { - self.seconds = Some(val); - self - } - - pub fn set_subseconds(mut self, subseconds: u16, mask_bits: u8) -> Self { - self.subseconds_mask_bits = mask_bits; - self.subseconds = subseconds; - self - } - - pub fn mask_day(mut self) -> Self { - self.day = None; - self - } - - pub fn mask_hours(mut self) -> Self { - self.hours = None; - self - } - - pub fn mask_minutes(mut self) -> Self { - self.minutes = None; - self - } - - pub fn mask_seconds(mut self) -> Self { - self.seconds = None; - self - } -} - -impl From