Skip to content

Clarify PCA9685 digital output and solenoid semantics - #532

Open
BanjoR wants to merge 2 commits into
DCC-EX:masterfrom
BanjoR:codex/commandstation-pca-solenoid
Open

BanjoR wants to merge 2 commits into
DCC-EX:masterfrom
BanjoR:codex/commandstation-pca-solenoid

Conversation

@BanjoR

@BanjoR BanjoR commented Aug 16, 2026

Copy link
Copy Markdown

Automatic issue closing

Fixes #354

Scope

Addresses issue #354 by adding digital level writes to IO_PCA9685pwm: HIGH maps to 100% duty (4095) and remains held until LOW (0) is written. Both PCA9685 drivers explicitly clear every configured channel during initialization. The documentation defines the level-held semantics, bounded activation responsibility, safe external-driver boundary, and maintainer bench criteria.

Files changed are limited to:

  • IO_PCA9685.cpp
  • IO_PCA9685pwm.h
  • docs/PCA9685_OUTPUTS.md
  • tests/test_pca9685_output_contract.py

Personal integration code and unrelated protocol behavior are explicitly out of scope.

Existing-PR audit: PR #509 is an unrelated I2C-address correction and is conflicting; no superseded PCA9685 digital-output PR was identified.

Verification

  • python -m pytest -p no:cacheprovider tests -q: 4 passed.
  • Focused python -m pytest -p no:cacheprovider tests/test_pca9685_output_contract.py -q: 4 passed.
  • Bundled Python syntax compilation of the regression test: passed.
  • git diff --check: passed.
  • Upstream ancestry (upstream/master is an ancestor) and exact changed-file allowlist: passed.
  • Git tracked status: clean. An ignored generated .pytest_cache/ directory remains physically present because ownership permissions prevented removal; no generated file is part of the PR diff. This physical-artifact hygiene point is not claimed as fully cleared.
  • Exact-head fork CI: PASS - CI run 31950094674 completed successfully for head 337aa5d.
  • The upstream PR has no firmware check attached because the repository workflow is push-triggered; no required-check set was available through the branch-protection endpoint (HTTP 404).

Validation update:

  • PASS - Exact default python -m platformio run in a clean task checkout with an isolated PlatformIO core completed for all five configured environments: mega2560, ESP32, Nucleo-F411RE, Nucleo-F446RE, and Nucleo-F429ZI.
  • No standalone native C++/format/docs toolchain was available for additional gates; the focused Python contract tests remain the host-side evidence.

Hardware validation: Not run—no hardware available.

Maintainer bench criteria

See docs/PCA9685_OUTPUTS.md. Reproducibly verify startup and independent-reset outputs remain off, HIGH is held until LOW, SDA/SCL and command-station power loss de-energize the external driver, repeated bounded activations stay within measured on-time/current/temperature ratings, and I2C recovery creates no unintended pulse.

@BanjoR
BanjoR marked this pull request as ready for review August 17, 2026 09:34
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.

[Feature Request] Simulate simple I/O in IO_PCA9685pwm

1 participant