racklet / electronics-prototyping

Design files for electronic components for use in Racklet
Apache License 2.0
3 stars 0 forks source link

Create a function library for the evaluator, bring back the ICCC voltage divider #16

Closed twelho closed 3 years ago

twelho commented 3 years ago

This moves kicad_rs and the new function library kicad_functions into a common Cargo workspace to facilitate dependency version sharing as well as make running stuff like cargo fmt for the project easier.

The new voltage divider function is based on https://github.com/trebinor/resistor-calc, which I had to fork and modify a bit to get to compile without its own expression evaluator. PR tracking upstreaming here: https://github.com/trebinor/resistor-calc/pull/4.

Support list for voltage_divider:

Continuation of #14, ticking one more box in the support list there. The last commit https://github.com/racklet/electronics-prototyping/commit/9a9a43f03eb13ee4db4a37f15c36dfd0038fd917 is just test data for evaluating the voltage divider and may be removed before merging. That test data configuration is identical to what was passed to ICCC for the BD9E DC-DC converter, and this Rust code does output the same optimal resistance values, so it should be working correctly.

cc @luxas @chiplet

twelho commented 3 years ago

After a bit of investigation it doesn't seem like there's built-in support for indexing tuples. I'll create an indexing function, hold on...