Index

Documentation

LibIIO.CLibIIO.iio_device_get_nameFunction
iio_device_get_name(dev)

Retrieve the device name (e.g. xadc)

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure

Returns

  • A string containing the name
Note

If the device has no name, an empty string is returned

See libiio

source
LibIIO.CLibIIO.iio_device_get_labelFunction
iio_device_get_label(dev)

Retrieve the device label (e.g. lo_pll0_rx_adf4351)

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure

Returns

  • A string containing the label
Note

If the device has no label, an empty string is returned

See libiio

source
LibIIO.CLibIIO.iio_device_get_channelFunction
iio_device_get_channel(dev, index)

Get the channel present at the given index.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • index::Cuint : The index corresponding to the channel

Returns

  • On success, a pointer to an iio_channel
  • If the index is invalid, an error is raised

See libiio

source
LibIIO.CLibIIO.iio_device_get_attrFunction
iio_device_get_attr(dev, index)

Get the device-specific attribute present at the given index.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • index::Cuint : The index corresponding to the attribute

Returns

  • On success, a string containing the attribute name
  • If the index is invalid, an empty string will be returned

See libiio

source
LibIIO.CLibIIO.iio_device_get_buffer_attrFunction
iio_device_get_buffer_attr(dev, index)

Get the buffer-specific attribute present at the given index.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • index::Cuint : The index corresponding to the attribute

Returns

  • On success, a string containing the attribute name
  • If the index is invalid, an empty string will be returned

See libiio

source
LibIIO.CLibIIO.iio_device_find_channelFunction
iio_device_find_channel(dev, name, output)

Try to find a channel structure by its name or ID.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • name::String : A string corresponding to the name or ID of the channel to search for
  • output::Bool : True if the searched channel is output, false otherwise

Returns

  • On success, a pointer to an iio_channel structure
  • If the name or ID does not correspond to any known channel of the given device, an error is raised

See libiio

source
LibIIO.CLibIIO.iio_device_find_attrFunction
iio_device_find_attr(dev, name)

Try to find a device-specific attribute by its name.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • name::String : A string corresponding to the name of the attribute

Returns

  • On succes, a string containing the attribute name
  • If the name does not correspond to any know aatribute of the device, an empty string is returned
Note

This function is useful to detect the presence of an attribute.

See libiio

source
LibIIO.CLibIIO.iio_device_find_buffer_attrFunction
iio_device_find_buffer_attr(dev, name)

Try to find a buffer-specific attribute by its name.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • name::String : A string corresponding to the name of the attribute

Returns

  • On succes, a string containing the attribute name
  • If the name does not correspond to any know aatribute of the device, an empty string is returned
Note

This function is useful to detect the presence of an attribute.

See libiio

source
LibIIO.CLibIIO.iio_device_attr_readFunction
iio_device_attr_read(dev, attr)

Read the content of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, a string with the attribute value.
  • On error, a negative errno code is returned
Note

This function deviates from the C library iio_device_attr_read. Instead of passing an empty string, call the function without the attr argument.

See libiio

source
iio_device_attr_read(dev)

Read the content of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure

Returns

  • On success, a Vector of Tuples of attribute index and value
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_read_allFunction
iio_device_attr_read_all(dev, cb, data)

Read the content of all device-specific attributes.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • cb::Ptr{Cvoid} : A pointer to a callback function
  • data::Ptr{Cvoid} : A pointer that will be passed to the callback function

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned
Note

This function is especially useful when used with the network backend, as all the device-specific attributes are read in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_attr_read_boolFunction
iio_device_attr_read_bool(dev, attr)

Read the content of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the bool value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_read_longlongFunction
iio_device_attr_read_longlong(dev, attr)

Read the content of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the Clonglong value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_read_doubleFunction
iio_device_attr_read_double(dev, attr)

Read the content of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the Cdouble value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_writeFunction
iio_device_attr_write(dev, attr, src)

Set the value of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • src::String A string to set the attribute to

Returns

  • On success, the number of bytes written
  • On error, a negative errno code is returned
Note

By passing C_NULL as the "attr" argument to iio_device_attr_write, it is now possible to write all of the attributes of a device.

The buffer must contain one block of data per attribute of the device, by the order they appear in the iio_device structure.

The first four bytes of one block correspond to a 32-bit signed value in network order. If negative, the attribute is not written; if positive, it corresponds to the length of the data to write. In that case, the rest of the block must contain the data.

See libiio

source
LibIIO.CLibIIO.iio_device_attr_write_rawFunction
iio_device_attr_write_raw(dev, attr, src, len)

