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 * @file iio.h
pmallick 0:e8a1ba50c46b 3 * @brief Header file of iio
pmallick 0:e8a1ba50c46b 4 * @author Cristian Pop (cristian.pop@analog.com)
pmallick 0:e8a1ba50c46b 5 * @author Mihail Chindris (mihail.chindris@analog.com)
pmallick 0:e8a1ba50c46b 6 ********************************************************************************
pmallick 0:e8a1ba50c46b 7 * Copyright 2013(c) Analog Devices, Inc.
pmallick 0:e8a1ba50c46b 8 *
pmallick 0:e8a1ba50c46b 9 * All rights reserved.
pmallick 0:e8a1ba50c46b 10 *
pmallick 0:e8a1ba50c46b 11 * Redistribution and use in source and binary forms, with or without
pmallick 0:e8a1ba50c46b 12 * modification, are permitted provided that the following conditions are met:
pmallick 0:e8a1ba50c46b 13 * - Redistributions of source code must retain the above copyright
pmallick 0:e8a1ba50c46b 14 * notice, this list of conditions and the following disclaimer.
pmallick 0:e8a1ba50c46b 15 * - Redistributions in binary form must reproduce the above copyright
pmallick 0:e8a1ba50c46b 16 * notice, this list of conditions and the following disclaimer in
pmallick 0:e8a1ba50c46b 17 * the documentation and/or other materials provided with the
pmallick 0:e8a1ba50c46b 18 * distribution.
pmallick 0:e8a1ba50c46b 19 * - Neither the name of Analog Devices, Inc. nor the names of its
pmallick 0:e8a1ba50c46b 20 * contributors may be used to endorse or promote products derived
pmallick 0:e8a1ba50c46b 21 * from this software without specific prior written permission.
pmallick 0:e8a1ba50c46b 22 * - The use of this software may or may not infringe the patent rights
pmallick 0:e8a1ba50c46b 23 * of one or more patent holders. This license does not release you
pmallick 0:e8a1ba50c46b 24 * from the requirement that you obtain separate licenses from these
pmallick 0:e8a1ba50c46b 25 * patent holders to use this software.
pmallick 0:e8a1ba50c46b 26 * - Use of the software either in source or binary form, must be run
pmallick 0:e8a1ba50c46b 27 * on or directly connected to an Analog Devices Inc. component.
pmallick 0:e8a1ba50c46b 28 *
pmallick 0:e8a1ba50c46b 29 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
pmallick 0:e8a1ba50c46b 30 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
pmallick 0:e8a1ba50c46b 31 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
pmallick 0:e8a1ba50c46b 32 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
pmallick 0:e8a1ba50c46b 33 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
pmallick 0:e8a1ba50c46b 34 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
pmallick 0:e8a1ba50c46b 35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
pmallick 0:e8a1ba50c46b 36 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
pmallick 0:e8a1ba50c46b 37 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
pmallick 0:e8a1ba50c46b 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pmallick 0:e8a1ba50c46b 39 *******************************************************************************/
pmallick 0:e8a1ba50c46b 40
pmallick 0:e8a1ba50c46b 41 #ifndef IIO_H_
pmallick 0:e8a1ba50c46b 42 #define IIO_H_
pmallick 0:e8a1ba50c46b 43
pmallick 0:e8a1ba50c46b 44 /******************************************************************************/
pmallick 0:e8a1ba50c46b 45 /***************************** Include Files **********************************/
pmallick 0:e8a1ba50c46b 46 /******************************************************************************/
pmallick 0:e8a1ba50c46b 47
pmallick 0:e8a1ba50c46b 48 #include "iio_types.h"
pmallick 0:e8a1ba50c46b 49 #include "uart.h"
pmallick 0:e8a1ba50c46b 50 #ifdef ENABLE_IIO_NETWORK
pmallick 0:e8a1ba50c46b 51 #include "tcp_socket.h"
pmallick 0:e8a1ba50c46b 52 #endif
pmallick 0:e8a1ba50c46b 53
pmallick 0:e8a1ba50c46b 54 /******************************************************************************/
pmallick 0:e8a1ba50c46b 55 /*************************** Types Declarations *******************************/
pmallick 0:e8a1ba50c46b 56 /******************************************************************************/
pmallick 0:e8a1ba50c46b 57
pmallick 0:e8a1ba50c46b 58 enum pysical_link_type {
pmallick 0:e8a1ba50c46b 59 USE_UART,
pmallick 0:e8a1ba50c46b 60 #ifdef ENABLE_IIO_NETWORK
pmallick 0:e8a1ba50c46b 61 USE_NETWORK
pmallick 0:e8a1ba50c46b 62 #endif
pmallick 0:e8a1ba50c46b 63 };
pmallick 0:e8a1ba50c46b 64
pmallick 0:e8a1ba50c46b 65 struct iio_desc;
pmallick 0:e8a1ba50c46b 66
pmallick 0:e8a1ba50c46b 67 struct iio_init_param {
pmallick 0:e8a1ba50c46b 68 enum pysical_link_type phy_type;
pmallick 0:e8a1ba50c46b 69 union {
pmallick 0:e8a1ba50c46b 70 struct uart_init_param *uart_init_param;
pmallick 0:e8a1ba50c46b 71 #ifdef ENABLE_IIO_NETWORK
pmallick 0:e8a1ba50c46b 72 struct tcp_socket_init_param *tcp_socket_init_param;
pmallick 0:e8a1ba50c46b 73 #endif
pmallick 0:e8a1ba50c46b 74 };
pmallick 0:e8a1ba50c46b 75 };
pmallick 0:e8a1ba50c46b 76
pmallick 0:e8a1ba50c46b 77 /******************************************************************************/
pmallick 0:e8a1ba50c46b 78 /************************ Functions Declarations ******************************/
pmallick 0:e8a1ba50c46b 79 /******************************************************************************/
pmallick 0:e8a1ba50c46b 80
pmallick 0:e8a1ba50c46b 81 /* Set communication ops and read/write ops that will be called from
pmallick 0:e8a1ba50c46b 82 * "libtinyiiod". */
pmallick 0:e8a1ba50c46b 83 ssize_t iio_init(struct iio_desc **desc, struct iio_init_param *init_param);
pmallick 0:e8a1ba50c46b 84 /* Free the resources allocated by iio_init(). */
pmallick 0:e8a1ba50c46b 85 ssize_t iio_remove(struct iio_desc *desc);
pmallick 0:e8a1ba50c46b 86 /* Execut an iio step. */
pmallick 0:e8a1ba50c46b 87 ssize_t iio_step(struct iio_desc *desc);
pmallick 0:e8a1ba50c46b 88 /* Register interface. */
pmallick 0:e8a1ba50c46b 89 ssize_t iio_register(struct iio_desc *desc, struct iio_device *dev_descriptor,
pmallick 0:e8a1ba50c46b 90 char *name, void *dev_instance,
pmallick 0:e8a1ba50c46b 91 struct iio_data_buffer *read_buff,
pmallick 0:e8a1ba50c46b 92 struct iio_data_buffer *write_buff);
pmallick 0:e8a1ba50c46b 93 /* Unregister interface. */
pmallick 0:e8a1ba50c46b 94 ssize_t iio_unregister(struct iio_desc *desc, char *name);
pmallick 0:e8a1ba50c46b 95
pmallick 0:e8a1ba50c46b 96 #endif /* IIO_H_ */