Loading...
Searching...
No Matches
Device

## Data Structures

struct | iio_device
| Represents a device in the IIO context. More...

## Functions

__api __check_ret __pure const struct iio_context * | iio_device_get_context (const struct iio_device *dev)
| Retrieve a pointer to the iio_context structure.
__api __check_ret __pure const char * | iio_device_get_id (const struct iio_device *dev)
| Retrieve the device ID (e.g. iio:device0).
__api __check_ret __pure const char * | iio_device_get_name (const struct iio_device *dev)
| Retrieve the device name (e.g. xadc).
__api __check_ret __pure const char * | iio_device_get_label (const struct iio_device *dev)
| Retrieve the device label (e.g. lo_pll0_rx_adf4351).
__api __check_ret __pure unsigned int | iio_device_get_channels_count (const struct iio_device *dev)
| Enumerate the channels of the given device.
__api __check_ret __pure unsigned int | iio_device_get_attrs_count (const struct iio_device *dev)
| Enumerate the device-specific attributes of the given device.
__api __check_ret __pure unsigned int | iio_device_get_buffer_attrs_count (const struct iio_device *dev)
| Enumerate the buffer-specific attributes of the given device.
__api __check_ret __pure struct iio_channel * | iio_device_get_channel (const struct iio_device *dev, unsigned int index)
| Get the channel present at the given index.
__api __check_ret __pure const char * | iio_device_get_attr (const struct iio_device *dev, unsigned int index)
| Get the device-specific attribute present at the given index.
__api __check_ret __pure const char * | iio_device_get_buffer_attr (const struct iio_device *dev, unsigned int index)
| Get the buffer-specific attribute present at the given index.
__api __check_ret __pure struct iio_channel * | iio_device_find_channel (const struct iio_device *dev, const char *name, bool output)
| Try to find a channel structure by its name of ID.
__api __check_ret __pure const char * | iio_device_find_attr (const struct iio_device *dev, const char *name)
| Try to find a device-specific attribute by its name.
__api __check_ret __pure const char * | iio_device_find_buffer_attr (const struct iio_device *dev, const char *name)
| Try to find a buffer-specific attribute by its name.
__api __check_ret ssize_t | iio_device_attr_read (const struct iio_device *dev, const char *attr, char *dst, size_t len)
| Read the content of the given device-specific attribute.
__api __check_ret int | iio_device_attr_read_all (struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d), void *data)
| Read the content of all device-specific attributes.
__api __check_ret int | iio_device_attr_read_bool (const struct iio_device *dev, const char *attr, bool *val)
| Read the content of the given device-specific attribute.
__api __check_ret int | iio_device_attr_read_longlong (const struct iio_device *dev, const char *attr, long long *val)
| Read the content of the given device-specific attribute.
__api __check_ret int | iio_device_attr_read_double (const struct iio_device *dev, const char *attr, double *val)
| Read the content of the given device-specific attribute.
__api __check_ret ssize_t | iio_device_attr_write (const struct iio_device *dev, const char *attr, const char *src)
| Set the value of the given device-specific attribute.
__api __check_ret ssize_t | iio_device_attr_write_raw (const struct iio_device *dev, const char *attr, const void *src, size_t len)
| Set the value of the given device-specific attribute.
__api __check_ret int | iio_device_attr_write_all (struct iio_device *dev, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)
| Set the values of all device-specific attributes.
__api __check_ret int | iio_device_attr_write_bool (const struct iio_device *dev, const char *attr, bool val)
| Set the value of the given device-specific attribute.
__api __check_ret int | iio_device_attr_write_longlong (const struct iio_device *dev, const char *attr, long long val)
| Set the value of the given device-specific attribute.
__api __check_ret int | iio_device_attr_write_double (const struct iio_device *dev, const char *attr, double val)
| Set the value of the given device-specific attribute.
__api __check_ret ssize_t | iio_device_buffer_attr_read (const struct iio_device *dev, const char *attr, char *dst, size_t len)
| Read the content of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_read_all (struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d), void *data)
| Read the content of all buffer-specific attributes.
__api __check_ret int | iio_device_buffer_attr_read_bool (const struct iio_device *dev, const char *attr, bool *val)
| Read the content of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_read_longlong (const struct iio_device *dev, const char *attr, long long *val)
| Read the content of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_read_double (const struct iio_device *dev, const char *attr, double *val)
| Read the content of the given buffer-specific attribute.
__api __check_ret ssize_t | iio_device_buffer_attr_write (const struct iio_device *dev, const char *attr, const char *src)
| Set the value of the given buffer-specific attribute.
__api __check_ret ssize_t | iio_device_buffer_attr_write_raw (const struct iio_device *dev, const char *attr, const void *src, size_t len)
| Set the value of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_write_all (struct iio_device *dev, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)
| Set the values of all buffer-specific attributes.
__api __check_ret int | iio_device_buffer_attr_write_bool (const struct iio_device *dev, const char *attr, bool val)
| Set the value of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_write_longlong (const struct iio_device *dev, const char *attr, long long val)
| Set the value of the given buffer-specific attribute.
__api __check_ret int | iio_device_buffer_attr_write_double (const struct iio_device *dev, const char *attr, double val)
| Set the value of the given buffer-specific attribute.
__api void | iio_device_set_data (struct iio_device *dev, void *data)
| Associate a pointer to an iio_device structure.
__api void * | iio_device_get_data (const struct iio_device *dev)
| Retrieve a previously associated pointer of an iio_device structure.
__api __check_ret int | iio_device_get_trigger (const struct iio_device *dev, const struct iio_device **trigger)
| Retrieve the trigger of a given device.
__api __check_ret int | iio_device_set_trigger (const struct iio_device *dev, const struct iio_device *trigger)
| Associate a trigger to a given device.
__api __check_ret __pure bool | iio_device_is_trigger (const struct iio_device *dev)
| Return True if the given device is a trigger.
__api __check_ret int | iio_device_set_kernel_buffers_count (const struct iio_device *dev, unsigned int nb_buffers)
| Configure the number of kernel buffers for a device.

