Connector pairs for sub-boards#488
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds sub-board connector-pair support so parent-board connectors and sub-board connectors can be modeled together while netlisting into separate board scopes.
Changes:
- Introduces
SubboardConnectorPairand updates board-scoped netlisting to support external/internal connector-pair scopes. - Adds reusable 2.54mm pin socket/header and 0.50mm FPC connector-pair blocks.
- Refactors the BLE joystick example and test utility to handle multiple generated netlists.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
edg/electronics_model/SubboardBlock.py |
Adds common subboard API base and connector-pair block type. |
edg/electronics_model/BoardScopedTransform.py |
Extends board scoping for connector-pair internals. |
edg/electronics_model/NetlistGenerator.py |
Applies parent-scope connection processing to mixed-scope hierarchy blocks. |
edg/electronics_model/__init__.py |
Exports SubboardConnectorPair. |
edg/electronics_model/test_netlist_connector_pair.py |
Adds tests for connector-pair netlist splitting. |
edg/parts/PassiveConnector_Header.py |
Adds 2.54mm socket/header connector pair. |
edg/parts/PassiveConnector_Fpc.py |
Adds configurable FPC connector pair and length assertion for flipped FPC. |
edg/parts/__init__.py |
Exports new connector-pair parts. |
examples/test_ble_joystick.py |
Moves joystick onto a sub-board using an FPC connector pair. |
examples/util.py |
Updates example netlist comparison to support multiple netlists. |
examples/BleJoystick/BleJoystick.net.ref |
Updates parent-board reference netlist for FPC connector. |
examples/BleJoystick/BleJoystick_stick.net.ref |
Adds joystick sub-board reference netlist. |
examples/BleJoystick/BleJoystick.svgpcb.js |
Updates generated SVG PCB placement/netlist for joystick connector. |
examples/Multimeter/Multimeter.ref.net |
Removes obsolete reference netlist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Parameters: | ||
| cable = "same" | "opposite": whether the FPC cable has contacts on the same side (Type A, mirror pin numbering) | ||
| or opposite sides (Type B, same pin numbering both sides) | ||
| ext_contact, int_contact = "top" | "bottom": the contact side for the external and internal connectors, respectively. |
Comment on lines
+74
to
+77
| if self.get(self.cable) == "same": # assuming same side contact side connectors | ||
| mirror = True | ||
| else: | ||
| mirror = False |
| while export-tapping ports from the external Block. The external Block should be generated first | ||
| for refdes ordering. This block's pin numbering should correspond to the external Block. | ||
|
|
||
| These should not be instantiated outside a SubboardBlock or SubblockConnectorPair. Bad things can happen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the SubboardConnectorPair class, which is meant to support re-usable connector-pair (one external connector in the parent board, one internal connector in the sub-board) libraries. Implements connector pairs for 2.54mm pin socket/headers and 0.50mm FPCs with all combinations of cables and contact sides.
Implementation-wise, this is handled by the netlister as taking on the parent and self-scopes of its container, recursively (SubboardConnectorPairs should be arbitrarily directly-nestable).
Since it shares an API with SubboardBlock (in terms of external / internal boards and export-tap), refactors that into a common HasSubooardBlockApi internal class.
Refactors the BLE joystick demo board to use this to move the joystick off the main board using a 0.50mm FPC. The example will be more thoroughly redone later.
Refactors the test infrastructure to support checking multiple generated netlists.
Opportunistic cleanup: deletes an extraneous reference netlist.
Resolves #367