Logic Analyzer Functions
dev.io.logic_analyzer - wire path i\b - generated from fwMenuLogicAnalyzer.
setup_logic_analyzer
configure. Configures the logic analyzer capture.
Configure Logic Analyzer
Configures a digital logic capture on a contiguous range of GPIO pins, with an optional edge trigger and auto-rearm.
Arguments
| # | Name | Description |
|---|---|---|
| 1 | sampleRateNs | Sample period in nanoseconds (time between samples). Smaller = faster. |
| 2 | sampleCount | Total number of samples to capture per run. |
| 3 | pinStart | First GPIO pin in the capture range (inclusive). |
| 4 | pinStop | Last GPIO pin in the capture range (inclusive). Bits per sample = pinStop - pinStart + 1. |
| 5 | triggerPin | GPIO pin used as the trigger source. |
| 6 | triggerType | Trigger mode (see below). |
| 7 | rearm | 0 = single-shot, 1 = automatically rearm after each capture. |
Trigger Types
0— Falling edge ontriggerPin1— Rising edge ontriggerPin2— None (one-shot, fires immediately onstart)3— Continuous (free-running capture)
Returns
success—trueif the configuration was accepted,falseotherwise.
Example
Capture 4096 samples on GPIO 0–7 at 1 µs/sample, triggering on a rising edge of GPIO 2, with auto-rearm enabled:
c 1000 4096 0 7 2 1 1
Notes
- Issue
s(start) after configuring to begin capture, ande(stop) to halt. - For analog capture, configure separately with
a.
Wire command: i\b\c
| Arg | Wire type |
|---|---|
| sample_rate_ns | decS32 |
| sample_count | decS32 |
| pin_start | decS32 |
| pin_stop | decS32 |
| trigger_pin | decS32 |
| trigger_type | decS32 |
| rearm | decS32 |
Returns: none (Ok/Err only)
dev.io.logic_analyzer.setup_logic_analyzer(sample_rate_ns: int, sample_count: int, pin_start: int, pin_stop: int, trigger_pin: int, trigger_type: int, rearm: int) -> Result
ow_status ow_io_logic_analyzer_setup_logic_analyzer(ow_device* dev, int32_t sample_rate_ns, int32_t sample_count, int32_t pin_start, int32_t pin_stop, int32_t trigger_pin, int32_t trigger_type, int32_t rearm);
dev.io().logic_analyzer().setup_logic_analyzer(sample_rate_ns: i32, sample_count: i32, pin_start: i32, pin_stop: i32, trigger_pin: i32, trigger_type: i32, rearm: i32) -> Result<(), OwError>
The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).
dev.io.logic_analyzer.setup_logic_analyzer(sample_rate_ns, sample_count, pin_start, pin_stop, trigger_pin, trigger_type, rearm) # check dev.ok
setup_analog
configure analog. Configures the analog capture inputs.
Wire command: i\b\a
| Arg | Wire type |
|---|---|
| analog_mask | decS32 |
| analog_rate_ns | decS32 |
| analog_res | decS32 |
Returns: none (Ok/Err only)
dev.io.logic_analyzer.setup_analog(analog_mask: int, analog_rate_ns: int, analog_res: int) -> Result
ow_status ow_io_logic_analyzer_setup_analog(ow_device* dev, int32_t analog_mask, int32_t analog_rate_ns, int32_t analog_res);
dev.io().logic_analyzer().setup_analog(analog_mask: i32, analog_rate_ns: i32, analog_res: i32) -> Result<(), OwError>
The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).
dev.io.logic_analyzer.setup_analog(analog_mask, analog_rate_ns, analog_res) # check dev.ok
start
start. Starts logic analyzer capture.
Wire command: i\b\s
Returns: none (Ok/Err only)
dev.io.logic_analyzer.start() -> Result
ow_status ow_io_logic_analyzer_start(ow_device* dev);
dev.io().logic_analyzer().start() -> Result<(), OwError>
The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).
dev.io.logic_analyzer.start() # check dev.ok
stop
stop. Stops logic analyzer capture.
Wire command: i\b\e
Returns: none (Ok/Err only)
dev.io.logic_analyzer.stop() -> Result
ow_status ow_io_logic_analyzer_stop(ow_device* dev);
dev.io().logic_analyzer().stop() -> Result<(), OwError>
The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).
dev.io.logic_analyzer.stop() # check dev.ok
trigger
trigger. Manually triggers the logic analyzer.
Wire command: i\b\t
| Arg | Wire type |
|---|---|
| trigger_type | decS32 |
Returns: none (Ok/Err only)
dev.io.logic_analyzer.trigger(trigger_type: int) -> Result
ow_status ow_io_logic_analyzer_trigger(ow_device* dev, int32_t trigger_type);
dev.io().logic_analyzer().trigger(trigger_type: i32) -> Result<(), OwError>
The C and Rust signatures above are also the WASM guest signatures - the device API surface is identical; only the transport differs (ow_open_wasm(&dev) in C, OneWili::open() in Rust).
dev.io.logic_analyzer.trigger(trigger_type) # check dev.ok