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.
Files changed (192) hide show
  1. {embeddedci-3.0.2 → embeddedci-3.0.3}/CHANGELOG.md +23 -0
  2. {embeddedci-3.0.2 → embeddedci-3.0.3}/PKG-INFO +45 -23
  3. {embeddedci-3.0.2 → embeddedci-3.0.3}/README.md +44 -22
  4. {embeddedci-3.0.2 → embeddedci-3.0.3}/pyproject.toml +1 -1
  5. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/__init__.py +2 -0
  6. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/client.py +118 -37
  7. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/constants.py +30 -8
  8. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/error_catalog.json +132 -1
  9. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/errors.py +23 -3
  10. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/feature_map.json +20 -4
  11. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/gpio.py +11 -3
  12. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/header.py +4 -3
  13. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/state.py +38 -12
  14. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/wiring.py +92 -32
  15. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/api_surface.json +12 -3
  16. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_gpio.py +41 -0
  17. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_bmp280_hil.py +3 -2
  18. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_client_v2.py +4 -3
  19. embeddedci-3.0.3/tests/test_pull_direction.py +196 -0
  20. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_refusal_errors.py +1 -1
  21. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_wiring.py +6 -4
  22. {embeddedci-3.0.2 → embeddedci-3.0.3}/.gitignore +0 -0
  23. {embeddedci-3.0.2 → embeddedci-3.0.3}/LICENSE +0 -0
  24. {embeddedci-3.0.2 → embeddedci-3.0.3}/docs/aivision.md +0 -0
  25. {embeddedci-3.0.2 → embeddedci-3.0.3}/docs/event-uart-design.md +0 -0
  26. {embeddedci-3.0.2 → embeddedci-3.0.3}/examples/README.md +0 -0
  27. {embeddedci-3.0.2 → embeddedci-3.0.3}/examples/test_bmp280.py +0 -0
  28. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/__init__.py +0 -0
  29. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/_http.py +0 -0
  30. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/__init__.py +0 -0
  31. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/client.py +0 -0
  32. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/cloud.py +0 -0
  33. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/discovery.py +0 -0
  34. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/errors.py +0 -0
  35. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/pytest_plugin.py +0 -0
  36. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/aivision/results.py +0 -0
  37. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/can.py +0 -0
  38. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/capabilities.py +0 -0
  39. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/capture.py +0 -0
  40. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/ci.py +0 -0
  41. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cli_config.py +0 -0
  42. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cli_login.py +0 -0
  43. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/cloud_auth.py +0 -0
  44. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/connection.py +0 -0
  45. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/control_loop.py +0 -0
  46. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/decode.py +0 -0
  47. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/discovery.py +0 -0
  48. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/dsp.py +0 -0
  49. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/esp.py +0 -0
  50. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/expansion.py +0 -0
  51. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/feature_map.py +0 -0
  52. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/flash.py +0 -0
  53. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/i2c.py +0 -0
  54. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/i2c_master.py +0 -0
  55. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/lease.py +0 -0
  56. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/lowlevel.py +0 -0
  57. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/main.c +0 -0
  58. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/motor_emulator.py +0 -0
  59. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/power.py +0 -0
  60. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/protocol.py +0 -0
  61. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/pytest_plugin.py +0 -0
  62. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/replay.py +0 -0
  63. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/results.py +0 -0
  64. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/__init__.py +0 -0
  65. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/README.md +0 -0
  66. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/docs/format.md +0 -0
  67. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/library.json +0 -0
  68. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/analog/ntc_10k_divider.yaml +0 -0
  69. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/analog/pressure_4_20ma.yaml +0 -0
  70. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/bme280.yaml +0 -0
  71. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/bmp280.yaml +0 -0
  72. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/ina219.yaml +0 -0
  73. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/mpu6050.yaml +0 -0
  74. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/scd4x.yaml +0 -0
  75. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/sht3x.yaml +0 -0
  76. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/sht4x.yaml +0 -0
  77. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/i2c/tmp117.yaml +0 -0
  78. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/spi/lis3dh.yaml +0 -0
  79. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/spi/lis3dh_fifo.yaml +0 -0
  80. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/uart/gps_nmea.yaml +0 -0
  81. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/sensors/uart/mhz19b.yaml +0 -0
  82. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/gps_drive.yaml +0 -0
  83. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/pressure_drop.yaml +0 -0
  84. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/bundled/stimuli/temperature_ramp_fault.yaml +0 -0
  85. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/definition.py +0 -0
  86. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/emulation.py +0 -0
  87. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/library.py +0 -0
  88. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/sensors/yaml12.py +0 -0
  89. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/server_api.py +0 -0
  90. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/spi.py +0 -0
  91. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/__init__.py +0 -0
  92. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/base.py +0 -0
  93. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/cloud.py +0 -0
  94. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/serial.py +0 -0
  95. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/tcp.py +0 -0
  96. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/tls.py +0 -0
  97. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/transport/usblink.py +0 -0
  98. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/uart.py +0 -0
  99. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/benchpod/waveforms.py +0 -0
  100. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/py.typed +0 -0
  101. {embeddedci-3.0.2 → embeddedci-3.0.3}/src/embeddedci/upload_build.py +0 -0
  102. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/conftest.py +0 -0
  103. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/README.md +0 -0
  104. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/conftest.py +0 -0
  105. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/e2e_bench.py +0 -0
  106. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/e2e_helpers.py +0 -0
  107. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_bench_profile.py +0 -0
  108. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_cloud.py +0 -0
  109. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_digital.py +0 -0
  110. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_dut.py +0 -0
  111. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_la13_14.py +0 -0
  112. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_pod.py +0 -0
  113. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_rev3.py +0 -0
  114. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_spi.py +0 -0
  115. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/e2e/test_e2e_usb.py +0 -0
  116. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_can_ecu_demo.py +0 -0
  117. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_can_loopback_hil.py +0 -0
  118. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/examples/test_smoke.py +0 -0
  119. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_fft_hw.py +0 -0
  120. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_oversample.py +0 -0
  121. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_adc_range.py +0 -0
  122. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision.py +0 -0
  123. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision_cloud.py +0 -0
  124. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_aivision_live.py +0 -0
  125. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_api_surface.py +0 -0
  126. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_can.py +0 -0
  127. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capabilities.py +0 -0
  128. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capabilities_scope.py +0 -0
  129. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capture.py +0 -0
  130. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_capture_replay_hw.py +0 -0
  131. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_ci.py +0 -0
  132. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_cloud.py +0 -0
  133. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_connection.py +0 -0
  134. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_control_loop.py +0 -0
  135. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_control_loop_hw.py +0 -0
  136. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_current_out_waveforms.py +0 -0
  137. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_limits_fixture.py +0 -0
  138. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_path_default.py +0 -0
  139. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dac_path_ranges.py +0 -0
  140. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_decode.py +0 -0
  141. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_decode_parity.py +0 -0
  142. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_docs_coverage.py +0 -0
  143. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_dsp.py +0 -0
  144. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_esp_flash.py +0 -0
  145. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_expansion.py +0 -0
  146. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_feature_map.py +0 -0
  147. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_flash_bridge.py +0 -0
  148. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_flash_build.py +0 -0
  149. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_generate16.py +0 -0
  150. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_gpio.py +0 -0
  151. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_header.py +0 -0
  152. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_http_redirect_auth.py +0 -0
  153. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_decode.py +0 -0
  154. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_master.py +0 -0
  155. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_parity.py +0 -0
  156. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_i2c_timed.py +0 -0
  157. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_image_switching.py +0 -0
  158. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_integration.py +0 -0
  159. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_la_voltage_fixture.py +0 -0
  160. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_lan_tls.py +0 -0
  161. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_lease.py +0 -0
  162. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_module.py +0 -0
  163. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_motor_emulator.py +0 -0
  164. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_one_source.py +0 -0
  165. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_pin_directions.py +0 -0
  166. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_pins_bias.py +0 -0
  167. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_protocol.py +0 -0
  168. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_replay.py +0 -0
  169. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_sensor_library.py +0 -0
  170. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_sensors.py +0 -0
  171. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_serial_autodetect.py +0 -0
  172. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_serial_text_console.py +0 -0
  173. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_spi.py +0 -0
  174. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_status_diag.py +0 -0
  175. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_tcp_transport.py +0 -0
  176. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_timed_power.py +0 -0
  177. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_timing.py +0 -0
  178. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_transport_failures.py +0 -0
  179. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_trigger_power.py +0 -0
  180. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_capture.py +0 -0
  181. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_de.py +0 -0
  182. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_frame.py +0 -0
  183. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_half_duplex.py +0 -0
  184. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_uart_session.py +0 -0
  185. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_unsupported_feature.py +0 -0
  186. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_upload_build.py +0 -0
  187. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_usb_net.py +0 -0
  188. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_waveforms.py +0 -0
  189. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/test_wiring_profiles.py +0 -0
  190. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/testdata/i2c_decode_vectors.json +0 -0
  191. {embeddedci-3.0.2 → embeddedci-3.0.3}/tests/testdata/spi_decode_vectors.json +0 -0
  192. {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.2
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
- [Bias resistors](#la-bias-resistors) · [Emulated sensors](#emulated-sensors) ·
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 EmbeddedCI reference bench (a NUCLEO-F446RE: UART on LA5/LA4, I2C on LA1/LA2, SWD
624
- on LA11/LA12, 3.3 V, internal 5 V), what profiles used to default to, is a preset:
625
- `Wiring.preset("embeddedci-reference")`. A version 1 file or dict (or one without a `version` key)
626
- still means what it did: what it leaves out takes the reference bench's values, and the profile you
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` lists the LA channels whose pull resistor is on (`{"pulls": [1, 2]}` in the JSON):
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 bias resistors
1086
+ ## LA pull resistors
1081
1087
 
1082
- Eight LA channels carry a fixed, switchable bias resistor. They are referenced to 3V3, so the pod
1083
- won't engage one while the LA bank is at 1.8 V (`PullState.available` is false).
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 | Resistor | Value |
1092
+ | Channels | Pulls | Value |
1086
1093
  |---|---|---|
1087
- | LA1, LA2 | pull-up | 4.7k |
1088
- | LA3, LA4 | pull-up | 2.2k |
1089
- | LA5, LA6 | pull-up | 10k |
1090
- | LA7, LA8 | pull-**down** | 10k |
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.enable_pullup(PIN1, PIN2) # LA1-LA6 only: ValueError on LA7/LA8
1097
- bp.enable_pulldown(PIN7) # LA7/LA8 only
1098
- print(bp.pull_state(PIN1)) # PullState(la=1, enabled=True, direction='up', ohms='4.7k', available=True)
1099
- print(bp.enabled_pulls()) # [1, 2, 7]
1100
- bp.set_pull(PIN7, False) # either direction
1101
- bp.disable_pullup(PIN1, PIN2)
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
- [Bias resistors](#la-bias-resistors) · [Emulated sensors](#emulated-sensors) ·
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 EmbeddedCI reference bench (a NUCLEO-F446RE: UART on LA5/LA4, I2C on LA1/LA2, SWD
583
- on LA11/LA12, 3.3 V, internal 5 V), what profiles used to default to, is a preset:
584
- `Wiring.preset("embeddedci-reference")`. A version 1 file or dict (or one without a `version` key)
585
- still means what it did: what it leaves out takes the reference bench's values, and the profile you
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` lists the LA channels whose pull resistor is on (`{"pulls": [1, 2]}` in the JSON):
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 bias resistors
1045
+ ## LA pull resistors
1040
1046
 
1041
- Eight LA channels carry a fixed, switchable bias resistor. They are referenced to 3V3, so the pod
1042
- won't engage one while the LA bank is at 1.8 V (`PullState.available` is false).
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 | Resistor | Value |
1051
+ | Channels | Pulls | Value |
1045
1052
  |---|---|---|
1046
- | LA1, LA2 | pull-up | 4.7k |
1047
- | LA3, LA4 | pull-up | 2.2k |
1048
- | LA5, LA6 | pull-up | 10k |
1049
- | LA7, LA8 | pull-**down** | 10k |
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.enable_pullup(PIN1, PIN2) # LA1-LA6 only: ValueError on LA7/LA8
1056
- bp.enable_pulldown(PIN7) # LA7/LA8 only
1057
- print(bp.pull_state(PIN1)) # PullState(la=1, enabled=True, direction='up', ohms='4.7k', available=True)
1058
- print(bp.enabled_pulls()) # [1, 2, 7]
1059
- bp.set_pull(PIN7, False) # either direction
1060
- bp.disable_pullup(PIN1, PIN2)
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=...)`) |
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "embeddedci"
7
- version = "3.0.2"
7
+ version = "3.0.3"
8
8
  description = "BenchPod SDK and pytest plugin for EmbeddedCI hardware-in-the-loop testing"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -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
- PULLDOWN_CHANNELS,
76
- PULLUP_CHANNELS,
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, UnsupportedFeatureError, classify_firmware_error,
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
- for la in PULLUP_CHANNELS + PULLDOWN_CHANNELS:
1101
- self.set_pull(la, la in w.pulls)
1102
- _log.info("power_on: pull resistors on LA%s from the wiring profile",
1103
- ", LA".join(str(x) for x in w.pulls) if w.pulls else " none")
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 bias resistors (LA1-8) ------------------------------------------
1477
- # LA1-LA6 carry a pull-UP, LA7/LA8 a pull-DOWN (see constants.PULL_OHMS). The resistors are
1478
- # 3V3-referenced, so the pod refuses to engage one while the LA bank is at 1.8 V.
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 _bias_channel(la: Union[Pin, int], allowed: Sequence[int], kind: str) -> int:
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
- if la_i not in allowed:
1484
- if la_i in PULLDOWN_CHANNELS and kind == "pull-up":
1485
- raise ValueError(f"LA{la_i} has a pull-DOWN, not a pull-up; use enable_pulldown")
1486
- if la_i in PULLUP_CHANNELS and kind == "pull-down":
1487
- raise ValueError(f"LA{la_i} has a pull-UP, not a pull-down; use enable_pullup")
1488
- raise ValueError(f"LA{la_i} has no {kind} (bias resistors exist on LA1-LA8 only)")
1489
- return la_i
1490
-
1491
- def set_pull(self, la: Union[Pin, int], enabled: bool) -> PullState:
1492
- """Engage or release LA ``la``'s fixed bias resistor, whichever way it pulls (LA1-LA8)."""
1493
- la_i = self._bias_channel(la, PULLUP_CHANNELS + PULLDOWN_CHANNELS, "bias resistor")
1494
- reply = self.command({"cmd": "la", "la": la_i, "pullup": "on" if enabled else "off"})
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 bias resistor: engaged, direction, value (LA1-LA8)."""
1499
- la_i = self._bias_channel(la, PULLUP_CHANNELS + PULLDOWN_CHANNELS, "bias resistor")
1500
- return PullState.from_reply(self.command({"cmd": "la", "la": la_i}), la_i)
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 bias resistor is currently engaged."""
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, 9) if mask >> (la - 1) & 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
- """Engage the pull-up on LA channels from LA1-LA6 — e.g. an open-drain I2C bus's SDA/SCL."""
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(self._bias_channel(la, PULLUP_CHANNELS, "pull-up"), True)
1578
+ self.set_pull(la, "up")
1511
1579
 
1512
1580
  def disable_pullup(self, *las: Union[Pin, int]) -> None:
1513
- """Release the pull-up on LA channels from LA1-LA6."""
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.set_pull(self._bias_channel(la, PULLUP_CHANNELS, "pull-up"), False)
1583
+ self._release_pull(la, "up")
1516
1584
 
1517
1585
  def enable_pulldown(self, *las: Union[Pin, int]) -> None:
1518
- """Engage the pull-down on LA7 and/or LA8."""
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(self._bias_channel(la, PULLDOWN_CHANNELS, "pull-down"), True)
1588
+ self.set_pull(la, "down")
1521
1589
 
1522
1590
  def disable_pulldown(self, *las: Union[Pin, int]) -> None:
1523
- """Release the pull-down on LA7 and/or LA8."""
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.set_pull(self._bias_channel(la, PULLDOWN_CHANNELS, "pull-down"), False)
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
- #: Fixed bias network per LA channel (LA1..LA8). LA1-LA6 pull UP to +3V3, LA7/LA8 pull
162
- #: DOWN; LA9-LA14 have none. Source of truth: firmware ``i2c_bus.c``.
163
- PULL_OHMS: Dict[int, str] = {
164
- 1: "4.7k", 2: "4.7k", 3: "2.2k", 4: "2.2k",
165
- 5: "10k", 6: "10k", 7: "10k", 8: "10k",
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
- PULLUP_CHANNELS: Tuple[int, ...] = (1, 2, 3, 4, 5, 6)
168
- PULLDOWN_CHANNELS: Tuple[int, ...] = (7, 8)
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.