|
My Project
|
Classes | |
| struct | iio_block |
| A block of memory containing data samples. More... | |
Functions | |
| struct iio_block * | iio_buffer_stream_create_block (struct iio_buffer_stream *buf_stream, size_t size) |
| Create a data block for the given buffer stream. | |
| void | iio_block_destroy (struct iio_block *block) |
| Destroy the given block. | |
| int | iio_block_get_dmabuf_fd (const struct iio_block *block) |
| Get the file descriptor of the underlying DMABUF object. | |
| int | iio_block_disable_cpu_access (struct iio_block *block, bool disable) |
| Disable CPU access of a given block. | |
| void * | iio_block_start (const struct iio_block *block) |
| Get the start address of the block. | |
| void * | iio_block_first (const struct iio_block *block, const struct iio_channel *chn) |
| Find the first sample of a channel in a block. | |
| void * | iio_block_end (const struct iio_block *block) |
| Get the address after the last sample in a block. | |
| ssize_t | iio_block_foreach_sample (const struct iio_block *block, const struct iio_channels_mask *mask, ssize_t(*callback)(const struct iio_channel *chn, void *src, size_t bytes, void *d), void *data) |
| Call the supplied callback for each sample found in a block. | |
| int | iio_block_enqueue (struct iio_block *block, size_t bytes_used, bool cyclic) |
| Enqueue the given iio_block to the buffer's queue. | |
| int | iio_block_dequeue (struct iio_block *block, bool nonblock) |
| Dequeue the given iio_block from the buffer's queue. | |
| struct iio_buffer_stream * | iio_block_get_buffer_stream (const struct iio_block *block) |
| Retrieve a pointer to the iio_buffer_stream structure. | |
| int iio_block_dequeue | ( | struct iio_block * | block, |
| bool | nonblock ) |
| void iio_block_destroy | ( | struct iio_block * | block | ) |
Destroy the given block.
| block | A pointer to an iio_block structure |
NOTE: If the block is backed by a DMABUF object, the file descriptor previously returned by iio_block_get_dmabuf_fd is closed by this function.
| int iio_block_disable_cpu_access | ( | struct iio_block * | block, |
| bool | disable ) |
Disable CPU access of a given block.
| block | A pointer to an iio_block structure |
| disable | Whether or not to disable CPU access |
NOTE:Disabling CPU access is useful when manipulating DMABUF objects. If CPU access is disabled, the block's internal buffer of samples should not be accessed. Therefore, the following functions should not be called: iio_block_start, iio_block_first, iio_block_end, iio_block_foreach_sample.
| void * iio_block_end | ( | const struct iio_block * | block | ) |
Get the address after the last sample in a block.
| block | A pointer to an iio_block structure |
| int iio_block_enqueue | ( | struct iio_block * | block, |
| size_t | bytes_used, | ||
| bool | cyclic ) |
Enqueue the given iio_block to the buffer's queue.
| block | A pointer to an iio_block structure |
| bytes_used | The amount of data in bytes to be transferred (either transmitted or received). If zero, the size of the block is used. |
| cyclic | If True, enable cyclic mode. The block's content will be repeated on the hardware's output until the buffer is cancelled or destroyed. |
NOTE: After iio_block_enqueue is called, the block's data must not be accessed until iio_block_dequeue successfully returns.
| void * iio_block_first | ( | const struct iio_block * | block, |
| const struct iio_channel * | chn ) |
Find the first sample of a channel in a block.
| block | A pointer to an iio_block structure |
| chn | A pointer to an iio_channel structure |
NOTE: This function, coupled with iio_block_end, can be used to iterate on all the samples of a given channel present in the block, doing the following:
for (void *ptr = iio_block_first(block, chn);
ptr < iio_block_end(block);
ptr += iio_device_get_sample_size(dev, mask)) {
....
}
The iio_channel passed as argument must be from the iio_device that was used to create the iio_buffer and then the iio_block, otherwise the result is undefined.
| ssize_t iio_block_foreach_sample | ( | const struct iio_block * | block, |
| const struct iio_channels_mask * | mask, | ||
| ssize_t(* | callback )(const struct iio_channel *chn, void *src, size_t bytes, void *d), | ||
| void * | data ) |
Call the supplied callback for each sample found in a block.
| block | A pointer to an iio_block structure |
| mask | A pointer to the iio_channels_mask structure that represents the list of channels for which we want samples |
| callback | A pointer to a function to call for each sample found |
| data | A user-specified pointer that will be passed to the callback |
NOTE: The callback receives four arguments:
| struct iio_buffer_stream * iio_block_get_buffer_stream | ( | const struct iio_block * | block | ) |
Retrieve a pointer to the iio_buffer_stream structure.
| block | A pointer to an iio_block structure |
| int iio_block_get_dmabuf_fd | ( | const struct iio_block * | block | ) |
Get the file descriptor of the underlying DMABUF object.
| block | A pointer to an iio_block structure |
NOTE: The returned file descriptor is owned by the iio_block. The caller must not close it; it is closed by iio_block_destroy.
| void * iio_block_start | ( | const struct iio_block * | block | ) |
Get the start address of the block.
| block | A pointer to an iio_block structure |
NOTE: Check the returned pointer with iio_err before dereferencing it. A block's memory is not guaranteed to be reachable by the CPU; memory that cannot be mapped or accessed, would be reported this way rather than as a valid address.
| struct iio_block * iio_buffer_stream_create_block | ( | struct iio_buffer_stream * | buf_stream, |
| size_t | size ) |
Create a data block for the given buffer stream.
| buf_stream | A pointer to an iio_buffer_stream structure |
| size | The size of the block to create, in bytes |