Skip to main content

Hc164Cols

Struct Hc164Cols 

Source
pub struct Hc164Cols<'peripherals> {
    cp: Output<'peripherals>,
    ds: Output<'peripherals>,
    mr: Output<'peripherals>,
    shifter_delay_cycles: u32,
}
Expand description

Column selector driven by an HC164 shift register.

Fields§

§cp: Output<'peripherals>

Clock input (CP) for shifting data into the register.

§ds: Output<'peripherals>

Serial data input (DS) for the shift register.

§mr: Output<'peripherals>

Master reset (MR) input for clearing the register.

§shifter_delay_cycles: u32

CPU cycles between pin transitions.

Implementations§

Source§

impl<'peripherals> Hc164Cols<'peripherals>

Source

pub const fn new( ds: Output<'peripherals>, cp: Output<'peripherals>, mr: Output<'peripherals>, shifter_delay_cycles: u32, ) -> Self

Create a new column selector for the HC164.

Source

fn pulse_cp(&mut self)

Pulse the clock pin for one shift step.

Source

pub fn select(&mut self, col: usize)

Select the given column.

For column 0: clears the register via MR then clocks in a high bit, placing the walking-one at position 0.

For all other columns: clocks in a low bit, advancing the walking-one to the next position. Must be called in strictly ascending order starting from 0 each scan.

Auto Trait Implementations§

§

impl<'peripherals> Freeze for Hc164Cols<'peripherals>

§

impl<'peripherals> RefUnwindSafe for Hc164Cols<'peripherals>

§

impl<'peripherals> Send for Hc164Cols<'peripherals>

§

impl<'peripherals> Sync for Hc164Cols<'peripherals>

§

impl<'peripherals> Unpin for Hc164Cols<'peripherals>

§

impl<'peripherals> UnsafeUnpin for Hc164Cols<'peripherals>

§

impl<'peripherals> !UnwindSafe for Hc164Cols<'peripherals>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.