device.jl

AdalmPluto.libIIO_jl.C_iio_device_attr_readMethod
C_iio_device_attr_read(device, attr)

Read the content of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A NULL-terminated string corresponding to the name of the attribute. Passing an empty string reads all the attributes.

Returns

  • On success, the number of bytes written to the buffer and the attribute value as a String.
  • On error, a negative errno code is returned along an empty String.
  • If all the attributes are being read, an array of the values above is returned.

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

NOTE

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

The buffer is filled with 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, 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_device_attr_read_allMethod
C_iio_device_attr_read_all()

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

Read the content of all device-specific attributes.

Parameters

  • dev : A pointer to an iio_device 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 device-specific attributes are read in one single command.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_read_boolMethod
C_iio_device_attr_read_bool(device, attr)

Read the content of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Bool) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_read_doubleMethod
C_iio_device_attr_read_double(device, attr)

Read the content of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Float64) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_read_longlongMethod
C_iio_device_attr_read_longlong(device, attr)

Read the content of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Int64) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_writeMethod
C_iio_device_attr_write(device, attr, value)

Set the value of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_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.

WARNING

If the value given is among the available values but not working on the radio, this function returns the success value without actually writing the value.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_write_allMethod
C_iio_device_attr_write_all()

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

Set the values of all device-specific attributes.

Parameters

  • dev : A pointer to an iio_device 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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_attr_write_boolMethod
C_iio_device_attr_write_bool(device, attr, value)

Set the value of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_attr_write_doubleMethod
C_iio_device_attr_write_double(device, attr, value)

Set the value of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_attr_write_longlongMethod
C_iio_device_attr_write_longlong(device, attr, value)

Set the value of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_attr_write_rawMethod
C_iio_device_attr_write_raw(device, attr, value)

Set the value of the given device-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_buffer_attr_readMethod
C_iio_device_buffer_attr_read(device, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device structure
  • attr::String : A NULL-terminated string corresponding to the name of the attribute. Passing an empty string reads all the attributes.

Returns

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

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

NOTE

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

The buffer is filled with one block of data per attribute of the buffer, 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, 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_device_buffer_attr_read_allMethod
C_iio_device_buffer_attr_read_all()

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

Read the content of all buffer-specific attributes.

Parameters

  • dev : A pointer to an iio_device 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 buffer-specific attributes are read in one single command.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_boolMethod
C_iio_device_buffer_attr_read_bool(device, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Bool) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_doubleMethod
C_iio_device_buffer_attr_read_double(device, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Float64) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_longlongMethod
C_iio_device_buffer_attr_read_longlong(device, attr)

Read the content of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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, value::Int64) is returned, where errno is a negative error code. value should be discarded.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_writeMethod
C_iio_device_buffer_attr_write(device, attr, value)

Set the value of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_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 buffer, 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.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_allMethod
C_iio_device_buffer_attr_write_all()

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

Set the values of all buffer-specific attributes.

Parameters

  • dev : A pointer to an iio_device 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 buffer-specific attributes are written in one single command.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_boolMethod
C_iio_device_buffer_attr_write_bool(device, attr, value)

Set the value of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_buffer_attr_write_doubleMethod
C_iio_device_buffer_attr_write_double(device, attr, value)

Set the value of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_buffer_attr_write_longlongMethod
C_iio_device_buffer_attr_write_longlong(device, attr, value)

Set the value of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_buffer_attr_write_rawMethod
C_iio_device_buffer_attr_write_raw(device, attr, value)

Set the value of the given buffer-specific attribute.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_find_attrMethod
C_iio_device_find_attr(device, name)

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

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_find_buffer_attrMethod
C_iio_device_find_buffer_attr(device, name)

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

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_find_channelMethod
C_iio_device_find_channel(device, name, isOutput)

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

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device structure
  • name::String : A NULL-terminated string corresponding to the name or the ID of the channel to search for
  • isOutput::Bool : True if the searched channel is output, False otherwise

Returns

  • On success, a pointer to an iio_channel structure
  • On failure, if the assertions are enabled, throws an error.
  • On failure, if the assertions are disabled, returns NULL.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_get_attrMethod
C_iio_device_get_attr(device, index)

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

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_get_buffer_attrMethod
C_iio_device_get_buffer_attr(device, index)

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

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device 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_device_get_channelMethod
C_iio_device_get_channel(device, index)

Get the channel present at the given index.

Parameters

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

Returns

  • On success, a pointer to an iio_channel structure
  • On failure, if the assertions are enabled, throws an error.
  • On failure, if the assertions are disabled, returns NULL.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_get_nameMethod
C_iio_device_get_name(device)

Retrieve the device name (e.g. xadc)

Parameters

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

Returns

  • A NULL-terminated string

NOTE

If the device has no name and the assertions are enabled, throws an error. If the device has no name and the assertions are enabled, returns an emtpy string.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_get_triggerMethod
C_iio_device_get_trigger(device)

Retrieve the trigger of a given device.

Parameters

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

Returns

  • On success, (0, trigger::Ptr{iio_device}) is returned.
  • On error, (errno, NULL) is returned, where errno is a negative error code.

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_set_kernel_buffers_countMethod
C_iio_device_set_kernel_buffers_count(device, nb_buffers)

Configure the number of kernel buffers for a device.

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

Parameters

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

Returns

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

libIIO documentation

source
AdalmPluto.libIIO_jl.C_iio_device_set_triggerMethod
C_iio_device_set_trigger(device, trigger)

Associate a trigger to a given device.

Parameters

  • device::Ptr{iio_device} : A pointer to an iio_device structure
  • trigger::Ptr{iio_device} : a pointer to the 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

libIIO documentation

source