My Project
Loading...
Searching...
No Matches
Buffer

Classes

struct  iio_buffer
 An input or output buffer, used to read or write samples. More...

Functions

const struct iio_device * iio_buffer_get_device (const struct iio_buffer *buf)
 Retrieve a pointer to the iio_device structure.
unsigned int iio_buffer_get_attrs_count (const struct iio_buffer *buf)
 Enumerate the attributes of the given buffer.
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.
unsigned int iio_buffer_get_scan_elements_count (const struct iio_buffer *buf)
 Enumerate the scan elements of the given buffer.
const struct iio_channel * iio_buffer_get_scan_element (const struct iio_buffer *buf, unsigned int index)
 Get the scan element present at the given index.
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.
bool iio_buffer_is_output (const struct iio_buffer *buf)
 Returns true if the buffer is an output buffer.
void iio_buffer_set_data (struct iio_buffer *buf, void *data)
 Associate a pointer to an iio_buffer structure.
void * iio_buffer_get_data (const struct iio_buffer *buf)
 Retrieve a previously associated pointer of an iio_buffer structure.

Detailed Description

Function Documentation

◆ iio_buffer_find_attr()

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
bufA pointer to an iio_buffer structure
nameA 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()

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
bufA pointer to an iio_buffer structure
indexThe 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()

unsigned int iio_buffer_get_attrs_count ( const struct iio_buffer * buf)

Enumerate the attributes of the given buffer.

Parameters
bufA pointer to an iio_buffer structure
Returns
The number of buffer-specific attributes found

◆ iio_buffer_get_data()

void * iio_buffer_get_data ( const struct iio_buffer * buf)

Retrieve a previously associated pointer of an iio_buffer structure.

Parameters
bufA pointer to an iio_buffer structure
Returns
The pointer previously associated if present, or NULL

◆ iio_buffer_get_device()

const struct iio_device * iio_buffer_get_device ( const struct iio_buffer * buf)

Retrieve a pointer to the iio_device structure.

Parameters
bufA pointer to an iio_buffer structure
Returns
A pointer to an iio_device structure

◆ iio_buffer_get_scan_element()

const struct iio_channel * iio_buffer_get_scan_element ( const struct iio_buffer * buf,
unsigned int index )

Get the scan element present at the given index.

Parameters
bufA pointer to an iio_buffer structure
indexThe index corresponding to the scan element
Returns
On success, a pointer to an iio_channel structure
If the index is invalid, NULL is returned

◆ iio_buffer_get_scan_elements_count()

unsigned int iio_buffer_get_scan_elements_count ( const struct iio_buffer * buf)

Enumerate the scan elements of the given buffer.

Parameters
bufA pointer to an iio_buffer structure
Returns
The number of scan elements associated with the buffer

◆ iio_buffer_is_output()

bool iio_buffer_is_output ( const struct iio_buffer * buf)

Returns true if the buffer is an output buffer.

Parameters
bufA pointer to an iio_buffer structure
Returns
True if the buffer is an output (TX) buffer, false otherwise

◆ iio_buffer_set_data()

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

Associate a pointer to an iio_buffer structure.

Parameters
bufA pointer to an iio_buffer structure
dataThe pointer to be associated