Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikskuh/waveform
Generates nice Unicode rendered waveforms.
https://github.com/ikskuh/waveform
Last synced: about 1 month ago
JSON representation
Generates nice Unicode rendered waveforms.
- Host: GitHub
- URL: https://github.com/ikskuh/waveform
- Owner: ikskuh
- License: zlib
- Created: 2022-12-30T13:53:59.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-09T14:54:34.000Z (9 months ago)
- Last Synced: 2024-05-17T11:43:10.683Z (6 months ago)
- Language: Zig
- Size: 11.7 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# waveform
Generates unicode waveforms that can be embedded into code comments
```
1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆
┆ ┆ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┏━━┓ ┆ ┆ ┆
CLK ┆ ┆ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┆ ┆ ┆
╍╍━━━━━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━┛ ┗━━━━━━━━━╍╍
┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆
╍╍━━━┓ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┏━━━━━━━━━━━━╍╍
/CE ┆ ┃ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┃ ┆ ┆ ┆ ┆
┆ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┆ ┆ ┆ ┆
┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆
┆ ┆ ┏━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┓ ┆ ┆ ┆ ┆
MOSI ╍╍━━━━━━┫ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━━━━━━━━╍╍
┆ ┆ ┗━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┛ ┆ ┆ ┆ ┆
┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆
┆ ┆ ┆ ┏━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━┓ ┆ ┆ ┆
MISO ╍╍━━━━━━━━━┫ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━━━━━╍╍
┆ ┆ ┆ ┗━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━┛ ┆ ┆ ┆
┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆
```The input for this diagram is a text file:
```
CLK | LLHLHLHLHLHLHLHLHLHLLLL
/CE | HLLLLLLLLLLLLLLLLLHHHHH
MOSI | ZZB-B-B-B-B-B-B-B-ZZZZZ
MISO | ZZZB-B-B-B-B-B-B-B-ZZZZ
```Each part after the `|` describes the state on a clock edge.
The allowed states are:
- `L`: edge to low
- `H`: edge to high
- `Z`: edge to high impedance
- `B`: edge to low or high (can be both)
- `-`: no change in the signal