## Detailed Description

## Function Documentation

## iio_device_attr_read()

__api __check_ret ssize_t iio_device_attr_read | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | char * | dst,
|  | size_t | len )

Read the content of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  dst | A pointer to the memory area where the NULL-terminated string corresponding to the value read will be stored
  len | The available length of the memory area, in bytes

Returns
  On success, the number of bytes written to the buffer
  On error, a negative errno code is returned

NOTE:By passing NULL as the "attr" argument to iio_device_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 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.

Here is the caller graph for this function:

## iio_device_attr_read_all()

__api __check_ret int iio_device_attr_read_all | ( | struct iio_device * | dev,
|  | int(* | cb )(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d),
|  | void * | data )

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.

## iio_device_attr_read_bool()

__api __check_ret int iio_device_attr_read_bool | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | bool * | val )

Read the content of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a bool variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_attr_read_double()

__api __check_ret int iio_device_attr_read_double | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | double * | val )

Read the content of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a double variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_attr_read_longlong()

__api __check_ret int iio_device_attr_read_longlong | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | long long * | val )

Read the content of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a long long variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

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

## iio_device_attr_write()

__api __check_ret ssize_t iio_device_attr_write | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | const char * | src )

Set the value of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  src | 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.

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

## iio_device_attr_write_all()

__api __check_ret int iio_device_attr_write_all | ( | struct iio_device * | dev,
|  | ssize_t(* | cb )(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d),
|  | void * | data )

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

NOTE: This function is especially useful when used with the network backend, as all the device-specific attributes are written in one single command.

## iio_device_attr_write_bool()

__api __check_ret int iio_device_attr_write_bool | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | bool | val )

Set the value of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A bool value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_attr_write_double()

__api __check_ret int iio_device_attr_write_double | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | double | val )

Set the value of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A double value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_attr_write_longlong()

__api __check_ret int iio_device_attr_write_longlong | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | long long | val )

Set the value of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A long long value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_attr_write_raw()

__api __check_ret ssize_t iio_device_attr_write_raw | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | const void * | src,
|  | size_t | len )

Set the value of the given device-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  src | A pointer to the data to be written
  len | The number of bytes that should be written

Returns
  On success, the number of bytes written
  On error, a negative errno code is returned

Here is the caller graph for this function:

## iio_device_buffer_attr_read()

__api __check_ret ssize_t iio_device_buffer_attr_read | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | char * | dst,
|  | size_t | len )

Read the content of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  dst | A pointer to the memory area where the NULL-terminated string corresponding to the value read will be stored
  len | The available length of the memory area, in bytes

Returns
  On success, the number of bytes written to the buffer
  On error, a negative errno code is returned

NOTE:By passing NULL 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.

Here is the caller graph for this function:

