4 releases
Uses new Rust 2024
| 0.1.3 | Mar 8, 2026 |
|---|---|
| 0.1.2 | Mar 8, 2026 |
| 0.1.1 | Mar 8, 2026 |
| 0.1.0 | Mar 8, 2026 |
#551 in Embedded development
63KB
1.5K
SLoC
wobblechar
Parse ASCII/UTF-8 waveform diagrams into a stream of decoded samples.
wobblechar creates a bridge between the human-friendly world of text waveforms
and the structured data needed for programmatic processing. It was born out of the
need to make testing less tedious and more intuitive.
CLK: _|‾|_|‾|_
DAT: ___|‾‾‾|_
Getting started
Add to your Cargo.toml:
[dependencies]
wobblechar = "0.1"
Then parse a waveform:
use wobblechar::Builder;
for item in Builder::<2>::new_from_string("
_|‾|_
‾|_|‾
")
.with_def_bool_mapper()
.build()
{
println!("t={} values={:?} changed={}", item.index, item.values, item.changed);
}
Default character mapping
| Character | Meaning |
|---|---|
_ |
Low (false / 0) |
| |
Edge — toggles the previous value |
anything else (e.g. ‾, X) |
High (true / 1) |
Custom mappings can be provided via Builder::with_const_bool_map,
Builder::with_const_num_mapper, or (with the std feature) the
HashMap-based variants.
Multi-line labeled format
Lines can carry a label prefix (Name: content) to allow non-contiguous
continuation across blocks. This is useful when interleaving multiple signals:
CLK: _|‾|_|‾|_ # clock
DAT: ___|‾‾|__ # data
# some comment
CLK: |‾|_|‾|_ # clock continued
DAT: __|‾‾‾|_ # data continued
no_std support
wobblechar is no_std by default and works in embedded environments.
Enable the std feature for HashMap-backed mappers:
[dependencies]
wobblechar = { version = "0.1", features = ["std"] }
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Dependencies
~1MB
~18K SLoC