GPIOOutputs

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

GPIO pins
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 asserted
  • ForceFan: Whether the ForceFan flag is asserted
  • Sync: EtherCAT synchronization signal
  • ModSegment: Modulation segment (High if segment is 1)
  • ModIdx(u16): High when the modulation index is the specified value
  • StmSegment: STM segment (High if segment is 1)
  • StmIdx(u16): High when the STM index is the specified value
  • IsStmMode: Whether FociSTM/GainSTM is being used
  • PwmOut(&Transducer): PWM output of the specified transducer
  • SysTimeEq(DcSysTime): High during the specified system time
  • Direct(bool): Output the specified value (if true, High; if false, Low)