Skip to content

feat: cite datasheet pin functions and separate unchecked pins from passes - #56

Merged
badimirzai merged 3 commits into
mainfrom
feat--pins-from-datasheets-the-checker-can-prove
Oct 8, 2026
Merged

badimirzai merged 3 commits into
mainfrom
feat--pins-from-datasheets-the-checker-can-prove

Conversation

@badimirzai

Copy link
Copy Markdown
Owner

Summary

  • Built-in parts now carry datasheet pin functions beside the existing supply_abs_max and gpio_abs_max rules. A function has a name, an optional number, a kind (power, ground, bus, or gpio_candidate), an optional signal, and a citation (title, revision, and table or section). rv does not fetch a datasheet at scan time, and a function without a citation is ignored.
  • Dedicated SDA on SCL or I2C_SCL, and dedicated SCL on SDA or I2C_SDA, is pin_function_mismatch (ERROR). Dedicated SDA and SCL of the same part on one net is pin_bus_short (ERROR). expected.text is the signal. observed.text is the net. The finding includes the datasheet citation. A gpio_candidate never produces these findings.
  • rv scan --format json gains a coverage object: proved counts dedicated bus checks that passed, refused lists existing ERROR and WARN findings, and not_checked lists unmatched parts, matched pins with no cited function, and a gpio_candidate on an I2C net name. Coverage does not change the exit code. An ESP32 GPIO on I2C_SDA is not checked, not a pass.
  • MPU-6050 and BNO055 record dedicated power, ground, SDA, and SCL. AP2114H-3.3 records VIN, VOUT, and GND. ESP32-WROOM-32, STM32F103C8T6, and RP2040 record power, ground, and I2C-capable GPIOs as candidates, not as the SDA pin. DRV8833, TB6612FNG, L298N, PCA9306, and TXS0108E stay on their voltage contracts. AMS1117-3.3 stays on its voltage contract because the datasheet that was read names the pins and does not print a revision. rv parts show prints the functions and the citations.

Test plan

  • Scan an MPU-6050 whose SDA pin is on I2C_SCL. Exit code is 2. The finding is pin_function_mismatch, expected.text is SDA, observed.text is the net, and the citation is MPU-6000/MPU-6050 Product Specification, revision 3.4, section 7.1.
  • Scan the same part with SDA on I2C_SDA and SCL on I2C_SCL. No pin_function_mismatch or pin_bus_short. Those checks appear under coverage.proved.
  • Scan an ESP32 GPIO on I2C_SDA. No pin_function_mismatch. coverage.not_checked lists that connection. Exit code stays 0 when nothing else fails.
  • rv parts show MPU-6050 and rv parts show ESP32-WROOM-32 print functions and citations. supply_abs_max is still listed.
  • Existing overvoltage and contract fixtures keep their previous exit codes.

A dedicated SDA or SCL pin on the opposite bus net is an error with the datasheet citation. A GPIO that can be muxed to I2C stays unchecked instead of counting as a pass.
The MPU fixture must exit 2 when SDA is on I2C_SCL, and a correct bus must not emit those findings. An ESP32 GPIO on I2C_SDA must show up under not_checked.
Pin functions are copied from a datasheet table. Coverage separates checks that passed from pins the scan did not check, and an unchecked pin is not a violation.
@badimirzai
badimirzai merged commit e324e22 into main Oct 8, 2026
2 checks passed
@badimirzai
badimirzai deleted the feat--pins-from-datasheets-the-checker-can-prove branch October 10, 2026 14:16
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