Index

Documentation

LibIIO.CLibIIO.iio_device_get_sample_sizeFunction
iio_device_get_sample_size(dev)

Get the current sample size.

Parameters

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

Returns

  • On success, the sample size in bytes
  • On error, a negative errno code is returned
Note

The sample size is not constant and will change when channels get enabled or disabled.

See libiio

source
LibIIO.CLibIIO.iio_channel_get_indexFunction
iio_channel_get_index(chn)

Get the index of the given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure

Returns

  • On success, a the index of the specified channel
  • On error, an negative errno code is returned

See libiio

source
LibIIO.CLibIIO.iio_channel_convertFunction
iio_channel_convert(chn, dst, src)

Convert the sample from hardware format to host format.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • dst::Ptr{Cvoid} : A pointer to the destination buffer where the converted sample should be written
  • src::Ptr{Cvoid} : A pointer to the source buffer containing the sample

See libiio

source
LibIIO.CLibIIO.iio_channel_convert_inverseFunction
iio_channel_convert_inverse(chn, dst, src)

Convert the sample from host format to hardware format.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • dst::Ptr{Cvoid} : A pointer to the destination buffer where the converted sample should be written
  • src::Ptr{Cvoid} : A pointer to the source buffer containing the sample

See libiio

source
LibIIO.CLibIIO.iio_device_get_debug_attrFunction
iio_device_get_debug_attr(dev, index)

Get the debug 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 debug attribute

Returns

  • On succes, a string containing the attribute value
  • If the index is invalid, an empty string is returned

See libiio

source
LibIIO.CLibIIO.iio_device_find_debug_attrFunction
iio_device_find_debug_attr(dev, name)

Try to find a debug attribute by its name.

Parameters

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

Returns

  • On success, a string with the attribute name
  • If the name does not correspond to any known debug attribute of the given device, an empty string is returned
Note

This function is useful to detect the presence of a debug attribute.

See libiio

source
LibIIO.CLibIIO.iio_device_debug_attr_readFunction
iio_device_debug_attr_read(dev, attr)

Read the content of the given debug 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_debug_attr_read, it is now possible to read all of the buffer attributes of a device.

See libiio

source
LibIIO.CLibIIO.iio_device_debug_attr_read_allFunction
iio_device_debug_attr_read_all(dev, cb, data)

Read the content of all debug 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 debug attributes are read in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_debug_attr_writeFunction
iio_device_debug_attr_write(dev, attr, src)

Set the value of the given debug 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_debug_attr_write, it is now possible to write all of the debug 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_debug_attr_write_rawFunction
iio_device_debug_attr_write_raw(dev, attr, src, len)

Set the value of the given debug 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_debug_attr_write_allFunction
iio_device_debug_attr_write_all(dev, cb, data)

Set the values of all debug 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 debug attributes are written in one single command.

See libiio

source
LibIIO.CLibIIO.iio_device_debug_attr_read_boolFunction
iio_device_debug_attr_read_bool(dev, attr)

Read the content of the given debug 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_debug_attr_read_longlongFunction
iio_device_debug_attr_read_longlong(dev, attr)

Read the content of the given debug 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_debug_attr_read_doubleFunction
iio_device_debug_attr_read_double(dev, attr)

Read the content of the given debug 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_debug_attr_write_boolFunction
iio_device_debug_attr_write_bool(dev, attr, val)

Set the value of the given debug 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_debug_attr_write_longlongFunction
iio_device_debug_attr_write_longlong(dev, attr, val)

Set the value of the given debug 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_debug_attr_write_doubleFunction
iio_device_debug_attr_write_double(dev, attr, val)

Set the value of the given debug 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_identify_filenameFunction
iio_device_identify_filename(dev, filename, chn, attr)

Identify the channel or debug attribute corresponding to a filename.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • filename::String : A string corresponding to the filename
  • chn::Ptr{Ptr{iio_channel}} : A pointer to a pointer of an iio_channel. The pointed pointer will be set to the address of the iio_channel structure if the filename correspond to the attribute of a channel, or C_NULL otherwise.
  • attr::String : A string field. The string will be set to the name of the attribute corresponding to the filename.

Returns

  • On success, 0 is returned, and chn and attr are modified
  • On error, a negative errno code is returned. chn and attr are not modified.

See libiio

source
LibIIO.CLibIIO.iio_device_reg_writeFunction
iio_device_reg_write(dev, address, value)

Set the value of a hardware register.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • address::Cuint : The address of the register
  • value::Cuint : The value to set the register to

Returns

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

See libiio

source
LibIIO.CLibIIO.iio_device_reg_readFunction
iio_device_reg_read(dev, address)

Get the value of a hardware register.

Parameters

  • dev::Ptr{iio_device} : A pointer to an iio_device structure
  • address::Cuint : The address of the register

Returns

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

See libiio

source