Crates.io | spwm_generator |
lib.rs | spwm_generator |
version | 0.3.0 |
source | src |
created_at | 2022-11-29 21:51:05.775425 |
updated_at | 2022-12-19 16:41:53.561732 |
description | A simple cli tool for genrate SPWM lookup tables |
homepage | |
repository | https://github.com/Ali-Mirghasemi/spwm_generator |
max_upload_size | |
id | 725741 |
size | 68,386 |
This is a simple cli app to help you generate SPWM
lookup table for your projects
You can use prebuilt binaries or build the project with rust compiler
You can install this tool with cargo
cargo install spwm_generator
Usage: spwm_generator [OPTIONS] --sin_freq <SIN_FREQ> --num_of_samples <NUM_OF_SAMPLES> --out <OUTPUT>
Options:
-f, --sin_freq <SIN_FREQ>
sin wave frequency
-n, --num_of_samples <NUM_OF_SAMPLES>
number of samples
-t, --pwm_top <PWM_TOP>
pwm top value [default: 255]
-p, --padding <PADDING>
padding for pwm min and max value [default: 0]
-o, --out <OUTPUT>
output file path
-m, --format <FORMAT>
format [default: raw] [possible values: raw, raw-hex, c, c-hex, rust, rust-hex]
-w, --row_width <ROW_WIDTH>
number of samples in row [default: 16]
-s, --separator <SEPARATOR>
separator character [default: ", "]
-a, --name <NAME>
name of variable [default: WAVE]
-h, --help
Print help information
-V, --version
Print version information
Generate SPWM
table for C
project
spwm_generator -m c -f 50 -c 10000 -o Table_50Hz.c
or
spwm_generator -m c-hex -f 50 -c 10000 -o Table_50Hz.c
Generate SPWM
table for Rust
project
spwm_generator -m rust -f 50 -c 10000 -o Table_50Hz.c
or
spwm_generator -m rust-hex -f 50 -c 10000 -o Table_50Hz.c