Crates.io | shiftreg-spi |
lib.rs | shiftreg-spi |
version | 0.1.0 |
source | src |
created_at | 2023-12-29 13:14:11.765069 |
updated_at | 2023-12-29 13:14:11.765069 |
description | SPI-based driver for shift registers such as 74HC595 with embedded-hal API |
homepage | https://crates.io/crates/shiftreg-spi |
repository | https://github.com/tana/shiftreg-spi |
max_upload_size | |
id | 1083343 |
size | 20,064 |
This is an embedded Rust driver for shift registers (such as 74HC595).
OutputPin
trait.
// Initialize a 8-bit shift register
let shift_reg: SipoShiftReg<_, 8, 1> = SipoShiftReg::new(spi);
// Get an array of individual pins
let mut pins = shift_reg.split();
// Set state of a pin
pins[0].set_high().unwrap();
pins[1].set_low().unwrap();
spi
is an SPI driver object which implements SpiDevice
.