Skip to main content

AdvancedShiftRegister

Struct AdvancedShiftRegister 

Source
pub struct AdvancedShiftRegister<const N: usize, OP: OutputPin> {
    pub shifters: [u8; N],
    /* private fields */
}

Fields§

§shifters: [u8; N]

Shifter data (currently set bits)

Implementations§

Source§

impl<const N: usize, OP: OutputPin> AdvancedShiftRegister<N, OP>

Source

pub fn new(data_pin: OP, clk_pin: OP, latch_pin: OP, default_val: u8) -> Self

Source

pub fn get_shifter_mut(&mut self, i: usize) -> ShifterValue

Get wrapper for value of one shifter register (for easy modyfing)

Source

pub fn get_pin_mut(&mut self, i: usize, bit: u8, auto_shift: bool) -> ShifterPin

Get wrapper for one bit of specifed shifter register (with embedded_hal digitalpin trait)

Source

pub fn get_shifter_range_mut( &mut self, range: Range<usize>, ) -> ShifterValueRange

Get wrapper for range of shifter registers (for easy modyfing of multiple registers at the same time)

Source

pub fn update_shifters(&mut self)

Push stored shifters data onto shifter registers

Auto Trait Implementations§

§

impl<const N: usize, OP> Freeze for AdvancedShiftRegister<N, OP>
where [u8; N]: Freeze, OP: Freeze,

§

impl<const N: usize, OP> RefUnwindSafe for AdvancedShiftRegister<N, OP>

§

impl<const N: usize, OP> Send for AdvancedShiftRegister<N, OP>
where [u8; N]: Send, OP: Send,

§

impl<const N: usize, OP> Sync for AdvancedShiftRegister<N, OP>
where [u8; N]: Sync, OP: Sync,

§

impl<const N: usize, OP> Unpin for AdvancedShiftRegister<N, OP>
where [u8; N]: Unpin, OP: Unpin,

§

impl<const N: usize, OP> UnsafeUnpin for AdvancedShiftRegister<N, OP>
where [u8; N]: UnsafeUnpin, OP: UnsafeUnpin,

§

impl<const N: usize, OP> UnwindSafe for AdvancedShiftRegister<N, OP>
where [u8; N]: UnwindSafe, OP: 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 = !

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.