diff --git a/tests/scenarios/board_pins.yaml b/tests/scenarios/board_pins.yaml new file mode 100644 index 00000000..6e5572b6 --- /dev/null +++ b/tests/scenarios/board_pins.yaml @@ -0,0 +1,119 @@ +type: board +name: "board_pins" + +# Smoke tests for user-accessible pins on the edge connector and croc pads. +# ADC tests verify that the pin can be configured and return a raw reading. +# Digital tests verify the internal pull-up reads high when the pin is floating. +# +# Note: These are basic configuration/readback smoke tests. Full electrical +# continuity testing requires a physical test bench (jig) with known voltages +# and will be added once the test bench hardware is designed. + +tests: + - name: "Pin P0 (PC4) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P0")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P1 (PA5) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P1")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P2 (PC5) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P2")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P3 (PA2) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P3")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P4 (PA4) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P4")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P10 (PA6) analog read" + action: hardware_script + script: | + from machine import ADC, Pin + adc = ADC(Pin("P10")) + result = adc.read_u16() + expect_range: [0, 65535] + mode: [hardware] + + - name: "Pin P6 (PC3) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P6", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] + + - name: "Pin P7 (PA9) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P7", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] + + - name: "Pin P8 (PA15) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P8", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] + + - name: "Pin P9 (PC2) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P9", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] + + - name: "Pin P12 (PC6) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P12", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] + + - name: "Pin P16 (PE4) digital pull-up read" + action: hardware_script + script: | + from machine import Pin + p = Pin("P16", Pin.IN, Pin.PULL_UP) + result = p.value() + expect: 1 + mode: [hardware] diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index a7c470af..d17fccd1 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -20,6 +20,9 @@ def _print_result(result, test): """Print the measured value for report capture.""" + if isinstance(result, bool): + # Boolean smoke tests (True/False) — nothing useful to print + return if isinstance(result, float): print(f"{result:.2f}") elif isinstance(result, int) and "expect" in test and isinstance(test["expect"], int) and test["expect"] > 0xFF: