[][src]Struct stm32f3xx_hal::rtc::Rtc

pub struct Rtc {
    pub regs: 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]

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_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

Auto Trait Implementations

impl Send for Rtc

impl !Sync for Rtc

impl Unpin for Rtc

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.