## iio_device_buffer_attr_read_all()

__api __check_ret int iio_device_buffer_attr_read_all | ( | struct iio_device * | dev,
|  | int(* | cb )(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d),
|  | void * | data )

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.

## iio_device_buffer_attr_read_bool()

__api __check_ret int iio_device_buffer_attr_read_bool | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | bool * | val )

Read the content of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a bool variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_buffer_attr_read_double()

__api __check_ret int iio_device_buffer_attr_read_double | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | double * | val )

Read the content of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a double variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_buffer_attr_read_longlong()

__api __check_ret int iio_device_buffer_attr_read_longlong | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | long long * | val )

Read the content of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A pointer to a long long variable where the value should be stored

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

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

## iio_device_buffer_attr_write()

__api __check_ret ssize_t iio_device_buffer_attr_write | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | const char * | src )

Set the value of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  src | 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.

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

## iio_device_buffer_attr_write_all()

__api __check_ret int iio_device_buffer_attr_write_all | ( | struct iio_device * | dev,
|  | ssize_t(* | cb )(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d),
|  | void * | data )

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.

## iio_device_buffer_attr_write_bool()

__api __check_ret int iio_device_buffer_attr_write_bool | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | bool | val )

Set the value of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A bool value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_buffer_attr_write_double()

__api __check_ret int iio_device_buffer_attr_write_double | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | double | val )

Set the value of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A double value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_buffer_attr_write_longlong()

__api __check_ret int iio_device_buffer_attr_write_longlong | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | long long | val )

Set the value of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  val | A long long value to set the attribute to

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

Here is the call graph for this function:

## iio_device_buffer_attr_write_raw()

__api __check_ret ssize_t iio_device_buffer_attr_write_raw | ( | const struct iio_device * | dev,
|  | const char * | attr,
|  | const void * | src,
|  | size_t | len )

Set the value of the given buffer-specific attribute.

Parameters

  dev | A pointer to an iio_device structure
  attr | A NULL-terminated string corresponding to the name of the attribute
  src | A pointer to the data to be written
  len | The number of bytes that should be written

Returns
  On success, the number of bytes written
  On error, a negative errno code is returned

Here is the caller graph for this function:

## iio_device_find_attr()

__api __check_ret __pure const char * iio_device_find_attr | ( | const struct iio_device * | dev,
|  | const char * | name )

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

Parameters

  dev | A pointer to an iio_device structure
  name | A NULL-terminated string corresponding to the name of the attribute

Returns
  On success, a pointer to a static NULL-terminated string
  If the name does not correspond to any known attribute of the given device, NULL is returned

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.

## iio_device_find_buffer_attr()

__api __check_ret __pure const char * iio_device_find_buffer_attr | ( | const struct iio_device * | dev,
|  | const char * | name )

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

Parameters

  dev | A pointer to an iio_device structure
  name | A NULL-terminated string corresponding to the name of the attribute

Returns
  On success, a pointer to a static NULL-terminated string
  If the name does not correspond to any known attribute of the given device, NULL is returned

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.

## iio_device_find_channel()

__api __check_ret __pure struct iio_channel * iio_device_find_channel | ( | const struct iio_device * | dev,
|  | const char * | name,
|  | bool | output )

Try to find a channel structure by its name of ID.

Parameters

  dev | A pointer to an iio_device structure
  name | A NULL-terminated string corresponding to the name or the ID of the channel to search for
  output | True if the searched channel is output, False otherwise

Returns
  On success, a pointer to an iio_channel structure
  If the name or ID does not correspond to any known channel of the given device, NULL is returned

Here is the call graph for this function:

## iio_device_get_attr()

__api __check_ret __pure const char * iio_device_get_attr | ( | const struct iio_device * | dev,
|  | unsigned int | index )

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

Parameters

  dev | A pointer to an iio_device structure
  index | The index corresponding to the attribute

Returns
  On success, a pointer to a static NULL-terminated string
  If the index is invalid, NULL is returned

## iio_device_get_attrs_count()

__api __check_ret __pure unsigned int iio_device_get_attrs_count | ( | const struct iio_device * | dev | ) |

Enumerate the device-specific attributes of the given device.

Parameters

  dev | A pointer to an iio_device structure

Returns
  The number of device-specific attributes found

## iio_device_get_buffer_attr()

__api __check_ret __pure const char * iio_device_get_buffer_attr | ( | const struct iio_device * | dev,
|  | unsigned int | index )

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

