SysControl

Struct SysControl 

Source
pub struct SysControl<'i, I> { /* private fields */ }

Implementations§

Source§

impl<'i, I> SysControl<'i, I>

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(&mut self) -> RegisterOperation<'_, I, u8, Control, RW>

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl<'i, I: Debug> Debug for SysControl<'i, I>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'i, I> Freeze for SysControl<'i, I>

§

impl<'i, I> RefUnwindSafe for SysControl<'i, I>
where I: RefUnwindSafe,

§

impl<'i, I> Send for SysControl<'i, I>
where I: Send,

§

impl<'i, I> Sync for SysControl<'i, I>
where I: Sync,

§

impl<'i, I> Unpin for SysControl<'i, I>

§

impl<'i, I> !UnwindSafe for SysControl<'i, I>

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.