SPWM Generator

This is a simple cli app to help you generate SPWM lookup table for your projects

Usage

You can use prebuilt binaries or build the project with rust compiler

Install with Rust

You can install this tool with cargo cargo install spwm_generator

Parameters

``` Usage: spwmgenerator [OPTIONS] --sinfreq --numofsamples --out

Options: -f, --sinfreq sin wave frequency -n, --numofsamples number of samples -t, --pwmtop pwm top value [default: 255] -p, --padding padding for pwm min and max value [default: 0] -o, --out output file path -m, --format format [default: raw] [possible values: raw, raw-hex, c, c-hex, rust, rust-hex] -w, --row_width number of samples in row [default: 16] -s, --separator separator character [default: ", "] -a, --name name of variable [default: WAVE] -h, --help Print help information -V, --version Print version information ```

Example C

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

Example Rust

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