Parameters

  dev | A pointer to an iio_device structure
  index | The index corresponding to the attribute

Returns
  On success, a pointer to a static NULL-terminated string
  If the index is invalid, NULL is returned

## iio_device_get_buffer_attrs_count()

__api __check_ret __pure unsigned int iio_device_get_buffer_attrs_count | ( | const struct iio_device * | dev | ) |

Enumerate the buffer-specific attributes of the given device.

Parameters

  dev | A pointer to an iio_device structure

Returns
  The number of buffer-specific attributes found

## iio_device_get_channel()

__api __check_ret __pure struct iio_channel * iio_device_get_channel | ( | const struct iio_device * | dev,
|  | unsigned int | index )

Get the channel present at the given index.

Parameters

  dev | A pointer to an iio_device structure
  index | The index corresponding to the channel

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

## iio_device_get_channels_count()

__api __check_ret __pure unsigned int iio_device_get_channels_count | ( | const struct iio_device * | dev | ) |

Enumerate the channels of the given device.

Parameters

  dev | A pointer to an iio_device structure

Returns
  The number of channels found

Here is the caller graph for this function:

## iio_device_get_context()

__api __check_ret __pure const struct iio_context * iio_device_get_context | ( | const struct iio_device * | dev | ) |

Retrieve a pointer to the iio_context structure.

Parameters

  dev | A pointer to an iio_device structure

Returns
  A pointer to an iio_context structure

## iio_device_get_data()

__api void * iio_device_get_data | ( | const struct iio_device * | dev | ) |

Retrieve a previously associated pointer of an iio_device structure.

Parameters

  dev | A pointer to an iio_device structure

Returns
  The pointer previously associated if present, or NULL

## iio_device_get_id()

__api __check_ret __pure const char * iio_device_get_id | ( | const struct iio_device * | dev | ) |

Retrieve the device ID (e.g. iio:device0).

Parameters

  dev | A pointer to an iio_device structure

Returns
  A pointer to a static NULL-terminated string

Here is the caller graph for this function:

## iio_device_get_label()

__api __check_ret __pure const char * iio_device_get_label | ( | const struct iio_device * | dev | ) |

Retrieve the device label (e.g. lo_pll0_rx_adf4351).

Parameters

  dev | A pointer to an iio_device structure

Returns
  A pointer to a static NULL-terminated string

NOTE: if the device has no label, NULL is returned.

## iio_device_get_name()

__api __check_ret __pure const char * iio_device_get_name | ( | const struct iio_device * | dev | ) |

Retrieve the device name (e.g. xadc).

Parameters

  dev | A pointer to an iio_device structure

Returns
  A pointer to a static NULL-terminated string

NOTE: if the device has no name, NULL is returned.

Here is the caller graph for this function:

## iio_device_get_trigger()

__api __check_ret int iio_device_get_trigger | ( | const struct iio_device * | dev,
|  | const struct iio_device ** | trigger )

Retrieve the trigger of a given device.

Parameters

  dev | A pointer to an iio_device structure
  trigger | a pointer to a pointer of an iio_device structure. The pointed pointer will be set to the address of the iio_device structure corresponding to the associated trigger device.

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

## iio_device_is_trigger()

__api __check_ret __pure bool iio_device_is_trigger | ( | const struct iio_device * | dev | ) |

Return True if the given device is a trigger.

Parameters

  dev | A pointer to an iio_device structure

Returns
  True if the device is a trigger, False otherwise

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

## iio_device_set_data()

__api void iio_device_set_data | ( | struct iio_device * | dev,
|  | void * | data )

Associate a pointer to an iio_device structure.

Parameters

  dev | A pointer to an iio_device structure
  data | The pointer to be associated

## iio_device_set_kernel_buffers_count()

__api __check_ret int iio_device_set_kernel_buffers_count | ( | const struct iio_device * | dev,
|  | unsigned int | nb_buffers )

Configure the number of kernel buffers for a device.

This function allows to change the number of buffers on kernel side.

Parameters

  dev | A pointer to an iio_device structure
  nb_buffers | The number of buffers

Returns
  On success, 0 is returned
  On error, a negative errno code is returned

## iio_device_set_trigger()

__api __check_ret int iio_device_set_trigger | ( | const struct iio_device * | dev,
|  | const struct iio_device * | trigger )

Associate a trigger to a given device.

Parameters

  dev | A pointer to an iio_device structure
  trigger | 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

Here is the call graph for this function: