Skip to content

Commit be37f18

Browse files
committed
cleaning an rebaseline
1 parent b4e9b44 commit be37f18

File tree

9 files changed

+5775
-30252
lines changed

9 files changed

+5775
-30252
lines changed

edg/abstract_parts/PassiveFilters.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def __init__(self, impedance: RangeLike, cutoff_freq: RangeLike):
159159
self.gnd = self.Export(self.rc.gnd.adapt_to(Ground()), [Common])
160160

161161

162-
class LowPassAnalogDifferentialRc(AnalogFilter, KiCadImportableBlock, GeneratorBlock):
162+
class LowPassAnalogDifferentialRc(AnalogFilter, KiCadImportableBlock):
163163
"""Analog-typed low-pass differential RC filter, with cutoff frequency specified at the -3dB (~70%) point.
164164
Impedance is the single-ended resistor value."""
165165
def symbol_pinning(self, symbol_name: str) -> Mapping[str, BasePort]:
@@ -179,16 +179,14 @@ def __init__(self, impedance: RangeLike, cutoff_freq: RangeLike):
179179
self.impedance = self.ArgParameter(impedance)
180180
self.cutoff_freq = self.ArgParameter(cutoff_freq)
181181

182-
self.generator_param(self.impedance, self.cutoff_freq)
183-
184-
def generate(self) -> None:
185-
super().generate()
182+
def contents(self) -> None:
183+
super().contents()
186184

187185
self.rp = self.Block(Resistor(resistance=self.impedance))
188186
self.rn = self.Block(Resistor(resistance=self.impedance))
189-
capacitance = Range.cancel_multiply(1 / (2 * pi * self.get(self.impedance)), 1 / self.get(self.cutoff_freq))
187+
capacitance = (1 / self.cutoff_freq).shrink_multiply(1 / (2 * pi * self.impedance))
190188
# capacitance is single-ended, halve it for differential
191-
self.c = self.Block(Capacitor(capacitance=0.5*capacitance*Farad,
189+
self.c = self.Block(Capacitor(capacitance=0.5*capacitance,
192190
voltage=self.inp.link().voltage-self.inn.link().voltage))
193191
self.connect(self.inp, self.rp.a.adapt_to(AnalogSink(
194192
impedance=self.rp.actual_resistance + self.outp.link().sink_impedance,

edg/parts/Inamp_Ina826.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ def generate(self):
101101
# gain error, lumped into the resistor gain
102102
self.require(self.ratio.within(Range(1, 1000)))
103103
# note, worst case gain at +/- 0.04%
104-
# TODO use 49...*kOhm(tol=...), once cancel_multiply can support RangeExpr types
105-
self.rg = self.Block(Resistor(Range.cancel_multiply(Range.from_tolerance(49.4e3, 0.0004),
106-
1/(self.get(self.ratio) - 1))))
104+
self.rg = self.Block(Resistor((1/(self.ratio - 1)).shrink_multiply(49.4*kOhm(tol=0.0004))))
107105
self.connect(self.rg.a, self.ic.rg2)
108106
self.connect(self.rg.b, self.ic.rg3)
109107

examples/Multimeter/Multimeter.net

Lines changed: 662 additions & 555 deletions
Large diffs are not rendered by default.

examples/Multimeter/Multimeter.svgpcb.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ board.setNetlist([
608608
{name: "measure.range.dummy.io", pads: [["U11", "1"]]},
609609
{name: "measure.range.switch.sw[0_0].com", pads: [["U12", "3"], ["U10", "4"]]},
610610
{name: "measure.range.switch.sw[0_1].com", pads: [["U12", "1"], ["U11", "4"]]},
611+
{name: "adc.mclkin", pads: [["U14", "18"]]},
611612
{name: "adc.vins.2", pads: [["U14", "7"]]},
612613
{name: "adc.vins.3", pads: [["U14", "8"]]},
613614
{name: "adc.vins.4", pads: [["U14", "9"]]},

0 commit comments

Comments
 (0)