libiio: Buffer

libiio 1.0 Library for interfacing with IIO devices

Loading...
Searching...
No Matches
Modules | Data Structures | Enumerator | Functions | Variables
Buffer
Collaboration diagram for Buffer:

## Modules
| Buffer Stream
| Block
| Stream
| Compatibility with hardware monitoring (hwmon) devices
| Functions to read IIO events
| Debug and low-level functions

## Data Structures
struct | iio_buffer
| An input or output buffer, used to read or write samples. More...

## Functions
__api __check_ret __pure const struct iio_device * | iio_buffer_get_device (const struct iio_buffer *buf)
| Retrieve a pointer to the iio_device structure.
__api __check_ret __pure unsigned int | iio_buffer_get_attrs_count (const struct iio_buffer *buf)
| Enumerate the attributes of the given buffer.
__api __check_ret __pure const struct iio_attr * | iio_buffer_get_attr (const struct iio_buffer *buf, unsigned int index)
| Get the buffer-specific attribute present at the given index.
__api __check_ret __pure const struct iio_attr * | iio_buffer_find_attr (const struct iio_buffer *buf, const char *name)
| Try to find a buffer-specific attribute by its name.
__api __check_ret __pure bool | iio_buffer_is_output (const struct iio_buffer *buf)
| Returns true if the buffer is an output buffer.
__api void | iio_buffer_set_data (struct iio_buffer *buf, void *data)
| Associate a pointer to an iio_buffer structure.
__api void * | iio_buffer_get_data (const struct iio_buffer *buf)
| Retrieve a previously associated pointer of an iio_buffer structure.

## Variables
FILE * | iio_context_params::out
| Handle to the standard output. If NULL, defaults to stdout.
FILE * | iio_context_params::err
| Handle to the error output. If NULL, defaults to stderr.
enum iio_log_level | iio_context_params::log_level
| Log level to use. Defaults to the log level that was specified at compilation.
enum iio_log_level | iio_context_params::stderr_level
| Under this log level (included), messages are sent to the error output ; above this log level (excluded), messages are sent to the standard output. If zero, defaults to LEVEL_WARNING.
enum iio_log_level | iio_context_params::timestamp_level
| Under this log level (excluded), messages are sent without timestamp; above this log level (included), messages are sent with a timestamp. If set to LEVEL_NOLOG, messages at all log levels are sent without a timestamp. If zero, defaults to LEVEL_DEBUG.
int | iio_context_params::timeout_ms
| Timeout for I/O operations in milliseconds.
unsigned int | iio_context_params::flags
| Flags that control context behavior. Bitmask of values from enum iio_context_flags.
char | iio_context_params::__rsrv [32]
| Reserved for future fields.
uint64_t | iio_event::id
int64_t | iio_event::timestamp
unsigned int | iio_data_format::length
| Total length of the sample, in bits.
unsigned int | iio_data_format::bits
| Length of valuable data in the sample, in bits.
unsigned int | iio_data_format::shift
| Right-shift to apply when converting sample.
bool | iio_data_format::is_signed
| Contains True if the sample is signed.
bool | iio_data_format::is_fully_defined
| Contains True if the sample is fully defined, sign extended, etc.
bool | iio_data_format::is_be
| Contains True if the sample is in big-endian format.
bool | iio_data_format::with_scale
| Contains True if the sample should be scaled when converted.
double | iio_data_format::scale
| Contains the scale to apply if with_scale is set.
unsigned int | iio_data_format::repeat
| Number of times length repeats (added in v0.8)
double | iio_data_format::offset
| Contains a value to be added to the raw sample before applying the scale.

## Detailed Description

## Function Documentation

## ◆ iio_buffer_find_attr()

__api __check_ret __pure const struct iio_attr * iio_buffer_find_attr | ( | const struct iio_buffer * | buf,
|  | const char * | name
| ) |  |

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

Parameters

  buf | A pointer to an iio_buffer structure
  name | A NULL-terminated string corresponding to the name of the attribute

Returns
  On success, a pointer to an iio_attr structure
  If the name does not correspond to any known attribute of the given buffer, NULL is returned

## ◆ iio_buffer_get_attr()

__api __check_ret __pure const struct iio_attr * iio_buffer_get_attr | ( | const struct iio_buffer * | buf,
|  | unsigned int | index
| ) |  |

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

Parameters

  buf | A pointer to an iio_buffer structure
  index | The index corresponding to the attribute

Returns
  On success, a pointer to an iio_attr structure
  If the index is invalid, NULL is returned

## ◆ iio_buffer_get_attrs_count()

__api __check_ret __pure unsigned int iio_buffer_get_attrs_count | ( | const struct iio_buffer * | buf | ) |

Enumerate the attributes of the given buffer.

Parameters

  buf | A pointer to an iio_buffer structure

Returns
  The number of buffer-specific attributes found

## ◆ iio_buffer_get_data()

__api void * iio_buffer_get_data | ( | const struct iio_buffer * | buf | ) |

Retrieve a previously associated pointer of an iio_buffer structure.

Parameters

  buf | A pointer to an iio_buffer structure

Returns
  The pointer previously associated if present, or NULL

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ iio_buffer_get_device()

__api __check_ret __pure const struct iio_device * iio_buffer_get_device | ( | const struct iio_buffer * | buf | ) |

Retrieve a pointer to the iio_device structure.

Parameters

  buf | A pointer to an iio_buffer structure

Returns
  A pointer to an iio_device structure

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ iio_buffer_is_output()

__api __check_ret __pure bool iio_buffer_is_output | ( | const struct iio_buffer * | buf | ) |

Returns true if the buffer is an output buffer.

Parameters

  buf | A pointer to an iio_buffer structure

Returns
  True if the buffer is an output (TX) buffer, false otherwise

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ iio_buffer_set_data()

__api void iio_buffer_set_data | ( | struct iio_buffer * | buf,
|  | void * | data
| ) |  |

Associate a pointer to an iio_buffer structure.

Parameters

  buf | A pointer to an iio_buffer structure
  data | The pointer to be associated

Here is the call graph for this function:

## Variable Documentation

## ◆ timeout_ms

int iio_context_params::timeout_ms

Timeout for I/O operations in milliseconds.

- Zero: use backend default timeout
- Negative values: no timeout (wait indefinitely)
- Positive values: timeout after specified milliseconds