this is testing

Committer:
pmallick
Date:
Thu Jan 14 19:12:57 2021 +0530
Revision:
0:e8a1ba50c46b
this is testing

Who changed what in which revision?

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