embeddedci 3.0.2__tar.gz → 3.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {embeddedci-3.0.2 → embeddedci-3.0.3}/CHANGELOG.md +23 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/PKG-INFO +45 -23
- {embeddedci-3.0.2 → embeddedci-3.0.3}/README.md +44 -22
- {embeddedci-3.0.2 → embeddedci-3.0.3}/pyproject.toml +1 -1
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/__init__.py +2 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/client.py +118 -37
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/constants.py +30 -8
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/error_catalog.json +132 -1
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/errors.py +23 -3
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/feature_map.json +20 -4
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/gpio.py +11 -3
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/header.py +4 -3
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/state.py +38 -12
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/wiring.py +92 -32
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/api_surface.json +12 -3
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_gpio.py +41 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_bmp280_hil.py +3 -2
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_client_v2.py +4 -3
- embeddedci-3.0.3/tests/test_pull_direction.py +196 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_refusal_errors.py +1 -1
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_wiring.py +6 -4
- {embeddedci-3.0.2 → embeddedci-3.0.3}/.gitignore +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/LICENSE +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/docs/aivision.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/docs/event-uart-design.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/examples/README.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/examples/test_bmp280.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/__init__.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/_http.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/__init__.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/client.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/cloud.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/discovery.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/errors.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/pytest_plugin.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/results.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/can.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/capabilities.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/capture.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/ci.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cli_config.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cli_login.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cloud_auth.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/connection.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/control_loop.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/decode.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/discovery.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/dsp.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/esp.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/expansion.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/feature_map.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/flash.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/i2c.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/i2c_master.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/lease.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/lowlevel.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/main.c +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/motor_emulator.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/power.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/protocol.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/pytest_plugin.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/replay.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/results.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/__init__.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/README.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/docs/format.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/library.json +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/analog/ntc_10k_divider.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/analog/pressure_4_20ma.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/bme280.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/bmp280.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/ina219.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/mpu6050.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/scd4x.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/sht3x.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/sht4x.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/tmp117.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/spi/lis3dh.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/spi/lis3dh_fifo.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/uart/gps_nmea.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/uart/mhz19b.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/gps_drive.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/pressure_drop.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/temperature_ramp_fault.yaml +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/definition.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/emulation.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/library.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/yaml12.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/server_api.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/spi.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/__init__.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/base.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/cloud.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/serial.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/tcp.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/tls.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/usblink.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/uart.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/waveforms.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/py.typed +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/upload_build.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/conftest.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/README.md +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/conftest.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/e2e_bench.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/e2e_helpers.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_bench_profile.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_cloud.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_digital.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_dut.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_la13_14.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_pod.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_rev3.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_spi.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_usb.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_can_ecu_demo.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_can_loopback_hil.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_smoke.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_fft_hw.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_oversample.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_range.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision_cloud.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision_live.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_api_surface.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_can.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capabilities.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capabilities_scope.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capture.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capture_replay_hw.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_ci.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_cloud.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_connection.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_control_loop.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_control_loop_hw.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_current_out_waveforms.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_limits_fixture.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_path_default.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_path_ranges.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_decode.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_decode_parity.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_docs_coverage.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dsp.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_esp_flash.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_expansion.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_feature_map.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_flash_bridge.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_flash_build.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_generate16.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_gpio.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_header.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_http_redirect_auth.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_decode.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_master.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_parity.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_timed.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_image_switching.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_integration.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_la_voltage_fixture.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_lan_tls.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_lease.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_module.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_motor_emulator.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_one_source.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_pin_directions.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_pins_bias.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_protocol.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_replay.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_sensor_library.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_sensors.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_serial_autodetect.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_serial_text_console.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_spi.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_status_diag.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_tcp_transport.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_timed_power.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_timing.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_transport_failures.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_trigger_power.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_capture.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_de.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_frame.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_half_duplex.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_session.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_unsupported_feature.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_upload_build.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_usb_net.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_waveforms.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_wiring_profiles.py +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/testdata/i2c_decode_vectors.json +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/testdata/spi_decode_vectors.json +0 -0
- {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/testdata/uart_decode_vectors.json +0 -0
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog — `embeddedci`
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
- The preset of the default pins is now `Wiring.preset("embeddedci-default")` (also the default of
|
|
6
|
+
`Wiring.preset()`), and `wiring.DEFAULT_PINS` is its values: they are the pins the pod used to
|
|
7
|
+
assume, not the wiring of a particular bench. The old names `"embeddedci-reference"` and
|
|
8
|
+
`REFERENCE_BENCH` still work. The values are unchanged, so version 1 profiles mean what they did.
|
|
9
|
+
- **Pull resistors by direction:** `BenchPod.set_pull(la, "up" | "down" | "off")` (None is off)
|
|
10
|
+
returns a `PullState` with `state`, `supported` (the directions the channel can pull) and `ohms`;
|
|
11
|
+
the pod picks the resistor. `enable_pullup` / `disable_pullup` / `enable_pulldown` /
|
|
12
|
+
`disable_pulldown` stay as shortcuts. `set_pull(la, True/False)` and `enabled=` still work
|
|
13
|
+
(deprecated: True pulls the channel's own direction). A direction the channel can't pull raises
|
|
14
|
+
`PullDirectionError` (code `BP0024`, also a `ValueError`), up/down on a channel without a resistor
|
|
15
|
+
`BP0023`. Firmware with the `la_pull_dir` feature gets `pull`; older firmware gets `pullup` and the
|
|
16
|
+
SDK checks the direction itself. `pull_state` and `enabled_pulls` cover LA1-LA14.
|
|
17
|
+
- **Wiring `pulls` map:** `Wiring.pulls` also takes `{"1": "up", "8": "down"}`; the list of channels
|
|
18
|
+
stays valid and means each channel's own direction. `Wiring.pull_directions()` gives either as
|
|
19
|
+
the map, and `power_on` applies it. `to_dict()` writes the list whenever every pull is its
|
|
20
|
+
channel's own direction, so older readers keep taking it.
|
|
21
|
+
- `LaPinState.pull_dirs`: every direction the channel's pull resistor can pull.
|
|
22
|
+
- The board's pull resistors are one table, `constants.PULL_TABLE` (`PullHw`: dirs, default,
|
|
23
|
+
ohms); `PULL_OHMS`, `PULLUP_CHANNELS` and `PULLDOWN_CHANNELS` come from it.
|
|
24
|
+
- Error catalog and features table synced from benchpod-firmware (BP0023, BP0024, `la_pull_dir`).
|
|
25
|
+
|
|
3
26
|
## 3.0.2
|
|
4
27
|
|
|
5
28
|
- **The profile on the pod's header:** `BenchPod.board_header()` says which I/O header the pod has
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: embeddedci
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.3
|
|
4
4
|
Summary: BenchPod SDK and pytest plugin for EmbeddedCI hardware-in-the-loop testing
|
|
5
5
|
Project-URL: Homepage, https://embeddedci.com
|
|
6
6
|
Project-URL: Repository, https://github.com/embeddedci-com/embeddedci-python
|
|
@@ -75,7 +75,7 @@ No pin numbers: the SWD channels, the UART pair, the baud and the power rail com
|
|
|
75
75
|
**Contents:** [Install](#install) · [Quick start](#quick-start) ·
|
|
76
76
|
[API conventions](#api-conventions-and-stability) · [pytest plugin](#pytest-plugin) ·
|
|
77
77
|
[Power and reset](#power-reset-and-power-monitoring) · [Flashing](#flashing) · [UART](#uart) ·
|
|
78
|
-
[
|
|
78
|
+
[Pull resistors](#la-pull-resistors) · [Emulated sensors](#emulated-sensors) ·
|
|
79
79
|
[Analog paths](#analog-paths-dc-output-and-single-readings) · [Captures](#captures) ·
|
|
80
80
|
[DAC](#dac-generator-replay-and-faults) · [Control loop](#in-fabric-dac-control-loop) ·
|
|
81
81
|
[CAN](#can) · [AI Vision](#ai-vision-board) · [Cloud](#cloud-embeddedcidevice-name) · [Build reporting](#build-reporting) ·
|
|
@@ -620,10 +620,14 @@ print(wiring.describe()) # a pin table: bias resistor and
|
|
|
620
620
|
**Nothing is wired unless the profile says so** (schema version 2, SDK 3.0). A pin the profile does
|
|
621
621
|
not set is never driven, and a call that needs it says which one to pass: `bp.flash()` without
|
|
622
622
|
`swclk`/`swdio` in the profile raises `ValueError: swd_swclk was not given and the wiring profile has
|
|
623
|
-
no swd_swclk`. The
|
|
624
|
-
on LA11/LA12, 3.3 V, internal 5 V),
|
|
625
|
-
`Wiring.preset("embeddedci-
|
|
626
|
-
|
|
623
|
+
no swd_swclk`. The default pins, what profiles used to default to (UART RX on LA5 and TX on LA4, I2C
|
|
624
|
+
SDA on LA1 and SCL on LA2, SWD on LA11/LA12, 3.3 V, internal 5 V), are a preset:
|
|
625
|
+
`Wiring.preset("embeddedci-default")` (the old name `"embeddedci-reference"` still works). They are
|
|
626
|
+
not the wiring of any particular bench: load your board's own profile by name
|
|
627
|
+
(`BenchPod(conn, wiring_profile="process-node-stm32")`, `bp.load_wiring("process-node-stm32")`), as
|
|
628
|
+
the [process-node example](https://github.com/embeddedci-com/examples/tree/main/process-node-stm32)
|
|
629
|
+
does with its `wiring/process-node-stm32.json`. A version 1 file or dict (or one without a `version`
|
|
630
|
+
key) still means what it did: what it leaves out takes the default pins' values, and the profile you
|
|
627
631
|
get back is version 2 with them written out. Re-save such a file as version 2 with
|
|
628
632
|
`benchpod wiring upgrade wiring.json`.
|
|
629
633
|
|
|
@@ -678,7 +682,9 @@ cloud device's single profile on embeddedci.com, and raises over the LAN or USB.
|
|
|
678
682
|
**Power-on applies the profile.** `bp.power_on()` (or `bp.power_on(wiring_profile="k66")`) sets the
|
|
679
683
|
profile's I/O voltage when the pod has none or another one, sets its pull resistors, then switches
|
|
680
684
|
the profile's rail on and records on the pod which profile powered the board (`target_status`).
|
|
681
|
-
`Wiring.pulls`
|
|
685
|
+
`Wiring.pulls` says which pull resistors are on, as a map of channel to direction
|
|
686
|
+
(`{"pulls": {"1": "up", "2": "up", "8": "down"}}` in the JSON) or as a list of channels that pull
|
|
687
|
+
their own direction (`{"pulls": [1, 2]}`); `Wiring.pull_directions()` gives either as the map.
|
|
682
688
|
`power_on` switches exactly those on and the others off. They work at 3.3 V only, so at 1.8 V nothing
|
|
683
689
|
is sent, and a profile without `pulls` (`None`) leaves them as they are. It never changes the I/O
|
|
684
690
|
voltage under a board that is already powered: that raises, and `bp.set_la_voltage()` does it if you
|
|
@@ -1077,30 +1083,45 @@ with bp.open_uart(rx=PIN5, tx=PIN4, de=PIN9, baud=19200, parity="even",
|
|
|
1077
1083
|
`de` needs gateware v58 (`bp.supports("uart_de")`); older pods raise `UnsupportedFeatureError`
|
|
1078
1084
|
before anything is sent. The USB console has no DE.
|
|
1079
1085
|
|
|
1080
|
-
## LA
|
|
1086
|
+
## LA pull resistors
|
|
1081
1087
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1088
|
+
You name the direction, `"up"`, `"down"` or `"off"`; the pod picks the resistor and reports its
|
|
1089
|
+
value. Which channels have one and which way each can pull depends on the board, and
|
|
1090
|
+
`PullState.supported` says it per channel. On today's boards each resistor pulls one way only:
|
|
1084
1091
|
|
|
1085
|
-
| Channels |
|
|
1092
|
+
| Channels | Pulls | Value |
|
|
1086
1093
|
|---|---|---|
|
|
1087
|
-
| LA1, LA2 |
|
|
1088
|
-
| LA3, LA4 |
|
|
1089
|
-
| LA5, LA6 |
|
|
1090
|
-
| LA7, LA8 |
|
|
1094
|
+
| LA1, LA2 | up | 4.7k |
|
|
1095
|
+
| LA3, LA4 | up | 2.2k |
|
|
1096
|
+
| LA5, LA6 | up | 10k |
|
|
1097
|
+
| LA7, LA8 | **down** | 10k |
|
|
1091
1098
|
| LA9–LA14 | none | — |
|
|
1092
1099
|
|
|
1100
|
+
The resistors are referenced to 3V3, so the pod won't engage one while the LA bank is at 1.8 V
|
|
1101
|
+
(`PullState.available` is false).
|
|
1102
|
+
|
|
1093
1103
|
```python
|
|
1094
1104
|
from embeddedci.benchpod import PIN1, PIN2, PIN7
|
|
1095
1105
|
|
|
1096
|
-
bp.
|
|
1097
|
-
bp.
|
|
1098
|
-
|
|
1099
|
-
print(bp.
|
|
1100
|
-
bp.
|
|
1101
|
-
bp.
|
|
1106
|
+
bp.set_pull(PIN1, "up") # PullState(la=1, enabled=True, direction='up', ohms='4.7k', supported=('up',), ...)
|
|
1107
|
+
bp.set_pull(PIN7, "down")
|
|
1108
|
+
bp.set_pull(PIN7, "off") # None is off too; "off" works on every channel
|
|
1109
|
+
print(bp.pull_state(PIN1).state) # 'up' ('up', 'down' or 'off')
|
|
1110
|
+
print(bp.enabled_pulls()) # [1]
|
|
1111
|
+
bp.enable_pullup(PIN1, PIN2) # shortcuts: set_pull(la, "up") ...
|
|
1112
|
+
bp.enable_pulldown(PIN7) # ... and set_pull(la, "down")
|
|
1113
|
+
bp.disable_pullup(PIN1, PIN2) # off, on a channel that pulls up
|
|
1102
1114
|
```
|
|
1103
1115
|
|
|
1116
|
+
A direction the channel can't pull raises `PullDirectionError` (a `FirmwareError` and a
|
|
1117
|
+
`ValueError`) with code `BP0024`, "LA7 supports pull-down only on this board", and `"up"` or `"down"`
|
|
1118
|
+
on a channel without a resistor raises it with `BP0023`. `.la`, `.want` and `.have` name the channel
|
|
1119
|
+
and the directions. `set_pull(la, True)` / `set_pull(la, False)` (or `enabled=`) still work but are
|
|
1120
|
+
deprecated: True pulls the channel's own direction.
|
|
1121
|
+
|
|
1122
|
+
Firmware before the `la_pull_dir` feature (`bp.supports("la_pull_dir")`) only takes on/off; the SDK
|
|
1123
|
+
then sends that and checks the direction itself, so the calls above work on every pod.
|
|
1124
|
+
|
|
1104
1125
|
An open-drain bus such as I2C must sit on LA1–LA6.
|
|
1105
1126
|
|
|
1106
1127
|
## GPIO on the LA pins
|
|
@@ -1147,7 +1168,7 @@ The other owners point to `bp.sensors.stop("<instance>")`, closing the session f
|
|
|
1147
1168
|
`bp.open_uart()` or `bp.open_spi()`, or waiting for a flash or step train to finish. The pod's own
|
|
1148
1169
|
text, with its raw protocol command, stays in `exc.firmware_message`.
|
|
1149
1170
|
|
|
1150
|
-
`bp.la_pins()` lists every channel's `LaPinState` (`function`, `gpio` mode, `level`, `pull`, `pull_on`),
|
|
1171
|
+
`bp.la_pins()` lists every channel's `LaPinState` (`function`, `gpio` mode, `level`, `pull`, `pull_on`, `pull_dirs`),
|
|
1151
1172
|
and `bp.configure_gpio(channels, mode)` is the same group claim as `gpio_pins()` returning those states.
|
|
1152
1173
|
Captures observe every channel whatever its function. GPIO channels stay GPIO — also across
|
|
1153
1174
|
disconnects — until released (the pytest `benchpod` fixture releases them at session start and end),
|
|
@@ -2284,6 +2305,7 @@ Invalid arguments raise `ValueError` before anything is sent. Everything else ra
|
|
|
2284
2305
|
| `DirectionConflictError` | a push-pull driver on a pin `la_dir` marks as a DUT output (a `FirmwareError`) | `la` |
|
|
2285
2306
|
| `I2CNackError` | an I2C device did not acknowledge (`I2CMaster.write`, `read`, `write_read`, `read_reg`, `write_reg`) | `addr`, `nack_at` |
|
|
2286
2307
|
| `PullConflictError` | an engaged bias resistor can't work with the channel's function (a `FirmwareError`) | `la` |
|
|
2308
|
+
| `PullDirectionError` | the channel can't pull that way (BP0024) or has no pull resistor (BP0023); also a `ValueError` | `la`, `want`, `have` |
|
|
2287
2309
|
| `TriggerTimeout` | a triggered capture's condition never happened (a `FirmwareError`) | `la`, `edge` |
|
|
2288
2310
|
| `CanTimeout` | `CanBus.expect` timed out | `frames` |
|
|
2289
2311
|
|
|
@@ -2350,7 +2372,7 @@ few built from other shapes); `to_dict()` goes the other way where a type is sen
|
|
|
2350
2372
|
| `LanTls` | `lan_tls`, `set_lan_tls_https_only`, `regenerate_lan_tls`, `set_lan_tls_cert` | `port`, `https_only`, `sessions`, `origin` (`generated`/`user`), `key`, `subject`, `san`, `not_after`, `sha256` (what clients pin), `error` (no certificate) |
|
|
2351
2373
|
| `UsbCcStatus` | `usb_cc` | `orientation`, `advertised`, `advertised_current` (A), `cc1_voltage`, `cc2_voltage` (V) |
|
|
2352
2374
|
| `PullState` | `pull_state`, `set_pull` | `la`, `enabled`, `direction`, `ohms`, `available` |
|
|
2353
|
-
| `LaPinState` | `la_pins`, `configure_gpio`, `la_dir` | `la`, `function`, `gpio`, `level`, `pull`, `pull_ohms`, `pull_on`, `dir`, `warn`, `warnings`, `in_use` |
|
|
2375
|
+
| `LaPinState` | `la_pins`, `configure_gpio`, `la_dir` | `la`, `function`, `gpio`, `level`, `pull`, `pull_ohms`, `pull_on`, `pull_dirs`, `dir`, `warn`, `warnings`, `in_use` |
|
|
2354
2376
|
| `GpioPin` (class) | `gpio`, `gpio_pins`, `signal` | `name`, `configure()`, `set(level)`, `high()`, `low()`, `activate()`, `deactivate()`, `is_active()`, `read()`, `wait_for(level, *, timeout)`, `pulse(width, *, count=1)`, `state()`, `release()` |
|
|
2355
2377
|
| `ExtPin` (class) | `gpio`, `gpio_pins`, `signal` on an EXT pin | a `GpioPin` with `ext`, `pin`; `la` is `None`; `pulse()` raises `ExpansionError` |
|
|
2356
2378
|
| `FlashResult` | `flash` | `ok`, `returncode`, `stdout`, `stderr`, `target_unreachable`, `stalled`, `artifact` (the uploaded build, for `flash(build=...)`) |
|
|
@@ -34,7 +34,7 @@ No pin numbers: the SWD channels, the UART pair, the baud and the power rail com
|
|
|
34
34
|
**Contents:** [Install](#install) · [Quick start](#quick-start) ·
|
|
35
35
|
[API conventions](#api-conventions-and-stability) · [pytest plugin](#pytest-plugin) ·
|
|
36
36
|
[Power and reset](#power-reset-and-power-monitoring) · [Flashing](#flashing) · [UART](#uart) ·
|
|
37
|
-
[
|
|
37
|
+
[Pull resistors](#la-pull-resistors) · [Emulated sensors](#emulated-sensors) ·
|
|
38
38
|
[Analog paths](#analog-paths-dc-output-and-single-readings) · [Captures](#captures) ·
|
|
39
39
|
[DAC](#dac-generator-replay-and-faults) · [Control loop](#in-fabric-dac-control-loop) ·
|
|
40
40
|
[CAN](#can) · [AI Vision](#ai-vision-board) · [Cloud](#cloud-embeddedcidevice-name) · [Build reporting](#build-reporting) ·
|
|
@@ -579,10 +579,14 @@ print(wiring.describe()) # a pin table: bias resistor and
|
|
|
579
579
|
**Nothing is wired unless the profile says so** (schema version 2, SDK 3.0). A pin the profile does
|
|
580
580
|
not set is never driven, and a call that needs it says which one to pass: `bp.flash()` without
|
|
581
581
|
`swclk`/`swdio` in the profile raises `ValueError: swd_swclk was not given and the wiring profile has
|
|
582
|
-
no swd_swclk`. The
|
|
583
|
-
on LA11/LA12, 3.3 V, internal 5 V),
|
|
584
|
-
`Wiring.preset("embeddedci-
|
|
585
|
-
|
|
582
|
+
no swd_swclk`. The default pins, what profiles used to default to (UART RX on LA5 and TX on LA4, I2C
|
|
583
|
+
SDA on LA1 and SCL on LA2, SWD on LA11/LA12, 3.3 V, internal 5 V), are a preset:
|
|
584
|
+
`Wiring.preset("embeddedci-default")` (the old name `"embeddedci-reference"` still works). They are
|
|
585
|
+
not the wiring of any particular bench: load your board's own profile by name
|
|
586
|
+
(`BenchPod(conn, wiring_profile="process-node-stm32")`, `bp.load_wiring("process-node-stm32")`), as
|
|
587
|
+
the [process-node example](https://github.com/embeddedci-com/examples/tree/main/process-node-stm32)
|
|
588
|
+
does with its `wiring/process-node-stm32.json`. A version 1 file or dict (or one without a `version`
|
|
589
|
+
key) still means what it did: what it leaves out takes the default pins' values, and the profile you
|
|
586
590
|
get back is version 2 with them written out. Re-save such a file as version 2 with
|
|
587
591
|
`benchpod wiring upgrade wiring.json`.
|
|
588
592
|
|
|
@@ -637,7 +641,9 @@ cloud device's single profile on embeddedci.com, and raises over the LAN or USB.
|
|
|
637
641
|
**Power-on applies the profile.** `bp.power_on()` (or `bp.power_on(wiring_profile="k66")`) sets the
|
|
638
642
|
profile's I/O voltage when the pod has none or another one, sets its pull resistors, then switches
|
|
639
643
|
the profile's rail on and records on the pod which profile powered the board (`target_status`).
|
|
640
|
-
`Wiring.pulls`
|
|
644
|
+
`Wiring.pulls` says which pull resistors are on, as a map of channel to direction
|
|
645
|
+
(`{"pulls": {"1": "up", "2": "up", "8": "down"}}` in the JSON) or as a list of channels that pull
|
|
646
|
+
their own direction (`{"pulls": [1, 2]}`); `Wiring.pull_directions()` gives either as the map.
|
|
641
647
|
`power_on` switches exactly those on and the others off. They work at 3.3 V only, so at 1.8 V nothing
|
|
642
648
|
is sent, and a profile without `pulls` (`None`) leaves them as they are. It never changes the I/O
|
|
643
649
|
voltage under a board that is already powered: that raises, and `bp.set_la_voltage()` does it if you
|
|
@@ -1036,30 +1042,45 @@ with bp.open_uart(rx=PIN5, tx=PIN4, de=PIN9, baud=19200, parity="even",
|
|
|
1036
1042
|
`de` needs gateware v58 (`bp.supports("uart_de")`); older pods raise `UnsupportedFeatureError`
|
|
1037
1043
|
before anything is sent. The USB console has no DE.
|
|
1038
1044
|
|
|
1039
|
-
## LA
|
|
1045
|
+
## LA pull resistors
|
|
1040
1046
|
|
|
1041
|
-
|
|
1042
|
-
|
|
1047
|
+
You name the direction, `"up"`, `"down"` or `"off"`; the pod picks the resistor and reports its
|
|
1048
|
+
value. Which channels have one and which way each can pull depends on the board, and
|
|
1049
|
+
`PullState.supported` says it per channel. On today's boards each resistor pulls one way only:
|
|
1043
1050
|
|
|
1044
|
-
| Channels |
|
|
1051
|
+
| Channels | Pulls | Value |
|
|
1045
1052
|
|---|---|---|
|
|
1046
|
-
| LA1, LA2 |
|
|
1047
|
-
| LA3, LA4 |
|
|
1048
|
-
| LA5, LA6 |
|
|
1049
|
-
| LA7, LA8 |
|
|
1053
|
+
| LA1, LA2 | up | 4.7k |
|
|
1054
|
+
| LA3, LA4 | up | 2.2k |
|
|
1055
|
+
| LA5, LA6 | up | 10k |
|
|
1056
|
+
| LA7, LA8 | **down** | 10k |
|
|
1050
1057
|
| LA9–LA14 | none | — |
|
|
1051
1058
|
|
|
1059
|
+
The resistors are referenced to 3V3, so the pod won't engage one while the LA bank is at 1.8 V
|
|
1060
|
+
(`PullState.available` is false).
|
|
1061
|
+
|
|
1052
1062
|
```python
|
|
1053
1063
|
from embeddedci.benchpod import PIN1, PIN2, PIN7
|
|
1054
1064
|
|
|
1055
|
-
bp.
|
|
1056
|
-
bp.
|
|
1057
|
-
|
|
1058
|
-
print(bp.
|
|
1059
|
-
bp.
|
|
1060
|
-
bp.
|
|
1065
|
+
bp.set_pull(PIN1, "up") # PullState(la=1, enabled=True, direction='up', ohms='4.7k', supported=('up',), ...)
|
|
1066
|
+
bp.set_pull(PIN7, "down")
|
|
1067
|
+
bp.set_pull(PIN7, "off") # None is off too; "off" works on every channel
|
|
1068
|
+
print(bp.pull_state(PIN1).state) # 'up' ('up', 'down' or 'off')
|
|
1069
|
+
print(bp.enabled_pulls()) # [1]
|
|
1070
|
+
bp.enable_pullup(PIN1, PIN2) # shortcuts: set_pull(la, "up") ...
|
|
1071
|
+
bp.enable_pulldown(PIN7) # ... and set_pull(la, "down")
|
|
1072
|
+
bp.disable_pullup(PIN1, PIN2) # off, on a channel that pulls up
|
|
1061
1073
|
```
|
|
1062
1074
|
|
|
1075
|
+
A direction the channel can't pull raises `PullDirectionError` (a `FirmwareError` and a
|
|
1076
|
+
`ValueError`) with code `BP0024`, "LA7 supports pull-down only on this board", and `"up"` or `"down"`
|
|
1077
|
+
on a channel without a resistor raises it with `BP0023`. `.la`, `.want` and `.have` name the channel
|
|
1078
|
+
and the directions. `set_pull(la, True)` / `set_pull(la, False)` (or `enabled=`) still work but are
|
|
1079
|
+
deprecated: True pulls the channel's own direction.
|
|
1080
|
+
|
|
1081
|
+
Firmware before the `la_pull_dir` feature (`bp.supports("la_pull_dir")`) only takes on/off; the SDK
|
|
1082
|
+
then sends that and checks the direction itself, so the calls above work on every pod.
|
|
1083
|
+
|
|
1063
1084
|
An open-drain bus such as I2C must sit on LA1–LA6.
|
|
1064
1085
|
|
|
1065
1086
|
## GPIO on the LA pins
|
|
@@ -1106,7 +1127,7 @@ The other owners point to `bp.sensors.stop("<instance>")`, closing the session f
|
|
|
1106
1127
|
`bp.open_uart()` or `bp.open_spi()`, or waiting for a flash or step train to finish. The pod's own
|
|
1107
1128
|
text, with its raw protocol command, stays in `exc.firmware_message`.
|
|
1108
1129
|
|
|
1109
|
-
`bp.la_pins()` lists every channel's `LaPinState` (`function`, `gpio` mode, `level`, `pull`, `pull_on`),
|
|
1130
|
+
`bp.la_pins()` lists every channel's `LaPinState` (`function`, `gpio` mode, `level`, `pull`, `pull_on`, `pull_dirs`),
|
|
1110
1131
|
and `bp.configure_gpio(channels, mode)` is the same group claim as `gpio_pins()` returning those states.
|
|
1111
1132
|
Captures observe every channel whatever its function. GPIO channels stay GPIO — also across
|
|
1112
1133
|
disconnects — until released (the pytest `benchpod` fixture releases them at session start and end),
|
|
@@ -2243,6 +2264,7 @@ Invalid arguments raise `ValueError` before anything is sent. Everything else ra
|
|
|
2243
2264
|
| `DirectionConflictError` | a push-pull driver on a pin `la_dir` marks as a DUT output (a `FirmwareError`) | `la` |
|
|
2244
2265
|
| `I2CNackError` | an I2C device did not acknowledge (`I2CMaster.write`, `read`, `write_read`, `read_reg`, `write_reg`) | `addr`, `nack_at` |
|
|
2245
2266
|
| `PullConflictError` | an engaged bias resistor can't work with the channel's function (a `FirmwareError`) | `la` |
|
|
2267
|
+
| `PullDirectionError` | the channel can't pull that way (BP0024) or has no pull resistor (BP0023); also a `ValueError` | `la`, `want`, `have` |
|
|
2246
2268
|
| `TriggerTimeout` | a triggered capture's condition never happened (a `FirmwareError`) | `la`, `edge` |
|
|
2247
2269
|
| `CanTimeout` | `CanBus.expect` timed out | `frames` |
|
|
2248
2270
|
|
|
@@ -2309,7 +2331,7 @@ few built from other shapes); `to_dict()` goes the other way where a type is sen
|
|
|
2309
2331
|
| `LanTls` | `lan_tls`, `set_lan_tls_https_only`, `regenerate_lan_tls`, `set_lan_tls_cert` | `port`, `https_only`, `sessions`, `origin` (`generated`/`user`), `key`, `subject`, `san`, `not_after`, `sha256` (what clients pin), `error` (no certificate) |
|
|
2310
2332
|
| `UsbCcStatus` | `usb_cc` | `orientation`, `advertised`, `advertised_current` (A), `cc1_voltage`, `cc2_voltage` (V) |
|
|
2311
2333
|
| `PullState` | `pull_state`, `set_pull` | `la`, `enabled`, `direction`, `ohms`, `available` |
|
|
2312
|
-
| `LaPinState` | `la_pins`, `configure_gpio`, `la_dir` | `la`, `function`, `gpio`, `level`, `pull`, `pull_ohms`, `pull_on`, `dir`, `warn`, `warnings`, `in_use` |
|
|
2334
|
+
| `LaPinState` | `la_pins`, `configure_gpio`, `la_dir` | `la`, `function`, `gpio`, `level`, `pull`, `pull_ohms`, `pull_on`, `pull_dirs`, `dir`, `warn`, `warnings`, `in_use` |
|
|
2313
2335
|
| `GpioPin` (class) | `gpio`, `gpio_pins`, `signal` | `name`, `configure()`, `set(level)`, `high()`, `low()`, `activate()`, `deactivate()`, `is_active()`, `read()`, `wait_for(level, *, timeout)`, `pulse(width, *, count=1)`, `state()`, `release()` |
|
|
2314
2336
|
| `ExtPin` (class) | `gpio`, `gpio_pins`, `signal` on an EXT pin | a `GpioPin` with `ext`, `pin`; `la` is `None`; `pulse()` raises `ExpansionError` |
|
|
2315
2337
|
| `FlashResult` | `flash` | `ok`, `returncode`, `stdout`, `stderr`, `target_unreachable`, `stalled`, `artifact` (the uploaded build, for `flash(build=...)`) |
|
|
@@ -110,6 +110,7 @@ from .errors import (
|
|
|
110
110
|
PodLeasedError,
|
|
111
111
|
PodLockedError,
|
|
112
112
|
PullConflictError,
|
|
113
|
+
PullDirectionError,
|
|
113
114
|
TargetUnreachableError,
|
|
114
115
|
TlsPinMismatchError,
|
|
115
116
|
TransportError,
|
|
@@ -356,6 +357,7 @@ __all__ = [
|
|
|
356
357
|
"CanTimeout",
|
|
357
358
|
"PinConflictError",
|
|
358
359
|
"PullConflictError",
|
|
360
|
+
"PullDirectionError",
|
|
359
361
|
"DirectionConflictError",
|
|
360
362
|
"TriggerTimeout",
|
|
361
363
|
"UnsupportedFeatureError",
|
|
@@ -72,9 +72,10 @@ from .constants import (
|
|
|
72
72
|
LA_STEP_MAX_STEPS,
|
|
73
73
|
LA_STEP_MIN_DELAY_US,
|
|
74
74
|
LA_VOLTAGES,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
PULL_DIRECTIONS,
|
|
76
|
+
PULL_TABLE,
|
|
77
77
|
REPLAY_MAPPINGS,
|
|
78
|
+
PullDirection,
|
|
78
79
|
WAVESHAPES,
|
|
79
80
|
AdcGainSource,
|
|
80
81
|
AdcRange,
|
|
@@ -99,8 +100,8 @@ from .constants import (
|
|
|
99
100
|
coerce_pin,
|
|
100
101
|
)
|
|
101
102
|
from .connection import resolve_connection
|
|
102
|
-
from .errors import (BenchPodError, FirmwareError,
|
|
103
|
-
status_too_large)
|
|
103
|
+
from .errors import (BenchPodError, FirmwareError, PullDirectionError, UnsupportedFeatureError,
|
|
104
|
+
classify_firmware_error, firmware_error, status_too_large)
|
|
104
105
|
from .flash import FlashResult
|
|
105
106
|
from .gpio import LA_DIRS, ExtPin, GpioPin, LaPinState
|
|
106
107
|
from .lease import DEFAULT_LEASE_TTL, DEFAULT_LEASE_WAIT, DeviceLease
|
|
@@ -229,6 +230,16 @@ _EXT_REFUSALS = {
|
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
|
|
233
|
+
class _NoPull:
|
|
234
|
+
"""set_pull's "pull not given" (``enabled=`` is the older keyword); a stable repr for the docs."""
|
|
235
|
+
|
|
236
|
+
def __repr__(self) -> str:
|
|
237
|
+
return "<required>"
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
_NO_PULL = _NoPull()
|
|
241
|
+
|
|
242
|
+
|
|
232
243
|
def _one_or_many(las: List[int]) -> Any:
|
|
233
244
|
return las[0] if len(las) == 1 else las
|
|
234
245
|
|
|
@@ -1097,10 +1108,11 @@ class BenchPod:
|
|
|
1097
1108
|
volts = w.la_voltage if w.la_voltage is not None else self.get_la_voltage().voltage
|
|
1098
1109
|
if volts is None or abs(volts - 3.3) > 0.05:
|
|
1099
1110
|
return
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1111
|
+
wanted = w.pull_directions()
|
|
1112
|
+
for la in PULL_TABLE:
|
|
1113
|
+
self.set_pull(la, wanted.get(la, "off"))
|
|
1114
|
+
_log.info("power_on: pull resistors from the wiring profile: %s",
|
|
1115
|
+
", ".join(f"LA{la} {d}" for la, d in sorted(wanted.items())) or "none")
|
|
1104
1116
|
|
|
1105
1117
|
def _rail_on(self, rail: int) -> bool:
|
|
1106
1118
|
try:
|
|
@@ -1473,56 +1485,125 @@ class BenchPod:
|
|
|
1473
1485
|
timeout=timeout, connect_attempts=connect_attempts,
|
|
1474
1486
|
)
|
|
1475
1487
|
|
|
1476
|
-
# -- LA
|
|
1477
|
-
#
|
|
1478
|
-
#
|
|
1488
|
+
# -- LA pull resistors -------------------------------------------------------
|
|
1489
|
+
# The host names a direction ("up", "down", "off"); the pod picks the resistor and reports its
|
|
1490
|
+
# value. Which channels have one and which way each can pull depends on the board: on today's
|
|
1491
|
+
# boards LA1-LA6 pull up, LA7/LA8 down and LA9-LA14 have none (constants.PULL_TABLE). The
|
|
1492
|
+
# resistors are 3V3-referenced, so the pod refuses to engage one while the LA bank is at 1.8 V.
|
|
1493
|
+
|
|
1494
|
+
def _pull_dir_api(self) -> bool:
|
|
1495
|
+
"""The pod takes ``pull: up|down|off`` (feature ``la_pull_dir``); older firmware only
|
|
1496
|
+
``pullup: on|off``, on today's boards."""
|
|
1497
|
+
try:
|
|
1498
|
+
return self.supports("la_pull_dir")
|
|
1499
|
+
except BenchPodError:
|
|
1500
|
+
return False
|
|
1479
1501
|
|
|
1480
1502
|
@staticmethod
|
|
1481
|
-
def
|
|
1503
|
+
def _pull_want(la: int, pull: Union[str, bool, None]) -> str:
|
|
1504
|
+
"""``pull`` as "up" / "down" / "off". True (deprecated) is the channel's own direction."""
|
|
1505
|
+
if pull is None or pull is False:
|
|
1506
|
+
return "off"
|
|
1507
|
+
if pull is True:
|
|
1508
|
+
hw = PULL_TABLE.get(la)
|
|
1509
|
+
return hw.default if hw else "up"
|
|
1510
|
+
want = str(pull).strip().lower()
|
|
1511
|
+
if want == "none":
|
|
1512
|
+
want = "off"
|
|
1513
|
+
check_choice(want, PULL_DIRECTIONS, "pull")
|
|
1514
|
+
return want
|
|
1515
|
+
|
|
1516
|
+
@staticmethod
|
|
1517
|
+
def _pull_refusal(la: int, want: str, supported: Tuple[str, ...]) -> PullDirectionError:
|
|
1518
|
+
"""The pod's own refusal (BP0023 / BP0024), for what the SDK refuses before asking."""
|
|
1519
|
+
if not supported:
|
|
1520
|
+
return firmware_error(f"LA{la} has no pull resistor on this board", cmd="la",
|
|
1521
|
+
code="BP0023", values={"la": la}) # type: ignore[return-value]
|
|
1522
|
+
have = supported[0]
|
|
1523
|
+
return firmware_error(f"LA{la} supports pull-{have} only on this board", cmd="la",
|
|
1524
|
+
code="BP0024", values={"la": la, "want": want, "have": have}) # type: ignore[return-value]
|
|
1525
|
+
|
|
1526
|
+
def set_pull(self, la: Union[Pin, int], pull: Union[PullDirection, bool, None, object] = _NO_PULL, *,
|
|
1527
|
+
enabled: Optional[bool] = None) -> PullState:
|
|
1528
|
+
"""Pull LA ``la`` ``"up"``, ``"down"`` or ``"off"`` (``None`` is off too) and return its
|
|
1529
|
+
:class:`PullState`.
|
|
1530
|
+
|
|
1531
|
+
The pod picks the resistor; :attr:`PullState.ohms` says which. A direction the channel's
|
|
1532
|
+
resistor can't pull raises :class:`~embeddedci.benchpod.errors.PullDirectionError` (BP0024,
|
|
1533
|
+
"LA7 supports pull-down only on this board"), and ``"up"``/``"down"`` on a channel without
|
|
1534
|
+
one too (BP0023). ``"off"`` is fine on every channel.
|
|
1535
|
+
|
|
1536
|
+
``set_pull(la, True)`` / ``set_pull(la, False)`` (and ``enabled=``) still work
|
|
1537
|
+
(deprecated): True engages the channel's own direction (up on LA1-LA6, down on LA7/LA8),
|
|
1538
|
+
False is off.
|
|
1539
|
+
"""
|
|
1540
|
+
if pull is _NO_PULL:
|
|
1541
|
+
if enabled is None:
|
|
1542
|
+
raise TypeError('set_pull() needs pull: "up", "down" or "off"')
|
|
1543
|
+
pull = bool(enabled)
|
|
1482
1544
|
la_i = coerce_pin(la, "la")
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1545
|
+
want = self._pull_want(la_i, pull) # type: ignore[arg-type]
|
|
1546
|
+
if self._pull_dir_api():
|
|
1547
|
+
with _classified_errors():
|
|
1548
|
+
reply = self.command({"cmd": "la", "la": la_i, "pull": want})
|
|
1549
|
+
return PullState.from_reply(reply, la_i)
|
|
1550
|
+
# Older firmware: only pullup on/off, which engages the channel's one direction. Check the
|
|
1551
|
+
# direction here, so "up" never engages LA7's pull-down.
|
|
1552
|
+
hw = PULL_TABLE.get(la_i)
|
|
1553
|
+
if want != "off" and (not hw or want not in hw.dirs):
|
|
1554
|
+
raise self._pull_refusal(la_i, want, hw.dirs if hw else ())
|
|
1555
|
+
if not hw:
|
|
1556
|
+
return PullState.none(la_i)
|
|
1557
|
+
with _classified_errors():
|
|
1558
|
+
reply = self.command({"cmd": "la", "la": la_i, "pullup": "off" if want == "off" else "on"})
|
|
1495
1559
|
return PullState.from_reply(reply, la_i)
|
|
1496
1560
|
|
|
1497
1561
|
def pull_state(self, la: Union[Pin, int]) -> PullState:
|
|
1498
|
-
"""Read LA ``la``'s
|
|
1499
|
-
la_i =
|
|
1500
|
-
|
|
1562
|
+
"""Read LA ``la``'s pull resistor: engaged, direction, value, supported directions."""
|
|
1563
|
+
la_i = coerce_pin(la, "la")
|
|
1564
|
+
if la_i not in PULL_TABLE and not self._pull_dir_api():
|
|
1565
|
+
return PullState.none(la_i) # older firmware refuses the query on LA9-LA14
|
|
1566
|
+
with _classified_errors():
|
|
1567
|
+
return PullState.from_reply(self.command({"cmd": "la", "la": la_i}), la_i)
|
|
1501
1568
|
|
|
1502
1569
|
def enabled_pulls(self) -> List[int]:
|
|
1503
|
-
"""The LA channels whose
|
|
1570
|
+
"""The LA channels whose pull resistor is currently engaged (either direction)."""
|
|
1504
1571
|
mask = int(_dict(self.command({"cmd": "la"})).get("la_pullup_mask", 0) or 0)
|
|
1505
|
-
return [la for la in range(1,
|
|
1572
|
+
return [la for la in range(1, 15) if mask >> (la - 1) & 1]
|
|
1506
1573
|
|
|
1507
1574
|
def enable_pullup(self, *las: Union[Pin, int]) -> None:
|
|
1508
|
-
"""
|
|
1575
|
+
"""Pull LA channels up, e.g. an open-drain I2C bus's SDA/SCL (LA1-LA6 on today's boards).
|
|
1576
|
+
Same as ``set_pull(la, "up")``."""
|
|
1509
1577
|
for la in las:
|
|
1510
|
-
self.set_pull(
|
|
1578
|
+
self.set_pull(la, "up")
|
|
1511
1579
|
|
|
1512
1580
|
def disable_pullup(self, *las: Union[Pin, int]) -> None:
|
|
1513
|
-
"""Release
|
|
1581
|
+
"""Release a pull-up. Same as ``set_pull(la, "off")`` on a channel that pulls up."""
|
|
1514
1582
|
for la in las:
|
|
1515
|
-
self.
|
|
1583
|
+
self._release_pull(la, "up")
|
|
1516
1584
|
|
|
1517
1585
|
def enable_pulldown(self, *las: Union[Pin, int]) -> None:
|
|
1518
|
-
"""
|
|
1586
|
+
"""Pull LA channels down (LA7/LA8 on today's boards). Same as ``set_pull(la, "down")``."""
|
|
1519
1587
|
for la in las:
|
|
1520
|
-
self.set_pull(
|
|
1588
|
+
self.set_pull(la, "down")
|
|
1521
1589
|
|
|
1522
1590
|
def disable_pulldown(self, *las: Union[Pin, int]) -> None:
|
|
1523
|
-
"""Release
|
|
1591
|
+
"""Release a pull-down. Same as ``set_pull(la, "off")`` on a channel that pulls down."""
|
|
1524
1592
|
for la in las:
|
|
1525
|
-
self.
|
|
1593
|
+
self._release_pull(la, "down")
|
|
1594
|
+
|
|
1595
|
+
def _release_pull(self, la: Union[Pin, int], kind: str) -> None:
|
|
1596
|
+
"""Switch the pull off, refusing a channel that can't pull ``kind`` at all (so a typo
|
|
1597
|
+
like disable_pullup(7) is not silently a no-op)."""
|
|
1598
|
+
la_i = coerce_pin(la, "la")
|
|
1599
|
+
if self._pull_dir_api():
|
|
1600
|
+
supported = self.pull_state(la_i).supported
|
|
1601
|
+
else:
|
|
1602
|
+
hw = PULL_TABLE.get(la_i)
|
|
1603
|
+
supported = hw.dirs if hw else ()
|
|
1604
|
+
if kind not in supported:
|
|
1605
|
+
raise self._pull_refusal(la_i, kind, supported)
|
|
1606
|
+
self.set_pull(la_i, "off")
|
|
1526
1607
|
|
|
1527
1608
|
# -- emulated sensors ---------------------------------------------------------
|
|
1528
1609
|
|
|
@@ -18,7 +18,7 @@ Units, everywhere in the public API: **volts**, **seconds**, **hertz**.
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
from enum import Enum, IntEnum
|
|
21
|
-
from typing import Dict, Literal, Sequence, Tuple, Union, get_args
|
|
21
|
+
from typing import Dict, Literal, NamedTuple, Sequence, Tuple, Union, get_args
|
|
22
22
|
|
|
23
23
|
from .errors import BenchPodError
|
|
24
24
|
|
|
@@ -158,14 +158,36 @@ ADC_SOURCE_PATHS: Dict[str, str] = {"ext": "adc_ext", "cal1": "cal1", "cal2": "c
|
|
|
158
158
|
#: LA I/O-bank voltages the pod supports (volts). 1.8 V needs a rev3 pod.
|
|
159
159
|
LA_VOLTAGES: Tuple[float, ...] = (1.8, 3.3)
|
|
160
160
|
|
|
161
|
-
#:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
#: Pull directions a host asks for (``BenchPod.set_pull``). The pod picks the resistor value.
|
|
162
|
+
PullDirection = Literal["up", "down", "off"]
|
|
163
|
+
PULL_DIRECTIONS: Tuple[str, ...] = ("up", "down", "off")
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class PullHw(NamedTuple):
|
|
167
|
+
"""One LA channel's pull resistor on a board: the directions it can pull, the one
|
|
168
|
+
``set_pull(la, True)`` (and firmware's older ``pullup:on``) engages, and its value."""
|
|
169
|
+
|
|
170
|
+
dirs: Tuple[str, ...]
|
|
171
|
+
default: str
|
|
172
|
+
ohms: str
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
#: Pull resistors per LA channel on today's boards (every v3 board): LA1-LA6 pull UP, LA7/LA8
|
|
176
|
+
#: pull DOWN, LA9-LA14 have none. The firmware has the same table (``la_pins.c``) and reports it
|
|
177
|
+
#: per channel (``la_pins`` ``dirs``); the SDK only uses this one for firmware that does not
|
|
178
|
+
#: (before the ``la_pull_dir`` feature). A board revision with other resistors gets its own table.
|
|
179
|
+
PULL_TABLE_V3: Dict[int, PullHw] = {
|
|
180
|
+
1: PullHw(("up",), "up", "4.7k"), 2: PullHw(("up",), "up", "4.7k"),
|
|
181
|
+
3: PullHw(("up",), "up", "2.2k"), 4: PullHw(("up",), "up", "2.2k"),
|
|
182
|
+
5: PullHw(("up",), "up", "10k"), 6: PullHw(("up",), "up", "10k"),
|
|
183
|
+
7: PullHw(("down",), "down", "10k"), 8: PullHw(("down",), "down", "10k"),
|
|
166
184
|
}
|
|
167
|
-
|
|
168
|
-
|
|
185
|
+
PULL_TABLE: Dict[int, PullHw] = PULL_TABLE_V3
|
|
186
|
+
|
|
187
|
+
#: Derived from :data:`PULL_TABLE`, kept for existing callers.
|
|
188
|
+
PULL_OHMS: Dict[int, str] = {la: hw.ohms for la, hw in PULL_TABLE.items()}
|
|
189
|
+
PULLUP_CHANNELS: Tuple[int, ...] = tuple(la for la, hw in PULL_TABLE.items() if "up" in hw.dirs)
|
|
190
|
+
PULLDOWN_CHANNELS: Tuple[int, ...] = tuple(la for la, hw in PULL_TABLE.items() if "down" in hw.dirs)
|
|
169
191
|
|
|
170
192
|
# LA step trains (``la_step``, ``GpioPin.pulse``): the gateware counts steps and the half-period in
|
|
171
193
|
# 16-bit counters, so the pod refuses more steps or a longer half-period.
|