Index
LibIIO.CLibIIO.iio_buffer_cancel
LibIIO.CLibIIO.iio_buffer_destroy
LibIIO.CLibIIO.iio_buffer_end
LibIIO.CLibIIO.iio_buffer_first
LibIIO.CLibIIO.iio_buffer_foreach_sample
LibIIO.CLibIIO.iio_buffer_get_data
LibIIO.CLibIIO.iio_buffer_get_device
LibIIO.CLibIIO.iio_buffer_get_poll_fd
LibIIO.CLibIIO.iio_buffer_push
LibIIO.CLibIIO.iio_buffer_push_partial
LibIIO.CLibIIO.iio_buffer_refill
LibIIO.CLibIIO.iio_buffer_set_blocking_mode
LibIIO.CLibIIO.iio_buffer_set_data
LibIIO.CLibIIO.iio_buffer_start
LibIIO.CLibIIO.iio_buffer_step
LibIIO.CLibIIO.iio_device_create_buffer
Documentation
LibIIO.CLibIIO.iio_buffer_get_device
— Functioniio_buffer_get_device(buffer)
Retrieves a pointer to the iio_device
structure.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- A pointer to an
iio_device
structure
See libiio
LibIIO.CLibIIO.iio_device_create_buffer
— Functioniio_device_create_buffer(dev, samples_count, cyclic)
Create an input or output buffer associated to the given device.
Parameters
dev::Ptr{iio_device}
: A pointer to aniio_device
structuresamples_count::Csize_t
: The number of samples that the buffer should containcyclic::Bool
: If true, enable cyclic mode
Returns
- On success, a pointer to an
iio_buffer
structure - On error, an error is raised
Channels that have to be written to / read from must be enabled before creating the buffer.
See libiio
LibIIO.CLibIIO.iio_buffer_destroy
— Functioniio_buffer_destroy(buf)
Destroy the given buffer.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- A pointer corresponding to the address that follows the last sample present in the buffer
See libiio
LibIIO.CLibIIO.iio_buffer_get_poll_fd
— Functioniio_buffer_get_poll_fd(buf)
Get a pollable file descriptor.
Can be used to know when iio_buffer_refill
or iio_buffer_push
can be called
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- On success, valid file descriptor
- On error, a negative errno code is returned
See libiio
LibIIO.CLibIIO.iio_buffer_set_blocking_mode
— Functioniio_buffer_set_blocking_mode(buf, blocking)
Make iio_buffer_refill
and iio_buffer_push
blocking or not.
After this function has been called with blocking == false, iio_buffer_refill
and iio_buffer_push
will return -EAGAIN
if no data is ready. A device is blocking by default.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structureblocking::Bool
: true if the buffer API should be blocking, else false
Returns
- On success, 0
- On error, a negative errno code is returned
See libiio
LibIIO.CLibIIO.iio_buffer_refill
— Functioniio_buffer_refill(buf)
Fetch more samples from the hardware.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- On success, the number of bytes read is returned
- On error, a negative errno code is returned
See libiio
LibIIO.CLibIIO.iio_buffer_push
— Functioniio_buffer_push(buf)
Send the samples to the hardware.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- On success, the number of bytes written is returned
- On error, a negative errno code is returned
Only valid for output buffers
See libiio
LibIIO.CLibIIO.iio_buffer_push_partial
— Functioniio_buffer_push_partial(buf, samples_count)
Send a given number of samples to the hardware.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structuresamples_count::Csize_t
: The number of samples to submit
Returns
- On success, the number of bytes written is returned
- On error, a negative errno code is returned
Only valid for output buffers
See libiio
LibIIO.CLibIIO.iio_buffer_cancel
— Functioniio_buffer_cancel(buf)
Cancel all buffer operations.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
This function cancels all outstanding buffer operations previously scheduled. This means any pending iio_buffer_push
or iio_buffer_refill
operation will abort and return immediately, any further invocations of these functions on the same buffer will return immediately with an error.
Usually iio_buffer_push
and iio_buffer_refill
will block until either all data has been transferred or a timeout occurs. This can depending on the configuration take a significant amount of time. iio_buffer_cancel
is useful to bypass these conditions if the buffer operation is supposed to be stopped in response to an external event (e.g. user input).
To be able to capture additional data after calling this function the buffer should be destroyed and then re-created.
This function can be called multiple times for the same buffer, but all but the first invocation will be without additional effect.
This function is thread-safe, but not signal-safe, i.e. it must not be called from a signal handler.
See libiio
LibIIO.CLibIIO.iio_buffer_start
— Functioniio_buffer_start(buf)
Get the start address of the buffer.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- A pointer corresponding to the start address of the buffer
See libiio
LibIIO.CLibIIO.iio_buffer_first
— Functioniio_buffer_first(buf, chn)
Find the first sample of a channel in a buffer.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structurechn::Ptr{iio_channel}
:A pointer to aniio_channel
structure
Returns
- A pointer to the first sample found, or to the end of the buffer if no sample for the given channel is present in the buffer
This function, coupled with iiobufferstep and iiobufferend, can be used to iterate on all the samples of a given channel present in the buffer, doing the following:
# Note that you have to adjust the end of the range for Julia, as the last value is included
for ptr in iio_buffer_first(buf, chn):iio_buffer_step(buf):(iio_buffer_end(buf) - iio_buffer_step(buf))
....
end
See libiio
LibIIO.CLibIIO.iio_buffer_step
— Functioniio_buffer_step(buf)
Get the step size between two samples of one channel.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- The difference between the addresses of two consecutive samples of one same channel
See libiio
LibIIO.CLibIIO.iio_buffer_end
— Functioniio_buffer_end(buf)
Get the address that follows the last sample in a buffer.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- A pointer corresponding to the address that follows the last sample present in the buffer
See libiio
LibIIO.CLibIIO.iio_buffer_foreach_sample
— Functioniio_buffer_foreach_sample(buf, callback, data)
Call the supplied callback each sample found in a buffer.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structurecallback::Ptr{Cvoid}
: A pointer to a function to call for each sample founddata::Ptr{Cvoid}
: A user-specified pointer that will be passed to the callback
Returns
- Number of bytes processed
The callback receives four arguments:
- A pointer to the
iio_channel
structure corresponding to the sample, - A pointer to the sample itself,
- The length of the sample in bytes,
- The user-specified pointer passed to
iio_buffer_foreach_sample
.
See libiio
LibIIO.CLibIIO.iio_buffer_set_data
— Functioniio_buffer_set_data(buf, data)
Associate a pointer to an iio_buffer
structure.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structuredata::Ptr{Cuchar}
: The pointer to be associated
See libiio
LibIIO.CLibIIO.iio_buffer_get_data
— Functioniio_buffer_get_data(buf)
Retrieve a pointer to the iio_device
structure.
Parameters
buf::Ptr{iio_buffer}
: A pointer to aniio_buffer
structure
Returns
- A pointer to an
iio_device
structure
See libiio