Scroll to navigation

iio_writedev(1) LibIIO Utilities 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

Tells iio_writedev to display some help, and then quit.
Prints the version information for this particular copy of iio_writedev and the version of the libiio library it is using. This is useful for knowing if the version of the library and iio_writedev on your system are up to date. This is also useful when reporting bugs.
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.
Use the specified trigger, if needed on the specified channel
Size of the capture buffer. Default is 256.
Number of samples (not bytes) to capture, 0 = infinite. Default is 0.
Buffer timeout in milliseconds. 0 = no timeout. Default is 0.
Use cyclic buffer mode.
The Uniform Resource Identifier (uri) for connecting to devices, can be one of:
network address, either numeric (192.168.0.1) or network hostname
blank, if compiled with zeroconf support, will find an IIO device on network
normally returned from iio_writedev -S
which are controlled, and need to match the iiod (or tinyiiod) on the other end of the serial port.
[port]
is something like '/dev/ttyUSB0' on Linux, and 'COM4' on Windows.
[baud]
is is normally one of 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200 [default], 128000 or 256000, but can vary system to system.
[settings]
would normally be configured as '8n1' this is controlled by:
(5, 6, 7, 8 [default], or 9)
('n' none [default], 'o' odd, 'e' even, 'm' mark, or 's' space)
(1 [default, or 2)
('0' none [default], 'x' Xon Xoff, 'r' RTSCTS, or 'd' DTRDSR)
with no address part.

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

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

19 August 2024 libiio-0.25