|
libiio
0.9
Library for interfacing with IIO devices
|
00001 /* 00002 * libiio - Library for interfacing industrial I/O (IIO) devices 00003 * 00004 * Copyright (C) 2015 Analog Devices, Inc. 00005 * Author: Paul Cercueil <paul.cercueil@analog.com> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 */ 00018 00019 #ifndef _IIOD_CLIENT_H 00020 #define _IIOD_CLIENT_H 00021 00022 #include "iio.h" 00023 00024 struct iio_mutex; 00025 struct iiod_client; 00026 struct iio_context_pdata; 00027 00028 struct iiod_client_ops { 00029 ssize_t (*write)(struct iio_context_pdata *pdata, 00030 void *desc, const char *src, size_t len); 00031 ssize_t (*read)(struct iio_context_pdata *pdata, 00032 void *desc, char *dst, size_t len); 00033 ssize_t (*read_line)(struct iio_context_pdata *pdata, 00034 void *desc, char *dst, size_t len); 00035 }; 00036 00037 struct iiod_client * iiod_client_new(struct iio_context_pdata *pdata, 00038 struct iio_mutex *lock, const struct iiod_client_ops *ops); 00039 void iiod_client_destroy(struct iiod_client *client); 00040 00041 int iiod_client_get_version(struct iiod_client *client, void *desc, 00042 unsigned int *major, unsigned int *minor, char *git_tag); 00043 int iiod_client_get_trigger(struct iiod_client *client, void *desc, 00044 const struct iio_device *dev, 00045 const struct iio_device **trigger); 00046 int iiod_client_set_trigger(struct iiod_client *client, void *desc, 00047 const struct iio_device *dev, const struct iio_device *trigger); 00048 int iiod_client_set_kernel_buffers_count(struct iiod_client *client, 00049 void *desc, const struct iio_device *dev, unsigned int nb_blocks); 00050 int iiod_client_set_timeout(struct iiod_client *client, 00051 void *desc, unsigned int timeout); 00052 ssize_t iiod_client_read_attr(struct iiod_client *client, void *desc, 00053 const struct iio_device *dev, const struct iio_channel *chn, 00054 const char *attr, char *dest, size_t len, bool is_debug); 00055 ssize_t iiod_client_write_attr(struct iiod_client *client, void *desc, 00056 const struct iio_device *dev, const struct iio_channel *chn, 00057 const char *attr, const char *src, size_t len, bool is_debug); 00058 int iiod_client_open_unlocked(struct iiod_client *client, void *desc, 00059 const struct iio_device *dev, size_t samples_count, 00060 bool cyclic); 00061 int iiod_client_close_unlocked(struct iiod_client *client, void *desc, 00062 const struct iio_device *dev); 00063 ssize_t iiod_client_read_unlocked(struct iiod_client *client, void *desc, 00064 const struct iio_device *dev, void *dst, size_t len, 00065 uint32_t *mask, size_t words); 00066 ssize_t iiod_client_write_unlocked(struct iiod_client *client, void *desc, 00067 const struct iio_device *dev, const void *src, size_t len); 00068 struct iio_context * iiod_client_create_context( 00069 struct iiod_client *client, void *desc); 00070 00071 #endif /* _IIOD_CLIENT_H */
1.7.6.1