Skip to content

Check board pin assignments against per-chip rules - #6

Open
ShivtejG236 wants to merge 1 commit into
mainfrom
feat/pin-rules
Open

ShivtejG236 wants to merge 1 commit into
mainfrom
feat/pin-rules

Conversation

@ShivtejG236

Copy link
Copy Markdown
Member

What

  • chips/<chip>.json: per-chip pin rules for the ESP32 and ESP32-S3. Each lists the GPIOs that exist, the input-only ones, the UARTs the GPS may use, and the pins that can never carry a sensor signal, with the reason for each.
  • boards.pin_errors(): checks a pin assignment against those rules and returns every problem, not only the first. Manifest validation now uses it.
  • Board manifests may add reserved pins. The ESP32-S3 DevKitC-1 reserves its octal PSRAM and RGB LED pins.
  • tools/test_pin_rules.py runs in CI.

Why

Groundwork for letting users change sensor pins: the same function will back the settings page, so an assignment that cannot work is rejected with its reason.

Notes

  • Strapping pins are blocked outright, including those that are safe with a pull-up (ESP32 GPIO 5 and 15).
  • No firmware source changes. Both shipped manifests pass the new rules.
  • The rules were written from Espressif's GPIO documentation (linked in each file) and have not been exercised on hardware.

chips/<chip>.json lists which GPIOs exist, which are input-only, which UARTs the GPS may use and which pins can never carry a sensor signal (strapping, flash and PSRAM, USB, the UART0 host link), each with its reason. boards.pin_errors() reports every problem with an assignment and now backs manifest validation; a board manifest can also reserve pins it already uses.

Rules are provided for the ESP32 and ESP32-S3. The ESP32-S3 DevKitC-1 manifest reserves its octal PSRAM and RGB LED pins.
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