pub struct Rtc { /* private fields */ }
Expand description

Entry point to the RTC API.

Implementations

Initializes the RTC API.

The init argument will only be used, if the real-time clock is not already configured. If the clock is not yet configured, and init is set to None, then the datetime corresponding to 2000-01-01 00:00:00 will be used for initialization.

Errors

Returns Error::InvalidInputData if the init datetime is outside of the valid range (years 2000-2099).

Panics

Panics, if the ABP1 clock frequency is lower than the RTC clock frequency. The RTC is currently hardcoded to use the LSE as clock source which runs at 32768 Hz.

Sets the date/time.

Note: Only dates in the range 2001-01-01 00:00:00 to 2099-12-31 23:59:59 are supported. If a date outside this range is passed in, Error::InvalidInputData will be returned.

Read and return the current date/time from the RTC.

Enable interrupts

The interrupts set to true in interrupts will be enabled. Those set to false will not be modified.

Disable interrupts

The interrupts set to true in interrupts will be disabled. Those set to false will not be modified.

Access the wakeup timer

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.

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.