this is testing

Committer:
pmallick
Date:
Thu Jan 14 18:54:16 2021 +0530
Revision:
0:3afcd581558d
this is testing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pmallick 0:3afcd581558d 1 /*
pmallick 0:3afcd581558d 2 * libtinyiiod - Tiny IIO Daemon Library
pmallick 0:3afcd581558d 3 *
pmallick 0:3afcd581558d 4 * Copyright (C) 2016 Analog Devices, Inc.
pmallick 0:3afcd581558d 5 * Author: Paul Cercueil <paul.cercueil@analog.com>
pmallick 0:3afcd581558d 6 *
pmallick 0:3afcd581558d 7 * This library is free software; you can redistribute it and/or
pmallick 0:3afcd581558d 8 * modify it under the terms of the GNU Lesser General Public
pmallick 0:3afcd581558d 9 * License as published by the Free Software Foundation; either
pmallick 0:3afcd581558d 10 * version 2.1 of the License, or (at your option) any later version.
pmallick 0:3afcd581558d 11 *
pmallick 0:3afcd581558d 12 * This library is distributed in the hope that it will be useful,
pmallick 0:3afcd581558d 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
pmallick 0:3afcd581558d 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
pmallick 0:3afcd581558d 15 * Lesser General Public License for more details.
pmallick 0:3afcd581558d 16 */
pmallick 0:3afcd581558d 17
pmallick 0:3afcd581558d 18 #ifndef TINYIIOD_H
pmallick 0:3afcd581558d 19 #define TINYIIOD_H
pmallick 0:3afcd581558d 20
pmallick 0:3afcd581558d 21 #include "compat.h"
pmallick 0:3afcd581558d 22
pmallick 0:3afcd581558d 23 struct tinyiiod;
pmallick 0:3afcd581558d 24
pmallick 0:3afcd581558d 25 enum iio_attr_type {
pmallick 0:3afcd581558d 26 IIO_ATTR_TYPE_DEVICE = 0,
pmallick 0:3afcd581558d 27 IIO_ATTR_TYPE_DEBUG = 1,
pmallick 0:3afcd581558d 28 IIO_ATTR_TYPE_BUFFER = 2,
pmallick 0:3afcd581558d 29 };
pmallick 0:3afcd581558d 30
pmallick 0:3afcd581558d 31 struct tinyiiod_ops {
pmallick 0:3afcd581558d 32 /* Read from the input stream */
pmallick 0:3afcd581558d 33 ssize_t (*read)(char *buf, size_t len);
pmallick 0:3afcd581558d 34
pmallick 0:3afcd581558d 35 /* Write to the output stream */
pmallick 0:3afcd581558d 36 ssize_t (*write)(const char *buf, size_t len);
pmallick 0:3afcd581558d 37 ssize_t (*read_line)(char *buf, size_t len);
pmallick 0:3afcd581558d 38
pmallick 0:3afcd581558d 39 ssize_t (*open_instance)();
pmallick 0:3afcd581558d 40
pmallick 0:3afcd581558d 41 ssize_t (*close_instance)();
pmallick 0:3afcd581558d 42
pmallick 0:3afcd581558d 43 ssize_t (*read_attr)(const char *device, const char *attr,
pmallick 0:3afcd581558d 44 char *buf, size_t len, enum iio_attr_type type);
pmallick 0:3afcd581558d 45 ssize_t (*write_attr)(const char *device, const char *attr,
pmallick 0:3afcd581558d 46 const char *buf, size_t len, enum iio_attr_type type);
pmallick 0:3afcd581558d 47
pmallick 0:3afcd581558d 48 ssize_t (*ch_read_attr)(const char *device, const char *channel,
pmallick 0:3afcd581558d 49 bool ch_out, const char *attr, char *buf, size_t len);
pmallick 0:3afcd581558d 50 ssize_t (*ch_write_attr)(const char *device, const char *channel,
pmallick 0:3afcd581558d 51 bool ch_out, const char *attr,
pmallick 0:3afcd581558d 52 const char *buf, size_t len);
pmallick 0:3afcd581558d 53
pmallick 0:3afcd581558d 54 int32_t (*open)(const char *device, size_t sample_size, uint32_t mask);
pmallick 0:3afcd581558d 55 int32_t (*close)(const char *device);
pmallick 0:3afcd581558d 56
pmallick 0:3afcd581558d 57 ssize_t (*transfer_dev_to_mem)(const char *device, size_t bytes_count);
pmallick 0:3afcd581558d 58 ssize_t (*read_data)(const char *device, char *buf, size_t offset,
pmallick 0:3afcd581558d 59 size_t bytes_count);
pmallick 0:3afcd581558d 60
pmallick 0:3afcd581558d 61 ssize_t (*transfer_mem_to_dev)(const char *device, size_t bytes_count);
pmallick 0:3afcd581558d 62 ssize_t (*write_data)(const char *device, const char *buf, size_t offset,
pmallick 0:3afcd581558d 63 size_t bytes_count);
pmallick 0:3afcd581558d 64
pmallick 0:3afcd581558d 65 int32_t (*get_mask)(const char *device, uint32_t *mask);
pmallick 0:3afcd581558d 66
pmallick 0:3afcd581558d 67 int32_t (*set_timeout)(uint32_t timeout);
pmallick 0:3afcd581558d 68
pmallick 0:3afcd581558d 69 ssize_t (*get_xml)(char **outxml);
pmallick 0:3afcd581558d 70 };
pmallick 0:3afcd581558d 71
pmallick 0:3afcd581558d 72 struct tinyiiod * tinyiiod_create(struct tinyiiod_ops *ops);
pmallick 0:3afcd581558d 73 void tinyiiod_destroy(struct tinyiiod *iiod);
pmallick 0:3afcd581558d 74 int32_t tinyiiod_read_command(struct tinyiiod *iiod);
pmallick 0:3afcd581558d 75
pmallick 0:3afcd581558d 76 #endif /* TINYIIOD_H */