iio_writedev(1)

πŸ’– iio_writedev β€” from the LibIIO Utilities girlies πŸ’–

okay so bestie, welcome to iio_writedev(1), one of the LibIIO Utilities. if you're here it's because you wanna write buffers onto an IIO device, and I am so proud of you for reading the manual first. main character behavior fr fr. 🫢


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

not me clocking that the description literally says iio_reg and not iio_writedev πŸ’€ I am NOT editing the sacred text, I just report what the page says. copy it, don't @ me.

πŸ’… OPTIONS πŸ’…

  • -h, --help β€” tells iio_writedev to show you some help, and then dip. so valid of it.
  • -V, --version β€” prints the version info for this exact copy of iio_writedev and the version of the libiio library it's using. lowkey iconic for checking whether your library and your iio_writedev are both up to date, and highkey essential when you're filing a bug report. πŸ‘‘
  • -S, --scan β€” scan for available IIO contexts. takes an optional arg for 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), and "*" (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, bestie, samples) 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. πŸ”
  • -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_writedev -S
    • serial:[port],[baud],[settings] β€” 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:
        • data_bits: (5, 6, 7, 8 [default], or 9)
        • parity_bits: ('n' none [default], 'o' odd, 'e' even, 'm' mark, or 's' space)
        • stop_bits: (1 [default, or 2)
        • flow_control: ('0' none [default], 'x' Xon Xoff, 'r' RTSCTS, or 'd' DTRDSR)
    • local: β€” with no address part. 🏠

πŸ”₯ RETURN VALUE πŸ”₯

if the specified device is not found, a non-zero exit code is returned. simple as that, no cap.


πŸŽ€ 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 β€” that part matters bestie, don't fight it. if no channel is provided, iio_writedev will write to all output channels. and 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
and yes, piping your little binary blob straight into stdin like that is chef's kiss. 🌈

⭐ SEE ALSO ⭐

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


if you made it to the end, you're literally the strongest soldier I know πŸ’œ this was libiio-0.26, dated 06 February 2026, straight out of the LibIIO Utilities fam. go write some buffers, bestie. slay. οΏ½οΏ½πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from