Index

Documentation

LibIIO.CLibIIO.iio_channel_get_nameFunction
iio_channel_get_name(chn)

Retrieve the channel name (e.g. vccint)

Parameters

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

Returns

  • A string with the channel name
Note

If the channel has no name, an empty string is returned.

See libiio

source
LibIIO.CLibIIO.iio_channel_is_scan_elementFunction
iio_channel_is_scan_element(chn)

Return true of the given channel is a scan element.

Parameters

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

Returns

  • True if the channel is a scan element, false otherweise
Note

A channel that is a scan element is a channel that can generate samples (for an input channel) or receive samples (for an output channel) after being enabled.

See libiio

source
LibIIO.CLibIIO.iio_channel_get_attrFunction
iio_channel_get_attr(chn, index)

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

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_find_attrFunction
iio_channel_find_attr(chn, name)

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

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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 atribute of the channel, an empty string is returned
Note

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

See libiio

source
LibIIO.CLibIIO.iio_channel_attr_get_filenameFunction
iio_channel_attr_get_filename(chn, attr)

Retrieve the filename of an attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String ; A string corresponding to the name of the attribute

Returns

  • On success, a string with the filename
  • If the attribute is unknown, an empty string is returned

See libiio

source
LibIIO.CLibIIO.iio_channel_attr_readFunction
iio_channel_attr_read(dev, attr)

Read the content of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_read. Instead of passing an empty string, call the function without the attr argument.

See libiio

source
iio_channel_attr_read(dev)

Read the content of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_read_allFunction
iio_channel_attr_read_all(dev, cb, data)

Read the content of all channel-specific attributes.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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 channel-specific attributes are read in one single command.

See libiio

source
LibIIO.CLibIIO.iio_channel_attr_read_boolFunction
iio_channel_attr_read_bool(dev, attr)

Read the content of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_read_longlongFunction
iio_channel_attr_read_longlong(dev, attr)

Read the content of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_read_doubleFunction
iio_channel_attr_read_double(dev, attr)

Read the content of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_writeFunction
iio_channel_attr_write(dev, attr, src)

Set the value of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_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_channel_attr_write_rawFunction
iio_channel_attr_write_raw(dev, attr, src, len)

Set the value of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_write_allFunction
iio_channel_attr_write_all(dev, cb, data)

Set the values of all channel-specifc attributes.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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 chsnnel-specific attributes are written in one single command.

See libiio

source
LibIIO.CLibIIO.iio_channel_attr_write_boolFunction
iio_channel_attr_write_bool(dev, attr, val)

Set the value of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_write_longlongFunction
iio_channel_attr_write_longlong(dev, attr, val)

Set the value of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_attr_write_doubleFunction
iio_channel_attr_write_double(dev, attr, val)

Set the value of the given channel-specific attribute.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel 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_channel_read_rawFunction
iio_channel_read_raw(chn, buffer, dst)

Demultiplex the samples of a given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • buffer::Ptr{iio_buffer} : A pointer to an iio_buffer structure
  • dst::Vector{Cuchar} : A destination memory area where the demultiplexed data will be stored

Returns

  • The size of the demultiplexed data, in bytes

See libiio

source
LibIIO.CLibIIO.iio_channel_readFunction
iio_channel_read(chn, buffer, dst)

Demultiplex and convert the samples of a given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • buffer::Ptr{iio_buffer} : A pointer to an iio_buffer structure
  • dst::Vector{Cuchar} : A destination memory area where the converted data will be stored

Returns

  • The size of the converted data, in bytes

See libiio

source
LibIIO.CLibIIO.iio_channel_write_rawFunction
iio_channel_write_raw(chn, buffer, dst)

Multiplex the samples of a given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • buffer::Ptr{iio_buffer} : A pointer to an iio_buffer structure
  • src::Vector{Cuchar} : A source memory area where the sequential data will be read from

Returns

  • The number of bytes actually multiplexed

See libiio

source
LibIIO.CLibIIO.iio_channel_writeFunction
iio_channel_write(chn, buffer, dst)

Convert and multiplex the samples of a given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • buffer::Ptr{iio_buffer} : A pointer to an iio_buffer structure
  • src::Vector{Cuchar} : A source memory area where the sequential data will be read from

Returns

  • The number of bytes actually converted and multiplexed

See libiio

source