iio_writedev(1)

write buffers on an IIO device

Section 1 libiio-utils bookworm source

Description

iio_writedev

NAME

iio_writedev - write buffers on an IIO device

SYNOPSIS

iio_writedev [ options ] [-n <hostname>] [-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

-h, --help

Tells iio_readdev to display some help, and then quit. -n, --network Use the network backend with the provided hostname

-u, --uri

The Uniform Resource Identifier (uri) for connecting to devices, can be one of:
ip:[address]

network address, either numeric (192.168.0.1) or network hostname

ip:

blank, if compiled with zeroconf support, will find an IIO device on network

usb:[device:port:instance]

normally returned from iio_info -s

serial:[port]

local

with no address part

-S, --scan

Scan for available IIO contexts, optional arg of specific backend(s) ’ip’, ’usb’ or ’ip,usb’. Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices ’usb=0456:b673’. vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) If no argument is given, it checks all that are available.

-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.

-a, --auto

Scan for available contexts and if only one is available use it.

-c --cyclic

Use cyclic buffer mode.

RETURN VALUE

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

USAGE

You use iio_readdev in the same way you use many of the other libiio utilities. You must specify a IIO device, and the specific channel to read. Since this is a write, channels must be output. It is easy to use iio_attr to find out what the channels are called.

This identifies the device, and channel that can be used.

iio_attr -a -o -c .
Using auto-detected IIO context at URI "usb:3.10.5"
dev ’cf-ad9361-dds-core-lpc’, channel ’voltage0’ (output, index: 0, format: le:S16/16>>0)
dev ’cf-ad9361-dds-core-lpc’, channel ’voltage1’ (output, index: 1, format: le:S16/16>>0)

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

SEE ALSO

iio_attr(1), iio_info(1), iio_readdev(1), iio_reg(1), iio_writedev(1), libiio(3)

libiio home page: https://wiki.analog.com/resources/tools-software/linux-software/libiio

libiio code: https://github.com/analogdevicesinc/libiio

Doxygen for libiio https://analogdevicesinc.github.io/libiio/

BUGS

All bugs are tracked at: https://github.com/analogdevicesinc/libiio/issues