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: u32CPU cycles between pin transitions.
Implementations§
Source§impl<'peripherals> Hc164Cols<'peripherals>
impl<'peripherals> Hc164Cols<'peripherals>
Sourcepub const fn new(
ds: Output<'peripherals>,
cp: Output<'peripherals>,
mr: Output<'peripherals>,
shifter_delay_cycles: u32,
) -> Self
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.
Sourcepub fn select(&mut self, col: usize)
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.