CrossByteBitStructI16

Struct CrossByteBitStructI16 

Source
pub struct CrossByteBitStructI16<Interface: ?Sized> { /* private fields */ }
Expand description

A register for interacting with 0-16bits over two consecutive bytes/registers

This reads/writes two bytes but provides a api presenting a u16 to the lib using it.

Implementations§

Source§

impl<I> CrossByteBitStructI16<I>
where I: Interface + ?Sized,

Source

pub fn new( register_address: u8, bits: u8, big_endian: bool, ) -> Result<CrossByteBitStructI16<I>, BitByteStructError<I::Error>>

Source

pub fn read( &self, bus: &mut dyn Interface<Error = I::Error>, ) -> Result<u16, BitByteStructError<I::Error>>

Read the new value to the relevant sub set of the registers

Source

pub fn write( &self, bus: &mut dyn Interface<Error = I::Error>, new_value: u16, ) -> Result<(), BitByteStructError<I::Error>>

Write the new value to the relevant sub set of the registers

Auto Trait Implementations§

§

impl<Interface> Freeze for CrossByteBitStructI16<Interface>
where Interface: ?Sized,

§

impl<Interface> RefUnwindSafe for CrossByteBitStructI16<Interface>
where Interface: RefUnwindSafe + ?Sized,

§

impl<Interface> Send for CrossByteBitStructI16<Interface>
where Interface: Send + ?Sized,

§

impl<Interface> Sync for CrossByteBitStructI16<Interface>
where Interface: Sync + ?Sized,

§

impl<Interface> Unpin for CrossByteBitStructI16<Interface>
where Interface: Unpin + ?Sized,

§

impl<Interface> UnwindSafe for CrossByteBitStructI16<Interface>
where Interface: UnwindSafe + ?Sized,

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.