svd2rust is both an executable binary that can be run, and a library that can be used in Rust programs.

Installing the command-line executable

Assuming you have Rust/Cargo installed, run this command in a terminal:

cargo install svd2rust

It will make the svd2rust command available in your PATH if you've allowed the PATH to be modified when installing Rust. cargo uninstall svd2rust uninstalls.

Adding svd2rust library as a dependency

Run this command in a terminal, in your project's directory:

cargo add --build svd2rust

to add svd2rust as a build-time dependency. To add it as a run-time dependency, run:

cargo add svd2rust

To add it manually, edit your project's Cargo.toml file and add to the [build-dependencies] or [dependencies] section:

svd2rust = "0.37.1"

The svd2rust library will be automatically available globally. Read the svd2rust library documentation.

Back to the crate overview.