API quick overview
Every call the AT1000 API offers, on one page. Use it to find the name you need, then follow the link for parameters, ranges and worked examples.
The shape of a script​
Every program follows the same four steps.
- NodeJS
- Python
- Rust
import { AT1000 } from '@ikalogic/at1000';
const devices = await AT1000.findDevices(); // 1. find
const tester = await AT1000.open(devices[0]); // 2. open, taking exclusive access
await tester.reset(); // 3. start from a known state
await tester.gpio.digital(0).write(true); // 4. do the work
from ikalogic_at1000 import AT1000
devices = AT1000.find_devices() # 1. find
tester = AT1000.open(devices[0]) # 2. open, taking exclusive access
tester.reset() # 3. start from a known state
tester.gpio.digital(0).write(True) # 4. do the work
use ikalogic_at1000::At1000;
use std::time::Duration;
let devices = At1000::find_devices(Duration::from_millis(500))?; // 1. find
let tester = At1000::open(&devices[0], None)?; // 2. open, taking exclusive access
tester.reset()?; // 3. start from a known state
tester.gpio.digital(0)?.write(true)?; // 4. do the work
Static constructors differ between languages, instance methods mostly do not. JavaScript uses
AT1000.findDevices(), while Python and Rust use AT1000.find_devices() and
At1000::find_devices() — but every method on an opened device is snake_case in all three,
including in JavaScript: read_current(), start_rx(), configure_output(). JavaScript calls
are async; Python and Rust calls are synchronous. Where a Rust call differs, the tables below
give the Rust form.
Finding and opening a device​
| Call | What it does |
|---|---|
AT1000.findDevices() / find_devices() | Discover devices on the network, returns host strings (Vec<At1000Device> in Rust) |
AT1000.findLocalDevice() / find_local_device() | Resolve this device's own address when running on it |
AT1000.isStandalone() / is_standalone() | True when the script runs on the device itself |
AT1000.open(host) / At1000::open(&device, None) (Rust) | Open a device and take exclusive access |
AT1000.open(host, { readonly: true }) / At1000::open(&device, OpenOptions { readonly: true, ..Default::default() }) (Rust) | Open read-only, for monitoring a device someone else is driving |
tester.reset() | Reset every subsystem to its default state |
tester.info | Model, serial number, firmware version, capabilities |
See Find and connect to AT1000 and Device access control.
tester.gpio — 32 analog / digital I/Os​
| Call | What it does |
|---|---|
gpio.digital(io) | Pick a pin for digital use, io 0-31 |
gpio.analog(io) | Pick a pin for analog use, io 0-31 |
gpio.pwm(io) | Pick a pin for PWM: io 17 or 21 measure, io 18 or 22 generate |
gpio.hold() / gpio.release() | Buffer writes, then apply them all on one edge |
gpio.read_config(io) / gpio.read_sync() | Read back a pin's configuration, or the sync state. Rust reads the configuration from the pin: gpio.digital(io)?.read_config() |
gpio.reset() | All pins back to analog input, PWM stopped, sync released |
DigitalIO configure_input({vil, vih}) | Input, with your own thresholds |
configure_output({value, vol, voh, vil, vih}) | Output, with your own levels |
configure_open_drain({value, vil, vih}) | Open drain, for I2C-like lines |
read() / write(value) | Read or drive the pin |
AnalogIO configure_input() / configure_output(v) | Analog in, or analog out at a starting voltage |
read() / write(v) | Measure a voltage, or set one |
PwmIO configure_input({vcc}) / configure_output({frequency, vcc, duration}) | Measure a PWM signal, or generate a square wave. Rust passes PwmInputConfig / PwmOutputConfig by value |
measure({timeout}) / read_config() / disable() | Capture frequency and duty cycle, read the PWM role back, or stop |
See Digital I/O, Analog I/O, PWM measurement and generation, Output synchronization and the GPIO API reference.
tester.power — supply, USB ports and precision current​
| Call | What it does |
|---|---|
power.dut(0) | The programmable supply, 1.6-13 V or 24 V |
power.usb(0..1) | A USB port's switched power |
power.relay_0() | The precision current path on relay 0 |
Dut enable(v) / disable() / configure({enabled, target_voltage}) | Turn it on at a voltage, or off. Rust passes DutConfiguration by value, and set_target_voltage(v) changes the voltage alone |
read() / read_voltage() / read_current() | Full state, or just one measurement |
Usb enable() / disable() / configure({enabled}) | Power cycle a port. Rust passes UsbConfiguration by value |
read() / read_voltage() / read_current() | What the attached device is drawing |
RelayPower read() / read_current() | Bidirectional current, down to one microamp |
See DUT power supply, USB power supply, Precision current measurement and the Power API reference.
tester.relays — 8 dry contacts​
| Call | What it does |
|---|---|
relays.relay(0..7) | Pick one contact |
relays.read() / relays.open() / relays.close() | All eight at once |
relays.reset() | All open |
Relay open() / close() / read() | Drive or read one contact |
is_open() / is_closed() | The same state as a boolean. Rust: relay.read()?.is_open() |
See Relay and dry contacts control.
tester.com — communication interfaces​
Every bus is reached the same way, and they share pins, so check pin alternate functions before combining them.
| Bus | Access | Calls |
|---|---|---|
| I2C | com.i2c(0..1) | configure enable disable tx(transaction) rx(transaction) |
| SPI | com.spi(0..1) | configure enable disable trx(data) |
| UART | com.uart(0..1) | configure enable disable tx start_rx rx stop_rx |
| CAN | com.can(0) | configure enable disable tx(frame) start_rx rx stop_rx |
| RS232 | com.rs232(0) | configure enable disable tx start_rx rx stop_rx |
| RS485 | com.rs485(0..1) | configure enable disable tx start_rx rx stop_rx |
com.usb(id).state() reports what is attached to a USB port, and com.reset() disables
every bus interface. PWM is not affected: gpio.reset() stops it.
The serial buses and CAN buffer nothing until you call start_rx(). rx() then returns
whatever arrived since the last call.
tester.hmi — screen, knob and speaker​
| Call | What it does |
|---|---|
hmi.prompt(request) | Ask the operator a question. See operator prompts. |
hmi.screen().print(text) | Show text, replacing what was there |
hmi.screen().colors({text, progress, background}) | Set the text, progress bar and background colors |
hmi.screen().progress(0..100) | Progress bar, 0 hides it. Rust: 0 shows an empty bar, clear_progress() hides it |
hmi.screen().clear() / clear_text() | Clear everything, or just the text |
hmi.audio().play({sound_id, volume}) | success, warning, failure, notification_1, notification_2 or imperial_march, volume 0-100. Rust takes a Sound: play(Sound::Success, 80.0) |
hmi.knob().wait_event(timeout_ms) | Block until the knob is turned or pressed. Rust takes a Duration, or None to wait indefinitely |
hmi.knob().is_button_held() | Current button state. Rust: knob().read_event()?.button_held |
See HMI: screen, button and sound.
tester.sequence() — many steps in one request​
| Call | What it does |
|---|---|
tester.sequence() | Start a command sequence: steps the device runs back to back, in one request |
Sequence gpio.read / gpio.write / gpio.wait_level / gpio.wait_voltage | Read or drive pins, or wait for a level or a voltage band |
gpio.configure / gpio.reset / gpio.hold / gpio.release | Set up pins, or hold several writes and apply them all at once |
gpio.pwm.output / gpio.pwm.input / gpio.pwm.measure / gpio.pwm.disable | Generate or measure a PWM signal |
relays.open / relays.close / relays.reset | Switch relays |
power.dut.* / power.usb.* / power.relay.* / power.reset | Switch the supplies, read or wait for a voltage or a current |
hmi.screen.* / hmi.audio.play / hmi.reset | Write to the screen, or play a sound |
com.usb.wait | Wait for a USB device to connect or disconnect |
delay(s) | Wait a fixed time. Rust's delay takes a Duration |
as(name) (JS) / as_(name) (Python) / named(name) (Rust) | Name the preceding step so its result can be looked up in the report |
run({timeout}) | Run every step and return one report |
In Rust each group is a method: tester.sequence().gpio().pwm().output(...). See
Command sequences and the
Sequence API reference.
tester.events — react instead of polling​
| Call | What it does |
|---|---|
events.connect() | Open the event stream |
events.on(type, cb) (JS) / events.subscribe(type, cb) (Python) | Listen to one event type, or * for all; returns an unsubscribe |
events.connected | Whether the stream is up |
events.close() | Shut the stream down |
events.listen([EventKind::RelaysState]) / events.listen_all() (Rust) | Open an EventStream iterator over some event types, or all of them. stream.next_timeout(Duration) waits for one event, stream.stop_handle().close() stops it. Rust has no connect(), connected or close() |
Common event types: gpio.state gpio.config relays.state relays.states power.dut
power.usb com.can_rx com.uart_rx com.rs232_rx com.rs485_rx hmi.knob
hmi.prompt session.state. This list is not exhaustive; see
Real-time events for the full catalogue.
Also available​
| Call | What it does |
|---|---|
tester.info (JS/Python) / tester.info() (Rust) | Cached device report, including capabilities |
tester.session.state() | Who currently holds the device |
Where to go next​
- Getting started with AT1000 — install the package and run your first script
- Standalone projects: stopping, USB devices, and logs
- Example applications — complete, working test sequences