• Linus Walleij's avatar
    iio: tools: generic_buffer: auto-enable channels · 5f991a92
    Linus Walleij authored
    If no channels are enabled when we run generic_buffer on a
    device, add a command-line option to just enable all of them,
    run the sampling and disable them all again afterwards.
    
    This is extremely useful when I'm low-level testing my
    sensors with interrupts and triggers, sample session:
    
    root@Ux500:/ lsiio
    Device 000: lsm303dlh_accel
    Device 001: lis331dl_accel
    Device 002: l3g4200d
    Device 003: lsm303dlh_magn
    Device 004: lps001wp
    Trigger 000: lsm303dlh_accel-trigger
    Trigger 001: lis331dl_accel-trigger
    Trigger 002: l3g4200d-trigger
    
    root@Ux500:/ generic_buffer -a -c 10 -n l3g4200d
    iio device number being used is 2
    iio trigger number being used is 2
    No channels are enabled, enabling all channels
    Enabling: in_anglvel_x_en
    Enabling: in_anglvel_y_en
    Enabling: in_anglvel_z_en
    Enabling: in_timestamp_en
    /sys/bus/iio/devices/iio:device2 l3g4200d-trigger
    -3.593664 -0.713133 4.870143 946684863662292480
    3.225546 0.867357 -4.945878 946684863671875000
    -0.676413 0.127296 0.1...
    5f991a92
iio_utils.h 2.93 KB