GPIOOutputs
GPIOOutputs
allows you to set the output of GPIO output pins for each device.

use autd3::prelude::*;
fn main() {
let _ =
GPIOOutputs::new(|_dev, gpio| {
if gpio == GPIOOut::O0 {
Some(GPIOOutputType::BaseSignal)
} else {
None
}
});
}
#include<autd3.hpp>
int main() {
using namespace autd3;
GPIOOutputs([](const auto& dev,
const auto& gpio) -> std::optional<GPIOOutputType> {
if (gpio == GPIOOut::O0)
return GPIOOutputType::BaseSignal;
else
return std::nullopt;
});
return 0; }
using AUTD3Sharp;
using AUTD3Sharp.Utils;
new GPIOOutputs(
(dev, gpio) => gpio == GPIOOut.O0 ? GPIOOutputType.BaseSignal : null
);
from pyautd3 import GPIOOutputs, GPIOOutputType, GPIOOut
GPIOOutputs(
lambda _dev, gpio: (
GPIOOutputType.BaseSignal if gpio == GPIOOut.O0 else None
),
)
The following data can be output.
BaseSignal
: Reference signal (50% duty cycle square wave with the same frequency as ultrasound)Thermo
: Whether the temperature sensor is assertedForceFan
: Whether the ForceFan flag is assertedSync
: EtherCAT synchronization signalModSegment
: Modulation segment (High if segment is 1)ModIdx(u16)
: High when the modulation index is the specified valueStmSegment
: STM segment (High if segment is 1)StmIdx(u16)
: High when the STM index is the specified valueIsStmMode
: Whether FociSTM/GainSTM is being usedPwmOut(&Transducer)
: PWM output of the specified transducerSysTimeEq(DcSysTime)
: High during the specified system timeDirect(bool)
: Output the specified value (iftrue
, High; iffalse
, Low)