pcb-toolkit
Rust library for PCB design calculations — impedance, current capacity, via properties, and more.
Part of the pcb-toolkit workspace.
Usage
[]
= "0.1"
use ;
let result = calculate.unwrap;
println!;
println!;
println!;
All public functions return Result<T, CalcError>. Negative dimensions,
out-of-range dielectric constants, and unknown materials are rejected with
descriptive errors.
Modules
| Module | Description | Status |
|---|---|---|
impedance::microstrip |
Microstrip impedance (Hammerstad-Jensen 1980) | Implemented |
impedance::stripline |
Stripline impedance (Cohn / Wadell) | Planned |
impedance::embedded |
Embedded microstrip (Brooks) | Planned |
impedance::coplanar |
Coplanar waveguide (Wadell) | Planned |
differential |
Differential pair impedance (6 topologies) | Types defined |
via |
Via parasitics: L, C, Z, resonance, DC R, thermal R | Planned |
current |
Conductor current capacity (IPC-2221A / IPC-2152) | Planned |
fusing |
Fusing current (Onderdonk equation) | Planned |
inductor |
Planar spiral inductors (Mohan/Wheeler) | Planned |
padstack |
Pad sizing (TH, BGA, routing) | Planned |
crosstalk |
Standalone crosstalk estimation | Planned |
ohms_law |
V=IR, LED bias, attenuators, series/parallel | Planned |
reactance |
Xc, Xl, resonant frequency | Planned |
wavelength |
Signal wavelength in dielectric | Planned |
ppm |
PPM/Hz conversion, crystal load capacitor | Planned |
spacing |
IPC-2221C minimum conductor spacing | Planned |
Supporting Infrastructure
materials— 25 built-in substrate materials (FR-4, Rogers, Isola, Getek, Teflon) with Er, Tg, and roughness correction. Case-insensitive lookup.copper— Copper weight to thickness conversion (0.25 oz through 5 oz), plating thickness, etch factor cross-section correction.units— Conversion between user-facing units and canonical internal units (mils, Hz, Farads, Henries, Celsius).constants— Physical constants (speed of light, copper resistivity, etc.).tables— Linear interpolation for lookup tables.
Design
- f64 everywhere. No arbitrary-precision or unit-of-measure crates.
- Canonical internal units. Mils for length, Hz for frequency. Conversion at the API boundary.
- Minimal dependencies.
thiserrorfor errors,serdefor serialization.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.