device.jl
AdalmPluto.libIIO_jl.C_iio_device_attr_read
AdalmPluto.libIIO_jl.C_iio_device_attr_read_all
AdalmPluto.libIIO_jl.C_iio_device_attr_read_bool
AdalmPluto.libIIO_jl.C_iio_device_attr_read_double
AdalmPluto.libIIO_jl.C_iio_device_attr_read_longlong
AdalmPluto.libIIO_jl.C_iio_device_attr_write
AdalmPluto.libIIO_jl.C_iio_device_attr_write_all
AdalmPluto.libIIO_jl.C_iio_device_attr_write_bool
AdalmPluto.libIIO_jl.C_iio_device_attr_write_double
AdalmPluto.libIIO_jl.C_iio_device_attr_write_longlong
AdalmPluto.libIIO_jl.C_iio_device_attr_write_raw
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_all
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_bool
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_double
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_longlong
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_all
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_bool
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_double
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_longlong
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_raw
AdalmPluto.libIIO_jl.C_iio_device_find_attr
AdalmPluto.libIIO_jl.C_iio_device_find_buffer_attr
AdalmPluto.libIIO_jl.C_iio_device_find_channel
AdalmPluto.libIIO_jl.C_iio_device_get_attr
AdalmPluto.libIIO_jl.C_iio_device_get_attrs_count
AdalmPluto.libIIO_jl.C_iio_device_get_buffer_attr
AdalmPluto.libIIO_jl.C_iio_device_get_buffer_attrs_count
AdalmPluto.libIIO_jl.C_iio_device_get_channel
AdalmPluto.libIIO_jl.C_iio_device_get_channels_count
AdalmPluto.libIIO_jl.C_iio_device_get_context
AdalmPluto.libIIO_jl.C_iio_device_get_data
AdalmPluto.libIIO_jl.C_iio_device_get_id
AdalmPluto.libIIO_jl.C_iio_device_get_name
AdalmPluto.libIIO_jl.C_iio_device_get_trigger
AdalmPluto.libIIO_jl.C_iio_device_is_trigger
AdalmPluto.libIIO_jl.C_iio_device_set_data
AdalmPluto.libIIO_jl.C_iio_device_set_kernel_buffers_count
AdalmPluto.libIIO_jl.C_iio_device_set_trigger
AdalmPluto.libIIO_jl.C_iio_device_attr_read
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_attr_read_all
— MethodC_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.
AdalmPluto.libIIO_jl.C_iio_device_attr_read_bool
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_attr_read_double
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_attr_read_longlong
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_attr_write
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::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.
AdalmPluto.libIIO_jl.C_iio_device_attr_write_all
— MethodC_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
AdalmPluto.libIIO_jl.C_iio_device_attr_write_bool
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Bool
: A bool value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_attr_write_double
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Float64
: A double value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_attr_write_longlong
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Int64
: A long long value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_attr_write_raw
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Ptr{Cvoid}
: A pointer to the data to be writtensize::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
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_all
— MethodC_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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_bool
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_double
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_read_longlong
— MethodC_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 structureattr::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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_all
— MethodC_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.
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_bool
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Bool
: A bool value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_double
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Float64
: A double value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_longlong
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Int64
: A long long value to set the attribute to
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_buffer_attr_write_raw
— MethodC_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 structureattr::String
: A NULL-terminated string corresponding to the name of the attributevalue::Ptr{Cvoid}
: A pointer to the data to be writtensize::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
AdalmPluto.libIIO_jl.C_iio_device_find_attr
— MethodC_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 structurename::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.
AdalmPluto.libIIO_jl.C_iio_device_find_buffer_attr
— MethodC_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 structurename::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.
AdalmPluto.libIIO_jl.C_iio_device_find_channel
— MethodC_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 structurename::String
: A NULL-terminated string corresponding to the name or the ID of the channel to search forisOutput::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.
AdalmPluto.libIIO_jl.C_iio_device_get_attr
— MethodC_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 structureindex::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.
AdalmPluto.libIIO_jl.C_iio_device_get_attrs_count
— MethodC_iio_device_get_attrs_count(device)
Enumerate the device-specific attributes of the given device.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- The number of device-specific attributes found
AdalmPluto.libIIO_jl.C_iio_device_get_buffer_attr
— MethodC_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 structureindex::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.
AdalmPluto.libIIO_jl.C_iio_device_get_buffer_attrs_count
— MethodC_iio_device_get_buffer_attrs_count(device)
Enumerate the buffer-specific attributes of the given device.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- The number of buffer-specific attributes found
AdalmPluto.libIIO_jl.C_iio_device_get_channel
— MethodC_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 structureindex::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.
AdalmPluto.libIIO_jl.C_iio_device_get_channels_count
— MethodC_iio_device_get_channels_count(device)
Retrieve a pointer to the iio_context structure.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- A pointer to an iio_context structure
AdalmPluto.libIIO_jl.C_iio_device_get_context
— MethodC_iio_device_get_context(device)
Retrieve a pointer to the iio_context structure.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- A pointer to an iio_context structure
AdalmPluto.libIIO_jl.C_iio_device_get_data
— MethodC_iio_device_get_data(device)
Retrieve a previously associated pointer of an iio_device structure.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- The pointer previously associated if present, or NULL
AdalmPluto.libIIO_jl.C_iio_device_get_id
— MethodC_iio_device_get_id(device)
Retrieve the device ID (e.g. iio:device0)
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- A NULL-terminated string
AdalmPluto.libIIO_jl.C_iio_device_get_name
— MethodC_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.
AdalmPluto.libIIO_jl.C_iio_device_get_trigger
— MethodC_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.
AdalmPluto.libIIO_jl.C_iio_device_is_trigger
— MethodC_iio_device_is_trigger(device)
Return True if the given device is a trigger.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structure
Returns
- True if the device is a trigger, False otherwise
AdalmPluto.libIIO_jl.C_iio_device_set_data
— MethodC_iio_device_set_data(device, data)
Associate a pointer to an iio_device structure. If the pointer is a Julia pointer, you need to protect the data from the GC.
See the Julia Documentation and GC.@preserve
.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structuredata::Ptr{Cvoid}
: A pointer to the data to be associated.
AdalmPluto.libIIO_jl.C_iio_device_set_kernel_buffers_count
— MethodC_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 structurenb_buffers::UInt32
: The number of buffers
Returns
- On success, 0 is returned
- On error, a negative errno code is returned
AdalmPluto.libIIO_jl.C_iio_device_set_trigger
— MethodC_iio_device_set_trigger(device, trigger)
Associate a trigger to a given device.
Parameters
device::Ptr{iio_device}
: A pointer to an iio_device structuretrigger::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