embassy-stm32

Crates

git

Versions

stm32g491mc

Flavors

RtcBorrow

Struct RtcBorrow 

Source
pub struct RtcBorrow<'a> { /* private fields */ }
Expand description

Contains an RTC borrow.

Methods from Deref<Target = Rtc>§

Source

pub fn calibrate(&mut self, clock_drift: f32, period: RtcCalibrationCyclePeriod)

Calibrate the clock drift.

clock_drift can be adjusted from -487.1 ppm to 488.5 ppm and is clamped to this range.

§Note

To perform a calibration when async_prescaler is less then 3, sync_prescaler has to be reduced accordingly (see RM0351 Rev 9, sec 38.3.12).

Source

pub const BACKUP_REGISTER_COUNT: usize = 32usize

Source

pub fn set_datetime(&mut self, t: DateTime) -> Result<(), RtcError>

Set the datetime to a new value.

§Errors

Will return RtcError::InvalidDateTime if the datetime is not a valid range.

Source

pub fn get_daylight_savings(&self) -> bool

Check if daylight savings time is active.

Source

pub fn set_daylight_savings(&mut self, daylight_savings: bool)

Enable/disable daylight savings time.

Source

pub fn read_backup_register(&self, register: usize) -> Option<u32>

Read content of the backup register.

The registers retain their values during wakes from standby mode or system resets. They also retain their value when Vdd is switched off as long as V_BAT is powered.

Source

pub fn write_backup_register(&self, register: usize, value: u32)

Set content of the backup register.

The registers retain their values during wakes from standby mode or system resets. They also retain their value when Vdd is switched off as long as V_BAT is powered.

Trait Implementations§

Source§

impl<'a> Deref for RtcBorrow<'a>

Source§

type Target = Rtc

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> DerefMut for RtcBorrow<'a>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for RtcBorrow<'a>

§

impl<'a> !RefUnwindSafe for RtcBorrow<'a>

§

impl<'a> !Send for RtcBorrow<'a>

§

impl<'a> !Sync for RtcBorrow<'a>

§

impl<'a> Unpin for RtcBorrow<'a>

§

impl<'a> !UnwindSafe for RtcBorrow<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.