Set the value of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • src::Ptr{Cvoid} : A pointer to the data to be written
  • len::Csize_t : The number of bytes that should be written

Returns

  • On success, the number of bytes written
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_write_allFunction
iio_device_attr_write_all(dev, cb, data)

Set the values of all device-specifc attributes.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • cb::Ptr{Cvoid} : A pointer to a callback function
  • data::Ptr{Cvoid} : A pointer that will be passed to the callback function

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned
Note

This function is especially useful when used with the network backend, as all the device-specific attributes are written in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_attr_write_boolFunction
iio_device_attr_write_bool(dev, attr, val)

Set the value of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Bool : A bool value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_write_longlongFunction
iio_device_attr_write_longlong(dev, attr, val)

Set the value of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Clonglong : A Clonglong value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_attr_write_doubleFunction
iio_device_attr_write_double(dev, attr, val)

Set the value of the given device-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Cdouble : A Cdouble value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_readFunction
iio_device_buffer_attr_read(dev, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, a Vector of Tuples of attribute index and value if attr is an empty string, otherwise a string with the attribute value.
  • On error, a negative errno code is returned
Note

By an empty string as the "attr" argument to iio_device_buffer_attr_read, it is now possible to read all of the buffer attributes of a device.

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_read_allFunction
iio_device_buffer_attr_read_all(dev, cb, data)

Read the content of all buffer-specific attributes.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • cb::Ptr{Cvoid} : A pointer to a callback function
  • data::Ptr{Cvoid} : A pointer that will be passed to the callback function

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned
Note

This function is especially useful when used with the network backend, as all the buffer-specific attributes are read in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_read_boolFunction
iio_device_buffer_attr_read_bool(dev, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the bool value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_read_longlongFunction
iio_device_buffer_attr_read_longlong(dev, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the Clonglong value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_read_doubleFunction
iio_device_buffer_attr_read_double(dev, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute

Returns

  • On success, 0 and the Cdouble value is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_writeFunction
iio_device_buffer_attr_write(dev, attr, src)

Set the value of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • src::String A string to set the attribute to

Returns

  • On success, the number of bytes written
  • On error, a negative errno code is returned
Note

By passing C_NULL as the "attr" argument to iio_device_buffer_attr_write, it is now possible to write all of the attributes of a device.

The buffer must contain one block of data per attribute of the device, by the order they appear in the iio_device structure.

The first four bytes of one block correspond to a 32-bit signed value in network order. If negative, the attribute is not written; if positive, it corresponds to the length of the data to write. In that case, the rest of the block must contain the data.

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_write_rawFunction
iio_device_buffer_attr_write_raw(dev, attr, src, len)

Set the value of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • src::Ptr{Cvoid} : A pointer to the data to be written
  • len::Csize_t : The number of bytes that should be written

Returns

  • On success, the number of bytes written
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_write_allFunction
iio_device_buffer_attr_write_all(dev, cb, data)

Set the values of all buffer-specific attributes.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • cb::Ptr{Cvoid} : A pointer to a callback function
  • data::Ptr{Cvoid} : A pointer that will be passed to the callback function

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned
Note

This function is especially useful when used with the network backend, as all the buffer-specific attributes are written in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_write_boolFunction
iio_device_buffer_attr_write_bool(dev, attr, val)

Set the value of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Bool : A bool value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_write_longlongFunction
iio_device_buffer_attr_write_longlong(dev, attr, val)

Set the value of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Clonglong : A Clonglong value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_buffer_attr_write_doubleFunction
iio_device_buffer_attr_write_double(dev, attr, val)

Set the value of the given buffer-specific attribute.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A string corresponding to the name of the attribute
  • val::Cdouble : A Cdouble value to set the attribute to

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_get_triggerFunction
iio_device_get_trigger(dev)

Retrieve the trigger of a given device.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • trigger::Ptr{iio_device} : A pointer to an [iio_device][@ref] structure. The pointer will be set to the address of the iio_device structure corresponding to the associated trigger device.

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_set_triggerFunction
iio_device_set_trigger(dev, trigger)

Associate a trigger to a given device.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • trigger::Ptr{iio_device : A pointer to an iio_device structure corresponding to the trigger that should be associated.

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_device_set_kernel_buffers_countFunction
iio_device_set_kernel_buffers_count(dev, nb_buffers)

Configure the number of kernel buffers for a device.

This function allows to change the number of buffers on kernel side.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • nb_buffers::Cuint : The number of buffers

Returns

  • On success, 0 is returned
  • On error, a negative errno code is returned

See libiio

source