pub struct Rtc<CS = Lse> {
    pub regs: RTC,
    /* private fields */
}
Expand description

Real Time Clock peripheral

Fields

regs: RTC

RTC Peripheral register

Implementations

Create and enable a new RTC with external crystal or ceramic resonator and default prescalers.

Create and enable a new RTC, and configure its clock source and prescalers.

From AN3371, Table 3, when using the LSE, set prediv_s to 255, and prediv_a to 127 to get a calendar clock of 1Hz.

Create and enable a new RTC with internal crystal and default prescalers.

Create and enable a new RTC, and configure its clock source and prescalers.

From AN3371, Table 3, when using the LSI, set prediv_s to 249, and prediv_a to 127 to get a calendar clock of 1Hz.

Set the time using time::Time.

Set the seconds [0-59].

Set the minutes [0-59].

Set the hours [0-23].

Set the day of week [1-7].

Set the day of month [1-31].

Set the month [1-12].

Set the year [1970-2069].

The year cannot be less than 1970, since the Unix epoch is assumed (1970-01-01 00:00:00). Also, the year cannot be greater than 2069 since the RTC range is 0 - 99.

Set the date.

The year cannot be less than 1970, since the Unix epoch is assumed (1970-01-01 00:00:00). Also, the year cannot be greater than 2069 since the RTC range is 0 - 99.

Set the date and time.

The year cannot be less than 1970, since the Unix epoch is assumed (1970-01-01 00:00:00). Also, the year cannot be greater than 2069 since the RTC range is 0 - 99.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.