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 Default Description
outputs [GpioOut; 4] all Off 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(SysTime) 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 SysTime passed to SysTimeEq, see SysTime.

use autd3_rs::commands::{Clear, GpioOut, SetGpioOut, Synchronize};
use autd3_rs::geometry::{Autd3, Geometry};
use autd3_rs::Client;
use autd3_rs::udp::TransportOption;
let geometry = Geometry::new(vec![Autd3::default()]);
let option = TransportOption::default();
let mut client = Client::open(&geometry, &option).await?;
client.send(Clear).await?;
client.send(Synchronize).await?;
client.send(SetGpioOut {
outputs: [
GpioOut::PatternBank,
GpioOut::Thermo,
GpioOut::PwmOut(0),
GpioOut::Off,
],
}).await?;