IIO Application Library

Dependents:  

Committer:
mahphalke
Date:
Mon Oct 05 12:28:13 2020 +0530
Revision:
1:182a6f54cab0
IIO application library- Initial Revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mahphalke 1:182a6f54cab0 1 /***************************************************************************//**
mahphalke 1:182a6f54cab0 2 * @file iio_app.h
mahphalke 1:182a6f54cab0 3 * @brief Header file of iio_app.
mahphalke 1:182a6f54cab0 4 * @author Cristian Pop (cristian.pop@analog.com)
mahphalke 1:182a6f54cab0 5 ********************************************************************************
mahphalke 1:182a6f54cab0 6 * Copyright 2019(c) Analog Devices, Inc.
mahphalke 1:182a6f54cab0 7 *
mahphalke 1:182a6f54cab0 8 * All rights reserved.
mahphalke 1:182a6f54cab0 9 *
mahphalke 1:182a6f54cab0 10 * Redistribution and use in source and binary forms, with or without
mahphalke 1:182a6f54cab0 11 * modification, are permitted provided that the following conditions are met:
mahphalke 1:182a6f54cab0 12 * - Redistributions of source code must retain the above copyright
mahphalke 1:182a6f54cab0 13 * notice, this list of conditions and the following disclaimer.
mahphalke 1:182a6f54cab0 14 * - Redistributions in binary form must reproduce the above copyright
mahphalke 1:182a6f54cab0 15 * notice, this list of conditions and the following disclaimer in
mahphalke 1:182a6f54cab0 16 * the documentation and/or other materials provided with the
mahphalke 1:182a6f54cab0 17 * distribution.
mahphalke 1:182a6f54cab0 18 * - Neither the name of Analog Devices, Inc. nor the names of its
mahphalke 1:182a6f54cab0 19 * contributors may be used to endorse or promote products derived
mahphalke 1:182a6f54cab0 20 * from this software without specific prior written permission.
mahphalke 1:182a6f54cab0 21 * - The use of this software may or may not infringe the patent rights
mahphalke 1:182a6f54cab0 22 * of one or more patent holders. This license does not release you
mahphalke 1:182a6f54cab0 23 * from the requirement that you obtain separate licenses from these
mahphalke 1:182a6f54cab0 24 * patent holders to use this software.
mahphalke 1:182a6f54cab0 25 * - Use of the software either in source or binary form, must be run
mahphalke 1:182a6f54cab0 26 * on or directly connected to an Analog Devices Inc. component.
mahphalke 1:182a6f54cab0 27 *
mahphalke 1:182a6f54cab0 28 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
mahphalke 1:182a6f54cab0 29 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
mahphalke 1:182a6f54cab0 30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
mahphalke 1:182a6f54cab0 31 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
mahphalke 1:182a6f54cab0 32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
mahphalke 1:182a6f54cab0 33 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
mahphalke 1:182a6f54cab0 34 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mahphalke 1:182a6f54cab0 35 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mahphalke 1:182a6f54cab0 36 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mahphalke 1:182a6f54cab0 37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mahphalke 1:182a6f54cab0 38 *******************************************************************************/
mahphalke 1:182a6f54cab0 39
mahphalke 1:182a6f54cab0 40 #ifndef IIO_APP_H_
mahphalke 1:182a6f54cab0 41 #define IIO_APP_H_
mahphalke 1:182a6f54cab0 42
mahphalke 1:182a6f54cab0 43 /******************************************************************************/
mahphalke 1:182a6f54cab0 44 /***************************** Include Files **********************************/
mahphalke 1:182a6f54cab0 45 /******************************************************************************/
mahphalke 1:182a6f54cab0 46
mahphalke 1:182a6f54cab0 47 #include "iio_types.h"
mahphalke 1:182a6f54cab0 48
mahphalke 1:182a6f54cab0 49 /******************************************************************************/
mahphalke 1:182a6f54cab0 50 /*************************** Types Declarations *******************************/
mahphalke 1:182a6f54cab0 51 /******************************************************************************/
mahphalke 1:182a6f54cab0 52
mahphalke 1:182a6f54cab0 53 /**
mahphalke 1:182a6f54cab0 54 * @struct iio_app_desc
mahphalke 1:182a6f54cab0 55 * @brief Application desciptor.
mahphalke 1:182a6f54cab0 56 */
mahphalke 1:182a6f54cab0 57 struct iio_app_desc {
mahphalke 1:182a6f54cab0 58 /** read./write function callbacks */
mahphalke 1:182a6f54cab0 59 struct iio_server_ops *iio_server_ops;
mahphalke 1:182a6f54cab0 60 /** iiod handle */
mahphalke 1:182a6f54cab0 61 struct tinyiiod *iiod;
mahphalke 1:182a6f54cab0 62 };
mahphalke 1:182a6f54cab0 63
mahphalke 1:182a6f54cab0 64 /**
mahphalke 1:182a6f54cab0 65 * @struct iio_app_init_param
mahphalke 1:182a6f54cab0 66 * @brief Application initial configuration.
mahphalke 1:182a6f54cab0 67 */
mahphalke 1:182a6f54cab0 68 struct iio_app_init_param {
mahphalke 1:182a6f54cab0 69 /** read./write function callbacks */
mahphalke 1:182a6f54cab0 70 struct iio_server_ops *iio_server_ops;
mahphalke 1:182a6f54cab0 71 };
mahphalke 1:182a6f54cab0 72
mahphalke 1:182a6f54cab0 73 /******************************************************************************/
mahphalke 1:182a6f54cab0 74 /************************ Functions Declarations ******************************/
mahphalke 1:182a6f54cab0 75 /******************************************************************************/
mahphalke 1:182a6f54cab0 76
mahphalke 1:182a6f54cab0 77 /* Init application. */
mahphalke 1:182a6f54cab0 78 int32_t iio_app_init(struct iio_app_desc **desc,
mahphalke 1:182a6f54cab0 79 struct iio_app_init_param *param);
mahphalke 1:182a6f54cab0 80 /* Free the resources allocated by iio_app_init(). */
mahphalke 1:182a6f54cab0 81 int32_t iio_app_remove(struct iio_app_desc *desc);
mahphalke 1:182a6f54cab0 82 /* Basic iio application loop. */
mahphalke 1:182a6f54cab0 83 int32_t iio_app(struct iio_app_desc *desc);
mahphalke 1:182a6f54cab0 84
mahphalke 1:182a6f54cab0 85 #endif // IIO_APP_H_