Triggers

class adi.trigger.hrtimer_trig(uri='', trig_name='trigger0')

Bases: context_manager, attribute

High-Resolution Timer Trigger

This class provides an interface for controlling an IIO hrtimer trigger. The trigger must be created first:

  • Ensure the iio-trig-hrtimer kernel module is loaded or built-in into the kernel

  • Ensure configfs is mounted

  • Create the a new trigger with:
    • mkdir /config/iio/triggers/hrtimer/mytrig

  • Restart iiod service if relying on a remote iio context

property name

Get the name of the trigger

property sampling_frequency

Get/Set sampling frequency of the trigger

class adi.trigger.sysfs_trig(uri='', trig_name='sysfstrig0')

Bases: context_manager, attribute

Sysfs Trigger

This class provides an interface for controlling an IIO sysfs trigger. The trigger must be created first:

  • Ensure the iio-trig-sysfs kernel module is loaded or built-in into the kernel

  • Create the a new trigger with:
    • echo 0 > /sys/bus/iio/devices/iio_sysfs_trigger/add_trigger

  • Restart iiod service if relying on a remote iio context

property name

Get the name of the trigger

trigger_now()

Trigger an immediate event