Analog Out & Trigger Functions
dev.io.analog_out - wire path i\a - generated from fwMenuAnalogOut.
set_analog_output
Set Analog Output. sets the voltage of an analog output 0 or 1. ch 2 and 3 are use for window comparator
Set Analog Output
Sets the voltage on an analog output channel.
Usage:
s
Arguments: channel Output channel number (0-3) 0, 1 : analog output voltages 2, 3 : window comparator thresholds (low, high) value Output voltage in volts (0.0 to 5.0)
Example: s 0 3.3 Set analog output 0 to 3.3 V s 2 1.0 Set window comparator low threshold to 1.0 V s 3 4.0 Set window comparator high threshold to 4.0 V
Wire command: i\a\s
| Arg | Wire type |
|---|---|
| channel | decS32 |
| value | float |
Returns: none (Ok/Err only)
dev.io.analog_out.set_analog_output(channel: int, value: float) -> Result
ow_status ow_io_analog_out_set_analog_output(ow_device* dev, int32_t channel, double value);
dev.io().analog_out().set_analog_output(channel: i32, value: f64) -> 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.analog_out.set_analog_output(channel, value) # check dev.ok
set_trigger_window
Set Trigger Window. Trigger will be 1 when TrigV is between V- and V+.
Set Trigger Window
Configures a window comparator on the Trig IN/VREF input (pin 4 of the FreeWili 2 20-pin connector). The comparator drives an internal digital signal that can be used as a trigger source for the Logic Analyzer and Logic Player.
Behavior
The digital trigger output is:
- High (1) when
valueLow ≤ TrigV ≤ valueHigh - Low (0) when
TrigVis outside the window
Arguments
| Name | Type | Units | Range |
|---|---|---|---|
valueLow | float | Volts | 0.0 – 5.0 |
valueHigh | float | Volts | 0.0 – 5.0 |
Constraints
valueLowmust be less thanvalueHigh.- If
valueLow >= valueHigh, the window is invalid and the trigger output will be stuck fixed (always high or always low) — no triggering will occur.
Returns
A basic status response indicating success or failure.
⚠️ Pin Sharing Warning
The Trig IN/VREF pin is shared with the CANFD special-function pins:
- Software CAN Rx
- CANFD Int
D
Wire command: i\a\t
| Arg | Wire type |
|---|---|
| value_low | float |
| value_high | float |
Returns: none (Ok/Err only)
dev.io.analog_out.set_trigger_window(value_low: float, value_high: float) -> Result
ow_status ow_io_analog_out_set_trigger_window(ow_device* dev, double value_low, double value_high);
dev.io().analog_out().set_trigger_window(value_low: f64, value_high: f64) -> 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.analog_out.set_trigger_window(value_low, value_high) # check dev.ok
set_enable_trigger
Enable Trigger. Enables the Trigger Input to CPU
Enable Trigger
Routes the window comparator output from the Trig IN/VREF pin (pin 4 of the FreeWili 2 20-pin connector) onto the CPU's internal GPIO40 trigger input.
Once enabled, the comparator signal configured by t (Set Trigger Window) becomes available to the Logic Analyzer and Logic Player as a trigger source.
Usage
e
No arguments.
Behavior
- Selects
analogtriggeras the input feature for GPIO40 via the I/O expander. - The digital state at GPIO40 will then reflect the window comparator:
- 1 when
valueLow ≤ TrigV ≤ valueHigh - 0 when
TrigVis outside the window
- 1 when
Prerequisites
- Set the comparator thresholds first with
t <valueLow> <valueHigh>. - Apply the analog signal to monitor on the
Trig IN/VREFpin.
Returns
A basic status response indicating success or failure.
⚠️ Pin Sharing Warning
GPIO40 and the Trig IN/VREF pin are shared with CANFD special-function pins (Software CAN Rx, CANFD Int). Enabling the trigger will override those features on this pin.
Wire command: i\a\e
Returns: none (Ok/Err only)
dev.io.analog_out.set_enable_trigger() -> Result
ow_status ow_io_analog_out_set_enable_trigger(ow_device* dev);
dev.io().analog_out().set_enable_trigger() -> 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.analog_out.set_enable_trigger() # check dev.ok
set_v_prog_vout
Set Programmable VOut. Sets the programmable VOut: enable then target voltage.
Set Programmable VOut
Controls the on-board programmable output supply (VOut) on the FreeWili 2. This rail can source up to 1.5 A at a software-selected voltage between 1.0 V and 5.5 V, and is also the source used by the g (Glitch Programmable VOut) command.
Usage
u <enable> [setVoltage]
Arguments
| Name | Type | Units | Range | Notes |
|---|---|---|---|---|
enable | int | — | 0 or 1 | 0 = disable VOut, 1 = enable VOut |
setVoltage | float | Volts | 1.0 – 5.5 | Only required (and used) when enable = 1 |
Behavior
u 0— Disables theVOutrail. No voltage is provided.setVoltageis ignored.u 1 <setVoltage>— Enables the rail (if not already enabled) and programs the supply tosetVoltagevolts.- If the rail was previously disabled, a brief settling delay is inserted and the target voltage is written twice to ensure the regulator latches in cleanly.
- If the rail was already enabled, the new voltage is applied immediately.
Examples
u 0 # turn VOut off
u 1 3.3 # enable VOut and set it to 3.3 V
u 1 5.0 # enable VOut and set it to 5.0 V
Returns
A basic status response indicating success or failure of the command.
Related Commands
g <nanoSeconds>— Briefly glitchesVOutlow (for fault-injection experiments).p(menu state) — Shows the currentVOutenable state and the most recently programmed voltage.
⚠️ Notes
- Make sure the load connected to
VOutis rated for the selected voltage before enabling. - Switching
VOuton or changing voltage can briefly perturb attached devices; power-cycle-sensitive targets should be designed accordingly.
Wire command: i\a\u
| Arg | Wire type |
|---|---|
| enable | decS32 |
| set_voltage | float |
Returns: none (Ok/Err only)
dev.io.analog_out.set_v_prog_vout(enable: int, set_voltage: float) -> Result
ow_status ow_io_analog_out_set_v_prog_vout(ow_device* dev, int32_t enable, double set_voltage);
dev.io().analog_out().set_v_prog_vout(enable: i32, set_voltage: f64) -> 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.analog_out.set_v_prog_vout(enable, set_voltage) # check dev.ok
set_glitch
Glitch Programmable VOut. Briefly glitches the programmable VOut for the given nanoseconds.
Glitch Programmable VOut
Triggers a brief voltage glitch on the on-board programmable VOut rail by activating the MOSFET crowbar that pulls the rail toward ground for approximately the requested number of nanoseconds. Intended for fault-injection / voltage-glitching experiments on a target powered from VOut.
Usage
g <nanoSeconds>
Arguments
| Name | Type | Units | Range |
|---|---|---|---|
nanoSeconds | int | nanoseconds | 10 – 2000 |
The pulse width is approximate, not exact. Actual glitch duration depends on MOSFET switching time, board parasitics, and the load on
VOut.
Behavior
- A single short low-side pulse is generated on the
VOutrail. - The rail returns to its previously programmed voltage after the pulse.
- No change is made to the
VOutenable state or programmed voltage setting.
Prerequisites
- Enable and program
VOutfirst withu 1 <setVoltage>(1.0 – 5.5 V). - Connect the target device to
VOut.
Examples
g 50 # ~50 ns glitch pulse on VOut
g 250 # ~250 ns glitch pulse on VOut
g 2000 # ~2 µs glitch pulse on VOut
Returns
A basic status response indicating whether the glitch command was accepted.
Related Commands
u <enable> [setVoltage]— Enable / set the programmableVOutvoltage.p(menu state) — Shows the currentVOutenable state and programmed voltage.
⚠️ Warnings
- Voltage glitching can reset, corrupt, or permanently damage the connected target. Only glitch devices you are willing to risk.
- The crowbar briefly shorts
VOutlow — ensure the load and any series/decoupling components can tolerate the transient. - Avoid long or repeated pulses near the upper end of the range, especially at higher
VOutvoltages and currents.
Wire command: i\a\g
| Arg | Wire type |
|---|---|
| nano_seconds | decS32 |
Returns: none (Ok/Err only)
dev.io.analog_out.set_glitch(nano_seconds: int) -> Result
ow_status ow_io_analog_out_set_glitch(ow_device* dev, int32_t nano_seconds);
dev.io().analog_out().set_glitch(nano_seconds: 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.analog_out.set_glitch(nano_seconds) # check dev.ok