embassy-stm32

Crates

git

Versions

stm32f103rg

Flavors

Skip to main content

Rtc

Struct Rtc 

Source
pub struct Rtc<'d> { /* private fields */ }
Expand description

RTC driver.

Implementations§

Source§

impl<'d> Rtc<'d>

Source

pub fn new(peri: Peri<'d, RTC>) -> Self

Create a new RTC driver.

The counter keeps running and keeps its value.

§Panics

Panics if the RTC clock is disabled in config.rcc.ls.

Source

pub fn counter(&self) -> u32

Read the counter.

Source

pub fn set_counter(&mut self, value: u32)

Set the counter.

This restarts the current second: the counter next increments one second after this call.

Auto Trait Implementations§

§

impl<'d> !UnwindSafe for Rtc<'d>

§

impl<'d> Forget for Rtc<'d>

§

impl<'d> Freeze for Rtc<'d>

§

impl<'d> Move for Rtc<'d>

§

impl<'d> RefUnwindSafe for Rtc<'d>

§

impl<'d> Send for Rtc<'d>

§

impl<'d> Sync for Rtc<'d>

§

impl<'d> Unpin for Rtc<'d>

§

impl<'d> UnsafeUnpin for Rtc<'d>

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.