Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the EDG parts library and examples to support a new CH32V003 microcontroller and updates the BLE joystick reference design to incorporate a lower-power nRF52 module, additional sub-boards/features, and revised power/charging architecture. It also standardizes SWD connectivity away from the legacy TC2050-style header toward the TC2030 Tag-Connect style across affected examples.
Changes:
- Add CH32V003 microcontroller support (including an SDI programming header abstraction) and integrate it into the BLE joystick button sub-board as an IO expander.
- Update BLE joystick example hardware architecture: soft power gating, INA219 battery sensing, IMU/magnetometer on I2C, button sub-board + neopixels, and nRF52840 module usage.
- Replace TC2050 SWD header usage with TC2030/Tag-Connect mappings in example PCB exports and example tests; remove the legacy SWD connector class.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/TofArray/TofArray.svgpcb.js | Adjusts placement and updates SWD connector footprint/pin mapping to TC2030. |
| examples/TofArray/TofArray.net.ref | Updates reference netlist to match TC2030 SWD footprint and pin remap. |
| examples/test_tofarray.py | Updates SWD connector refinement to Tag-Connect style. |
| examples/test_multimeter.py | Updates SWD connector refinement to Tag-Connect style. |
| examples/test_ble_joystick.py | Major BLE joystick design update; adds ButtonSubboard; integrates CH32V003 + new power/I2C peripherals. |
| examples/Multimeter/Multimeter.svgpcb.js | Placement changes and SWD connector update to TC2030 with netlist pin remap. |
| examples/Multimeter/Multimeter.net.ref | Updates reference netlist to match TC2030 SWD footprint and pin remap. |
| examples/Keyboard/Keyboard.kicad_pro | KiCad project settings updates (defaults/DRC/tuning/export sections). |
| examples/BleJoystick/BleJoystick.svgpcb.js | Updates board export for new BLE joystick architecture and added peripherals/subconnectors. |
| examples/BleJoystick/BleJoystick.net.ref | Updates reference netlist for revised joystick architecture and new components. |
| examples/BleJoystick/BleJoystick_stick.net.ref | Updates stick sub-board connector footprint/pins and refdes changes. |
| examples/BleJoystick/BleJoystick_btns.net.ref | Adds new reference netlist for the button sub-board. |
| edg/parts/power/BatteryCharger_Mcp73831.py | Adds optional PROG-pin control (charge enable/disable) via generated FET; converts to GeneratorBlock. |
| edg/parts/microcontroller/nRF52840.py | Fixes Holyiot footprint instantiation to correctly use external=True on the block wrapper. |
| edg/parts/microcontroller/Ch32v003.py | New CH32V003 device + wrapper MCU block and SDI programming header abstractions. |
| edg/parts/microcontroller/init.py | Exports new CH32V003-related blocks. |
| edg/parts/connector/SwdHeaders.py | Removes the legacy TC2050-compatible SWD header implementation. |
| edg/parts/connector/init.py | Stops exporting the removed SWD header class. |
| edg/electronics_interfaces/DigitalPorts.py | Adds DigitalBidir.as_voltage_source() helper. |
| edg/circuits/PowerConditioning.py | Improves SoftPowerGate button input documentation string. |
| edg/abstract_parts/IoControllerWrapper.py | Marks wrapper/modelable base classes as non-library and guards generator_param usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+13
| class Ch32vSdiHeader(ProgrammingConnector): | ||
| """Abstract programming header for the CH32V using the one-pin SDI interface with SWIO pin..""" |
Comment on lines
+69
to
76
| self.prog_ctl = self.Port( | ||
| DigitalBidir(), | ||
| optional=True, | ||
| doc="GPIO that controls a FET that enables charging, pull high to enable", | ||
| ) | ||
|
|
||
| self.generator_param(self.prog_ctl.is_connected()) | ||
|
|
Comment on lines
199
to
+204
| ( | ||
| ["mcu", "pin_assigns"], | ||
| [ | ||
| "led=_GPIO9_STRAP", # force using the strapping / boot mode pin | ||
| # note, only ADC pins are IO0/1/3/4/5 (pins 18/17/15/3/4) | ||
| "ax1=3", | ||
| "ax2=15", | ||
| "trig=17", | ||
| "vbat_sense=18", | ||
| # 'vbat_sense_gate=14', | ||
| # 'gate_ctl=5', | ||
| "i2c.scl=4", | ||
| "i2c.sda=14", | ||
| "sw=5", # joystick | ||
| "sw0=10", # membranes | ||
| "sw1=13", | ||
| "sw2=6", | ||
| # TODO pin this | ||
| ], | ||
| ), |
Comment on lines
+205
to
211
| ( | ||
| ["btns", "ioe", "pin_assigns"], | ||
| [ | ||
| "i2c.scl=12", | ||
| "i2c.sda=11", | ||
| # TODO pin the rest | ||
| ], |
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 CH32V003 and uses it in the BLE joystick.
Modifies the BLE joystick example with lessons learned / new features:
This board has not been routed yet, that will happen later. Additional circuit modifications may be required during routing.
Other fixes: