Skip to content

JoshMcguigan/shift-register-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shift-register-driver Docs Docs

Platform agnostic driver for shift register's built using the embedded-hal

What works

  • Controlling outputs through serial-in parallel-out shift registers with 8 outputs
  • Chaining shift registers up to 128 outputs

TODO

  • Add parallel-out serial-in shift register support

Example

    use shift_register_driver::sipo::ShiftRegister;
    use embedded_hal::digital::v2::OutputPin;

    let shift_register = ShiftRegister::new(clock, latch, data);
    {
        let mut outputs: [_; 8] = shift_register.decompose();

        for out in outputs.iter_mut() {
            out.set_high().unwrap();
            delay.delay_ms(300u32);
        }

        for out in outputs.iter_mut().rev() {
            out.set_low().unwrap();
            delay.delay_ms(300u32);
        }

    }
    // shift_register.release() can optionally be used when the shift register is no longer needed
    //      in order to regain ownership of the original GPIO pins
    let (clock, latch, data) = shift_register.release();

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Platform agnostic driver for shift register's built using the embedded-hal

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages