Skip to main content

Pcf8563LowLevel

Struct Pcf8563LowLevel 

Source
pub struct Pcf8563LowLevel<I> { /* private fields */ }
Expand description

Root block of the Pcf8563LowLevel driver

Implementations§

Source§

impl<I> Pcf8563LowLevel<I>

Source

pub const fn new(interface: I) -> Self

Create a new instance of the block based on device interface

Source

pub fn read_all_registers( &mut self, callback: impl FnMut(u8, &'static str, FieldSetValue), ) -> Result<(), I::Error>
where I: RegisterInterface<AddressType = u8>,

Read all readable register values in this block from the device. The callback is called for each of them. Any registers in child blocks are not included.

The callback has three arguments:

  • The address of the register
  • The name of the register (with index for repeated registers)
  • The read value from the register

This is useful for e.g. debug printing all values. The given field_sets::FieldSetValue has a Debug and Format implementation that forwards to the concrete type the lies within so it can be printed without matching on it.

Source

pub async fn read_all_registers_async( &mut self, callback: impl FnMut(u8, &'static str, FieldSetValue), ) -> Result<(), I::Error>
where I: AsyncRegisterInterface<AddressType = u8>,

Read all readable register values in this block from the device. The callback is called for each of them. Any registers in child blocks are not included.

The callback has three arguments:

  • The address of the register
  • The name of the register (with index for repeated registers)
  • The read value from the register

This is useful for e.g. debug printing all values. The given field_sets::FieldSetValue has a Debug and Format implementation that forwards to the concrete type the lies within so it can be printed without matching on it.

Source

pub fn control_status_1( &mut self, ) -> RegisterOperation<'_, I, u8, ControlStatus1, RW>

Control and status register 1. Controls clock operation, test modes, and power-on reset override.

Source

pub fn control_status_2( &mut self, ) -> RegisterOperation<'_, I, u8, ControlStatus2, RW>

Control and status register 2. Controls timer/alarm interrupts and flags.

Source

pub fn seconds(&mut self) -> RegisterOperation<'_, I, u8, Seconds, RW>

Seconds register with voltage-low flag. Seconds are BCD encoded (0-59).

Source

pub fn minutes(&mut self) -> RegisterOperation<'_, I, u8, Minutes, RW>

Minutes register. Minutes are BCD encoded (0-59).

Source

pub fn hours(&mut self) -> RegisterOperation<'_, I, u8, Hours, RW>

Hours register. Hours are BCD encoded (0-23, 24-hour format).

Source

pub fn days(&mut self) -> RegisterOperation<'_, I, u8, Days, RW>

Days register. Days are BCD encoded (1-31).

Source

pub fn weekdays(&mut self) -> RegisterOperation<'_, I, u8, Weekdays, RW>

Weekdays register. Weekday value (0-6, user-definable assignment).

Source

pub fn century_months( &mut self, ) -> RegisterOperation<'_, I, u8, CenturyMonths, RW>

Century flag and months register. Months are BCD encoded (1-12).

Source

pub fn years(&mut self) -> RegisterOperation<'_, I, u8, Years, RW>

Years register. Years are BCD encoded (0-99).

Source

pub fn minute_alarm(&mut self) -> RegisterOperation<'_, I, u8, MinuteAlarm, RW>

Minute alarm register. Minutes are BCD encoded (0-59).

Source

pub fn hour_alarm(&mut self) -> RegisterOperation<'_, I, u8, HourAlarm, RW>

Hour alarm register. Hours are BCD encoded (0-23).

Source

pub fn day_alarm(&mut self) -> RegisterOperation<'_, I, u8, DayAlarm, RW>

Day alarm register. Days are BCD encoded (1-31).

Source

pub fn weekday_alarm( &mut self, ) -> RegisterOperation<'_, I, u8, WeekdayAlarm, RW>

Weekday alarm register.

Source

pub fn clkout_control( &mut self, ) -> RegisterOperation<'_, I, u8, ClkoutControl, RW>

CLKOUT frequency control register.

Source

pub fn timer_control( &mut self, ) -> RegisterOperation<'_, I, u8, TimerControl, RW>

Timer control register.

Source

pub fn timer(&mut self) -> RegisterOperation<'_, I, u8, Timer, RW>

Timer countdown value register. 8-bit binary countdown timer (0-255). Countdown period = n / source_clock_frequency When read, returns current countdown value.

Trait Implementations§

Source§

impl<I: Debug> Debug for Pcf8563LowLevel<I>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I> Freeze for Pcf8563LowLevel<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Pcf8563LowLevel<I>
where I: RefUnwindSafe,

§

impl<I> Send for Pcf8563LowLevel<I>
where I: Send,

§

impl<I> Sync for Pcf8563LowLevel<I>
where I: Sync,

§

impl<I> Unpin for Pcf8563LowLevel<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for Pcf8563LowLevel<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for Pcf8563LowLevel<I>
where I: UnwindSafe,

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 = 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.