quadrature-decoder
Pure logic-level implementations of quadrature decoders with support for full-, half- an quad-stepping.
Incremental Decoder
use ;
let mut decoder: ..> = Defaultdefault;
// Update the decoder with pulse trains `a` and `b` and handle the result:
match decoder.update
// Or, if you only care about correctly detected changes:
if let Some = decoder.update.unwrap_or_default
println!;
See the examples directory for a more comprehensive example.
Indexed Incremental Decoder
An indexed decoder resets its counter whenever a raising edge is detected on the z pulse train.
use ;
let mut decoder: ..> = Defaultdefault;
// Update the decoder with pulse trains `a`, `b` and `z` and handle the result:
match decoder.update
// Or, if you only care about correctly detected changes:
if let Some = decoder.update.unwrap_or_default
println!;
See the examples directory for a more comprehensive example.
Decoding Strategies
Full-step Decoding
A full-step decoder is able to detect up to 1 change(s) per quadrature cycle.
use ;
let mut decoder: = Defaultdefault;
Half-step Decoding
A full-step decoder is able to detect up to 2 change(s) per quadrature cycle.
use ;
let mut decoder: = Defaultdefault;
Quad-step Decoding
A full-step decoder is able to detect up to 4 change(s) per quadrature cycle.
use ;
let mut decoder: = Defaultdefault;
Documentation
Please refer to the documentation on docs.rs.
Contributing
Please read CONTRIBUTING.md for details on our code of conduct,
and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the MPL-2.0 – see the LICENSE.md file for details.