pub struct Pcf8563LowLevel<I> { /* private fields */ }Expand description
Root block of the Pcf8563LowLevel driver
Implementations§
Source§impl<I> Pcf8563LowLevel<I>
impl<I> Pcf8563LowLevel<I>
Sourcepub const fn new(interface: I) -> Self
pub const fn new(interface: I) -> Self
Create a new instance of the block based on device interface
Sourcepub fn read_all_registers(
&mut self,
callback: impl FnMut(u8, &'static str, FieldSetValue),
) -> Result<(), I::Error>where
I: RegisterInterface<AddressType = u8>,
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.
Sourcepub async fn read_all_registers_async(
&mut self,
callback: impl FnMut(u8, &'static str, FieldSetValue),
) -> Result<(), I::Error>where
I: AsyncRegisterInterface<AddressType = u8>,
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.
Sourcepub fn control_status_1(
&mut self,
) -> RegisterOperation<'_, I, u8, ControlStatus1, RW>
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.
Sourcepub fn control_status_2(
&mut self,
) -> RegisterOperation<'_, I, u8, ControlStatus2, RW>
pub fn control_status_2( &mut self, ) -> RegisterOperation<'_, I, u8, ControlStatus2, RW>
Control and status register 2. Controls timer/alarm interrupts and flags.
Sourcepub fn seconds(&mut self) -> RegisterOperation<'_, I, u8, Seconds, RW>
pub fn seconds(&mut self) -> RegisterOperation<'_, I, u8, Seconds, RW>
Seconds register with voltage-low flag. Seconds are BCD encoded (0-59).
Sourcepub fn minutes(&mut self) -> RegisterOperation<'_, I, u8, Minutes, RW>
pub fn minutes(&mut self) -> RegisterOperation<'_, I, u8, Minutes, RW>
Minutes register. Minutes are BCD encoded (0-59).
Sourcepub fn hours(&mut self) -> RegisterOperation<'_, I, u8, Hours, RW>
pub fn hours(&mut self) -> RegisterOperation<'_, I, u8, Hours, RW>
Hours register. Hours are BCD encoded (0-23, 24-hour format).
Sourcepub fn days(&mut self) -> RegisterOperation<'_, I, u8, Days, RW>
pub fn days(&mut self) -> RegisterOperation<'_, I, u8, Days, RW>
Days register. Days are BCD encoded (1-31).
Sourcepub fn weekdays(&mut self) -> RegisterOperation<'_, I, u8, Weekdays, RW>
pub fn weekdays(&mut self) -> RegisterOperation<'_, I, u8, Weekdays, RW>
Weekdays register. Weekday value (0-6, user-definable assignment).
Sourcepub fn century_months(
&mut self,
) -> RegisterOperation<'_, I, u8, CenturyMonths, RW>
pub fn century_months( &mut self, ) -> RegisterOperation<'_, I, u8, CenturyMonths, RW>
Century flag and months register. Months are BCD encoded (1-12).
Sourcepub fn years(&mut self) -> RegisterOperation<'_, I, u8, Years, RW>
pub fn years(&mut self) -> RegisterOperation<'_, I, u8, Years, RW>
Years register. Years are BCD encoded (0-99).
Sourcepub fn minute_alarm(&mut self) -> RegisterOperation<'_, I, u8, MinuteAlarm, RW>
pub fn minute_alarm(&mut self) -> RegisterOperation<'_, I, u8, MinuteAlarm, RW>
Minute alarm register. Minutes are BCD encoded (0-59).
Sourcepub fn hour_alarm(&mut self) -> RegisterOperation<'_, I, u8, HourAlarm, RW>
pub fn hour_alarm(&mut self) -> RegisterOperation<'_, I, u8, HourAlarm, RW>
Hour alarm register. Hours are BCD encoded (0-23).
Sourcepub fn day_alarm(&mut self) -> RegisterOperation<'_, I, u8, DayAlarm, RW>
pub fn day_alarm(&mut self) -> RegisterOperation<'_, I, u8, DayAlarm, RW>
Day alarm register. Days are BCD encoded (1-31).
Sourcepub fn weekday_alarm(
&mut self,
) -> RegisterOperation<'_, I, u8, WeekdayAlarm, RW>
pub fn weekday_alarm( &mut self, ) -> RegisterOperation<'_, I, u8, WeekdayAlarm, RW>
Weekday alarm register.
Sourcepub fn clkout_control(
&mut self,
) -> RegisterOperation<'_, I, u8, ClkoutControl, RW>
pub fn clkout_control( &mut self, ) -> RegisterOperation<'_, I, u8, ClkoutControl, RW>
CLKOUT frequency control register.
Sourcepub fn timer_control(
&mut self,
) -> RegisterOperation<'_, I, u8, TimerControl, RW>
pub fn timer_control( &mut self, ) -> RegisterOperation<'_, I, u8, TimerControl, RW>
Timer control register.
Sourcepub fn timer(&mut self) -> RegisterOperation<'_, I, u8, Timer, RW>
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.