https://github.com/recursiveerror/drive_74hc595
drive for 74HC959 shift-register
https://github.com/recursiveerror/drive_74hc595
Last synced: 8 months ago
JSON representation
drive for 74HC959 shift-register
- Host: GitHub
- URL: https://github.com/recursiveerror/drive_74hc595
- Owner: RecursiveError
- License: mit
- Created: 2023-04-18T00:02:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T15:18:48.000Z (over 1 year ago)
- Last Synced: 2025-03-25T00:38:38.390Z (9 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# DRIVE 74HC595
library for using IC 74HC595 Shift Register with embedded_hal
### how to use
first pass the correct pins to struct
```rust
let mut drive = ShiftRegister::new(OE, SER, SRCLR, SRCLK, RCLK);
```
OE and SRCLR can be dummy pins (if this is the case connect the pin of IC OE and SRCLR to GND and VCC respectively)
*If you choose to disable these pins, the functions associated with them will not work.*
after that call the "begin" function
```rust
drive.begin();
```
now the IC is ready to be used. see more functions in the list below
### functions
`begin` starts the 74HC595
`load` loads an 8bit value to the 74HC595
`enable_output` enable output
`disable_output` disable the output (operations can still be performed)
`output_clear` clean the output
`shift_zero` shifts zero once
`shift_one` shift one once
`shift_zero_times` shifts zero N times
`shift_one_times` shift one N times