iio_writedev(1)

NAME
iio_writedev - write buffers on an IIO device

SYNOPSIS
iio_writedev [ options ] [-t <trigger>] [-T <timeout-ms>] [-b <buffer-size>] [-s <samples>] <iio_device> [<channel> ...]

DESCRIPTION
iio_reg is a utility for writing buffers from connected IIO devices.

OPTIONS
##COMMON_COMMANDS_START## ##COMMON_COMMANDS_STOP##

-t --trigger
    Use the specified trigger, if needed on the specified channel

-b --buffer-size
    Size of the capture buffer. Default is 256.

-s --samples
    Number of samples (not bytes) to capture, 0 = infinite. Default is 0.

-T --timeout
    Buffer timeout in milliseconds. 0 = no timeout. Default is 0.

-c --cyclic
    Use cyclic buffer mode. ##COMMON_OPTION_START## ##COMMON_OPTION_STOP##

RETURN VALUE
If the specified device is not found, a non-zero exit code is returned.

USAGE

You use iio_writedev in the same way you use many of the other libiio utilities. You should specify a IIO device, and the specific channel to write. Since this is a write, channels must be output. If no channel is provided, iio_writedev will write to all output channels. If no device is provided, iio_writedev will print a few examples:
    iio_writedev -a
    Using auto-detected IIO context at URI "usb:3.10.5"
    Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage0
    Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage1
    Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage2
    Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage3
    Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc

This sends 1024 samples of I and Q data to the USB attached AD9361. data is taking from standard in, in a binary format.
    iio_writedev -a -s 1024 cf-ad9361-dds-core-lpc voltage0 voltage1 < ./samples.dat