libiio
iio.h
Go to the documentation of this file.
1 /*
2  * libiio - Library for interfacing industrial I/O (IIO) devices
3  *
4  * Copyright (C) 2014 Analog Devices, Inc.
5  * Author: Paul Cercueil <paul.cercueil@analog.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * */
18 
22 #ifndef __IIO_H__
23 #define __IIO_H__
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include <limits.h>
30 #include <stdint.h>
31 #include <stdlib.h>
32 #include <stddef.h>
33 
34 #if (defined(_WIN32) || defined(__MBED__))
35 #ifndef _SSIZE_T_DEFINED
36 typedef ptrdiff_t ssize_t;
37 #define _SSIZE_T_DEFINED
38 #endif
39 #else
40 #include <sys/types.h>
41 #endif
42 
43 #if defined(_MSC_VER) && (_MSC_VER < 1800) && !defined(__BOOL_DEFINED)
44 #undef bool
45 #undef false
46 #undef true
47 #define bool char
48 #define false 0
49 #define true 1
50 #else
51 #include <stdbool.h>
52 #endif
53 
54 #if defined(__GNUC__) && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
55 #ifndef __cnst
56 #define __cnst __attribute__((const))
57 #endif
58 #ifndef __pure
59 #define __pure __attribute__((pure))
60 #endif
61 #define __notused __attribute__((unused))
62 #ifdef IIO_CHECK_RET
63 #define __check_ret __attribute__((warn_unused_result))
64 #else
65 #define __check_ret
66 #endif
67 #else
68 #define __cnst
69 #define __pure
70 #define __notused
71 #define __check_ret
72 #endif
73 
74 #ifdef _WIN32
75 # ifdef LIBIIO_EXPORTS
76 # define __api __declspec(dllexport)
77 # else
78 # define __api __declspec(dllimport)
79 # endif
80 #elif __GNUC__ >= 4 && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
81 # define __api __attribute__((visibility ("default")))
82 #else
83 # define __api
84 #endif
85 
86 struct iio_context;
87 struct iio_device;
88 struct iio_channel;
89 struct iio_buffer;
90 
91 struct iio_context_info;
92 struct iio_scan_context;
93 
102  IIO_VOLTAGE,
103  IIO_CURRENT,
104  IIO_POWER,
105  IIO_ACCEL,
106  IIO_ANGL_VEL,
107  IIO_MAGN,
108  IIO_LIGHT,
109  IIO_INTENSITY,
110  IIO_PROXIMITY,
111  IIO_TEMP,
112  IIO_INCLI,
113  IIO_ROT,
114  IIO_ANGL,
115  IIO_TIMESTAMP,
116  IIO_CAPACITANCE,
117  IIO_ALTVOLTAGE,
118  IIO_CCT,
119  IIO_PRESSURE,
120  IIO_HUMIDITYRELATIVE,
121  IIO_ACTIVITY,
122  IIO_STEPS,
123  IIO_ENERGY,
124  IIO_DISTANCE,
125  IIO_VELOCITY,
126  IIO_CONCENTRATION,
127  IIO_RESISTANCE,
128  IIO_PH,
129  IIO_UVINDEX,
130  IIO_ELECTRICALCONDUCTIVITY,
131  IIO_COUNT,
132  IIO_INDEX,
133  IIO_GRAVITY,
134  IIO_POSITIONRELATIVE,
135  IIO_PHASE,
136  IIO_MASSCONCENTRATION,
137  IIO_CHAN_TYPE_UNKNOWN = INT_MAX
138 };
139 
148  IIO_NO_MOD,
149  IIO_MOD_X,
150  IIO_MOD_Y,
151  IIO_MOD_Z,
152  IIO_MOD_X_AND_Y,
153  IIO_MOD_X_AND_Z,
154  IIO_MOD_Y_AND_Z,
155  IIO_MOD_X_AND_Y_AND_Z,
156  IIO_MOD_X_OR_Y,
157  IIO_MOD_X_OR_Z,
158  IIO_MOD_Y_OR_Z,
159  IIO_MOD_X_OR_Y_OR_Z,
160  IIO_MOD_LIGHT_BOTH,
161  IIO_MOD_LIGHT_IR,
162  IIO_MOD_ROOT_SUM_SQUARED_X_Y,
163  IIO_MOD_SUM_SQUARED_X_Y_Z,
164  IIO_MOD_LIGHT_CLEAR,
165  IIO_MOD_LIGHT_RED,
166  IIO_MOD_LIGHT_GREEN,
167  IIO_MOD_LIGHT_BLUE,
168  IIO_MOD_QUATERNION,
169  IIO_MOD_TEMP_AMBIENT,
170  IIO_MOD_TEMP_OBJECT,
171  IIO_MOD_NORTH_MAGN,
172  IIO_MOD_NORTH_TRUE,
173  IIO_MOD_NORTH_MAGN_TILT_COMP,
174  IIO_MOD_NORTH_TRUE_TILT_COMP,
175  IIO_MOD_RUNNING,
176  IIO_MOD_JOGGING,
177  IIO_MOD_WALKING,
178  IIO_MOD_STILL,
179  IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z,
180  IIO_MOD_I,
181  IIO_MOD_Q,
182  IIO_MOD_CO2,
183  IIO_MOD_VOC,
184  IIO_MOD_LIGHT_UV,
185  IIO_MOD_LIGHT_DUV,
186  IIO_MOD_PM1,
187  IIO_MOD_PM2P5,
188  IIO_MOD_PM4,
189  IIO_MOD_PM10,
190  IIO_MOD_ETHANOL,
191  IIO_MOD_H2,
192 };
193 
194 /* ---------------------------------------------------------------------------*/
195 /* ------------------------- Scan functions ----------------------------------*/
212 __api __check_ret struct iio_scan_context * iio_create_scan_context(
213  const char *backend, unsigned int flags);
214 
215 
220 __api void iio_scan_context_destroy(struct iio_scan_context *ctx);
221 
222 
230 __api __check_ret ssize_t iio_scan_context_get_info_list(struct iio_scan_context *ctx,
231  struct iio_context_info ***info);
232 
233 
237 __api void iio_context_info_list_free(struct iio_context_info **info);
238 
239 
244 __api __check_ret __pure const char * iio_context_info_get_description(
245  const struct iio_context_info *info);
246 
247 
252 __api __check_ret __pure const char * iio_context_info_get_uri(
253  const struct iio_context_info *info);
254 
255 /* ------------------------------------------------------------------*/
257 /* ------------------------- Top-level functions -----------------------------*/
266 __api void iio_library_get_version(unsigned int *major,
267  unsigned int *minor, char git_tag[8]);
268 
269 
275 __api void iio_strerror(int err, char *dst, size_t len);
276 
277 
283 __api __check_ret __cnst bool iio_has_backend(const char *backend);
284 
285 
290 __api __check_ret __cnst unsigned int iio_get_backends_count(void);
291 
292 
299 __api __check_ret __cnst const char * iio_get_backend(unsigned int index);
300 
301 /* ------------------------------------------------------------------*/
303 /* ------------------------- Context functions -------------------------------*/
319 __api __check_ret struct iio_context * iio_create_default_context(void);
320 
321 
325 __api __check_ret struct iio_context * iio_create_local_context(void);
326 
327 
335 __api __check_ret struct iio_context * iio_create_xml_context(const char *xml_file);
336 
337 
346 __api __check_ret struct iio_context * iio_create_xml_context_mem(
347  const char *xml, size_t len);
348 
349 
354 __api __check_ret struct iio_context * iio_create_network_context(const char *host);
355 
356 
379 __api __check_ret struct iio_context * iio_create_context_from_uri(const char *uri);
380 
381 
386 __api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx);
387 
388 
393 __api void iio_context_destroy(struct iio_context *ctx);
394 
395 
403 __api __check_ret int iio_context_get_version(const struct iio_context *ctx,
404  unsigned int *major, unsigned int *minor, char git_tag[8]);
405 
406 
410 __api __check_ret __pure const char * iio_context_get_xml(const struct iio_context *ctx);
411 
412 
420 __api __check_ret __pure const char * iio_context_get_name(const struct iio_context *ctx);
421 
422 
429 __api __check_ret __pure const char * iio_context_get_description(
430  const struct iio_context *ctx);
431 
432 
438 __api __check_ret __pure unsigned int iio_context_get_attrs_count(
439  const struct iio_context *ctx);
440 
441 
451 __api __check_ret int iio_context_get_attr(
452  const struct iio_context *ctx, unsigned int index,
453  const char **name, const char **value);
454 
455 
464 __api __check_ret const char * iio_context_get_attr_value(
465  const struct iio_context *ctx, const char *name);
466 
467 
471 __api __check_ret __pure unsigned int iio_context_get_devices_count(
472  const struct iio_context *ctx);
473 
474 
480 __api __check_ret __pure struct iio_device * iio_context_get_device(
481  const struct iio_context *ctx, unsigned int index);
482 
483 
491 __api __check_ret __pure struct iio_device * iio_context_find_device(
492  const struct iio_context *ctx, const char *name);
493 
494 
502 __api __check_ret int iio_context_set_timeout(
503  struct iio_context *ctx, unsigned int timeout_ms);
504 
505 /* ------------------------------------------------------------------*/
507 /* ------------------------- Device functions --------------------------------*/
517 __api __check_ret __pure const struct iio_context * iio_device_get_context(
518  const struct iio_device *dev);
519 
520 
524 __api __check_ret __pure const char * iio_device_get_id(const struct iio_device *dev);
525 
526 
532 __api __check_ret __pure const char * iio_device_get_name(const struct iio_device *dev);
533 
534 
538 __api __check_ret __pure unsigned int iio_device_get_channels_count(
539  const struct iio_device *dev);
540 
541 
545 __api __check_ret __pure unsigned int iio_device_get_attrs_count(
546  const struct iio_device *dev);
547 
551 __api __check_ret __pure unsigned int iio_device_get_buffer_attrs_count(
552  const struct iio_device *dev);
553 
559 __api __check_ret __pure struct iio_channel * iio_device_get_channel(
560  const struct iio_device *dev, unsigned int index);
561 
562 
568 __api __check_ret __pure const char * iio_device_get_attr(
569  const struct iio_device *dev, unsigned int index);
570 
576 __api __check_ret __pure const char * iio_device_get_buffer_attr(
577  const struct iio_device *dev, unsigned int index);
578 
587 __api __check_ret __pure struct iio_channel * iio_device_find_channel(
588  const struct iio_device *dev, const char *name, bool output);
589 
590 
602 __api __check_ret __pure const char * iio_device_find_attr(
603  const struct iio_device *dev, const char *name);
604 
616 __api __check_ret __pure const char * iio_device_find_buffer_attr(
617  const struct iio_device *dev, const char *name);
618 
640 __api __check_ret ssize_t iio_device_attr_read(const struct iio_device *dev,
641  const char *attr, char *dst, size_t len);
642 
643 
654 __api __check_ret int iio_device_attr_read_all(struct iio_device *dev,
655  int (*cb)(struct iio_device *dev, const char *attr,
656  const char *value, size_t len, void *d),
657  void *data);
658 
659 
667 __api __check_ret int iio_device_attr_read_bool(const struct iio_device *dev,
668  const char *attr, bool *val);
669 
670 
678 __api __check_ret int iio_device_attr_read_longlong(const struct iio_device *dev,
679  const char *attr, long long *val);
680 
681 
689 __api __check_ret int iio_device_attr_read_double(const struct iio_device *dev,
690  const char *attr, double *val);
691 
692 
711 __api __check_ret ssize_t iio_device_attr_write(const struct iio_device *dev,
712  const char *attr, const char *src);
713 
714 
723 __api __check_ret ssize_t iio_device_attr_write_raw(const struct iio_device *dev,
724  const char *attr, const void *src, size_t len);
725 
726 
737 __api __check_ret int iio_device_attr_write_all(struct iio_device *dev,
738  ssize_t (*cb)(struct iio_device *dev,
739  const char *attr, void *buf, size_t len, void *d),
740  void *data);
741 
742 
750 __api __check_ret int iio_device_attr_write_bool(const struct iio_device *dev,
751  const char *attr, bool val);
752 
753 
761 __api __check_ret int iio_device_attr_write_longlong(const struct iio_device *dev,
762  const char *attr, long long val);
763 
764 
772 __api __check_ret int iio_device_attr_write_double(const struct iio_device *dev,
773  const char *attr, double val);
774 
797 __api __check_ret ssize_t iio_device_buffer_attr_read(const struct iio_device *dev,
798  const char *attr, char *dst, size_t len);
799 
810 __api __check_ret int iio_device_buffer_attr_read_all(struct iio_device *dev,
811  int (*cb)(struct iio_device *dev, const char *attr,
812  const char *value, size_t len, void *d),
813  void *data);
814 
815 
823 __api __check_ret int iio_device_buffer_attr_read_bool(const struct iio_device *dev,
824  const char *attr, bool *val);
825 
826 
834 __api __check_ret int iio_device_buffer_attr_read_longlong(const struct iio_device *dev,
835  const char *attr, long long *val);
836 
837 
845 __api __check_ret int iio_device_buffer_attr_read_double(const struct iio_device *dev,
846  const char *attr, double *val);
847 
848 
868 __api __check_ret ssize_t iio_device_buffer_attr_write(const struct iio_device *dev,
869  const char *attr, const char *src);
870 
871 
880 __api __check_ret ssize_t iio_device_buffer_attr_write_raw(const struct iio_device *dev,
881  const char *attr, const void *src, size_t len);
882 
883 
894 __api __check_ret int iio_device_buffer_attr_write_all(struct iio_device *dev,
895  ssize_t (*cb)(struct iio_device *dev,
896  const char *attr, void *buf, size_t len, void *d),
897  void *data);
898 
899 
907 __api __check_ret int iio_device_buffer_attr_write_bool(const struct iio_device *dev,
908  const char *attr, bool val);
909 
910 
918 __api __check_ret int iio_device_buffer_attr_write_longlong(const struct iio_device *dev,
919  const char *attr, long long val);
920 
921 
929 __api __check_ret int iio_device_buffer_attr_write_double(const struct iio_device *dev,
930  const char *attr, double val);
931 
932 
936 __api void iio_device_set_data(struct iio_device *dev, void *data);
937 
938 
942 __api void * iio_device_get_data(const struct iio_device *dev);
943 
944 
952 __api __check_ret int iio_device_get_trigger(const struct iio_device *dev,
953  const struct iio_device **trigger);
954 
955 
962 __api __check_ret int iio_device_set_trigger(const struct iio_device *dev,
963  const struct iio_device *trigger);
964 
965 
969 __api __check_ret __pure bool iio_device_is_trigger(const struct iio_device *dev);
970 
978 __api __check_ret int iio_device_set_kernel_buffers_count(const struct iio_device *dev,
979  unsigned int nb_buffers);
980 /* ------------------------------------------------------------------*/
982 /* ------------------------- Channel functions -------------------------------*/
992 __api __check_ret __pure const struct iio_device * iio_channel_get_device(
993  const struct iio_channel *chn);
994 
995 
999 __api __check_ret __pure const char * iio_channel_get_id(const struct iio_channel *chn);
1000 
1001 
1007 __api __check_ret __pure const char * iio_channel_get_name(const struct iio_channel *chn);
1008 
1009 
1013 __api __check_ret __pure bool iio_channel_is_output(const struct iio_channel *chn);
1014 
1015 
1023 __api __check_ret __pure bool iio_channel_is_scan_element(const struct iio_channel *chn);
1024 
1025 
1029 __api __check_ret __pure unsigned int iio_channel_get_attrs_count(
1030  const struct iio_channel *chn);
1031 
1032 
1038 __api __check_ret __pure const char * iio_channel_get_attr(
1039  const struct iio_channel *chn, unsigned int index);
1040 
1041 
1053 __api __check_ret __pure const char * iio_channel_find_attr(
1054  const struct iio_channel *chn, const char *name);
1055 
1056 
1063 __api __check_ret __pure const char * iio_channel_attr_get_filename(
1064  const struct iio_channel *chn, const char *attr);
1065 
1066 
1088 __api __check_ret ssize_t iio_channel_attr_read(const struct iio_channel *chn,
1089  const char *attr, char *dst, size_t len);
1090 
1091 
1102 __api __check_ret int iio_channel_attr_read_all(struct iio_channel *chn,
1103  int (*cb)(struct iio_channel *chn,
1104  const char *attr, const char *val, size_t len, void *d),
1105  void *data);
1106 
1107 
1115 __api __check_ret int iio_channel_attr_read_bool(const struct iio_channel *chn,
1116  const char *attr, bool *val);
1117 
1118 
1126 __api __check_ret int iio_channel_attr_read_longlong(const struct iio_channel *chn,
1127  const char *attr, long long *val);
1128 
1129 
1137 __api __check_ret int iio_channel_attr_read_double(const struct iio_channel *chn,
1138  const char *attr, double *val);
1139 
1140 
1159 __api __check_ret ssize_t iio_channel_attr_write(const struct iio_channel *chn,
1160  const char *attr, const char *src);
1161 
1162 
1171 __api __check_ret ssize_t iio_channel_attr_write_raw(const struct iio_channel *chn,
1172  const char *attr, const void *src, size_t len);
1173 
1174 
1185 __api __check_ret int iio_channel_attr_write_all(struct iio_channel *chn,
1186  ssize_t (*cb)(struct iio_channel *chn,
1187  const char *attr, void *buf, size_t len, void *d),
1188  void *data);
1189 
1190 
1198 __api __check_ret int iio_channel_attr_write_bool(const struct iio_channel *chn,
1199  const char *attr, bool val);
1200 
1201 
1209 __api __check_ret int iio_channel_attr_write_longlong(const struct iio_channel *chn,
1210  const char *attr, long long val);
1211 
1212 
1220 __api __check_ret int iio_channel_attr_write_double(const struct iio_channel *chn,
1221  const char *attr, double val);
1222 
1223 
1230 __api void iio_channel_enable(struct iio_channel *chn);
1231 
1232 
1235 __api void iio_channel_disable(struct iio_channel *chn);
1236 
1237 
1241 __api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn);
1242 
1243 
1251 __api __check_ret size_t iio_channel_read_raw(const struct iio_channel *chn,
1252  struct iio_buffer *buffer, void *dst, size_t len);
1253 
1254 
1262 __api __check_ret size_t iio_channel_read(const struct iio_channel *chn,
1263  struct iio_buffer *buffer, void *dst, size_t len);
1264 
1265 
1273 __api __check_ret size_t iio_channel_write_raw(const struct iio_channel *chn,
1274  struct iio_buffer *buffer, const void *src, size_t len);
1275 
1276 
1284 __api __check_ret size_t iio_channel_write(const struct iio_channel *chn,
1285  struct iio_buffer *buffer, const void *src, size_t len);
1286 
1287 
1291 __api void iio_channel_set_data(struct iio_channel *chn, void *data);
1292 
1293 
1297 __api void * iio_channel_get_data(const struct iio_channel *chn);
1298 
1299 
1303 __api __check_ret __pure enum iio_chan_type iio_channel_get_type(
1304  const struct iio_channel *chn);
1305 
1306 
1310 __api __check_ret __pure enum iio_modifier iio_channel_get_modifier(
1311  const struct iio_channel *chn);
1312 
1313 /* ------------------------------------------------------------------*/
1315 /* ------------------------- Buffer functions --------------------------------*/
1325 __api __check_ret __pure const struct iio_device * iio_buffer_get_device(
1326  const struct iio_buffer *buf);
1327 
1328 
1338 __api __check_ret struct iio_buffer * iio_device_create_buffer(const struct iio_device *dev,
1339  size_t samples_count, bool cyclic);
1340 
1341 
1346 __api void iio_buffer_destroy(struct iio_buffer *buf);
1347 
1356 __api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf);
1357 
1369 __api __check_ret int iio_buffer_set_blocking_mode(struct iio_buffer *buf, bool blocking);
1370 
1371 
1378 __api __check_ret ssize_t iio_buffer_refill(struct iio_buffer *buf);
1379 
1380 
1387 __api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf);
1388 
1389 
1397 __api __check_ret ssize_t iio_buffer_push_partial(struct iio_buffer *buf,
1398  size_t samples_count);
1399 
1423 __api void iio_buffer_cancel(struct iio_buffer *buf);
1424 
1425 
1429 __api void * iio_buffer_start(const struct iio_buffer *buf);
1430 
1431 
1447 __api void * iio_buffer_first(const struct iio_buffer *buf,
1448  const struct iio_channel *chn);
1449 
1450 
1455 __api __check_ret ptrdiff_t iio_buffer_step(const struct iio_buffer *buf);
1456 
1457 
1462 __api void * iio_buffer_end(const struct iio_buffer *buf);
1463 
1464 
1476 __api __check_ret ssize_t iio_buffer_foreach_sample(struct iio_buffer *buf,
1477  ssize_t (*callback)(const struct iio_channel *chn,
1478  void *src, size_t bytes, void *d), void *data);
1479 
1480 
1484 __api void iio_buffer_set_data(struct iio_buffer *buf, void *data);
1485 
1486 
1490 __api void * iio_buffer_get_data(const struct iio_buffer *buf);
1491 
1492 /* ------------------------------------------------------------------*/
1494 /* ------------------------- Low-level functions -----------------------------*/
1506  unsigned int length;
1507 
1509  unsigned int bits;
1510 
1512  unsigned int shift;
1513 
1516 
1519 
1521  bool is_be;
1522 
1525 
1527  double scale;
1528 
1530  unsigned int repeat;
1531 };
1532 
1533 
1541 __api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev);
1542 
1543 
1548 __api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn);
1549 
1550 
1554 __api __check_ret __cnst const struct iio_data_format * iio_channel_get_data_format(
1555  const struct iio_channel *chn);
1556 
1557 
1563 __api void iio_channel_convert(const struct iio_channel *chn,
1564  void *dst, const void *src);
1565 
1566 
1572 __api void iio_channel_convert_inverse(const struct iio_channel *chn,
1573  void *dst, const void *src);
1574 
1575 
1579 __api __check_ret __pure unsigned int iio_device_get_debug_attrs_count(
1580  const struct iio_device *dev);
1581 
1582 
1588 __api __check_ret __pure const char * iio_device_get_debug_attr(
1589  const struct iio_device *dev, unsigned int index);
1590 
1591 
1604 __api __check_ret __pure const char * iio_device_find_debug_attr(
1605  const struct iio_device *dev, const char *name);
1606 
1607 
1630 __api __check_ret ssize_t iio_device_debug_attr_read(const struct iio_device *dev,
1631  const char *attr, char *dst, size_t len);
1632 
1633 
1643 __api __check_ret int iio_device_debug_attr_read_all(struct iio_device *dev,
1644  int (*cb)(struct iio_device *dev, const char *attr,
1645  const char *value, size_t len, void *d),
1646  void *data);
1647 
1648 
1668 __api __check_ret ssize_t iio_device_debug_attr_write(const struct iio_device *dev,
1669  const char *attr, const char *src);
1670 
1671 
1680 __api __check_ret ssize_t iio_device_debug_attr_write_raw(const struct iio_device *dev,
1681  const char *attr, const void *src, size_t len);
1682 
1683 
1693 __api __check_ret int iio_device_debug_attr_write_all(struct iio_device *dev,
1694  ssize_t (*cb)(struct iio_device *dev,
1695  const char *attr, void *buf, size_t len, void *d),
1696  void *data);
1697 
1698 
1706 __api __check_ret int iio_device_debug_attr_read_bool(const struct iio_device *dev,
1707  const char *attr, bool *val);
1708 
1709 
1717 __api __check_ret int iio_device_debug_attr_read_longlong(const struct iio_device *dev,
1718  const char *attr, long long *val);
1719 
1720 
1728 __api __check_ret int iio_device_debug_attr_read_double(const struct iio_device *dev,
1729  const char *attr, double *val);
1730 
1731 
1739 __api __check_ret int iio_device_debug_attr_write_bool(const struct iio_device *dev,
1740  const char *attr, bool val);
1741 
1742 
1750 __api __check_ret int iio_device_debug_attr_write_longlong(const struct iio_device *dev,
1751  const char *attr, long long val);
1752 
1753 
1761 __api __check_ret int iio_device_debug_attr_write_double(const struct iio_device *dev,
1762  const char *attr, double val);
1763 
1764 
1777 __api __check_ret int iio_device_identify_filename(const struct iio_device *dev,
1778  const char *filename, struct iio_channel **chn,
1779  const char **attr);
1780 
1781 
1788 __api __check_ret int iio_device_reg_write(struct iio_device *dev,
1789  uint32_t address, uint32_t value);
1790 
1791 
1798 __api __check_ret int iio_device_reg_read(struct iio_device *dev,
1799  uint32_t address, uint32_t *value);
1800 
1801 
1804 #ifdef __cplusplus
1805 }
1806 #endif
1807 
1808 #undef __api
1809 
1810 #endif /* __IIO_H__ */
__api __check_ret __pure const char * iio_channel_get_name(const struct iio_channel *chn)
Retrieve the channel name (e.g.
Definition: channel.c:311
__api __check_ret struct iio_context * iio_context_clone(const struct iio_context *ctx)
Duplicate a pre-existing IIO context.
Definition: context.c:268
__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:748
__api __check_ret int iio_buffer_get_poll_fd(struct iio_buffer *buf)
Get a pollable file descriptor.
Definition: buffer.c:121
__api __check_ret __pure const char * iio_channel_get_id(const struct iio_channel *chn)
Retrieve the channel ID (e.g.
Definition: channel.c:306
__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:627
__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:316
__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:291
__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:716
__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:176
__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:463
__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
__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 void * iio_buffer_get_data(const struct iio_buffer *buf)
Retrieve a previously associated pointer of an iio_buffer structure.
Definition: buffer.c:308
bool is_be
Contains True if the sample is in big-endian format.
Definition: iio.h:1521
__api void iio_context_destroy(struct iio_context *ctx)
Destroy the given context.
Definition: context.c:151
__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:313
__api void iio_buffer_set_data(struct iio_buffer *buf, void *data)
Associate a pointer to 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:131
unsigned int bits
Length of valuable data in the sample, in bits.
Definition: iio.h:1509
__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:572
__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&#39;s data format structure.
Definition: channel.c:403
__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:754
__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:750
__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 __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:852
__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:475
__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:265
__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:691
__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:615
Represents an input or output channel of a device.
Definition: iio-private.h:172
unsigned int length
Total length of the sample, in bits.
Definition: iio.h:1506
Definition: iio_stresstest.c:169
__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:321
__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:636
__api void * iio_buffer_end(const struct iio_buffer *buf)
Get the address that follows the last sample in a buffer.
Definition: buffer.c:298
__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:336
__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:362
__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:883
__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:378
__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:41
Represents a device in the IIO context.
Definition: iio-private.h:191
__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:809
__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:683
__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:296
__api void iio_scan_context_destroy(struct iio_scan_context *ctx)
Destroy the given scan context.
Definition: scan.c:171
__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 name of ID.
Definition: context.c:190
__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:249
__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:1132
__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:411
__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:831
__api __check_ret struct iio_context * iio_create_context_from_uri(const char *uri)
Create a context from a URI description.
Definition: context.c:278
__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:250
__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:652
__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:715
__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:739
iio_modifier
IIO channel modifier.
Definition: iio.h:147
__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:605
__api __check_ret struct iio_context * iio_create_xml_context(const char *xml_file)
Create a context from a XML file.
Definition: context.c:363
__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:796
__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 __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:47
__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:293
__api void iio_buffer_destroy(struct iio_buffer *buf)
Destroy the given buffer.
Definition: buffer.c:112
__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:240
__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:391
__api __check_ret ssize_t iio_buffer_push(struct iio_buffer *buf)
Send the samples to the hardware.
Definition: buffer.c:152
__api __check_ret struct iio_context * iio_create_default_context(void)
Create a context from local or remote IIO devices.
Definition: context.c:309
__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:768
bool is_signed
Contains True if the sample is signed.
Definition: iio.h:1515
__api void * iio_buffer_start(const struct iio_buffer *buf)
Get the start address of the buffer.
Definition: buffer.c:250
unsigned int repeat
Number of times length repeats (added in v0.8)
Definition: iio.h:1530
__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:42
__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:326
bool with_scale
Contains True if the sample should be scaled when converted.
Definition: iio.h:1524
__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:807
__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:668
__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:138
__api void * iio_device_get_data(const struct iio_device *dev)
Retrieve a previously associated pointer of an iio_device structure.
Definition: device.c:458
__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:305
double scale
Contains the scale to apply if with_scale is set.
Definition: iio.h:1527
__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:270
__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:695
__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:738
__api __check_ret ssize_t iio_device_get_sample_size(const struct iio_device *dev)
Get the current sample size.
Definition: device.c:571
__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:576
__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:651
__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 __pure const char * iio_device_get_id(const struct iio_device *dev)
Retrieve the device ID (e.g.
Definition: device.c:225
__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:604
__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:1148
__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:844
iio_chan_type
IIO channel type.
Definition: iio.h:101
__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:728
__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:255
__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:317
__api void iio_buffer_cancel(struct iio_buffer *buf)
Cancel all buffer operations.
Definition: buffer.c:318
__api __check_ret __pure long iio_channel_get_index(const struct iio_channel *chn)
Get the index of the given channel.
Definition: channel.c:398
__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:1140
__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:437
__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:536
__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:372
__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:592
__api void * iio_channel_get_data(const struct iio_channel *chn)
Retrieve a previously associated pointer of an iio_channel structure.
Definition: channel.c:393
__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:421
__api __check_ret bool iio_channel_is_enabled(const struct iio_channel *chn)
Returns True if the channel is enabled.
Definition: channel.c:409
__api void iio_channel_set_data(struct iio_channel *chn, void *data)
Associate a pointer to an iio_channel structure.
Definition: channel.c:388
bool is_fully_defined
Contains True if the sample is fully defined, sign extended, etc.
Definition: iio.h:1518
__api void iio_device_set_data(struct iio_device *dev, void *data)
Associate a pointer to an iio_device structure.
Definition: device.c:453
__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:373
__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:703
An input or output buffer, used to read or write samples.
Definition: iio-private.h:214
__api __check_ret struct iio_context * iio_create_local_context(void)
Create a context from local IIO devices (Linux only)
Definition: context.c:333
__api void iio_strerror(int err, char *dst, size_t len)
Get a string description of an error code.
Definition: utilities.c:188
__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:188
unsigned int shift
Right-shift to apply when converting sample.
Definition: iio.h:1512
__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:620
__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:447
__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:706
__api __check_ret __pure const char * iio_device_get_name(const struct iio_device *dev)
Retrieve the device name (e.g.
Definition: device.c:230
__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:639
__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:133
The information related to a discovered context.
Definition: iio-private.h:225
__api void iio_context_info_list_free(struct iio_context_info **info)
Free a context info list.
Definition: scan.c:90
__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:382
__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:427
__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:667
__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:279
__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:126
__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:680
__api __check_ret __cnst bool iio_has_backend(const char *backend)
Check if the specified backend is available.
Definition: backend.c:75
__api void iio_channel_enable(struct iio_channel *chn)
Enable the given channel.
Definition: channel.c:415
__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:401
__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:181
__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:260
__api void iio_channel_disable(struct iio_channel *chn)
Disable the given channel.
Definition: channel.c:421
__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:341
__api __check_ret __cnst unsigned int iio_get_backends_count(void)
Get the number of available backends.
Definition: backend.c:23
__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:350
The scanning context.
Definition: scan.c:25
__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:497
__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:235
__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:819
__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:486
__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:143
__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:175
__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:759
__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:1124
__api __check_ret struct iio_context * iio_create_network_context(const char *host)
Create a context from the network.
Definition: context.c:343
Contains the format of a data sample.
Definition: iio.h:1504
__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:896
__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:331
__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:728
__api __check_ret __cnst const char * iio_get_backend(unsigned int index)
Retrieve the name of a given backend.
Definition: backend.c:46
Contains the representation of an IIO context.
Definition: iio-private.h:156
__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:353
__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:784
__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:35