pub struct ShiftRegister<SPI, OE, CLR, LATCH, D> { /* private fields */ }Expand description
A 74hc595 (compatible) shift register.
Implementations§
Source§impl<SPI, OE, CLR, LATCH, D> ShiftRegister<SPI, OE, CLR, LATCH, D>
impl<SPI, OE, CLR, LATCH, D> ShiftRegister<SPI, OE, CLR, LATCH, D>
Sourcepub fn new(spi: SPI, not_oe: OE, not_clr: CLR, latch: LATCH, delay: D) -> Self
pub fn new(spi: SPI, not_oe: OE, not_clr: CLR, latch: LATCH, delay: D) -> Self
Creates a new ShiftRegister.
Sourcepub fn output_enable(&mut self, enable: bool) -> Result<(), OE::Error>
pub fn output_enable(&mut self, enable: bool) -> Result<(), OE::Error>
Enables or disables the shift register output drivers.
Sourcepub async fn clear(&mut self) -> Result<(), CLR::Error>
pub async fn clear(&mut self) -> Result<(), CLR::Error>
Clears the shift register.
This does not change the value of the output latches. Use Self::latch()
after clearing if you want the outputs to be reset.
Sourcepub async fn latch(&mut self) -> Result<(), LATCH::Error>
pub async fn latch(&mut self) -> Result<(), LATCH::Error>
Latches the current values in the shift register into the output latches.
Auto Trait Implementations§
impl<SPI, OE, CLR, LATCH, D> Freeze for ShiftRegister<SPI, OE, CLR, LATCH, D>
impl<SPI, OE, CLR, LATCH, D> RefUnwindSafe for ShiftRegister<SPI, OE, CLR, LATCH, D>where
SPI: RefUnwindSafe,
OE: RefUnwindSafe,
CLR: RefUnwindSafe,
LATCH: RefUnwindSafe,
D: RefUnwindSafe,
impl<SPI, OE, CLR, LATCH, D> Send for ShiftRegister<SPI, OE, CLR, LATCH, D>
impl<SPI, OE, CLR, LATCH, D> Sync for ShiftRegister<SPI, OE, CLR, LATCH, D>
impl<SPI, OE, CLR, LATCH, D> Unpin for ShiftRegister<SPI, OE, CLR, LATCH, D>
impl<SPI, OE, CLR, LATCH, D> UnwindSafe for ShiftRegister<SPI, OE, CLR, LATCH, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more