Loading...
Searching...
No Matches
iio.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* libiio - Library for interfacing industrial I/O (IIO) devices
*
* Copyright (C) 2014 Analog Devices, Inc.
* Author: Paul Cercueil <paul.cercueil@analog.com>
*/
#ifndef __IIO_H__
#define __IIO_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#if (defined(_WIN32) || defined(__MBED__))
#ifndef _SSIZE_T_DEFINED
typedef ptrdiff_t ssize_t;
#define _SSIZE_T_DEFINED
#endif
#else
#include <sys/types.h>
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1800) && !defined(__BOOL_DEFINED)
#undef bool
#undef false
#undef true
#define bool char
#define false 0
#define true 1
#else
#include <stdbool.h>
#endif
#if defined(__GNUC__) && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
#ifndef __cnst
#define __cnst __attribute__((const))
#endif
#ifndef __pure
#define __pure __attribute__((pure))
#endif
#define __notused __attribute__((unused))
#ifdef IIO_CHECK_RET
#define __check_ret __attribute__((warn_unused_result))
#else
#define __check_ret
#endif
#else
#define __cnst
#define __pure
#define __notused
#define __check_ret
#endif
#ifdef _WIN32
# ifdef LIBIIO_STATIC
# define __api
# elif defined(LIBIIO_EXPORTS)
# define __api __declspec(dllexport)
# else
# define __api __declspec(dllimport)
# endif
#elif __GNUC__ >= 4 && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
# define __api __attribute__((visibility ("default")))
#else
# define __api
#endif
struct iio_context;
struct iio_device;
struct iio_channel;
struct iio_buffer;
struct iio_context_info;
struct iio_scan_context;
struct iio_scan_block;
/*
* <linux/iio/types.h> header guard to protect these enums from being defined
* twice
*/
#ifndef _IIO_TYPES_H_
#define _IIO_TYPES_H_
enum iio_chan_type {
IIO_VOLTAGE,
IIO_CURRENT,
IIO_POWER,
IIO_ACCEL,
IIO_ANGL_VEL,
IIO_MAGN,
IIO_LIGHT,
IIO_INTENSITY,
IIO_PROXIMITY,
IIO_TEMP,
IIO_INCLI,
IIO_ROT,
IIO_ANGL,
IIO_TIMESTAMP,
IIO_CAPACITANCE,
IIO_ALTVOLTAGE,
IIO_CCT,
IIO_PRESSURE,
IIO_HUMIDITYRELATIVE,
IIO_ACTIVITY,
IIO_STEPS,
IIO_ENERGY,
IIO_DISTANCE,
IIO_VELOCITY,
IIO_CONCENTRATION,
IIO_RESISTANCE,
IIO_PH,
IIO_UVINDEX,
IIO_ELECTRICALCONDUCTIVITY,
IIO_COUNT,
IIO_INDEX,
IIO_GRAVITY,
IIO_POSITIONRELATIVE,
IIO_PHASE,
IIO_MASSCONCENTRATION,
IIO_CHAN_TYPE_UNKNOWN = INT_MAX
};
enum iio_modifier {
IIO_NO_MOD,
IIO_MOD_X,
IIO_MOD_Y,
IIO_MOD_Z,
IIO_MOD_X_AND_Y,
IIO_MOD_X_AND_Z,
IIO_MOD_Y_AND_Z,
IIO_MOD_X_AND_Y_AND_Z,
IIO_MOD_X_OR_Y,
IIO_MOD_X_OR_Z,
IIO_MOD_Y_OR_Z,
IIO_MOD_X_OR_Y_OR_Z,
IIO_MOD_LIGHT_BOTH,
IIO_MOD_LIGHT_IR,
IIO_MOD_ROOT_SUM_SQUARED_X_Y,
IIO_MOD_SUM_SQUARED_X_Y_Z,
IIO_MOD_LIGHT_CLEAR,
IIO_MOD_LIGHT_RED,
IIO_MOD_LIGHT_GREEN,
IIO_MOD_LIGHT_BLUE,
IIO_MOD_QUATERNION,
IIO_MOD_TEMP_AMBIENT,
IIO_MOD_TEMP_OBJECT,
IIO_MOD_NORTH_MAGN,
IIO_MOD_NORTH_TRUE,
IIO_MOD_NORTH_MAGN_TILT_COMP,
IIO_MOD_NORTH_TRUE_TILT_COMP,
IIO_MOD_RUNNING,
IIO_MOD_JOGGING,
IIO_MOD_WALKING,
IIO_MOD_STILL,
IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z,
IIO_MOD_I,
IIO_MOD_Q,
IIO_MOD_CO2,
IIO_MOD_VOC,
IIO_MOD_LIGHT_UV,
IIO_MOD_LIGHT_DUV,
IIO_MOD_PM1,
IIO_MOD_PM2P5,
IIO_MOD_PM4,
IIO_MOD_PM10,
IIO_MOD_ETHANOL,
IIO_MOD_H2,
IIO_MOD_O2,
IIO_MOD_LINEAR_X,
IIO_MOD_LINEAR_Y,
IIO_MOD_LINEAR_Z,
IIO_MOD_PITCH,
IIO_MOD_YAW,
IIO_MOD_ROLL,
};
enum iio_event_type {
IIO_EV_TYPE_THRESH,
IIO_EV_TYPE_MAG,
IIO_EV_TYPE_ROC,
IIO_EV_TYPE_THRESH_ADAPTIVE,
IIO_EV_TYPE_MAG_ADAPTIVE,
IIO_EV_TYPE_CHANGE,
IIO_EV_TYPE_MAG_REFERENCED,
IIO_EV_TYPE_GESTURE,
};
enum iio_event_direction {
IIO_EV_DIR_EITHER,
IIO_EV_DIR_RISING,
IIO_EV_DIR_FALLING,
IIO_EV_DIR_NONE,
IIO_EV_DIR_SINGLETAP,
IIO_EV_DIR_DOUBLETAP,
};
#endif /* _IIO_TYPES_H_ */
/* ---------------------------------------------------------------------------*/
/* ------------------------- Scan functions ----------------------------------*/
__api __check_ret struct iio_scan_context * iio_create_scan_context(
const char *backend, unsigned int flags);
__api void iio_scan_context_destroy(struct iio_scan_context *ctx);
__api __check_ret ssize_t iio_scan_context_get_info_list(struct iio_scan_context *ctx,
struct iio_context_info ***info);
__api void iio_context_info_list_free(struct iio_context_info **info);
__api __check_ret __pure const char * iio_context_info_get_description(
const struct iio_context_info *info);
__api __check_ret __pure const char * iio_context_info_get_uri(
const struct iio_context_info *info);
__api struct iio_scan_block * iio_create_scan_block(
const char *backend, unsigned int flags);
__api void iio_scan_block_destroy(struct iio_scan_block *blk);
__api ssize_t iio_scan_block_scan(struct iio_scan_block *blk);
__api struct iio_context_info *iio_scan_block_get_info(
struct iio_scan_block *blk, unsigned int index);
/* ------------------------------------------------------------------*/
/* ------------------------- Top-level functions -----------------------------*/
__api void iio_library_get_version(unsigned int *major,
unsigned int *minor, char git_tag[8]);
__api void iio_strerror(int err, char *dst, size_t len);
__api __check_ret __cnst bool iio_has_backend(const char *backend);
__api __check_ret __cnst unsigned int iio_get_backends_count(void);
__api __check_ret __cnst const char * iio_get_backend(unsigned int index);
/* ------------------------------------------------------------------*/
/* ------------------------- Context functions -------------------------------*/
__api __check_ret struct iio_context * iio_create_default_context(void);
__api __check_ret struct iio_context * iio_create_local_context(void);
__api __check_ret struct iio_context * iio_create_xml_context(const char *xml_file);
__api __check_ret struct iio_context * iio_create_xml_context_mem(
const char *xml, size_t len);
__api __check_ret struct iio_context * iio_create_network_context(const char *host);
__api __check_ret struct iio_context * iio_create_context_from_uri(const char *uri);
__api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx);
__api void iio_context_destroy(struct iio_context *ctx);
__api __check_ret int iio_context_get_version(const struct iio_context *ctx,
unsigned int *major, unsigned int *minor, char git_tag[8]);
__api __check_ret __pure const char * iio_context_get_xml(const struct iio_context *ctx);
__api __check_ret __pure const char * iio_context_get_name(const struct iio_context *ctx);
__api __check_ret __pure const char * iio_context_get_description(
const struct iio_context *ctx);
__api __check_ret __pure unsigned int iio_context_get_attrs_count(
const struct iio_context *ctx);
__api __check_ret int iio_context_get_attr(
const struct iio_context *ctx, unsigned int index,
const char **name, const char **value);
__api __check_ret const char * iio_context_get_attr_value(
const struct iio_context *ctx, const char *name);
__api __check_ret __pure unsigned int iio_context_get_devices_count(
const struct iio_context *ctx);
__api __check_ret __pure struct iio_device * iio_context_get_device(
const struct iio_context *ctx, unsigned int index);
__api __check_ret __pure struct iio_device * iio_context_find_device(
const struct iio_context *ctx, const char *name);
__api __check_ret int iio_context_set_timeout(
struct iio_context *ctx, unsigned int timeout_ms);
/* ------------------------------------------------------------------*/
/* ------------------------- Device functions --------------------------------*/
__api __check_ret __pure const struct iio_context * iio_device_get_context(
const struct iio_device *dev);
__api __check_ret __pure const char * iio_device_get_id(const struct iio_device *dev);
__api __check_ret __pure const char * iio_device_get_name(const struct iio_device *dev);
__api __check_ret __pure const char * iio_device_get_label(const struct iio_device *dev);
__api __check_ret __pure unsigned int iio_device_get_channels_count(
const struct iio_device *dev);
__api __check_ret __pure unsigned int iio_device_get_attrs_count(
const struct iio_device *dev);
__api __check_ret __pure unsigned int iio_device_get_buffer_attrs_count(
const struct iio_device *dev);
__api __check_ret __pure struct iio_channel * iio_device_get_channel(
const struct iio_device *dev, unsigned int index);
__api __check_ret __pure const char * iio_device_get_attr(
const struct iio_device *dev, unsigned int index);
__api __check_ret __pure const char * iio_device_get_buffer_attr(
const struct iio_device *dev, unsigned int index);
__api __check_ret __pure struct iio_channel * iio_device_find_channel(
const struct iio_device *dev, const char *name, bool output);
__api __check_ret __pure const char * iio_device_find_attr(
const struct iio_device *dev, const char *name);
__api __check_ret __pure const char * iio_device_find_buffer_attr(
const struct iio_device *dev, const char *name);
__api __check_ret ssize_t iio_device_attr_read(const struct iio_device *dev,
const char *attr, char *dst, size_t len);
__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);
__api __check_ret int iio_device_attr_read_bool(const struct iio_device *dev,
const char *attr, bool *val);
__api __check_ret int iio_device_attr_read_longlong(const struct iio_device *dev,
const char *attr, long long *val);
__api __check_ret int iio_device_attr_read_double(const struct iio_device *dev,
const char *attr, double *val);
__api __check_ret ssize_t iio_device_attr_write(const struct iio_device *dev,
const char *attr, const char *src);
__api __check_ret ssize_t iio_device_attr_write_raw(const struct iio_device *dev,
const char *attr, const void *src, size_t len);
__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);
__api __check_ret int iio_device_attr_write_bool(const struct iio_device *dev,
const char *attr, bool val);
__api __check_ret int iio_device_attr_write_longlong(const struct iio_device *dev,
const char *attr, long long val);
__api __check_ret int iio_device_attr_write_double(const struct iio_device *dev,
const char *attr, double val);
__api __check_ret ssize_t iio_device_buffer_attr_read(const struct iio_device *dev,
const char *attr, char *dst, size_t len);
__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);
__api __check_ret int iio_device_buffer_attr_read_bool(const struct iio_device *dev,
const char *attr, bool *val);
__api __check_ret int iio_device_buffer_attr_read_longlong(const struct iio_device *dev,
const char *attr, long long *val);
__api __check_ret int iio_device_buffer_attr_read_double(const struct iio_device *dev,
const char *attr, double *val);
__api __check_ret ssize_t iio_device_buffer_attr_write(const struct iio_device *dev,
const char *attr, const char *src);
__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);
__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);
__api __check_ret int iio_device_buffer_attr_write_bool(const struct iio_device *dev,
const char *attr, bool val);
__api __check_ret int iio_device_buffer_attr_write_longlong(const struct iio_device *dev,
const char *attr, long long val);
__api __check_ret int iio_device_buffer_attr_write_double(const struct iio_device *dev,
const char *attr, double val);
__api void iio_device_set_data(struct iio_device *dev, void *data);
__api void * iio_device_get_data(const struct iio_device *dev);
__api __check_ret int iio_device_get_trigger(const struct iio_device *dev,
const struct iio_device **trigger);
__api __check_ret int iio_device_set_trigger(const struct iio_device *dev,
const struct iio_device *trigger);
__api __check_ret __pure bool iio_device_is_trigger(const struct iio_device *dev);
__api __check_ret int iio_device_set_kernel_buffers_count(const struct iio_device *dev,
unsigned int nb_buffers);
/* ------------------------------------------------------------------*/
/* ------------------------- Channel functions -------------------------------*/
__api __check_ret __pure const struct iio_device * iio_channel_get_device(
const struct iio_channel *chn);
__api __check_ret __pure const char * iio_channel_get_id(const struct iio_channel *chn);
__api __check_ret __pure const char * iio_channel_get_name(const struct iio_channel *chn);
__api __check_ret __pure bool iio_channel_is_output(const struct iio_channel *chn);
__api __check_ret __pure bool iio_channel_is_scan_element(const struct iio_channel *chn);
__api __check_ret __pure unsigned int iio_channel_get_attrs_count(
const struct iio_channel *chn);
__api __check_ret __pure const char * iio_channel_get_attr(
const struct iio_channel *chn, unsigned int index);
__api __check_ret __pure const char * iio_channel_find_attr(
const struct iio_channel *chn, const char *name);
__api __check_ret __pure const char * iio_channel_attr_get_filename(
const struct iio_channel *chn, const char *attr);
__api __check_ret ssize_t iio_channel_attr_read(const struct iio_channel *chn,
const char *attr, char *dst, size_t len);
__api __check_ret int iio_channel_attr_read_all(struct iio_channel *chn,
int (*cb)(struct iio_channel *chn,
const char *attr, const char *val, size_t len, void *d),
void *data);
__api __check_ret int iio_channel_attr_read_bool(const struct iio_channel *chn,
const char *attr, bool *val);
__api __check_ret int iio_channel_attr_read_longlong(const struct iio_channel *chn,
const char *attr, long long *val);
__api __check_ret int iio_channel_attr_read_double(const struct iio_channel *chn,
const char *attr, double *val);
__api __check_ret ssize_t iio_channel_attr_write(const struct iio_channel *chn,
const char *attr, const char *src);
__api __check_ret ssize_t iio_channel_attr_write_raw(const struct iio_channel *chn,
const char *attr, const void *src, size_t len);
__api __check_ret int iio_channel_attr_write_all(struct iio_channel *chn,
ssize_t (*cb)(struct iio_channel *chn,
const char *attr, void *buf, size_t len, void *d),
void *data);
__api __check_ret int iio_channel_attr_write_bool(const struct iio_channel *chn,
const char *attr, bool val);
__api __check_ret int iio_channel_attr_write_longlong(const struct iio_channel *chn,
const char *attr, long long val);
__api __check_ret int iio_channel_attr_write_double(const struct iio_channel *chn,
const char *attr, double val);
__api void iio_channel_enable(struct iio_channel *chn);
__api void iio_channel_disable(struct iio_channel *chn);
__api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn);
__api __check_ret size_t iio_channel_read_raw(const struct iio_channel *chn,
struct iio_buffer *buffer, void *dst, size_t len);
__api __check_ret size_t iio_channel_read(const struct iio_channel *chn,
struct iio_buffer *buffer, void *dst, size_t len);
__api __check_ret size_t iio_channel_write_raw(const struct iio_channel *chn,
struct iio_buffer *buffer, const void *src, size_t len);
__api __check_ret size_t iio_channel_write(const struct iio_channel *chn,
struct iio_buffer *buffer, const void *src, size_t len);
__api void iio_channel_set_data(struct iio_channel *chn, void *data);
__api void * iio_channel_get_data(const struct iio_channel *chn);
__api __check_ret __pure enum iio_chan_type iio_channel_get_type(
const struct iio_channel *chn);
__api __check_ret __pure enum iio_modifier iio_channel_get_modifier(
const struct iio_channel *chn);
/* ------------------------------------------------------------------*/
/* ------------------------- Buffer functions --------------------------------*/
__api __check_ret __pure const struct iio_device * iio_buffer_get_device(
const struct iio_buffer *buf);
__api __check_ret struct iio_buffer * iio_device_create_buffer(const struct iio_device *dev,
size_t samples_count, bool cyclic);
__api void iio_buffer_destroy(struct iio_buffer *buf);
__api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf);
__api __check_ret int iio_buffer_set_blocking_mode(struct iio_buffer *buf, bool blocking);
__api __check_ret ssize_t iio_buffer_refill(struct iio_buffer *buf);
__api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf);
__api __check_ret ssize_t iio_buffer_push_partial(struct iio_buffer *buf,
size_t samples_count);
__api void iio_buffer_cancel(struct iio_buffer *buf);
__api void * iio_buffer_start(const struct iio_buffer *buf);
__api void * iio_buffer_first(const struct iio_buffer *buf,
const struct iio_channel *chn);
__api __check_ret ptrdiff_t iio_buffer_step(const struct iio_buffer *buf);
__api void * iio_buffer_end(const struct iio_buffer *buf);
__api __check_ret ssize_t iio_buffer_foreach_sample(struct iio_buffer *buf,
ssize_t (*callback)(const struct iio_channel *chn,
void *src, size_t bytes, void *d), void *data);
__api void iio_buffer_set_data(struct iio_buffer *buf, void *data);
__api void * iio_buffer_get_data(const struct iio_buffer *buf);
/* ------------------------------------------------------------------*/
/* ---------------------------- HWMON support --------------------------------*/
enum hwmon_chan_type {
HWMON_VOLTAGE,
HWMON_FAN,
HWMON_PWM,
HWMON_TEMP,
HWMON_CURRENT,
HWMON_POWER,
HWMON_ENERGY,
HWMON_HUMIDITY,
HWMON_INTRUSION,
HWMON_CHAN_TYPE_UNKNOWN = IIO_CHAN_TYPE_UNKNOWN,
};
static inline enum hwmon_chan_type
hwmon_channel_get_type(const struct iio_channel *chn)
{
return (enum hwmon_chan_type) iio_channel_get_type(chn);
}
static inline bool iio_device_is_hwmon(const struct iio_device *dev)
{
const char *id = iio_device_get_id(dev);
return id[0] == 'h';
}
/* ------------------------------------------------------------------*/
/* ------------------------- Low-level functions -----------------------------*/
struct iio_data_format {
unsigned int length;
unsigned int bits;
unsigned int shift;
bool is_signed;
bool is_fully_defined;
bool is_be;
bool with_scale;
double scale;
unsigned int repeat;
};
__api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev);
__api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn);
__api __check_ret __cnst const struct iio_data_format * iio_channel_get_data_format(
const struct iio_channel *chn);
__api void iio_channel_convert(const struct iio_channel *chn,
void *dst, const void *src);
__api void iio_channel_convert_inverse(const struct iio_channel *chn,
void *dst, const void *src);
__api __check_ret __pure unsigned int iio_device_get_debug_attrs_count(
const struct iio_device *dev);
__api __check_ret __pure const char * iio_device_get_debug_attr(
const struct iio_device *dev, unsigned int index);
__api __check_ret __pure const char * iio_device_find_debug_attr(
const struct iio_device *dev, const char *name);
__api __check_ret ssize_t iio_device_debug_attr_read(const struct iio_device *dev,
const char *attr, char *dst, size_t len);
__api __check_ret int iio_device_debug_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);
__api __check_ret ssize_t iio_device_debug_attr_write(const struct iio_device *dev,
const char *attr, const char *src);
__api __check_ret ssize_t iio_device_debug_attr_write_raw(const struct iio_device *dev,
const char *attr, const void *src, size_t len);
__api __check_ret int iio_device_debug_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);
__api __check_ret int iio_device_debug_attr_read_bool(const struct iio_device *dev,
const char *attr, bool *val);
__api __check_ret int iio_device_debug_attr_read_longlong(const struct iio_device *dev,
const char *attr, long long *val);
__api __check_ret int iio_device_debug_attr_read_double(const struct iio_device *dev,
const char *attr, double *val);
__api __check_ret int iio_device_debug_attr_write_bool(const struct iio_device *dev,
const char *attr, bool val);
__api __check_ret int iio_device_debug_attr_write_longlong(const struct iio_device *dev,
const char *attr, long long val);
__api __check_ret int iio_device_debug_attr_write_double(const struct iio_device *dev,
const char *attr, double val);
__api __check_ret int iio_device_identify_filename(const struct iio_device *dev,
const char *filename, struct iio_channel **chn,
const char **attr);
__api __check_ret int iio_device_reg_write(struct iio_device *dev,
uint32_t address, uint32_t value);
__api __check_ret int iio_device_reg_read(struct iio_device *dev,
uint32_t address, uint32_t *value);
#ifdef __cplusplus
}
#endif
#undef __api
#endif /* __IIO_H__ */
iio_buffer_set_data
__api void iio_buffer_set_data(struct iio_buffer *buf, void *data)
Associate a pointer to an iio_buffer structure.
Definition buffer.c:298
iio_buffer_cancel
__api void iio_buffer_cancel(struct iio_buffer *buf)
Cancel all buffer operations.
Definition buffer.c:313
iio_buffer_end
__api void * iio_buffer_end(const struct iio_buffer *buf)
Get the address that follows the last sample in a buffer.
Definition buffer.c:293
iio_buffer_get_poll_fd
__api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf)
Get a pollable file descriptor.
Definition buffer.c:113
iio_buffer_push_partial
__api __check_ret ssize_t iio_buffer_push_partial(struct iio_buffer *buf, size_t samples_count)
Send a given number of samples to the hardware.
Definition buffer.c:183
iio_buffer_step
__api __check_ret ptrdiff_t iio_buffer_step(const struct iio_buffer *buf)
Get the step size between two samples of one channel.
Definition buffer.c:288
iio_buffer_foreach_sample
__api __check_ret ssize_t iio_buffer_foreach_sample(struct iio_buffer *buf, 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 buffer.
Definition buffer.c:194
iio_device_create_buffer
__api __check_ret struct iio_buffer * iio_device_create_buffer(const struct iio_device *dev, size_t samples_count, bool cyclic)
Create an input or output buffer associated to the given device.
Definition buffer.c:26
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.
Definition buffer.c:308
iio_buffer_destroy
__api void iio_buffer_destroy(struct iio_buffer *buf)
Destroy the given buffer.
Definition buffer.c:104
iio_buffer_refill
__api __check_ret ssize_t iio_buffer_refill(struct iio_buffer *buf)
Fetch more samples from the hardware.
Definition buffer.c:123
iio_buffer_start
__api void * iio_buffer_start(const struct iio_buffer *buf)
Get the start address of the buffer.
Definition buffer.c:245
iio_buffer_first
__api void * iio_buffer_first(const struct iio_buffer *buf, const struct iio_channel *chn)
Find the first sample of a channel in a buffer.
Definition buffer.c:250
iio_buffer_set_blocking_mode
__api __check_ret int iio_buffer_set_blocking_mode(struct iio_buffer *buf, bool blocking)
Make iio_buffer_refill() and iio_buffer_push() blocking or not.
Definition buffer.c:118
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.
Definition buffer.c:303
iio_buffer_push
__api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf)
Send the samples to the hardware.
Definition buffer.c:147
iio_channel_is_scan_element
__api __check_ret __pure bool iio_channel_is_scan_element(const struct iio_channel *chn)
Return True if the given channel is a scan element.
Definition channel.c:318
iio_channel_attr_read_longlong
__api __check_ret int iio_channel_attr_read_longlong(const struct iio_channel *chn, const char *attr, long long *val)
Read the content of the given channel-specific attribute.
Definition channel.c:689
iio_channel_get_attrs_count
__api __check_ret __pure unsigned int iio_channel_get_attrs_count(const struct iio_channel *chn)
Enumerate the channel-specific attributes of the given channel.
Definition channel.c:333
iio_channel_get_type
__api __check_ret __pure enum iio_chan_type iio_channel_get_type(const struct iio_channel *chn)
Get the type of the given channel.
Definition channel.c:328
iio_channel_enable
__api void iio_channel_enable(struct iio_channel *chn)
Enable the given channel.
Definition channel.c:452
iio_channel_attr_read
__api __check_ret ssize_t iio_channel_attr_read(const struct iio_channel *chn, const char *attr, char *dst, size_t len)
Read the content of the given channel-specific attribute.
Definition channel.c:387
iio_channel_attr_get_filename
__api __check_ret __pure const char * iio_channel_attr_get_filename(const struct iio_channel *chn, const char *attr)
Retrieve the filename of an attribute.
Definition channel.c:762
iio_channel_attr_read_bool
__api __check_ret int iio_channel_attr_read_bool(const struct iio_channel *chn, const char *attr, bool *val)
Read the content of the given channel-specific attribute.
Definition channel.c:706
iio_channel_write_raw
__api __check_ret size_t iio_channel_write_raw(const struct iio_channel *chn, struct iio_buffer *buffer, const void *src, size_t len)
Multiplex the samples of a given channel.
Definition channel.c:658
iio_channel_attr_write
__api __check_ret ssize_t iio_channel_attr_write(const struct iio_channel *chn, const char *attr, const char *src)
Set the value of the given channel-specific attribute.
Definition channel.c:419
iio_channel_is_output
__api __check_ret __pure bool iio_channel_is_output(const struct iio_channel *chn)
Return True if the given channel is an output channel.
Definition channel.c:313
iio_channel_get_data
__api void * iio_channel_get_data(const struct iio_channel *chn)
Retrieve a previously associated pointer of an iio_channel structure.
Definition channel.c:430
iio_channel_get_modifier
__api __check_ret __pure enum iio_modifier iio_channel_get_modifier(const struct iio_channel *chn)
Get the modifier type of the given channel.
Definition channel.c:323
iio_channel_set_data
__api void iio_channel_set_data(struct iio_channel *chn, void *data)
Associate a pointer to an iio_channel structure.
Definition channel.c:425
iio_channel_write
__api __check_ret size_t iio_channel_write(const struct iio_channel *chn, struct iio_buffer *buffer, const void *src, size_t len)
Convert and multiplex the samples of a given channel.
Definition channel.c:673
iio_channel_read
__api __check_ret size_t iio_channel_read(const struct iio_channel *chn, struct iio_buffer *buffer, void *dst, size_t len)
Demultiplex and convert the samples of a given channel.
Definition channel.c:642
iio_channel_attr_write_all
__api __check_ret int iio_channel_attr_write_all(struct iio_channel *chn, ssize_t(*cb)(struct iio_channel *chn, const char *attr, void *buf, size_t len, void *d), void *data)
Set the values of all channel-specific attributes.
Definition channel.c:832
iio_channel_attr_read_double
__api __check_ret int iio_channel_attr_read_double(const struct iio_channel *chn, const char *attr, double *val)
Read the content of the given channel-specific attribute.
Definition channel.c:718
iio_channel_get_device
__api __check_ret __pure const struct iio_device * iio_channel_get_device(const struct iio_channel *chn)
Retrieve a pointer to the iio_device structure.
Definition channel.c:875
iio_channel_attr_write_bool
__api __check_ret int iio_channel_attr_write_bool(const struct iio_channel *chn, const char *attr, bool val)
Set the value of the given channel-specific attribute.
Definition channel.c:751
iio_channel_get_attr
__api __check_ret __pure const char * iio_channel_get_attr(const struct iio_channel *chn, unsigned int index)
Get the channel-specific attribute present at the given index.
Definition channel.c:338
iio_channel_get_id
__api __check_ret __pure const char * iio_channel_get_id(const struct iio_channel *chn)
Retrieve the channel ID (e.g. voltage0).
Definition channel.c:303
iio_channel_attr_read_all
__api __check_ret int iio_channel_attr_read_all(struct iio_channel *chn, int(*cb)(struct iio_channel *chn, const char *attr, const char *val, size_t len, void *d), void *data)
Read the content of all channel-specific attributes.
Definition channel.c:773
iio_channel_find_attr
__api __check_ret __pure const char * iio_channel_find_attr(const struct iio_channel *chn, const char *name)
Try to find a channel-specific attribute by its name.
Definition channel.c:361
iio_channel_attr_write_longlong
__api __check_ret int iio_channel_attr_write_longlong(const struct iio_channel *chn, const char *attr, long long val)
Set the value of the given channel-specific attribute.
Definition channel.c:729
iio_channel_get_name
__api __check_ret __pure const char * iio_channel_get_name(const struct iio_channel *chn)
Retrieve the channel name (e.g. vccint).
Definition channel.c:308
iio_channel_attr_write_raw
__api __check_ret ssize_t iio_channel_attr_write_raw(const struct iio_channel *chn, const char *attr, const void *src, size_t len)
Set the value of the given channel-specific attribute.
Definition channel.c:403
iio_channel_read_raw
__api __check_ret size_t iio_channel_read_raw(const struct iio_channel *chn, struct iio_buffer *buffer, void *dst, size_t len)
Demultiplex the samples of a given channel.
Definition channel.c:627
iio_channel_disable
__api void iio_channel_disable(struct iio_channel *chn)
Disable the given channel.
Definition channel.c:458
iio_channel_attr_write_double
__api __check_ret int iio_channel_attr_write_double(const struct iio_channel *chn, const char *attr, double val)
Set the value of the given channel-specific attribute.
Definition channel.c:739
iio_channel_is_enabled
__api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn)
Returns True if the channel is enabled.
Definition channel.c:446
iio_create_default_context
__api __check_ret struct iio_context * iio_create_default_context(void)
Create a context from local or remote IIO devices.
Definition context.c:415
iio_context_get_description
__api __check_ret __pure const char * iio_context_get_description(const struct iio_context *ctx)
Get a description of the given context.
Definition context.c:250
iio_context_find_device
__api __check_ret __pure struct iio_device * iio_context_find_device(const struct iio_context *ctx, const char *name)
Try to find a device structure by its ID, label or name.
Definition context.c:294
iio_context_get_version
__api __check_ret int iio_context_get_version(const struct iio_context *ctx, unsigned int *major, unsigned int *minor, char git_tag[8])
Get the version of the backend in use.
Definition context.c:355
iio_create_local_context
__api __check_ret struct iio_context * iio_create_local_context(void)
Create a context from local IIO devices (Linux only).
Definition context.c:429
iio_context_get_attr
__api __check_ret int iio_context_get_attr(const struct iio_context *ctx, unsigned int index, const char **name, const char **value)
Retrieve the name and value of a context-specific attribute.
Definition context.c:470
iio_create_context_from_uri
__api __check_ret struct iio_context * iio_create_context_from_uri(const char *uri)
Create a context from a URI description.
Definition context.c:394
iio_context_get_xml
__api __check_ret __pure const char * iio_context_get_xml(const struct iio_context *ctx)
Obtain a XML representation of the given context.
Definition context.c:240
iio_context_clone
__api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx)
Duplicate a pre-existing IIO context.
Definition context.c:384
iio_create_network_context
__api __check_ret struct iio_context * iio_create_network_context(const char *host)
Create a context from the network.
Definition context.c:438
iio_context_destroy
__api void iio_context_destroy(struct iio_context *ctx)
Destroy the given context.
Definition context.c:258
iio_create_xml_context_mem
__api __check_ret struct iio_context * iio_create_xml_context_mem(const char *xml, size_t len)
Create a context from XML data in memory.
Definition context.c:447
iio_context_get_device
__api __check_ret __pure struct iio_device * iio_context_get_device(const struct iio_context *ctx, unsigned int index)
Get the device present at the given index.
Definition context.c:285
iio_context_get_attrs_count
__api __check_ret __pure unsigned int iio_context_get_attrs_count(const struct iio_context *ctx)
Get the number of context-specific attributes.
Definition context.c:465
iio_context_get_devices_count
__api __check_ret __pure unsigned int iio_context_get_devices_count(const struct iio_context *ctx)
Enumerate the devices found in the given context.
Definition context.c:280
iio_context_get_name
__api __check_ret __pure const char * iio_context_get_name(const struct iio_context *ctx)
Get the name of the given context.
Definition context.c:245
iio_context_set_timeout
__api __check_ret int iio_context_set_timeout(struct iio_context *ctx, unsigned int timeout_ms)
Set a timeout for I/O operations.
Definition context.c:376
iio_create_xml_context
__api __check_ret struct iio_context * iio_create_xml_context(const char *xml_file)
Create a context from a XML file.
Definition context.c:456
iio_context_get_attr_value
__api __check_ret const char * iio_context_get_attr_value(const struct iio_context *ctx, const char *name)
Retrieve the value of a context-specific attribute.
Definition context.c:483
iio_device_debug_attr_read_double
__api __check_ret int iio_device_debug_attr_read_double(const struct iio_device *dev, const char *attr, double *val)
Read the content of the given debug attribute.
Definition device.c:708
iio_device_reg_write
__api __check_ret int iio_device_reg_write(struct iio_device *dev, uint32_t address, uint32_t value)
Set the value of a hardware register.
Definition device.c:795
iio_device_debug_attr_write_raw
__api __check_ret ssize_t iio_device_debug_attr_write_raw(const struct iio_device *dev, const char *attr, const void *src, size_t len)
Set the value of the given debug attribute.
Definition device.c:652
iio_device_debug_attr_read_all
__api __check_ret int iio_device_debug_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 debug attributes.
Definition device.c:1012
iio_device_debug_attr_write_longlong
__api __check_ret int iio_device_debug_attr_write_longlong(const struct iio_device *dev, const char *attr, long long val)
Set the value of the given debug attribute.
Definition device.c:719
iio_device_debug_attr_write_double
__api __check_ret int iio_device_debug_attr_write_double(const struct iio_device *dev, const char *attr, double val)
Set the value of the given debug attribute.
Definition device.c:731
iio_device_debug_attr_write_bool
__api __check_ret int iio_device_debug_attr_write_bool(const struct iio_device *dev, const char *attr, bool val)
Set the value of the given debug attribute.
Definition device.c:743
iio_device_get_sample_size
__api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev)
Get the current sample size.
Definition device.c:483
iio_device_debug_attr_write_all
__api __check_ret int iio_device_debug_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 debug attributes.
Definition device.c:1036
iio_device_get_debug_attr
__api __check_ret __pure const char * iio_device_get_debug_attr(const struct iio_device *dev, unsigned int index)
Get the debug attribute present at the given index.
Definition device.c:673
iio_device_reg_read
__api __check_ret int iio_device_reg_read(struct iio_device *dev, uint32_t address, uint32_t *value)
Get the value of a hardware register.
Definition device.c:808
iio_device_identify_filename
__api __check_ret int iio_device_identify_filename(const struct iio_device *dev, const char *filename, struct iio_channel **chn, const char **attr)
Identify the channel or debug attribute corresponding to a filename.
Definition device.c:756
iio_device_find_debug_attr
__api __check_ret __pure const char * iio_device_find_debug_attr(const struct iio_device *dev, const char *name)
Try to find a debug attribute by its name.
Definition device.c:228
iio_device_debug_attr_read
__api __check_ret ssize_t iio_device_debug_attr_read(const struct iio_device *dev, const char *attr, char *dst, size_t len)
Read the content of the given debug attribute.
Definition device.c:642
iio_channel_get_data_format
__api __check_ret __cnst const struct iio_data_format * iio_channel_get_data_format(const struct iio_channel *chn)
Get a pointer to a channel's data format structure.
Definition channel.c:440
iio_device_get_debug_attrs_count
__api __check_ret __pure unsigned int iio_device_get_debug_attrs_count(const struct iio_device *dev)
Enumerate the debug attributes of the given device.
Definition device.c:668
iio_device_debug_attr_read_bool
__api __check_ret int iio_device_debug_attr_read_bool(const struct iio_device *dev, const char *attr, bool *val)
Read the content of the given debug attribute.
Definition device.c:696
iio_device_debug_attr_write
__api __check_ret ssize_t iio_device_debug_attr_write(const struct iio_device *dev, const char *attr, const char *src)
Set the value of the given debug attribute.
Definition device.c:662
iio_channel_convert_inverse
__api void iio_channel_convert_inverse(const struct iio_channel *chn, void *dst, const void *src)
Convert the sample from host format to hardware format.
Definition channel.c:598
iio_channel_convert
__api void iio_channel_convert(const struct iio_channel *chn, void *dst, const void *src)
Convert the sample from hardware format to host format.
Definition channel.c:566
iio_channel_get_index
__api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn)
Get the index of the given channel.
Definition channel.c:435
iio_device_debug_attr_read_longlong
__api __check_ret int iio_device_debug_attr_read_longlong(const struct iio_device *dev, const char *attr, long long *val)
Read the content of the given debug attribute.
Definition device.c:679
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.
Definition device.c:216
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.
Definition device.c:488
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.
Definition device.c:617
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.
Definition device.c:1060
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).
Definition device.c:128
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.
Definition device.c:316
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.
Definition device.c:194
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.
Definition device.c:157
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.
Definition device.c:402
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.
Definition device.c:1044
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).
Definition device.c:138
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.
Definition device.c:629
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.
Definition device.c:528
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.
Definition device.c:199
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.
Definition device.c:594
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.
Definition device.c:222
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.
Definition device.c:1028
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.
Definition device.c:211
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.
Definition device.c:368
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.
Definition device.c:352
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.
Definition device.c:380
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.
Definition device.c:582
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.
Definition device.c:505
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.
Definition device.c:342
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.
Definition device.c:363
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.
Definition device.c:552
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.
Definition device.c:205
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.
Definition device.c:332
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.
Definition device.c:326
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.
Definition device.c:1020
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.
Definition device.c:517
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.
Definition device.c:148
iio_device_set_data
__api void iio_device_set_data(struct iio_device *dev, void *data)
Associate a pointer to an iio_device structure.
Definition device.c:358
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).
Definition device.c:133
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.
Definition device.c:605
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.
Definition device.c:540
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.
Definition device.c:1052
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.
Definition device.c:143
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.
Definition device.c:391
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.
Definition device.c:565
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.
Definition device.c:306
hwmon_chan_type
hwmon_chan_type
Hwmon channel type.
Definition iio.h:1633
iio_context_info_get_uri
__api __check_ret __pure const char * iio_context_info_get_uri(const struct iio_context_info *info)
Get the URI of a discovered context.
Definition scan.c:27
iio_create_scan_block
__api struct iio_scan_block * iio_create_scan_block(const char *backend, unsigned int flags)
Create a scan block.
Definition scan.c:218
iio_context_info_list_free
__api void iio_context_info_list_free(struct iio_context_info **info)
Free a context info list.
Definition scan.c:103
iio_scan_context_get_info_list
__api __check_ret ssize_t iio_scan_context_get_info_list(struct iio_scan_context *ctx, struct iio_context_info ***info)
Enumerate available contexts.
Definition scan.c:33
iio_scan_context_destroy
__api void iio_scan_context_destroy(struct iio_scan_context *ctx)
Destroy the given scan context.
Definition scan.c:188
iio_scan_block_destroy
__api void iio_scan_block_destroy(struct iio_scan_block *blk)
Destroy the given scan block.
Definition scan.c:238
iio_scan_block_get_info
__api struct iio_context_info * iio_scan_block_get_info(struct iio_scan_block *blk, unsigned int index)
Get the iio_context_info for a particular context.
Definition scan.c:208
iio_create_scan_context
__api __check_ret struct iio_scan_context * iio_create_scan_context(const char *backend, unsigned int flags)
Create a scan context.
Definition scan.c:139
iio_scan_block_scan
__api ssize_t iio_scan_block_scan(struct iio_scan_block *blk)
Enumerate available contexts via scan block.
Definition scan.c:200
iio_context_info_get_description
__api __check_ret __pure const char * iio_context_info_get_description(const struct iio_context_info *info)
Get a description of a discovered context.
Definition scan.c:21
iio_strerror
__api void iio_strerror(int err, char *dst, size_t len)
Get a string description of an error code.
Definition utilities.c:204
iio_get_backend
__api __check_ret __cnst const char * iio_get_backend(unsigned int index)
Retrieve the name of a given backend.
Definition backend.c:27
iio_has_backend
__api __check_ret __cnst bool iio_has_backend(const char *backend)
Check if the specified backend is available.
Definition backend.c:62
iio_library_get_version
__api void iio_library_get_version(unsigned int *major, unsigned int *minor, char git_tag[8])
Get the version of the libiio library.
Definition utilities.c:192
iio_get_backends_count
__api __check_ret __cnst unsigned int iio_get_backends_count(void)
Get the number of available backends.
Definition backend.c:14
iio_event_type
iio_event_type
IIO event type.
Definition iio.h:208
iio_chan_type
iio_chan_type
IIO channel type.
Definition iio.h:101
iio_event_direction
iio_event_direction
IIO event direction.
Definition iio.h:225
iio_modifier
iio_modifier
IIO channel modifier.
Definition iio.h:147
iio_buffer
An input or output buffer, used to read or write samples.
iio_channel
Represents an input or output channel of a device.
iio_context_info
The information related to a discovered context.
iio_context
Contains the representation of an IIO context.
iio_data_format
Contains the format of a data sample.
Definition iio.h:1680
iio_data_format::is_signed
bool is_signed
Contains True if the sample is signed.
Definition iio.h:1691
iio_data_format::is_be
bool is_be
Contains True if the sample is in big-endian format.
Definition iio.h:1697
iio_data_format::with_scale
bool with_scale
Contains True if the sample should be scaled when converted.
Definition iio.h:1700
iio_data_format::scale
double scale
Contains the scale to apply if with_scale is set.
Definition iio.h:1703
iio_data_format::repeat
unsigned int repeat
Number of times length repeats (added in v0.8).
Definition iio.h:1706
iio_data_format::length
unsigned int length
Total length of the sample, in bits.
Definition iio.h:1682
iio_data_format::is_fully_defined
bool is_fully_defined
Contains True if the sample is fully defined, sign extended, etc.
Definition iio.h:1694
iio_data_format::shift
unsigned int shift
Right-shift to apply when converting sample.
Definition iio.h:1688
iio_data_format::bits
unsigned int bits
Length of valuable data in the sample, in bits.
Definition iio.h:1685
iio_device
Represents a device in the IIO context.