channel.jl

AdalmPluto.libIIO_jl.C_iio_channel_attr_get_filenameMethod
C_iio_channel_attr_get_filename(channel, attr)

Retrieve the filename of an attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, a NULL-terminated string
  • If the attribute name is unknown, NULL is returned. If the assertions are enabled, throws an error instead.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_readMethod
C_iio_channel_attr_read(channel, attr)

Read the content of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, (nbytes, value::String) where nbytes is the length of the value string.
  • On error, (errno, "") is returned, where errno is a negative error code.
  • If all the attributes are begin read, an array of the values above is returned.

The string may be shorter than the number of bytes returned as the conversion tirims excess null characters.

NOTE

By passing NULL (replaced by an empty string in the Julia wrapper) as the "attr" argument to iio_channel_attr_read, it is now possible to read all of the attributes of a channel.

The buffer is filled with one block of data per attribute of the channel, by the order they appear in the iio_channel structure.

The first four bytes of one block correspond to a 32-bit signed value in network order. If negative, it corresponds to the errno code that were returned when reading the attribute; if positive, it corresponds to the length of the data read. In that case, the rest of the block contains the data.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_read_allMethod
C_iio_channel_attr_read_all()

THIS IS A PLACEHOLDER. THE DOCUMENTATION BELOW IS ONLY A COPY/PASTE OF THE C DOCUMENTATION.

Read the content of all channel-specific attributes.

Parameters

  • chn : A pointer to an iio_channel structure
  • cb : A pointer to a callback function
  • data : 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.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_read_boolMethod
C_iio_channel_attr_read_bool(channel, attr)

Read the content of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, (0, value::Bool) is returned
  • On error, (errno, false) is returned, where errno is a negative error code. The second value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_read_doubleMethod
C_iio_channel_attr_read_double(channel, attr)

Read the content of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, (0, value::Float64) is returned
  • On error, (errno, 0) is returned, where errno is a negative error code. The second value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_read_longlongMethod
C_iio_channel_attr_read_longlong(channel, attr)

Read the content of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, (0, value::Int64) is returned
  • On error, (errno, 0) is returned, where errno is a negative error code. The second value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_writeMethod
C_iio_channel_attr_write(channel, attr, value)

Set the value of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute
  • value::String : A NULL-terminated 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 NULL as the "attr" argument to iio_channel_attr_write, it is now possible to write all of the attributes of a channel.

The buffer must contain one block of data per attribute of the channel, by the order they appear in the iio_channel 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.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_write_allMethod
C_iio_channel_attr_write_all()

THIS IS A PLACEHOLDER. THE DOCUMENTATION BELOW IS ONLY A COPY/PASTE OF THE C DOCUMENTATION.

Set the values of all channel-specific attributes.

Parameters

  • chn : A pointer to an iio_channel structure
  • cb : A pointer to a callback function
  • data : 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 written in one single command.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_write_boolMethod
C_iio_channel_attr_write_bool(channel, attr, value)

Set the value of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute
  • value::Bool : A bool value to set the attribute to

Returns

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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_write_doubleMethod
C_iio_channel_attr_write_double(channel, attr, value)

Set the value of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute
  • value::Float64 : A double value to set the attribute to

Returns

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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_write_longlongMethod
C_iio_channel_attr_write_longlong(channel, attr, value)

Set the value of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute
  • value::Int64 : A long long value to set the attribute to

Returns

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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_attr_write_rawMethod
C_iio_channel_attr_write_raw(channel, attr, value)

Set the value of the given channel-specific attribute.

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • attr::String : a NULL-terminated string corresponding to the name of the attribute
  • value::Ptr{Cvoid} : A pointer to the data to be written
  • size::Csize_t : The number of bytes to be written

Returns

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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_enableMethod
C_iio_channel_enable(channel)

Enable the given channel.

Parameters

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

NOTE

Before creating an iiobuffer structure with `iiodevicecreatebuffer`, it is required to enable at least one channel of the device to read from.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_find_attrMethod
C_iio_channel_find_attr(channel, name)

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

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • name::String : A NULL-terminated string corresponding to the name of the attribute

Returns

  • On success, a NULL-terminated string.
  • On failure, if the assertions are enabled, throws an error.
  • On failure, if the assertions are disabled, returns an empty string.

NOTE

This function is useful to detect the presence of an attribute. It can also be used to retrieve the name of an attribute as a pointer to a static string from a dynamically allocated string.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_get_attrMethod
C_iio_channel_get_attr(channel, index)

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

Parameters

  • channel::Ptr{iio_channel} : A pointer to an iio_channel structure
  • index::UInt32 : The index corresponding to the attribute

Returns

  • On success, a NULL-terminated string.
  • On failure, if the assertions are enabled, throws an error.
  • On failure, if the assertions are disabled, returns an empty string.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_get_nameMethod
C_iio_channel_get_name(channel)

Retrieve the channel name (e.g. vccint)

Parameters

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

Returns

  • A NULL-terminated string.

NOTE

If the channel has no name, and the assertions are enabled, throws an error. If the assertions are disabled, returns an empty string.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_read!Method
C_iio_channel_read!(chn, buf, dst)

Demultiplex and convert the samples of a given channel.

Parameters

  • chn::Ptr{iio_channel} : A pointer to an iio_channel structure
  • buf::Ptr{iio_buffer} : A pointer to an iio_buffer structure
  • dst::Array{UInt8} : An array where the converted data will be stored

Returns

  • The size of the converted data written is dst, in bytes

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_read_rawMethod
C_iio_channel_read_raw()

THIS IS A PLACEHOLDER. THE DOCUMENTATION BELOW IS ONLY A COPY/PASTE OF THE C DOCUMENTATION.

Demultiplex the samples of a given channel.

Parameters

  • chn : A pointer to an iio_channel structure
  • buffer : A pointer to an iio_buffer structure
  • dst : A pointer to the memory area where the demultiplexed data will be stored
  • len : The available length of the memory area, in bytes

Returns

  • The size of the demultiplexed data, in bytes

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_writeMethod
C_iio_channel_write()

THIS IS A PLACEHOLDER. THE DOCUMENTATION BELOW IS ONLY A COPY/PASTE OF THE C DOCUMENTATION.

Convert and multiplex the samples of a given channel.

Parameters

  • chn : A pointer to an iio_channel structure
  • buffer : A pointer to an iio_buffer structure
  • src : A pointer to the memory area where the sequential data will be read from
  • len : The length of the memory area, in bytes

Returns

  • The number of bytes actually converted and multiplexed

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_channel_write_rawMethod
C_iio_channel_write_raw()

THIS IS A PLACEHOLDER. THE DOCUMENTATION BELOW IS ONLY A COPY/PASTE OF THE C DOCUMENTATION.

Multiplex the samples of a given channel.

Parameters

  • chn : A pointer to an iio_channel structure
  • buffer : A pointer to an iio_buffer structure
  • src : A pointer to the memory area where the sequential data will be read from
  • len : The length of the memory area, in bytes

Returns

  • The number of bytes actually multiplexed

libIIO documentation

source