Skip to content

Conversation

@Lulzx
Copy link

@Lulzx Lulzx commented Dec 4, 2025

Summary

Implements the <connector standard="usb_c" /> flow as described in issue tscircuit/tscircuit#748.

  • Add Connector class extending NormalComponent
  • Define USB-C standard pin mapping following USB Type-C specification:
    • USB 2.0 Data: DP, DM (with aliases D+, D-)
    • Configuration Channel: CC1, CC2
    • Power: VBUS1-4, GND1-4
    • Sideband Use: SBU1, SBU2
    • SuperSpeed TX/RX pairs for USB 3.x
    • VCONN, SHIELD
  • Auto-create ports with standard names when standard prop is set
  • Support internallyConnectedPins for connectors
  • Export getStandardPins() helper and USB_C_STANDARD_PINS constant

Usage

<board width="20mm" height="20mm">
  <Connector standard="usb_c" name="USB1" />
  <chip name="MCU" pinLabels={{ pin1: "USB_DP", pin2: "USB_DM" }} />
  <trace from=".USB1 > .DP" to=".MCU > .USB_DP" />
  <trace from=".USB1 > .DM" to=".MCU > .USB_DM" />
</board>

Related PRs

This is part of a multi-repo implementation:

  • tscircuit/props: Add StandardPartResult type and findStandardPart to PartsEngine
  • tscircuit/parts-engine: Add USB-C connector support
  • tscircuit/circuit-json: Add source_simple_connector type

Test plan

  • Unit tests for USB-C standard pin definitions
  • Test component renders with USB-C standard
  • Test ports are created with standard names
  • Test traces can connect to standard pins

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview Comment Dec 5, 2025 9:18pm

Implements the `<connector standard="usb_c" />` flow as described in issue tscircuit#748.

- Add Connector class extending NormalComponent
- Define USB-C standard pin mapping (DP, DM, CC1, CC2, VBUS, GND, SBU, TX/RX)
- Auto-create ports with standard names when standard prop is set
- Support internally connected pins for connectors
- Export getStandardPins() helper and USB_C_STANDARD_PINS constant
- Add unit tests for connector functionality

Usage:
```tsx
<Connector standard="usb_c" name="USB1" />
<trace from=".USB1 > .DP" to=".MCU > .USB_DP" />
```
@Lulzx Lulzx force-pushed the feat/connector-standard-usb-c branch from a6e62e0 to b26eaa8 Compare December 4, 2025 14:00
Lulzx added a commit to Lulzx/tscircuit that referenced this pull request Dec 4, 2025
This feature is implemented across multiple repositories:

- tscircuit/core#1715 - Add Connector component with USB-C standard support
- tscircuit/parts-engine#17 - Add USB-C connector support and findStandardPart API
- tscircuit/props#525 - Add StandardPartResult type and findStandardPart to PartsEngine
- tscircuit/circuit-json#366 - Add source_simple_connector type

No changes needed in this repository as it re-exports from @tscircuit/core.
Once the dependent packages are published, the Connector component will be
available automatically.

Usage:
```tsx
<connector standard="usb_c" name="USB1" />
<trace from=".USB1 > .DP" to=".MCU > .USB_DP" />
```

Closes tscircuit#748
Override doInitialPartsEngineRender to call findStandardPart when a
standard prop is specified. This enables automatic footprint loading
from the parts engine for standard connectors like USB-C.

- Add doInitialPartsEngineRender override for standard connectors
- Add updatePartsEngineRender to apply async results
- Add _applyStandardPartResult to update supplier part numbers and
  create footprint components from Circuit JSON
Lulzx added 2 commits December 6, 2025 02:13
- Add DP1, DP2, D+2 aliases to USB_C_STANDARD_PINS.DP
- Add DM1, DM2, D-2 aliases to USB_C_STANDARD_PINS.DM
- This ensures 16-pin USB-C footprints map correctly to standard ports
- Add tests for parts engine integration with findStandardPart
- Add tests for fallback behavior and error handling
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions
Copy link

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions bot closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant