Skip to content

Pull resistors by direction: set_pull(la, "up"|"down"|"off"), wiring pulls map, MCP pull= - #112

Merged
wardviaene merged 4 commits into
mainfrom
pull-direction
Nov 19, 2026
Merged

wardviaene merged 4 commits into
mainfrom
pull-direction

Conversation

@wardviaene

@wardviaene wardviaene commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Hosts for embeddedci-com/benchpod-firmware#167: the pull-resistor API names a direction instead of on/off, on today's boards, so it is final before the next digital board (up/down on every channel).

Rebased onto main after #111 and #113 merged.

SDK (embeddedci)

  • set_pull(la, "up" | "down" | "off") (None is off) returns PullState with state, supported (directions the channel can pull) and ohms. The pod picks the resistor.
  • enable_pullup / disable_pullup / enable_pulldown / disable_pulldown stay as shortcuts. set_pull(la, True/False) and enabled= still work (deprecated: True = the channel's own direction).
  • Firmware with feature la_pull_dir gets {"pull": ...}; older firmware gets pullup on/off and the SDK checks the direction itself, so "up" never engages LA7's pull-down on 3.10.11.
  • BP0023 / BP0024 raise PullDirectionError (a FirmwareError and a ValueError, which these refusals raised before), with la, want, have.
  • One pull table: constants.PULL_TABLE (PullHw); PULL_OHMS, PULLUP_CHANNELS, PULLDOWN_CHANNELS derive from it.
  • Wiring.pulls takes a map {"1": "up", "8": "down"}; the list of channels stays valid and means each channel's own direction. Wiring.pull_directions(); power_on applies it.
  • Error catalog and features table synced from benchpod-firmware#167.
  • README section "LA pull resistors", CHANGELOG Unreleased, API snapshot refreshed.
  • New e2e test test_pull_by_direction (works on old and new firmware).

MCP (embeddedci-mcp)

  • set_pull(las, pull="up"|"down"|"off"), channels 1-14; enabled still works.
  • pull_status: all 14 channels with state and supported.
  • guide, README tool rows, refusal rewrites and set_wiring's pulls text updated.
  • Still works against embeddedci 3.0.2 (the mcp-min-sdk job): there it checks the direction itself and lists LA1-8.

Tests

  • pytest packages/embeddedci 1002 passed; packages/embeddedci-mcp 209 passed (also against PyPI embeddedci 3.0.2); openhtf 74; scripts 12.
  • HW results on benchpod-30a9f1 follow in a comment.

🤖 Generated with Claude Code

@wardviaene

Copy link
Copy Markdown
Member Author

HW verification on benchpod-30a9f1 (analog v3r2, gw 58), pod lock held, restored to the published 3.10.11 afterwards.

Dev build of this branch (DFU):

  • {"cmd":"la","la":N,"pull":"up|down|off"}: LA1 up/off, LA7 down/off; replies carry state and dirs.
  • Refusals: LA7 up and LA3 down -> BP0024 (want/have right after the follow-up commit; the first flash showed want:"off", fixed in this PR), LA9/LA14 up/down and LA10/LA11 pullup:on -> BP0023, pull:"sideways" -> "pull must be up, down or off", LA15 -> "LA15 is not a pin".
  • pullup alias: LA2 on/off (up), LA8 on/off (down); mask 130 = LA2+LA8.
  • LA9 query answers {"dirs":[],"state":"off"}; la_pins carries dirs.
  • I2C refusal names {"cmd":"la","la":1,"pull":"up"}; LA9 as SDA: "no pod pull-up on this board".
  • SDK e2e (gpio, pod, rev3 tiers) 110 passed / 12 skipped; MCP e2e 9 passed; MCP set_pull(pull=...) and pull_status by hand; CLI la pull up/down/off, refusals exit 3, bad direction exit 2.

Released 3.10.11 (fallback path): SDK e2e gpio+pod 101 passed / 8 skipped (incl. the new test_pull_by_direction); CLI la pull sends pullup and refuses LA7 up / LA9 up itself with BP0024 / BP0023.

wardviaene and others added 4 commits November 18, 2026 18:14
…pulls map, MCP pull=

SDK: set_pull(la, pull) names the direction and returns PullState with state,
supported and ohms; True/False and enabled= stay (deprecated: True = the
channel's own direction). Firmware with la_pull_dir gets {"pull":...}; older
firmware gets pullup on/off and the SDK checks the direction itself. BP0023 /
BP0024 raise PullDirectionError (also a ValueError). The board's resistors are
one table, constants.PULL_TABLE. Wiring.pulls takes a map {la: "up"|"down"}
next to the list; pull_directions() and power_on use it. Error catalog and
features table synced from benchpod-firmware#167.

MCP: set_pull(las, pull="up"|"down"|"off") (enabled still works), channels
1-14; pull_status lists all 14 with state and supported; guide, README and
set_wiring's pulls text updated. Works against embeddedci 3.0.2 too (checks
the direction itself there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the pulls list when every pull is its own direction

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit aadea39 into main Nov 19, 2026
20 checks passed
@wardviaene
wardviaene deleted the pull-direction branch November 19, 2026 01:04
@wardviaene wardviaene mentioned this pull request Nov 19, 2026
wardviaene added a commit that referenced this pull request Nov 19, 2026
Pull resistors by direction (#112), default-pins preset name (#113),
pull texts (#111); features table synced from benchpod-firmware 3.10.12
(la_pull_dir first released in 3.10.12).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant