tools/svd2regs/README.md
This Python script, svd2regs.py, converts CMSIS-SVD (System View Description) files into Rust code for memory-mapped peripheral registers. It helps automate the creation of register interface code for embedded Rust projects, using the style of the Tock OS kernel.
To install all dependencies use:
uv sync
Once the dependencies are installed, you can execute the script using uv run. The basic command structure is:
uv run python svd2regs.py [OPTIONS] <PERIPHERAL>
cmsis-svd Database uv run python svd2regs.py SIM --mcu Freescale MK64F12
uv run python svd2regs.py SIM --svd mcu.svd --fmt
uv run python svd2regs.py SIM --svd mcu.svd --fmt '--force' --save src/peripherals.rs