Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions tests/scenarios/board_pins.yaml
Original file line number Diff line number Diff line change
@@ -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]
3 changes: 3 additions & 0 deletions tests/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down