Skip to content

SetGpioOut

SetGpioOut is a command that sets the signals output to the device’s 4 GPIO output terminals.

SetGpioOut { outputs };
Field Type Description
outputs [GpioOut; 4] Outputs assigned to terminals 0..3
Off Always Low (default)
BaseSignal Reference signal of the ultrasound (40 kHz)
Thermo Temperature sensor assertion
ForceFan ForceFan state
Sync Synchronization signal
ModBank Active Modulation bank
ModIdx(u16) High when Modulation is at the specified index
PatternBank Active Pattern bank
PatternIdx(u16) High when Pattern is at the specified index
IsStmMode High when in Stm mode (size != 1)
SysTimeEq(DcSysTime) High when the system time matches the specified value
SyncDiff Synchronization error
PwmOut(u8) PWM output of the specified transducer
Direct(bool) Directly output the specified fixed value

For the DcSysTime passed to SysTimeEq, see DcSysTime.

use autd3_rs::commands::{GpioOut, SetGpioOut};
use autd3_rs::geometry::{Autd3, Geometry};
use autd3_rs::{Client, ClientConfig};
use autd3_rs_link_nop::Nop;
let geometry = Geometry::new(vec![Autd3::default()]);
let client = Client::open(&geometry, Nop, ClientConfig::default()).await?;
let mut builder = client.datagram_builder();
builder.push(SetGpioOut {
outputs: [
GpioOut::PatternBank,
GpioOut::Thermo,
GpioOut::PwmOut(0),
GpioOut::Off,
],
});
let frames = builder.build()?;
for frame in &frames {
client.send_checked(frame).await?;
}
client.close().await?;