libiio  0.23
Library for interfacing with IIO devices
iio.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * libiio - Library for interfacing industrial I/O (IIO) devices
4  *
5  * Copyright (C) 2014 Analog Devices, Inc.
6  * Author: Paul Cercueil <paul.cercueil@analog.com>
7  */
8 
12 #ifndef __IIO_H__
13 #define __IIO_H__
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include <limits.h>
20 #include <stdint.h>
21 #include <stdlib.h>
22 #include <stddef.h>
23 
24 #if (defined(_WIN32) || defined(__MBED__))
25 #ifndef _SSIZE_T_DEFINED
26 typedef ptrdiff_t ssize_t;
27 #define _SSIZE_T_DEFINED
28 #endif
29 #else
30 #include <sys/types.h>
31 #endif
32 
33 #if defined(_MSC_VER) && (_MSC_VER < 1800) && !defined(__BOOL_DEFINED)
34 #undef bool
35 #undef false
36 #undef true
37 #define bool char
38 #define false 0
39 #define true 1
40 #else
41 #include <stdbool.h>
42 #endif
43 
44 #if defined(__GNUC__) && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
45 #ifndef __cnst
46 #define __cnst __attribute__((const))
47 #endif
48 #ifndef __pure
49 #define __pure __attribute__((pure))
50 #endif
51 #define __notused __attribute__((unused))
52 #ifdef IIO_CHECK_RET
53 #define __check_ret __attribute__((warn_unused_result))
54 #else
55 #define __check_ret
56 #endif
57 #else
58 #define __cnst
59 #define __pure
60 #define __notused
61 #define __check_ret
62 #endif
63 
64 #ifdef _WIN32
65 # ifdef LIBIIO_STATIC
66 # define __api
67 # elif defined(LIBIIO_EXPORTS)
68 # define __api __declspec(dllexport)
69 # else
70 # define __api __declspec(dllimport)
71 # endif
72 #elif __GNUC__ >= 4 && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
73 # define __api __attribute__((visibility ("default")))
74 #else
75 # define __api
76 #endif
77 
78 struct iio_context;
79 struct iio_device;
80 struct iio_channel;
81 struct iio_buffer;
82 
83 struct iio_context_info;
84 struct iio_scan_context;
85 struct iio_scan_block;
86 
95  IIO_VOLTAGE,
96  IIO_CURRENT,
97  IIO_POWER,
98  IIO_ACCEL,
99  IIO_ANGL_VEL,
100  IIO_MAGN,
101  IIO_LIGHT,
102  IIO_INTENSITY,
103  IIO_PROXIMITY,
104  IIO_TEMP,
105  IIO_INCLI,
106  IIO_ROT,
107  IIO_ANGL,
108  IIO_TIMESTAMP,
109  IIO_CAPACITANCE,
110  IIO_ALTVOLTAGE,
111  IIO_CCT,
112  IIO_PRESSURE,
113  IIO_HUMIDITYRELATIVE,
114  IIO_ACTIVITY,
115  IIO_STEPS,
116  IIO_ENERGY,
117  IIO_DISTANCE,
118  IIO_VELOCITY,
119  IIO_CONCENTRATION,
120  IIO_RESISTANCE,
121  IIO_PH,
122  IIO_UVINDEX,
123  IIO_ELECTRICALCONDUCTIVITY,
124  IIO_COUNT,
125  IIO_INDEX,
126  IIO_GRAVITY,
127  IIO_POSITIONRELATIVE,
128  IIO_PHASE,
129  IIO_MASSCONCENTRATION,
130  IIO_CHAN_TYPE_UNKNOWN = INT_MAX
131 };
132 
141  IIO_NO_MOD,
142  IIO_MOD_X,
143  IIO_MOD_Y,
144  IIO_MOD_Z,
145  IIO_MOD_X_AND_Y,
146  IIO_MOD_X_AND_Z,
147  IIO_MOD_Y_AND_Z,
148  IIO_MOD_X_AND_Y_AND_Z,
149  IIO_MOD_X_OR_Y,
150  IIO_MOD_X_OR_Z,
151  IIO_MOD_Y_OR_Z,
152  IIO_MOD_X_OR_Y_OR_Z,
153  IIO_MOD_LIGHT_BOTH,
154  IIO_MOD_LIGHT_IR,
155  IIO_MOD_ROOT_SUM_SQUARED_X_Y,
156  IIO_MOD_SUM_SQUARED_X_Y_Z,
157  IIO_MOD_LIGHT_CLEAR,
158  IIO_MOD_LIGHT_RED,
159  IIO_MOD_LIGHT_GREEN,
160  IIO_MOD_LIGHT_BLUE,
161  IIO_MOD_QUATERNION,
162  IIO_MOD_TEMP_AMBIENT,
163  IIO_MOD_TEMP_OBJECT,
164  IIO_MOD_NORTH_MAGN,
165  IIO_MOD_NORTH_TRUE,
166  IIO_MOD_NORTH_MAGN_TILT_COMP,
167  IIO_MOD_NORTH_TRUE_TILT_COMP,
168  IIO_MOD_RUNNING,
169  IIO_MOD_JOGGING,
170  IIO_MOD_WALKING,
171  IIO_MOD_STILL,
172  IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z,
173  IIO_MOD_I,
174  IIO_MOD_Q,
175  IIO_MOD_CO2,
176  IIO_MOD_VOC,
177  IIO_MOD_LIGHT_UV,
178  IIO_MOD_LIGHT_DUV,
179  IIO_MOD_PM1,
180  IIO_MOD_PM2P5,
181  IIO_MOD_PM4,
182  IIO_MOD_PM10,
183  IIO_MOD_ETHANOL,
184  IIO_MOD_H2,
185  IIO_MOD_O2,
186 };
187 
188 /* ---------------------------------------------------------------------------*/
189 /* ------------------------- Scan functions ----------------------------------*/
208 __api __check_ret struct iio_scan_context * iio_create_scan_context(
209  const char *backend, unsigned int flags);
210 
211 
216 __api void iio_scan_context_destroy(struct iio_scan_context *ctx);
217 
218 
226 __api __check_ret ssize_t iio_scan_context_get_info_list(struct iio_scan_context *ctx,
227  struct iio_context_info ***info);
228 
229 
233 __api void iio_context_info_list_free(struct iio_context_info **info);
234 
235 
240 __api __check_ret __pure const char * iio_context_info_get_description(
241  const struct iio_context_info *info);
242 
243 
248 __api __check_ret __pure const char * iio_context_info_get_uri(
249  const struct iio_context_info *info);
250 
251 
260 __api struct iio_scan_block * iio_create_scan_block(
261  const char *backend, unsigned int flags);
262 
263 
270 __api void iio_scan_block_destroy(struct iio_scan_block *blk);
271 
272 
279 __api ssize_t iio_scan_block_scan(struct iio_scan_block *blk);
280 
281 
291  struct iio_scan_block *blk, unsigned int index);
292 
293 /* ------------------------------------------------------------------*/
295 /* ------------------------- Top-level functions -----------------------------*/
304 __api void iio_library_get_version(unsigned int *major,
305  unsigned int *minor, char git_tag[8]);
306 
307 
313 __api void iio_strerror(int err, char *dst, size_t len);
314 
315 
321 __api __check_ret __cnst bool iio_has_backend(const char *backend);
322 
323 
328 __api __check_ret __cnst unsigned int iio_get_backends_count(void);
329 
330 
337 __api __check_ret __cnst const char * iio_get_backend(unsigned int index);
338 
339 /* ------------------------------------------------------------------*/
341 /* ------------------------- Context functions -------------------------------*/
355 __api __check_ret struct iio_context * iio_create_default_context(void);
356 
357 
361 __api __check_ret struct iio_context * iio_create_local_context(void);
362 
363 
371 __api __check_ret struct iio_context * iio_create_xml_context(const char *xml_file);
372 
373 
382 __api __check_ret struct iio_context * iio_create_xml_context_mem(
383  const char *xml, size_t len);
384 
385 
390 __api __check_ret struct iio_context * iio_create_network_context(const char *host);
391 
392 
423 __api __check_ret struct iio_context * iio_create_context_from_uri(const char *uri);
424 
425 
434 __api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx);
435 
436 
441 __api void iio_context_destroy(struct iio_context *ctx);
442 
443 
451 __api __check_ret int iio_context_get_version(const struct iio_context *ctx,
452  unsigned int *major, unsigned int *minor, char git_tag[8]);
453 
454 
458 __api __check_ret __pure const char * iio_context_get_xml(const struct iio_context *ctx);
459 
460 
468 __api __check_ret __pure const char * iio_context_get_name(const struct iio_context *ctx);
469 
470 
477 __api __check_ret __pure const char * iio_context_get_description(
478  const struct iio_context *ctx);
479 
480 
486 __api __check_ret __pure unsigned int iio_context_get_attrs_count(
487  const struct iio_context *ctx);
488 
489 
499 __api __check_ret int iio_context_get_attr(
500  const struct iio_context *ctx, unsigned int index,
501  const char **name, const char **value);
502 
503 
512 __api __check_ret const char * iio_context_get_attr_value(
513  const struct iio_context *ctx, const char *name);
514 
515 
519 __api __check_ret __pure unsigned int iio_context_get_devices_count(
520  const struct iio_context *ctx);
521 
522 
528 __api __check_ret __pure struct iio_device * iio_context_get_device(
529  const struct iio_context *ctx, unsigned int index);
530 
531 
539 __api __check_ret __pure struct iio_device * iio_context_find_device(
540  const struct iio_context *ctx, const char *name);
541 
542 
550 __api __check_ret int iio_context_set_timeout(
551  struct iio_context *ctx, unsigned int timeout_ms);
552 
553 /* ------------------------------------------------------------------*/
555 /* ------------------------- Device functions --------------------------------*/
565 __api __check_ret __pure const struct iio_context * iio_device_get_context(
566  const struct iio_device *dev);
567 
568 
572 __api __check_ret __pure const char * iio_device_get_id(const struct iio_device *dev);
573 
574 
580 __api __check_ret __pure const char * iio_device_get_name(const struct iio_device *dev);
581 
582 
588 __api __check_ret __pure const char * iio_device_get_label(const struct iio_device *dev);
589 
590 
594 __api __check_ret __pure unsigned int iio_device_get_channels_count(
595  const struct iio_device *dev);
596 
597 
601 __api __check_ret __pure unsigned int iio_device_get_attrs_count(
602  const struct iio_device *dev);
603 
607 __api __check_ret __pure unsigned int iio_device_get_buffer_attrs_count(
608  const struct iio_device *dev);
609 
615 __api __check_ret __pure struct iio_channel * iio_device_get_channel(
616  const struct iio_device *dev, unsigned int index);
617 
618 
624 __api __check_ret __pure const char * iio_device_get_attr(
625  const struct iio_device *dev, unsigned int index);
626 
632 __api __check_ret __pure const char * iio_device_get_buffer_attr(
633  const struct iio_device *dev, unsigned int index);
634 
643 __api __check_ret __pure struct iio_channel * iio_device_find_channel(
644  const struct iio_device *dev, const char *name, bool output);
645 
646 
658 __api __check_ret __pure const char * iio_device_find_attr(
659  const struct iio_device *dev, const char *name);
660 
672 __api __check_ret __pure const char * iio_device_find_buffer_attr(
673  const struct iio_device *dev, const char *name);
674 
696 __api __check_ret ssize_t iio_device_attr_read(const struct iio_device *dev,
697  const char *attr, char *dst, size_t len);
698 
699 
710 __api __check_ret int iio_device_attr_read_all(struct iio_device *dev,
711  int (*cb)(struct iio_device *dev, const char *attr,
712  const char *value, size_t len, void *d),
713  void *data);
714 
715 
723 __api __check_ret int iio_device_attr_read_bool(const struct iio_device *dev,
724  const char *attr, bool *val);
725 
726 
734 __api __check_ret int iio_device_attr_read_longlong(const struct iio_device *dev,
735  const char *attr, long long *val);
736 
737 
745 __api __check_ret int iio_device_attr_read_double(const struct iio_device *dev,
746  const char *attr, double *val);
747 
748 
767 __api __check_ret ssize_t iio_device_attr_write(const struct iio_device *dev,
768  const char *attr, const char *src);
769 
770 
779 __api __check_ret ssize_t iio_device_attr_write_raw(const struct iio_device *dev,
780  const char *attr, const void *src, size_t len);
781 
782 
793 __api __check_ret int iio_device_attr_write_all(struct iio_device *dev,
794  ssize_t (*cb)(struct iio_device *dev,
795  const char *attr, void *buf, size_t len, void *d),
796  void *data);
797 
798 
806 __api __check_ret int iio_device_attr_write_bool(const struct iio_device *dev,
807  const char *attr, bool val);
808 
809 
817 __api __check_ret int iio_device_attr_write_longlong(const struct iio_device *dev,
818  const char *attr, long long val);
819 
820 
828 __api __check_ret int iio_device_attr_write_double(const struct iio_device *dev,
829  const char *attr, double val);
830 
853 __api __check_ret ssize_t iio_device_buffer_attr_read(const struct iio_device *dev,
854  const char *attr, char *dst, size_t len);
855 
866 __api __check_ret int iio_device_buffer_attr_read_all(struct iio_device *dev,
867  int (*cb)(struct iio_device *dev, const char *attr,
868  const char *value, size_t len, void *d),
869  void *data);
870 
871 
879 __api __check_ret int iio_device_buffer_attr_read_bool(const struct iio_device *dev,
880  const char *attr, bool *val);
881 
882 
890 __api __check_ret int iio_device_buffer_attr_read_longlong(const struct iio_device *dev,
891  const char *attr, long long *val);
892 
893 
901 __api __check_ret int iio_device_buffer_attr_read_double(const struct iio_device *dev,
902  const char *attr, double *val);
903 
904 
924 __api __check_ret ssize_t iio_device_buffer_attr_write(const struct iio_device *dev,
925  const char *attr, const char *src);
926 
927 
936 __api __check_ret ssize_t iio_device_buffer_attr_write_raw(const struct iio_device *dev,
937  const char *attr, const void *src, size_t len);
938 
939 
950 __api __check_ret int iio_device_buffer_attr_write_all(struct iio_device *dev,
951  ssize_t (*cb)(struct iio_device *dev,
952  const char *attr, void *buf, size_t len, void *d),
953  void *data);
954 
955 
963 __api __check_ret int iio_device_buffer_attr_write_bool(const struct iio_device *dev,
964  const char *attr, bool val);
965 
966 
974 __api __check_ret int iio_device_buffer_attr_write_longlong(const struct iio_device *dev,
975  const char *attr, long long val);
976 
977 
985 __api __check_ret int iio_device_buffer_attr_write_double(const struct iio_device *dev,
986  const char *attr, double val);
987 
988 
992 __api void iio_device_set_data(struct iio_device *dev, void *data);
993 
994 
998 __api void * iio_device_get_data(const struct iio_device *dev);
999 
1000 
1008 __api __check_ret int iio_device_get_trigger(const struct iio_device *dev,
1009  const struct iio_device **trigger);
1010 
1011 
1018 __api __check_ret int iio_device_set_trigger(const struct iio_device *dev,
1019  const struct iio_device *trigger);
1020 
1021 
1025 __api __check_ret __pure bool iio_device_is_trigger(const struct iio_device *dev);
1026 
1034 __api __check_ret int iio_device_set_kernel_buffers_count(const struct iio_device *dev,
1035  unsigned int nb_buffers);
1036 /* ------------------------------------------------------------------*/
1038 /* ------------------------- Channel functions -------------------------------*/
1048 __api __check_ret __pure const struct iio_device * iio_channel_get_device(
1049  const struct iio_channel *chn);
1050 
1051 
1055 __api __check_ret __pure const char * iio_channel_get_id(const struct iio_channel *chn);
1056 
1057 
1063 __api __check_ret __pure const char * iio_channel_get_name(const struct iio_channel *chn);
1064 
1065 
1069 __api __check_ret __pure bool iio_channel_is_output(const struct iio_channel *chn);
1070 
1071 
1079 __api __check_ret __pure bool iio_channel_is_scan_element(const struct iio_channel *chn);
1080 
1081 
1085 __api __check_ret __pure unsigned int iio_channel_get_attrs_count(
1086  const struct iio_channel *chn);
1087 
1088 
1094 __api __check_ret __pure const char * iio_channel_get_attr(
1095  const struct iio_channel *chn, unsigned int index);
1096 
1097 
1109 __api __check_ret __pure const char * iio_channel_find_attr(
1110  const struct iio_channel *chn, const char *name);
1111 
1112 
1119 __api __check_ret __pure const char * iio_channel_attr_get_filename(
1120  const struct iio_channel *chn, const char *attr);
1121 
1122 
1144 __api __check_ret ssize_t iio_channel_attr_read(const struct iio_channel *chn,
1145  const char *attr, char *dst, size_t len);
1146 
1147 
1158 __api __check_ret int iio_channel_attr_read_all(struct iio_channel *chn,
1159  int (*cb)(struct iio_channel *chn,
1160  const char *attr, const char *val, size_t len, void *d),
1161  void *data);
1162 
1163 
1171 __api __check_ret int iio_channel_attr_read_bool(const struct iio_channel *chn,
1172  const char *attr, bool *val);
1173 
1174 
1182 __api __check_ret int iio_channel_attr_read_longlong(const struct iio_channel *chn,
1183  const char *attr, long long *val);
1184 
1185 
1193 __api __check_ret int iio_channel_attr_read_double(const struct iio_channel *chn,
1194  const char *attr, double *val);
1195 
1196 
1215 __api __check_ret ssize_t iio_channel_attr_write(const struct iio_channel *chn,
1216  const char *attr, const char *src);
1217 
1218 
1227 __api __check_ret ssize_t iio_channel_attr_write_raw(const struct iio_channel *chn,
1228  const char *attr, const void *src, size_t len);
1229 
1230 
1241 __api __check_ret int iio_channel_attr_write_all(struct iio_channel *chn,
1242  ssize_t (*cb)(struct iio_channel *chn,
1243  const char *attr, void *buf, size_t len, void *d),
1244  void *data);
1245 
1246 
1254 __api __check_ret int iio_channel_attr_write_bool(const struct iio_channel *chn,
1255  const char *attr, bool val);
1256 
1257 
1265 __api __check_ret int iio_channel_attr_write_longlong(const struct iio_channel *chn,
1266  const char *attr, long long val);
1267 
1268 
1276 __api __check_ret int iio_channel_attr_write_double(const struct iio_channel *chn,
1277  const char *attr, double val);
1278 
1279 
1286 __api void iio_channel_enable(struct iio_channel *chn);
1287 
1288 
1291 __api void iio_channel_disable(struct iio_channel *chn);
1292 
1293 
1297 __api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn);
1298 
1299 
1307 __api __check_ret size_t iio_channel_read_raw(const struct iio_channel *chn,
1308  struct iio_buffer *buffer, void *dst, size_t len);
1309 
1310 
1318 __api __check_ret size_t iio_channel_read(const struct iio_channel *chn,
1319  struct iio_buffer *buffer, void *dst, size_t len);
1320 
1321 
1329 __api __check_ret size_t iio_channel_write_raw(const struct iio_channel *chn,
1330  struct iio_buffer *buffer, const void *src, size_t len);
1331 
1332 
1340 __api __check_ret size_t iio_channel_write(const struct iio_channel *chn,
1341  struct iio_buffer *buffer, const void *src, size_t len);
1342 
1343 
1347 __api void iio_channel_set_data(struct iio_channel *chn, void *data);
1348 
1349 
1353 __api void * iio_channel_get_data(const struct iio_channel *chn);
1354 
1355 
1359 __api __check_ret __pure enum iio_chan_type iio_channel_get_type(
1360  const struct iio_channel *chn);
1361 
1362 
1366 __api __check_ret __pure enum iio_modifier iio_channel_get_modifier(
1367  const struct iio_channel *chn);
1368 
1369 /* ------------------------------------------------------------------*/
1371 /* ------------------------- Buffer functions --------------------------------*/
1381 __api __check_ret __pure const struct iio_device * iio_buffer_get_device(
1382  const struct iio_buffer *buf);
1383 
1384 
1394 __api __check_ret struct iio_buffer * iio_device_create_buffer(const struct iio_device *dev,
1395  size_t samples_count, bool cyclic);
1396 
1397 
1402 __api void iio_buffer_destroy(struct iio_buffer *buf);
1403 
1412 __api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf);
1413 
1425 __api __check_ret int iio_buffer_set_blocking_mode(struct iio_buffer *buf, bool blocking);
1426 
1427 
1434 __api __check_ret ssize_t iio_buffer_refill(struct iio_buffer *buf);
1435 
1436 
1443 __api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf);
1444 
1445 
1453 __api __check_ret ssize_t iio_buffer_push_partial(struct iio_buffer *buf,
1454  size_t samples_count);
1455 
1479 __api void iio_buffer_cancel(struct iio_buffer *buf);
1480 
1481 
1485 __api void * iio_buffer_start(const struct iio_buffer *buf);
1486 
1487 
1503 __api void * iio_buffer_first(const struct iio_buffer *buf,
1504  const struct iio_channel *chn);
1505 
1506 
1511 __api __check_ret ptrdiff_t iio_buffer_step(const struct iio_buffer *buf);
1512 
1513 
1518 __api void * iio_buffer_end(const struct iio_buffer *buf);
1519 
1520 
1532 __api __check_ret ssize_t iio_buffer_foreach_sample(struct iio_buffer *buf,
1533  ssize_t (*callback)(const struct iio_channel *chn,
1534  void *src, size_t bytes, void *d), void *data);
1535 
1536 
1540 __api void iio_buffer_set_data(struct iio_buffer *buf, void *data);
1541 
1542 
1546 __api void * iio_buffer_get_data(const struct iio_buffer *buf);
1547 
1548 /* ------------------------------------------------------------------*/
1550 /* ------------------------- Low-level functions -----------------------------*/
1562  unsigned int length;
1563 
1565  unsigned int bits;
1566 
1568  unsigned int shift;
1569 
1572 
1575 
1577  bool is_be;
1578 
1581 
1583  double scale;
1584 
1586  unsigned int repeat;
1587 };
1588 
1589 
1597 __api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev);
1598 
1599 
1604 __api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn);
1605 
1606 
1610 __api __check_ret __cnst const struct iio_data_format * iio_channel_get_data_format(
1611  const struct iio_channel *chn);
1612 
1613 
1619 __api void iio_channel_convert(const struct iio_channel *chn,
1620  void *dst, const void *src);
1621 
1622 
1628 __api void iio_channel_convert_inverse(const struct iio_channel *chn,
1629  void *dst, const void *src);
1630 
1631 
1635 __api __check_ret __pure unsigned int iio_device_get_debug_attrs_count(
1636  const struct iio_device *dev);
1637 
1638 
1644 __api __check_ret __pure const char * iio_device_get_debug_attr(
1645  const struct iio_device *dev, unsigned int index);
1646 
1647 
1660 __api __check_ret __pure const char * iio_device_find_debug_attr(
1661  const struct iio_device *dev, const char *name);
1662 
1663 
1686 __api __check_ret ssize_t iio_device_debug_attr_read(const struct iio_device *dev,
1687  const char *attr, char *dst, size_t len);
1688 
1689 
1699 __api __check_ret int iio_device_debug_attr_read_all(struct iio_device *dev,
1700  int (*cb)(struct iio_device *dev, const char *attr,
1701  const char *value, size_t len, void *d),
1702  void *data);
1703 
1704 
1724 __api __check_ret ssize_t iio_device_debug_attr_write(const struct iio_device *dev,
1725  const char *attr, const char *src);
1726 
1727 
1736 __api __check_ret ssize_t iio_device_debug_attr_write_raw(const struct iio_device *dev,
1737  const char *attr, const void *src, size_t len);
1738 
1739 
1749 __api __check_ret int iio_device_debug_attr_write_all(struct iio_device *dev,
1750  ssize_t (*cb)(struct iio_device *dev,
1751  const char *attr, void *buf, size_t len, void *d),
1752  void *data);
1753 
1754 
1762 __api __check_ret int iio_device_debug_attr_read_bool(const struct iio_device *dev,
1763  const char *attr, bool *val);
1764 
1765 
1773 __api __check_ret int iio_device_debug_attr_read_longlong(const struct iio_device *dev,
1774  const char *attr, long long *val);
1775 
1776 
1784 __api __check_ret int iio_device_debug_attr_read_double(const struct iio_device *dev,
1785  const char *attr, double *val);
1786 
1787 
1795 __api __check_ret int iio_device_debug_attr_write_bool(const struct iio_device *dev,
1796  const char *attr, bool val);
1797 
1798 
1806 __api __check_ret int iio_device_debug_attr_write_longlong(const struct iio_device *dev,
1807  const char *attr, long long val);
1808 
1809 
1817 __api __check_ret int iio_device_debug_attr_write_double(const struct iio_device *dev,
1818  const char *attr, double val);
1819 
1820 
1833 __api __check_ret int iio_device_identify_filename(const struct iio_device *dev,
1834  const char *filename, struct iio_channel **chn,
1835  const char **attr);
1836 
1837 
1844 __api __check_ret int iio_device_reg_write(struct iio_device *dev,
1845  uint32_t address, uint32_t value);
1846 
1847 
1854 __api __check_ret int iio_device_reg_read(struct iio_device *dev,
1855  uint32_t address, uint32_t *value);
1856 
1857 
1860 #ifdef __cplusplus
1861 }
1862 #endif
1863 
1864 #undef __api
1865 
1866 #endif /* __IIO_H__ */
__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
__api void iio_buffer_set_data(struct iio_buffer *buf, void *data)
Associate a pointer to an iio_buffer structure.
Definition: buffer.c:298
__api void iio_buffer_cancel(struct iio_buffer *buf)
Cancel all buffer operations.
Definition: buffer.c:313
__api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf)
Get a pollable file descriptor.
Definition: buffer.c:113
__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
__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
__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
__api void * iio_buffer_start(const struct iio_buffer *buf)
Get the start address of the buffer.
Definition: buffer.c:245
__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.
__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
__api void iio_buffer_destroy(struct iio_buffer *buf)
Destroy the given buffer.
Definition: buffer.c:104
__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
__api __check_ret ssize_t iio_buffer_refill(struct iio_buffer *buf)
Fetch more samples from the hardware.
Definition: buffer.c:123
__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
__api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf)
Send the samples to the hardware.
Definition: buffer.c:147
__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
__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:273
__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:604
__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:302
__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:288
__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:283
__api void iio_channel_enable(struct iio_channel *chn)
Enable the given channel.
Definition: channel.c:367
__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:314
__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:621
__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:573
__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:334
__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:263
__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:268
__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:278
__api void iio_channel_set_data(struct iio_channel *chn, void *data)
Associate a pointer to an iio_channel structure.
Definition: channel.c:340
__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:588
__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:557
__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:747
__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:633
__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:666
__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:677
__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:688
__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:644
__api void * iio_channel_get_data(const struct iio_channel *chn)
Retrieve a previously associated pointer of an iio_channel structure.
Definition: channel.c:345
__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:324
__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:542
__api void iio_channel_disable(struct iio_channel *chn)
Disable the given channel.
Definition: channel.c:373
__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:654
__api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn)
Returns True if the channel is enabled.
Definition: channel.c:361
__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:790
__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:293
__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:258
__api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx)
Duplicate a pre-existing IIO context.
Definition: context.c:384
__api __check_ret struct iio_context * iio_create_default_context(void)
Create a context from local or remote IIO devices.
Definition: context.c:415
__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
__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
__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
__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
__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
__api void iio_context_destroy(struct iio_context *ctx)
Destroy the given context.
Definition: context.c:258
__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
__api __check_ret struct iio_context * iio_create_network_context(const char *host)
Create a context from the network.
Definition: context.c:438
__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
__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
__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
__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
__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
__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
__api __check_ret struct iio_context * iio_create_local_context(void)
Create a context from local IIO devices (Linux only)
Definition: context.c:429
__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
__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
__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:701
__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:788
__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:645
__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.
__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:712
__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
__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:724
__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:736
__api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev)
Get the current sample size.
Definition: device.c:476
__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:1029
__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:801
__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:749
__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:635
__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:661
__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:355
__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:689
__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:655
__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:513
__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:481
__api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn)
Get the index of the given channel.
Definition: channel.c:350
__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:666
__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:672
__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:481
__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:610
__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
__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
__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
__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:1037
__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:622
__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:521
__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:587
__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
__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 __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
__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
__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
__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
__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
__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
__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
__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
__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
__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:575
__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:498
__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
__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
__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:545
__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
__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
__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
__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_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:510
__api void iio_device_set_data(struct iio_device *dev, void *data)
Associate a pointer to an iio_device structure.
Definition: device.c:358
__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:598
__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:1053
__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:533
__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:1045
__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
__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
__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:558
__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
__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
__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
__api void iio_context_info_list_free(struct iio_context_info **info)
Free a context info list.
Definition: scan.c:71
__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:34
__api void iio_scan_context_destroy(struct iio_scan_context *ctx)
Destroy the given scan context.
Definition: scan.c:141
__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:28
__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:22
__api void iio_scan_block_destroy(struct iio_scan_block *blk)
Destroy the given scan block.
Definition: scan.c:190
__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:160
__api __check_ret struct iio_scan_context * iio_create_scan_context(const char *backend, unsigned int flags)
Create a scan context.
Definition: scan.c:112
__api struct iio_scan_block * iio_create_scan_block(const char *backend, unsigned int flags)
Create a scan block.
Definition: scan.c:170
__api ssize_t iio_scan_block_scan(struct iio_scan_block *blk)
Enumerate available contexts via scan block.
Definition: scan.c:152
__api __check_ret __cnst const char * iio_get_backend(unsigned int index)
Retrieve the name of a given backend.
Definition: backend.c:27
__api void iio_strerror(int err, char *dst, size_t len)
Get a string description of an error code.
Definition: utilities.c:198
__api __check_ret __cnst bool iio_has_backend(const char *backend)
Check if the specified backend is available.
Definition: backend.c:62
__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:186
__api __check_ret __cnst unsigned int iio_get_backends_count(void)
Get the number of available backends.
Definition: backend.c:14
iio_chan_type
IIO channel type.
Definition: iio.h:94
iio_modifier
IIO channel modifier.
Definition: iio.h:140
An input or output buffer, used to read or write samples.
Represents an input or output channel of a device.
The information related to a discovered context.
Contains the representation of an IIO context.
Contains the format of a data sample.
Definition: iio.h:1560
bool is_signed
Contains True if the sample is signed.
Definition: iio.h:1571
bool is_be
Contains True if the sample is in big-endian format.
Definition: iio.h:1577
bool with_scale
Contains True if the sample should be scaled when converted.
Definition: iio.h:1580
double scale
Contains the scale to apply if with_scale is set.
Definition: iio.h:1583
unsigned int repeat
Number of times length repeats (added in v0.8)
Definition: iio.h:1586
unsigned int length
Total length of the sample, in bits.
Definition: iio.h:1562
bool is_fully_defined
Contains True if the sample is fully defined, sign extended, etc.
Definition: iio.h:1574
unsigned int shift
Right-shift to apply when converting sample.
Definition: iio.h:1568
unsigned int bits
Length of valuable data in the sample, in bits.
Definition: iio.h:1565
Represents a device in the IIO context.