Commit becfb8f
authored
Nondirectioned Ground refactor (#364)
This introduces a dedicated non-directioned Ground type, with an
optional GroundReference which can specify the voltage level. Ground can
optionally specify a voltage tolerance.
Prior, Ground was actually just a VoltageSink in disguise, which had a
few problems stemming from the VoltageSink/VoltageSource directionality
that this fixes:
- Avoids needing explicit VoltageSource merges when connecting the
ground of multiple power supplies, eg USB + battery
- Avoids a confusing gnd and gnd_src for devices that can source or sink
power
- Eliminates unused current_draw parameter
This refactors a lot of internal libraries. Notable structural changes:
- BLDC driver current-sense resistors moved into the block, generating
if the sense pins are used.
- Ditto with the soldering iron connector
- Gate driver switch node is now a Ground
- Unify gnd and gnd_src for blocks that have both
- DecouplingCapacitor defined in terms of gnd/voltage instead of pos/neg
This change is breaking and requires some changes to top-level designs:
- Voltage-source merges for grounds for multiple power sources must be
removed
- GroundSource should be replaced with Ground (remapped with a
deprecation)
- VoltageTestPoint must be replaced with GroundTestPoint, now that the
types are different
- In general, ground-side current sense resistors are more difficult
now, the move so far is to move them into the associated block
Library cleanup to support offset grounds is needed in the future, to
make sure all devices use VoltageSink.from_gnd to use a ground-relative
voltage instead of assuming ground is 0v.
Also some internal cleanup.
Notes for the future:
- Some things that might need further thought
- Is there a clean unified way to get the voltage of a port accounting
for connected-ness and directionality? Currently, we have
`GroundLink._voltage_range` and `VoltageLink,_voltage_range`, though
code that doesn't need to be as robust uses port.link().voltage1 parent 8390382 commit becfb8f
File tree
96 files changed
+1113
-1012
lines changed- edg
- abstract_parts
- electronics_model
- parts
- resources
- examples
- BasicKeyboard
- BldcController
- Datalogger
- Fcml
- HighSwitch
- IotDisplay
- IotIron
- JacdacKeyswitch
- Multimeter
- PcbBot
- ProtectedCharger
- TestBlinkyBasic
- TofArray
- UsbSourceMeasure
- resources
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
96 files changed
+1113
-1012
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
333 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
340 | 341 | | |
341 | | - | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 89 | + | |
101 | 90 | | |
102 | 91 | | |
103 | 92 | | |
104 | 93 | | |
105 | 94 | | |
106 | 95 | | |
107 | 96 | | |
108 | | - | |
| 97 | + | |
109 | 98 | | |
110 | 99 | | |
111 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 93 | + | |
95 | 94 | | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
0 commit comments