[−][src]Struct stm32f3xx_hal::rtc::Rtc
Real Time Clock peripheral
Fields
regs: RTC
RTC Peripheral register definition
Implementations
impl Rtc
[src]
pub fn new(
regs: RTC,
prediv_s: u16,
prediv_a: u8,
bypass: bool,
apb1: &mut APB1,
bdcr: &mut BDCR,
pwr: &mut PWR
) -> Self
[src]
regs: RTC,
prediv_s: u16,
prediv_a: u8,
bypass: bool,
apb1: &mut APB1,
bdcr: &mut BDCR,
pwr: &mut PWR
) -> Self
Create and enable a new RTC, and configure its clock source and prescalers.
From AN4759, Table 7, when using the LSE (The only clock source this module
supports currently), set prediv_s
to 255, and prediv_a
to 127 to get a
calendar clock of 1Hz.
The bypass
argument is true
if you're using an external oscillator that
doesn't connect to OSC32_IN
, such as a MEMS resonator.
pub fn set_24h_fmt(&mut self)
[src]
Sets calendar clock to 24 hr format
pub fn set_12h_fmt(&mut self)
[src]
Sets calendar clock to 12 hr format
pub fn is_24h_fmt(&self) -> bool
[src]
Reads current hour format selection
Trait Implementations
impl Rtcc for Rtc
[src]
type Error = Error
Error type
pub fn set_time(&mut self, time: &NaiveTime) -> Result<(), Self::Error>
[src]
set time using NaiveTime (ISO 8601 time without timezone) Hour format is 24h
pub fn set_seconds(&mut self, seconds: u8) -> Result<(), Self::Error>
[src]
pub fn set_minutes(&mut self, minutes: u8) -> Result<(), Self::Error>
[src]
pub fn set_hours(&mut self, hours: Hours) -> Result<(), Self::Error>
[src]
pub fn set_weekday(&mut self, weekday: u8) -> Result<(), Self::Error>
[src]
pub fn set_day(&mut self, day: u8) -> Result<(), Self::Error>
[src]
pub fn set_month(&mut self, month: u8) -> Result<(), Self::Error>
[src]
pub fn set_year(&mut self, year: u16) -> Result<(), Self::Error>
[src]
pub fn set_date(&mut self, date: &NaiveDate) -> Result<(), Self::Error>
[src]
Set the date using NaiveDate (ISO 8601 calendar date without timezone).
WeekDay is set using the set_weekday
method
pub fn set_datetime(&mut self, date: &NaiveDateTime) -> Result<(), Self::Error>
[src]
pub fn get_seconds(&mut self) -> Result<u8, Self::Error>
[src]
pub fn get_minutes(&mut self) -> Result<u8, Self::Error>
[src]
pub fn get_hours(&mut self) -> Result<Hours, Self::Error>
[src]
pub fn get_time(&mut self) -> Result<NaiveTime, Self::Error>
[src]
pub fn get_weekday(&mut self) -> Result<u8, Self::Error>
[src]
pub fn get_day(&mut self) -> Result<u8, Self::Error>
[src]
pub fn get_month(&mut self) -> Result<u8, Self::Error>
[src]
pub fn get_year(&mut self) -> Result<u16, Self::Error>
[src]
pub fn get_date(&mut self) -> Result<NaiveDate, Self::Error>
[src]
pub fn get_datetime(&mut self) -> Result<NaiveDateTime, Self::Error>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,