Power API Reference
The Power API provides control over programmable power supplies for Device Under Test (DUT), USB ports, and current measurement through relay 0. The DUT channel supplies 1.6โ13 V programmable, or a fixed 24 V at up to 2A with precise current monitoring.
Accessing Powerโ
- NodeJS
- Python
- Rust
const power = tester.power;
power = tester.power
let power = &tester.power;
Power Module Methodsโ
reset()โ
Resets all power supplies to their default state (disabled).
- NodeJS
- Python
- Rust
await tester.power.reset();
tester.power.reset()
tester.power.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
dut(id)โ
Access a specific DUT power supply channel.
- NodeJS
- Python
- Rust
const dut0 = tester.power.dut(0);
dut0 = tester.power.dut(0)
let dut0 = tester.power.dut(0)?;
Parameters:
id(number/int/usize): DUT channel identifier (0-based)
Returns: Dut instance / Result<Dut, At1000Error> in Rust
usb(id)โ
Access a specific USB port for power control and monitoring.
- NodeJS
- Python
- Rust
const usb0 = tester.power.usb(0);
usb0 = tester.power.usb(0)
let usb0 = tester.power.usb(0)?;
Parameters:
id(number/int/usize): USB port identifier (0-based, typically 0-1)
Returns: Usb instance / Result<Usb, At1000Error> in Rust
relay_0()โ
Access the power-measurement relay for high-precision current measurement.
- NodeJS
- Python
- Rust
const relay0 = tester.power.relay_0();
relay0 = tester.power.relay_0()
let relay0 = tester.power.relay_0();
Returns: RelayPower instance / RelayPower in Rust (not a Result)
This is a special relay with current measurement capability. Current measurement is done using a 0.33 Ohm shunt resistor, providing 1ยตA resolution up to 500mA.
Dut Classโ
Programmable power supply for powering and testing devices.
reset()โ
Resets the DUT channel to its default state (disabled).
- NodeJS
- Python
- Rust
await dut.reset();
dut.reset()
let dut = tester.power.dut(0)?;
dut.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
configure(config)โ
Configures the DUT power supply.
- NodeJS
- Python
- Rust
await dut.configure({
enabled: true,
target_voltage: 3.3
});
dut.configure({
"enabled": True,
"target_voltage": 3.3
})
use ikalogic_at1000::DutConfiguration;
let dut = tester.power.dut(0)?;
dut.configure(&DutConfiguration {
enabled: Some(true),
target_voltage: Some(3.3),
})?;
Parameters:
config(DutConfiguration/&DutConfigurationin Rust):enabled(boolean/bool/Option<bool>, optional): Enable or disable the supplytarget_voltage(number/float/Option<f64>, optional): Target voltage (1.6โ13 V, or 24 V)
Returns: Promise<DutState> / DutState / Result<DutState, At1000Error> - Full state including measured voltage and current
Exceptions:
- Throws validation error if
target_voltageis outside 1.6โ13 V and not exactly 24 V
enable(voltage)โ
Enables the DUT power supply at the specified voltage.
- NodeJS
- Python
- Rust
await dut.enable(12.0); // Enable at 12V
dut.enable(12.0) # Enable at 12V
let dut = tester.power.dut(0)?;
dut.enable(12.0)?; // Enable at 12V
Parameters:
voltage(number/float/f64): Target voltage (1.6โ13 V, or 24 V)
Returns: Promise<DutState> / DutState / Result<DutState, At1000Error> - Updated state
Exceptions:
- Throws validation error if voltage is outside 1.6โ13 V and not exactly 24 V
disable()โ
Disables the DUT power supply.
- NodeJS
- Python
- Rust
await dut.disable();
dut.disable()
let dut = tester.power.dut(0)?;
dut.disable()?;
Returns: Promise<DutState> / DutState / Result<DutState, At1000Error> - Updated state with enabled: false
read()โ
Reads the complete current state of the DUT supply.
- NodeJS
- Python
- Rust
const state = await dut.read();
console.log("Enabled:", state.enabled);
console.log("Target:", state.target_voltage, "V");
console.log("Actual:", state.voltage, "V");
console.log("Current:", state.current, "A");
state = dut.read()
print(f"Enabled: {state.enabled}")
print(f"Target: {state.target_voltage} V")
print(f"Actual: {state.voltage} V")
print(f"Current: {state.current} A")
let dut = tester.power.dut(0)?;
let state = dut.read()?;
println!("Enabled: {}", state.enabled);
println!("Target: {} V", state.target_voltage);
println!("Actual: {} V", state.voltage);
println!("Current: {} A", state.current);
Returns: Promise<DutState> / DutState / Result<DutState, At1000Error> - Full state object
read_current()โ
Reads only the current drawn by the DUT.
- NodeJS
- Python
- Rust
const current = await dut.read_current();
console.log("Current:", current, "A");
current = dut.read_current()
print(f"Current: {current} A")
let dut = tester.power.dut(0)?;
let current = dut.read_current()?;
println!("Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
read_voltage()โ
Reads only the actual output voltage.
- NodeJS
- Python
- Rust
const voltage = await dut.read_voltage();
console.log("Voltage:", voltage, "V");
voltage = dut.read_voltage()
print(f"Voltage: {voltage} V")
let dut = tester.power.dut(0)?;
let voltage = dut.read_voltage()?;
println!("Voltage: {voltage} V");
Returns: Promise<number> / float / Result<f64, At1000Error> - Voltage in volts
Usb Classโ
USB port power control with monitoring capabilities.
reset()โ
Resets the USB port to its default state (disabled).
- NodeJS
- Python
- Rust
await usb.reset();
usb.reset()
let usb = tester.power.usb(0)?;
usb.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
configure(config)โ
Configures the USB port power.
- NodeJS
- Python
- Rust
await usb.configure({
enabled: true
});
usb.configure({
"enabled": True
})
use ikalogic_at1000::UsbConfiguration;
let usb = tester.power.usb(0)?;
usb.configure(&UsbConfiguration { enabled: true })?;
Parameters:
config(UsbConfiguration/&UsbConfigurationin Rust):enabled(boolean/bool/bool, required): Enable or disable USB power
Returns: Promise<UsbState> / UsbState / Result<UsbState, At1000Error> - Current state including voltage and current
enable()โ
Enables USB port power.
- NodeJS
- Python
- Rust
await usb.enable();
usb.enable()
let usb = tester.power.usb(0)?;
usb.enable()?;
Returns: Promise<UsbState> / UsbState / Result<UsbState, At1000Error> - Updated state with enabled: true
disable()โ
Disables USB port power (power cycle).
- NodeJS
- Python
- Rust
await usb.disable();
usb.disable()
let usb = tester.power.usb(0)?;
usb.disable()?;
Returns: Promise<UsbState> / UsbState / Result<UsbState, At1000Error> - Updated state with enabled: false
read()โ
Reads the complete current state of the USB port.
- NodeJS
- Python
- Rust
const state = await usb.read();
console.log("Enabled:", state.enabled);
console.log("Voltage:", state.voltage, "V");
console.log("Current:", state.current, "A");
state = usb.read()
print(f"Enabled: {state.enabled}")
print(f"Voltage: {state.voltage} V")
print(f"Current: {state.current} A")
let usb = tester.power.usb(0)?;
let state = usb.read()?;
println!("Enabled: {}", state.enabled);
println!("Voltage: {} V", state.voltage);
println!("Current: {} A", state.current);
Returns: Promise<UsbState> / UsbState / Result<UsbState, At1000Error> - Full state object
read_current()โ
Reads only the current drawn through the USB port.
- NodeJS
- Python
- Rust
const current = await usb.read_current();
console.log("USB Current:", current, "A");
current = usb.read_current()
print(f"USB Current: {current} A")
let usb = tester.power.usb(0)?;
let current = usb.read_current()?;
println!("USB Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
read_voltage()โ
Reads the USB port voltage.
- NodeJS
- Python
- Rust
const voltage = await usb.read_voltage();
console.log("USB Voltage:", voltage, "V");
voltage = usb.read_voltage()
print(f"USB Voltage: {voltage} V")
let usb = tester.power.usb(0)?;
let voltage = usb.read_voltage()?;
println!("USB Voltage: {voltage} V");
Returns: Promise<number> / float / Result<f64, At1000Error> - Voltage in volts
RelayPower Classโ
Relay 0 with high-precision current measurement capability.
read()โ
Reads the complete state including current measurement.
- NodeJS
- Python
- Rust
const state = await relay0.read();
console.log("Current through relay:", state.current, "A");
state = relay0.read()
print(f"Current through relay: {state.current} A")
let relay0 = tester.power.relay_0();
let state = relay0.read()?;
println!("Current through relay: {} A", state.current);
Returns: Promise<RelayState> / RelayState / Result<RelayPowerState, At1000Error> - State object with current measurement
read_current()โ
Reads only the current flowing through the relay.
- NodeJS
- Python
- Rust
const current = await relay0.read_current();
console.log("Relay 0 Current:", current, "A");
current = relay0.read_current()
print(f"Relay 0 Current: {current} A")
let relay0 = tester.power.relay_0();
let current = relay0.read_current()?;
println!("Relay 0 Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
Relay must be closed for current to flow and be measured. Bidirectional current measurement is supported.
Typesโ
DutStateโ
{
enabled: boolean,
target_voltage: number, // 1.6โ13 V, or 24 V
voltage: number, // Measured voltage
current: number // Measured current in amperes
}
Rust: ikalogic_at1000::DutState
pub struct DutState {
pub enabled: bool,
pub target_voltage: f64,
pub voltage: f64,
pub current: f64,
}
DutConfigurationโ
{
enabled?: boolean,
target_voltage?: number // 1.6โ13 V, or 24 V
}
Rust: ikalogic_at1000::DutConfiguration
pub struct DutConfiguration {
pub enabled: Option<bool>,
pub target_voltage: Option<f64>,
}
UsbStateโ
{
enabled: boolean,
voltage: number, // Measured voltage
current: number // Measured current in amperes
}
Rust: ikalogic_at1000::UsbState
pub struct UsbState {
pub enabled: bool,
pub current: f64,
pub voltage: f64,
}
UsbConfigurationโ
{
enabled: boolean
}
Rust: ikalogic_at1000::UsbConfiguration
pub struct UsbConfiguration {
pub enabled: bool,
}
RelayStateโ
{
current: number // Measured current in amperes
}
Rust: ikalogic_at1000::RelayPowerState
pub struct RelayPowerState {
pub current: f64,
}
Notesโ
- DUT channel supplies 1.6โ13 V programmable, or a fixed 24 V at up to 2A
- USB ports provide standard 5V USB power with monitoring
- Voltage measurements are highly accurate for precise verification
- Current measurements allow for real-time monitoring and over-current detection
- Always allow time for voltage stabilization after enable (100-200ms recommended)
- Use
disable()to safely power down before disconnecting devices - Relay 0 provides high-precision current measurement (1ยตA resolution, max 500mA) when closed
- Monitor current during boot/startup to verify proper device initialization