2 releases
| 0.1.1 | Feb 8, 2026 |
|---|---|
| 0.1.0 | Feb 8, 2026 |
#405 in Hardware support
Used in designguard-cli
745KB
16K
SLoC
DesignGuard
KiCad schematic and PCB validation library for Rust.
Catches common design mistakes before manufacturing:
- Missing decoupling capacitors
- Incorrect pull-up/pull-down resistors
- Trace width violations (IPC-2221)
- Component datasheet compliance
- Power integrity issues
- EMI/EMC concerns
Installation
Add to your Cargo.toml:
[dependencies]
designguard = "0.1"
Quick Start
use designguard::prelude::*;
use std::path::Path;
fn main() -> Result<(), DesignGuardError> {
let options = ValidationOptions::default();
let result = DesignGuardCore::validate_schematic(
Path::new("design.kicad_sch"),
options,
)?;
for issue in &result.issues {
println!("{:?}: {}", issue.severity, issue.message);
}
if result.has_critical() {
eprintln!("Critical issues found!");
std::process::exit(1);
}
Ok(())
}
Features
Schematic validation
- Decoupling capacitors: 100nF bypass caps near IC power pins
- I2C pull-ups: 2.2k–10k on SDA/SCL nets
- Crystal load caps: 10–33pF paired capacitors
- Power integrity: GND symbols and IC power connections
- ESD protection: TVS diodes on USB/Ethernet
- Datasheet checks: Built-in component library (STM32, ESP32, RP2040, etc.)
PCB validation
- Trace width: IPC-2221 current capacity
- EMI checks: Plane gaps, via placement, crosstalk
- Custom rules: JSON rule engine
Examples
See the examples/ directory:
simple_validation.rs– basic usagecustom_rules.rs– usingRulesEnginewith default rules
CLI and GUI
- CLI:
designguard-cli(same repo, workspace member) - GUI: DesignGuard desktop app
Documentation
- API docs (when published): docs.rs/designguard. If the crate was just published, docs.rs may take a few minutes to build; you can request a rebuild if needed.
- Build docs locally: From the repo root run
cargo doc --no-deps -p designguard --opento build and open the API docs (same as docs.rs).
License
MIT – see LICENSE in the repository root.
Dependencies
~15–32MB
~351K SLoC