this is testing

Files at this revision

API Documentation at this revision

Comitter:
pmallick
Date:
Thu Jan 14 18:54:16 2021 +0530
Commit message:
this is testing

Changed in this revision

.mbed Show annotated file Show diff for this revision Revisions of this file
.mbedignore Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed.lib Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/README.md Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7124/ad7124.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7124/ad7124.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7124/ad7124_regs.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7124/ad7124_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad713x/ad713x.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad713x/ad713x.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad411x_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7172_2_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7172_4_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7173_8_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7175_2_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7175_8_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad7176_2_regs.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad717x.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad717x/ad717x.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7606/ad7606.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/adc/ad7606/ad7606.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/dac/ad5686/ad5686.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/dac/ad5686/ad5686.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/License.txt Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/inc/platform_drivers.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/inc/platform_support.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/delay.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/gpio.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/gpio_extra.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/i2c.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/i2c_extra.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/irq.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/irq_extra.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/platform_support.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/spi.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/spi_extra.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/uart.cpp Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/platform/mbed/src/uart_extra.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/temperature/adt7420/adt7420.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/drivers/temperature/adt7420/adt7420.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/axi_io.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/circular_buffer.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/clk.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/crc.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/crc16.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/crc8.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/delay.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/error.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/fifo.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/gpio.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/i2c.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/irq.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/list.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/pwm.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/rtc.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/spi.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/timer.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/trng.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/uart.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/util.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/include/xml.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/adi_console_menu/License.txt Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/adi_console_menu/adi_console_menu.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/adi_console_menu/adi_console_menu.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/iio.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/iio.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/iio_app.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/iio_app.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/iio_types.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/LICENSE Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/LICENSE_ADIBSD Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/README.md Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/compat.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/parser.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod-private.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.h Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/circular_buffer.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/clk.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/crc16.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/crc8.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/fifo.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/list.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/util.c Show annotated file Show diff for this revision Revisions of this file
app/noos_mbed/util/xml.c Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_data_capture.c Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_data_capture.h Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_support.c Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_support.h Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_user_config.c Show annotated file Show diff for this revision Revisions of this file
app/src/ad7606_user_config.h Show annotated file Show diff for this revision Revisions of this file
app/src/app_config.h Show annotated file Show diff for this revision Revisions of this file
app/src/iio_ad7606.c Show annotated file Show diff for this revision Revisions of this file
app/src/iio_ad7606.h Show annotated file Show diff for this revision Revisions of this file
app/src/iio_ad7606_attr.h Show annotated file Show diff for this revision Revisions of this file
app/src/iio_transport.c Show annotated file Show diff for this revision Revisions of this file
app/src/iio_transport.h Show annotated file Show diff for this revision Revisions of this file
app/src/main.c Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 3afcd581558d .mbed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.mbed	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,2 @@
+TARGET=SDP_K1
+TOOLCHAIN=GCC_ARM
diff -r 000000000000 -r 3afcd581558d .mbedignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.mbedignore	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,1 @@
+app/noos_mbed/include/irq.h
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed.lib	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,1 @@
+https://bitbucket.analog.com/scm/pcts/noos_mbed.git
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/README.md
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/README.md	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,23 @@
+
+# no-OS ( Mbed Version )
+
+[Analog Devices Inc.](http://www.analog.com/en/index.html) Mbed Version of Software drivers for systems with mbed OS
+
+
+## Software
+
+The goal of these noos-mbed drivers is to be able to provide reference drivers for precision converters ADCs and DACs compatible with mbed supported boards, as mbed platform enables us work with diverse protofio of microcontroller while minimizing the hadware dependency.
+The mbed version of the no-OS is quite similar to the original version with inclusion of platform drivers changes to resolve naming conflicts with Mbed-OS files. 
+
+## Documentation
+
+For more information about projects develop using noos-mbed drivers, please visit our [wiki](https://wiki.analog.com/resources/tools-software/product-support-software) page.
+
+## Which branch should I use?
+
+  * If you want to use the latest releases, check out the master branch 
+
+  * If you want to use the drivers under development, check out the develop branch.
+
+
+
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,328 @@
+/***************************************************************************//**
+ *   @file   ad5592r-base.c
+ *   @brief  Implementation of AD5592R Base Driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#include "error.h"
+#include "ad5592r-base.h"
+
+/**
+ * Write register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_base_reg_write(struct ad5592r_dev *dev, uint8_t reg,
+			       uint16_t value)
+{
+	return dev->ops->reg_write(dev, reg, value);
+}
+
+/**
+ * Read register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_base_reg_read(struct ad5592r_dev *dev, uint8_t reg,
+			      uint16_t *value)
+{
+	return dev->ops->reg_read(dev, reg, value);
+}
+
+/**
+ * Get GPIO value
+ *
+ * @param dev - The device structure.
+ * @param offset - The channel number.
+ * @return 0 or 1 depending on the GPIO value.
+ */
+int32_t ad5592r_gpio_get(struct ad5592r_dev *dev, uint8_t offset)
+{
+	int32_t ret = 0;
+	uint8_t val;
+
+	if (!dev)
+		return FAILURE;
+
+	if (dev->gpio_out & BIT(offset))
+		val = dev->gpio_val;
+	else
+		ret = dev->ops->gpio_read(dev, &val);
+
+	if (ret < 0)
+		return ret;
+
+	return !!(val & BIT(offset));
+}
+
+/**
+ * Set GPIO value
+ *
+ * @param dev - The device structure.
+ * @param offset - The channel number.
+ * @param value - the GPIO value (0 or 1)
+ */
+int32_t ad5592r_gpio_set(struct ad5592r_dev *dev, uint8_t offset, int32_t value)
+{
+	if (!dev)
+		return FAILURE;
+
+	if (value)
+		dev->gpio_val |= BIT(offset);
+	else
+		dev->gpio_val &= ~BIT(offset);
+
+	return ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_SET,
+				      dev->gpio_val);
+}
+
+/**
+ * Set GPIO as input
+ *
+ * @param dev - The device structure.
+ * @param offset - The channel number.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_gpio_direction_input(struct ad5592r_dev *dev, uint8_t offset)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->gpio_out &= ~BIT(offset);
+	dev->gpio_in |= BIT(offset);
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_OUT_EN,
+				     dev->gpio_out);
+	if (ret < 0)
+		return ret;
+
+	return ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_IN_EN,
+				      dev->gpio_in);
+}
+
+/**
+ * Set GPIO as output
+ *
+ * @param dev - The device structure.
+ * @param offset - The channel number.
+ * @param value - GPIO value to set.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_gpio_direction_output(struct ad5592r_dev *dev,
+				      uint8_t offset, int32_t value)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	if (value)
+		dev->gpio_val |= BIT(offset);
+	else
+		dev->gpio_val &= ~BIT(offset);
+
+	dev->gpio_in &= ~BIT(offset);
+	dev->gpio_out |= BIT(offset);
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_SET, dev->gpio_val);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_OUT_EN,
+				     dev->gpio_out);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_IN_EN,
+				     dev->gpio_in);
+
+	return ret;
+}
+
+/**
+ * Software reset device.
+ *
+ * @param dev - The device structure.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_software_reset(struct ad5592r_dev *dev)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	/* Writing this magic value resets the device */
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_RESET, 0xdac);
+
+	mdelay(10);
+
+	return ret;
+}
+
+/**
+ * Set channels modes.
+ *
+ * @param dev - The device structure.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev)
+{
+	int32_t ret;
+	uint8_t i;
+	uint8_t pulldown = 0, tristate = 0, dac = 0, adc = 0;
+	uint16_t read_back;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->gpio_in = 0;
+	dev->gpio_out = 0;
+
+	for (i = 0; i < dev->num_channels; i++) {
+		switch (dev->channel_modes[i]) {
+		case CH_MODE_DAC:
+			dac |= BIT(i);
+			break;
+
+		case CH_MODE_ADC:
+			adc |= BIT(i);
+			break;
+
+		case CH_MODE_DAC_AND_ADC:
+			dac |= BIT(i);
+			adc |= BIT(i);
+			break;
+
+		case CH_MODE_GPI:
+			dev->gpio_in |= BIT(i);
+			break;
+
+		case CH_MODE_GPO:
+			dev->gpio_out |= BIT(i);
+			break;
+
+		case CH_MODE_UNUSED:
+		/* fall-through */
+		default:
+			switch (dev->channel_offstate[i]) {
+			case CH_OFFSTATE_OUT_TRISTATE:
+				tristate |= BIT(i);
+				break;
+
+			case CH_OFFSTATE_OUT_LOW:
+				dev->gpio_out |= BIT(i);
+				break;
+
+			case CH_OFFSTATE_OUT_HIGH:
+				dev->gpio_out |= BIT(i);
+				dev->gpio_val |= BIT(i);
+				break;
+
+			case CH_OFFSTATE_PULLDOWN:
+			/* fall-through */
+			default:
+				pulldown |= BIT(i);
+				break;
+			}
+		}
+	}
+
+	/* Pull down unused pins to GND */
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_PULLDOWN, pulldown);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_TRISTATE, tristate);
+	if (ret < 0)
+		return ret;
+
+	/* Configure pins that we use */
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_DAC_EN, dac);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_ADC_EN, adc);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_SET, dev->gpio_val);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_OUT_EN,
+				     dev->gpio_out);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_base_reg_write(dev, AD5592R_REG_GPIO_IN_EN,
+				     dev->gpio_in);
+	if (ret < 0)
+		return ret;
+
+	/* Verify that we can read back at least one register */
+	ret = ad5592r_base_reg_read(dev, AD5592R_REG_ADC_EN, &read_back);
+	if (!ret && (read_back & 0xff) != adc)
+		return FAILURE;
+
+	return ret;
+}
+
+/**
+ * Reset channels and set GPIO to unused.
+ *
+ * @param dev - The device structure.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_reset_channel_modes(struct ad5592r_dev *dev)
+{
+	uint32_t i;
+
+	if (!dev)
+		return FAILURE;
+
+	for (i = 0; i < sizeof(dev->channel_modes); i++)
+		dev->channel_modes[i] = CH_MODE_UNUSED;
+
+	return ad5592r_set_channel_modes(dev);
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r-base.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,149 @@
+/***************************************************************************//**
+ *   @file   ad5592r-base.h
+ *   @brief  Header file of AD5592R Base Driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef AD5592R_BASE_H_
+#define AD5592R_BASE_H_
+
+#include "stdint.h"
+#include "platform_drivers.h"
+
+#include <stdbool.h>
+
+#define CH_MODE_UNUSED			0
+#define CH_MODE_ADC			1
+#define CH_MODE_DAC			2
+#define CH_MODE_DAC_AND_ADC		3
+#define CH_MODE_GPI			4
+#define CH_MODE_GPO			5
+
+#define CH_OFFSTATE_PULLDOWN		0
+#define CH_OFFSTATE_OUT_LOW		1
+#define CH_OFFSTATE_OUT_HIGH		2
+#define CH_OFFSTATE_OUT_TRISTATE	3
+
+enum ad5592r_registers {
+	AD5592R_REG_NOOP		= 0x0,
+	AD5592R_REG_DAC_READBACK	= 0x1,
+	AD5592R_REG_ADC_SEQ		= 0x2,
+	AD5592R_REG_CTRL		= 0x3,
+	AD5592R_REG_ADC_EN		= 0x4,
+	AD5592R_REG_DAC_EN		= 0x5,
+	AD5592R_REG_PULLDOWN		= 0x6,
+	AD5592R_REG_LDAC		= 0x7,
+	AD5592R_REG_GPIO_OUT_EN		= 0x8,
+	AD5592R_REG_GPIO_SET		= 0x9,
+	AD5592R_REG_GPIO_IN_EN		= 0xA,
+	AD5592R_REG_PD			= 0xB,
+	AD5592R_REG_OPEN_DRAIN		= 0xC,
+	AD5592R_REG_TRISTATE		= 0xD,
+	AD5592R_REG_RESET		= 0xF,
+};
+
+#define AD5592R_REG_PD_PD_ALL			    BIT(10)
+#define AD5592R_REG_PD_EN_REF			    BIT(9)
+
+#define AD5592R_REG_CTRL_ADC_PC_BUFF		    BIT(9)
+#define AD5592R_REG_CTRL_ADC_BUFF_EN		    BIT(8)
+#define AD5592R_REG_CTRL_CONFIG_LOCK		    BIT(7)
+#define AD5592R_REG_CTRL_W_ALL_DACS		    BIT(6)
+#define AD5592R_REG_CTRL_ADC_RANGE		    BIT(5)
+#define AD5592R_REG_CTRL_DAC_RANGE		    BIT(4)
+
+#define AD5592R_REG_ADC_SEQ_REP			    BIT(9)
+#define AD5592R_REG_ADC_SEQ_TEMP_READBACK	    BIT(8)
+#define AD5592R_REG_ADC_SEQ_CODE_MSK(x)		    ((x) & 0x0FFF)
+
+#define AD5592R_REG_GPIO_OUT_EN_ADC_NOT_BUSY	    BIT(8)
+
+#define AD5592R_REG_LDAC_IMMEDIATE_OUT		    0x00
+#define AD5592R_REG_LDAC_INPUT_REG_ONLY		    0x01
+#define AD5592R_REG_LDAC_INPUT_REG_OUT		    0x02
+
+#define INTERNAL_VREF_VOLTAGE			    2.5
+
+struct ad5592r_dev;
+
+struct ad5592r_rw_ops {
+	int32_t (*write_dac)(struct ad5592r_dev *dev, uint8_t chan,
+			     uint16_t value);
+	int32_t (*read_adc)(struct ad5592r_dev *dev, uint8_t chan,
+			    uint16_t *value);
+	int32_t(*multi_read_adc)(struct ad5592r_dev *dev,
+				 uint16_t chans, uint16_t *value);
+	int32_t (*reg_write)(struct ad5592r_dev *dev, uint8_t reg,
+			     uint16_t value);
+	int32_t (*reg_read)(struct ad5592r_dev *dev, uint8_t reg,
+			    uint16_t *value);
+	int32_t (*gpio_read)(struct ad5592r_dev *dev, uint8_t *value);
+};
+
+struct ad5592r_init_param {
+	bool int_ref;
+};
+
+struct ad5592r_dev {
+	const struct ad5592r_rw_ops *ops;
+	i2c_desc *i2c;
+	spi_desc *spi;
+	uint16_t spi_msg;
+	uint8_t num_channels;
+	uint16_t cached_dac[8];
+	uint16_t cached_gp_ctrl;
+	uint8_t channel_modes[8];
+	uint8_t channel_offstate[8];
+	uint8_t gpio_out;
+	uint8_t gpio_in;
+	uint8_t gpio_val;
+	uint8_t ldac_mode;
+};
+
+int32_t ad5592r_base_reg_write(struct ad5592r_dev *dev, uint8_t reg,
+			       uint16_t value);
+int32_t ad5592r_base_reg_read(struct ad5592r_dev *dev, uint8_t reg,
+			      uint16_t *value);
+int32_t ad5592r_gpio_get(struct ad5592r_dev *dev, uint8_t offset);
+int32_t ad5592r_gpio_set(struct ad5592r_dev *dev, uint8_t offset,
+			 int32_t value);
+int32_t ad5592r_gpio_direction_input(struct ad5592r_dev *dev, uint8_t offset);
+int32_t ad5592r_gpio_direction_output(struct ad5592r_dev *dev,
+				      uint8_t offset, int32_t value);
+int32_t ad5592r_software_reset(struct ad5592r_dev *dev);
+int32_t ad5592r_set_channel_modes(struct ad5592r_dev *dev);
+int32_t ad5592r_reset_channel_modes(struct ad5592r_dev *dev);
+
+#endif /* AD5592R_BASE_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,295 @@
+/***************************************************************************//**
+ *   @file   ad5592r.c
+ *   @brief  Implementation of AD5592R driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#include "error.h"
+#include "ad5592r-base.h"
+#include "ad5592r.h"
+
+const struct ad5592r_rw_ops ad5592r_rw_ops = {
+	.write_dac = ad5592r_write_dac,
+	.read_adc = ad5592r_read_adc,
+	.multi_read_adc = ad5592r_multi_read_adc,
+	.reg_write = ad5592r_reg_write,
+	.reg_read = ad5592r_reg_read,
+	.gpio_read = ad5592r_gpio_read,
+};
+
+/**
+ * Write NOP and read value.
+ *
+ * @param dev - The device structure.
+ * @param buf - buffer where to read
+ * @return 0 in case of success, negative error code otherwise
+ */
+static int32_t ad5592r_spi_wnop_r16(struct ad5592r_dev *dev, uint16_t *buf)
+{
+	int32_t ret;
+	uint16_t spi_msg_nop = 0; /* NOP */
+
+	ret = spi_write_and_read(dev->spi, (uint8_t *)&spi_msg_nop,
+				 sizeof(spi_msg_nop));
+	if (ret < 0)
+		return ret;
+
+	*buf = swab16(spi_msg_nop);
+
+	return ret;
+}
+
+/**
+ * Write DAC channel.
+ *
+ * @param dev - The device structure.
+ * @param chan - The channel number.
+ * @param value - DAC value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
+			  uint16_t value)
+{
+	if (!dev)
+		return FAILURE;
+
+	dev->spi_msg = swab16( BIT(15) | (uint16_t)(chan << 12) | value);
+
+	return spi_write_and_read(dev->spi, (uint8_t *)&dev->spi_msg,
+				  sizeof(dev->spi_msg));
+}
+
+/**
+ * Read ADC channel.
+ *
+ * @param dev - The device structure.
+ * @param chan - The channel number.
+ * @param value - ADC value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
+			 uint16_t *value)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->spi_msg = swab16((uint16_t)(AD5592R_REG_ADC_SEQ << 11) |
+			      BIT(chan));
+
+	ret = spi_write_and_read(dev->spi, (uint8_t *)&dev->spi_msg,
+				 sizeof(dev->spi_msg));
+	if (ret < 0)
+		return ret;
+
+	/*
+	 * Invalid data:
+	 * See Figure 40. Single-Channel ADC Conversion Sequence
+	 */
+	ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+	if (ret < 0)
+		return ret;
+
+	*value = dev->spi_msg;
+
+	return 0;
+}
+
+/**
+ * Read Multiple ADC Channels.
+ *
+ * @param dev - The device structure.
+ * @param chans - The ADC channels to be readback
+ * @param values - ADC value array
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans,
+			       uint16_t *values)
+{
+	int32_t ret;
+	uint8_t samples;
+	uint8_t i;
+
+	if (!dev)
+		return FAILURE;
+
+	samples = hweight8(chans);
+
+	dev->spi_msg = swab16((uint16_t)(AD5592R_REG_ADC_SEQ << 11) | chans);
+
+	ret = spi_write_and_read(dev->spi, (uint8_t *)&dev->spi_msg,
+				 sizeof(dev->spi_msg));
+	if (ret < 0)
+		return ret;
+
+	/*
+	 * Invalid data:
+	 * See Figure 40. Single-Channel ADC Conversion Sequence
+	 */
+	ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+	if (ret < 0)
+		return ret;
+
+	for (i = 0; i < samples; i++) {
+		ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+		if (ret < 0)
+			return ret;
+		values[i] = dev->spi_msg;
+	}
+
+	return 0;
+}
+
+/**
+ * Write register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
+{
+	if (!dev)
+		return FAILURE;
+
+	dev->spi_msg = swab16((reg << 11) | value);
+
+	return spi_write_and_read(dev->spi, (uint8_t *)&dev->spi_msg,
+				  sizeof(dev->spi_msg));
+}
+
+/**
+ * Read register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->spi_msg = swab16((AD5592R_REG_LDAC << 11) |
+			      AD5592R_LDAC_READBACK_EN | (reg << 2) | dev->ldac_mode);
+
+	ret = spi_write_and_read(dev->spi, (uint8_t *)&dev->spi_msg,
+				 sizeof(dev->spi_msg));
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+	if (ret < 0)
+		return ret;
+
+	*value = dev->spi_msg;
+
+	return 0;
+}
+
+/**
+ * Read GPIOs.
+ *
+ * @param dev - The device structure.
+ * @param value - GPIOs value.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
+{
+	int32_t ret;
+
+	if (!dev)
+		return FAILURE;
+
+	ret = ad5592r_reg_write(dev, AD5592R_REG_GPIO_IN_EN,
+				AD5592R_GPIO_READBACK_EN | dev->gpio_in);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_spi_wnop_r16(dev, &dev->spi_msg);
+	if (ret < 0)
+		return ret;
+
+	*value = (uint8_t)dev->spi_msg;
+
+	return 0;
+}
+
+/**
+ * Initialize AD5593r device.
+ *
+ * @param dev - The device structure.
+ * @param init_param - The initial parameters of the device.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5592r_init(struct ad5592r_dev *dev,
+		     struct ad5592r_init_param *init_param)
+{
+	int32_t ret;
+	uint16_t temp_reg_val;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->ops = &ad5592r_rw_ops;
+
+	ret = ad5592r_software_reset(dev);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_set_channel_modes(dev);
+	if (ret < 0)
+		return ret;
+
+	if(init_param->int_ref) {
+		ret = ad5592r_reg_read(dev, AD5592R_REG_PD, &temp_reg_val);
+		if (ret < 0)
+			return ret;
+		temp_reg_val |= AD5592R_REG_PD_EN_REF;
+
+		return ad5592r_reg_write(dev, AD5592R_REG_PD, temp_reg_val);
+	}
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5592r.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,66 @@
+/***************************************************************************//**
+ *   @file   ad5592r.h
+ *   @brief  Header file of AD5592R driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef AD5592R_H_
+#define AD5592R_H_
+
+#include "stdint.h"
+#include "ad5592r-base.h"
+
+#define AD5592R_GPIO_READBACK_EN	BIT(10)
+#define AD5592R_LDAC_READBACK_EN	BIT(6)
+
+#define swab16(x) \
+	((((x) & 0x00ff) << 8) | \
+	 (((x) & 0xff00) >> 8))
+
+int32_t ad5592r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
+			  uint16_t value);
+int32_t ad5592r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
+			 uint16_t *value);
+int32_t ad5592r_multi_read_adc(struct ad5592r_dev *dev,
+			       uint16_t chans, uint16_t *value);
+int32_t ad5592r_reg_write(struct ad5592r_dev *dev, uint8_t reg,
+			  uint16_t value);
+int32_t ad5592r_reg_read(struct ad5592r_dev *dev, uint8_t reg,
+			 uint16_t *value);
+int32_t ad5592r_gpio_read(struct ad5592r_dev *dev, uint8_t *value);
+int32_t ad5592r_init(struct ad5592r_dev *dev,
+		     struct ad5592r_init_param *init_param);
+
+#endif /* AD5592R_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,300 @@
+/***************************************************************************//**
+ *   @file   ad5593r.c
+ *   @brief  Implementation of AD5593R driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#include "ad5592r-base.h"
+#include "error.h"
+#include "ad5593r.h"
+
+#define AD5593R_MODE_CONF		(0 << 4)
+#define AD5593R_MODE_DAC_WRITE		(1 << 4)
+#define AD5593R_MODE_ADC_READBACK	(4 << 4)
+#define AD5593R_MODE_DAC_READBACK	(5 << 4)
+#define AD5593R_MODE_GPIO_READBACK	(6 << 4)
+#define AD5593R_MODE_REG_READBACK	(7 << 4)
+
+#define STOP_BIT	1
+#define RESTART_BIT	0
+#define AD5593R_ADC_VALUES_BUFF_SIZE	    18
+
+const struct ad5592r_rw_ops ad5593r_rw_ops = {
+	.write_dac = ad5593r_write_dac,
+	.read_adc = ad5593r_read_adc,
+	.multi_read_adc= ad5593r_multi_read_adc,
+	.reg_write = ad5593r_reg_write,
+	.reg_read = ad5593r_reg_read,
+	.gpio_read = ad5593r_gpio_read,
+};
+
+/**
+ * Write DAC channel.
+ *
+ * @param dev - The device structure.
+ * @param chan - The channel number.
+ * @param value - DAC value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
+			  uint16_t value)
+{
+	uint8_t data[3];
+
+	if (!dev)
+		return FAILURE;
+
+	data[0] = AD5593R_MODE_DAC_WRITE | chan;
+	data[1] = (value >> 8) & 0xF ;
+	data[2] = value & 0xFF;
+
+	return i2c_write(dev->i2c, data, sizeof(data), STOP_BIT);
+}
+
+/**
+ * Read ADC channel.
+ *
+ * @param dev - The device structure.
+ * @param chan - The channel number.
+ * @param value - ADC value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
+			 uint16_t *value)
+{
+	int32_t ret;
+	uint8_t data[3];
+	uint16_t temp;
+
+	if (!dev)
+		return FAILURE;
+
+	temp = BIT(chan);
+
+	data[0] = AD5593R_MODE_CONF | AD5592R_REG_ADC_SEQ;
+	data[1] = temp >> 8;
+	data[2] = temp & 0xFF;
+
+	ret = i2c_write(dev->i2c, data, sizeof(data), STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	data[0] = AD5593R_MODE_ADC_READBACK;
+	ret = i2c_write(dev->i2c, data, 1, STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	ret = i2c_read(dev->i2c, data, 2, STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	*value = (uint16_t)((data[0] & 0x0F) << 8) + data[1];
+
+	return 0;
+}
+
+/**
+ * Read Multiple ADC Channels.
+ *
+ * @param dev - The device structure.
+ * @param chans - The ADC channels to be readback
+ * @param values - ADC value array
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans,
+			       uint16_t *values)
+{
+	uint8_t data[AD5593R_ADC_VALUES_BUFF_SIZE], i;
+	int32_t ret;
+	uint8_t samples;
+
+	if (!dev)
+		return FAILURE;
+
+	samples = hweight8(chans);
+
+	data[0] = AD5593R_MODE_CONF | AD5592R_REG_ADC_SEQ;
+	data[1] = chans >> 8;
+	data[2] = chans & 0xFF;
+
+	ret = i2c_write(dev->i2c, data, 3, STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	data[0] = AD5593R_MODE_ADC_READBACK;
+	ret = i2c_write(dev->i2c, data, 1, RESTART_BIT);
+	if (ret < 0)
+		return ret;
+
+	ret = i2c_read(dev->i2c, data, (2 * samples), STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	for (i = 0; i < samples; i++) {
+		values[i] = ((uint16_t)(((data[2 * i] & 0xFF) << 8) + data[(2 * i) + 1]));
+	}
+
+	return 0;
+}
+
+/**
+ * Write register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_reg_write(struct ad5592r_dev *dev, uint8_t reg,
+			  uint16_t value)
+{
+	int32_t ret;
+	uint8_t data[3];
+
+	if (!dev)
+		return FAILURE;
+
+	data[0] = AD5593R_MODE_CONF | reg;
+	data[1] = value >> 8;
+	data[2] = value;
+
+	ret = i2c_write(dev->i2c, data,sizeof(data), STOP_BIT);
+
+	if (reg == AD5592R_REG_RESET && ret < 0) {
+		return SUCCESS;
+	}
+
+	return ret;
+}
+
+/**
+ * Read register.
+ *
+ * @param dev - The device structure.
+ * @param reg - The register address.
+ * @param value - register value
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_reg_read(struct ad5592r_dev *dev, uint8_t reg,
+			 uint16_t *value)
+{
+	int32_t ret;
+	uint8_t data[2];
+
+	if (!dev)
+		return FAILURE;
+
+	data[0] = AD5593R_MODE_REG_READBACK | reg;
+
+	ret = i2c_write(dev->i2c, data, 1, STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	ret = i2c_read(dev->i2c, data, sizeof(data), STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	*value = (uint16_t) (data[0] << 8) + data[1];
+
+	return 0;
+}
+
+/**
+ * Read GPIOs.
+ *
+ * @param dev - The device structure.
+ * @param value - GPIOs value.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
+{
+	int32_t ret;
+	uint8_t data[2];
+
+	if (!dev)
+		return FAILURE;
+
+	data[0] = AD5593R_MODE_GPIO_READBACK;
+	ret = i2c_write(dev->i2c, data, 1, STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	ret = i2c_read(dev->i2c, data, sizeof(data), STOP_BIT);
+	if (ret < 0)
+		return ret;
+
+	*value = data[1];
+
+	return 0;
+}
+
+/**
+ * Initialize AD5593r device.
+ *
+ * @param dev - The device structure.
+ * @param init_param - The initial parameters of the device.
+ * @return 0 in case of success, negative error code otherwise
+ */
+int32_t ad5593r_init(struct ad5592r_dev *dev,
+		     struct ad5592r_init_param *init_param)
+{
+	int32_t ret;
+	uint16_t temp_reg_val;
+
+	if (!dev)
+		return FAILURE;
+
+	dev->ops = &ad5593r_rw_ops;
+
+	ret = ad5592r_software_reset(dev);
+	if (ret < 0)
+		return ret;
+
+	ret = ad5592r_set_channel_modes(dev);
+	if (ret < 0)
+		return ret;
+
+	if(init_param->int_ref) {
+		ret = ad5593r_reg_read(dev, AD5592R_REG_PD, &temp_reg_val);
+		if (ret < 0)
+			return ret;
+		temp_reg_val |= AD5592R_REG_PD_EN_REF;
+
+		return ad5593r_reg_write(dev, AD5592R_REG_PD, temp_reg_val);
+	}
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc-dac/ad5592r/ad5593r.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,59 @@
+/***************************************************************************//**
+ *   @file   ad5593r.h
+ *   @brief  Header file of AD5593R driver.
+ *   @author Mircea Caprioru (mircea.caprioru@analog.com)
+********************************************************************************
+ * Copyright 2018, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef AD5593R_H_
+#define AD5593R_H_
+
+#include "stdint.h"
+#include "ad5592r-base.h"
+
+int32_t ad5593r_write_dac(struct ad5592r_dev *dev, uint8_t chan,
+			  uint16_t value);
+int32_t ad5593r_read_adc(struct ad5592r_dev *dev, uint8_t chan,
+			 uint16_t *value);
+int32_t ad5593r_multi_read_adc(struct ad5592r_dev *dev,
+			       uint16_t chans, uint16_t *value);
+int32_t ad5593r_reg_write(struct ad5592r_dev *dev, uint8_t reg,
+			  uint16_t value);
+int32_t ad5593r_reg_read(struct ad5592r_dev *dev, uint8_t reg,
+			 uint16_t *value);
+int32_t ad5593r_gpio_read(struct ad5592r_dev *dev, uint8_t *value);
+int32_t ad5593r_init(struct ad5592r_dev *dev,
+		     struct ad5592r_init_param *init_param);
+
+#endif /* AD5593R_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7124/ad7124.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7124/ad7124.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,555 @@
+/***************************************************************************//**
+*   @file    ad7124.c
+*   @brief   AD7124 implementation file.
+*   @devices AD7124-4, AD7124-8
+*
+********************************************************************************
+* Copyright 2015-2019(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdlib.h>
+#include <stdbool.h>
+#include "ad7124.h"
+
+/* Error codes */
+#define INVALID_VAL -1 /* Invalid argument */
+#define COMM_ERR    -2 /* Communication error on receive */
+#define TIMEOUT     -3 /* A timeout has occured */
+
+/*
+ * Post reset delay required to ensure all internal config done
+ * A time of 2ms should be enough based on the data sheet, but 4ms
+ * chosen to provide enough margin, in case mdelay is not accurate.
+ */
+#define AD7124_POST_RESET_DELAY      4
+
+
+/***************************************************************************//**
+ * @brief Reads the value of the specified register without checking if the
+ *        device is ready to accept user requests.
+ *
+ * @param dev   - The handler of the instance of the driver.
+ * @param p_reg - Pointer to the register structure holding info about the
+ *               register to be read. The read value is stored inside the
+ *               register structure.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_no_check_read_register(struct ad7124_dev *dev,
+				      struct ad7124_st_reg* p_reg)
+{
+	int32_t ret = 0;
+	uint8_t buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	uint8_t i = 0;
+	uint8_t check8 = 0, add_status_length = 0;
+	uint8_t msg_buf[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+
+	if(!dev || !p_reg)
+		return INVALID_VAL;
+
+	/* Build the Command word */
+	buffer[0] = AD7124_COMM_REG_WEN | AD7124_COMM_REG_RD |
+		    AD7124_COMM_REG_RA(p_reg->addr);
+
+	/*
+	 * If this is an AD7124_DATA register read, and the DATA_STATUS bit is set
+	 * in ADC_CONTROL, need to read 4, not 3 bytes for DATA with STATUS
+	 */
+	if ((p_reg->addr == AD7124_DATA_REG) &&
+	    (dev->regs[AD7124_ADC_Control].value & AD7124_ADC_CTRL_REG_DATA_STATUS)) {
+		add_status_length = 1;
+	}
+
+	/* Read data from the device */
+	ret = spi_write_and_read(dev->spi_desc,
+				 buffer,
+				 ((dev->use_crc != AD7124_DISABLE_CRC) ? p_reg->size + 1
+				  : p_reg->size) + 1 + add_status_length);
+	if(ret < 0)
+		return ret;
+
+	/* Check the CRC */
+	if(dev->use_crc == AD7124_USE_CRC) {
+		msg_buf[0] = AD7124_COMM_REG_WEN | AD7124_COMM_REG_RD |
+			     AD7124_COMM_REG_RA(p_reg->addr);
+		for(i = 1; i < p_reg->size + 2 + add_status_length; ++i) {
+			msg_buf[i] = buffer[i];
+		}
+		check8 = ad7124_compute_crc8(msg_buf, p_reg->size + 2 + add_status_length);
+	}
+
+	if(check8 != 0) {
+		/* ReadRegister checksum failed. */
+		return COMM_ERR;
+	}
+
+	/*
+	 * if reading Data with 4 bytes, need to copy the status byte to the STATUS
+	 * register struct value member
+	 */
+	if (add_status_length) {
+		dev->regs[AD7124_Status].value = buffer[p_reg->size + 1];
+	}
+
+	/* Build the result */
+	p_reg->value = 0;
+	for(i = 1; i < p_reg->size + 1; i++) {
+		p_reg->value <<= 8;
+		p_reg->value += buffer[i];
+	}
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Writes the value of the specified register without checking if the
+ *        device is ready to accept user requests.
+ *
+ * @param dev - The handler of the instance of the driver.
+ * @param reg - Register structure holding info about the register to be written
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_no_check_write_register(struct ad7124_dev *dev,
+				       struct ad7124_st_reg reg)
+{
+	int32_t ret = 0;
+	int32_t reg_value = 0;
+	uint8_t wr_buf[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	uint8_t i = 0;
+	uint8_t crc8 = 0;
+
+	if(!dev)
+		return INVALID_VAL;
+
+	/* Build the Command word */
+	wr_buf[0] = AD7124_COMM_REG_WEN | AD7124_COMM_REG_WR |
+		    AD7124_COMM_REG_RA(reg.addr);
+
+	/* Fill the write buffer */
+	reg_value = reg.value;
+	for(i = 0; i < reg.size; i++) {
+		wr_buf[reg.size - i] = reg_value & 0xFF;
+		reg_value >>= 8;
+	}
+
+	/* Compute the CRC */
+	if(dev->use_crc != AD7124_DISABLE_CRC) {
+		crc8 = ad7124_compute_crc8(wr_buf, reg.size + 1);
+		wr_buf[reg.size + 1] = crc8;
+	}
+
+	/* Write data to the device */
+	ret = spi_write_and_read(dev->spi_desc,
+				 wr_buf,
+				 (dev->use_crc != AD7124_DISABLE_CRC) ? reg.size + 2
+				 : reg.size + 1);
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Reads the value of the specified register only when the device is ready
+ *        to accept user requests. If the device ready flag is deactivated the
+ *        read operation will be executed without checking the device state.
+ *
+ * @param dev   - The handler of the instance of the driver.
+ * @param p_reg - Pointer to the register structure holding info about the
+ *               register to be read. The read value is stored inside the
+ *               register structure.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_read_register(struct ad7124_dev *dev,
+			     struct ad7124_st_reg* p_reg)
+{
+	int32_t ret;
+
+	if (p_reg->addr != AD7124_ERR_REG && dev->check_ready) {
+		ret = ad7124_wait_for_spi_ready(dev,
+						dev->spi_rdy_poll_cnt);
+		if (ret < 0)
+			return ret;
+	}
+	ret = ad7124_no_check_read_register(dev,
+					    p_reg);
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Writes the value of the specified register only when the device is
+ *        ready to accept user requests. If the device ready flag is deactivated
+ *        the write operation will be executed without checking the device state.
+ *
+ * @param dev - The handler of the instance of the driver.
+ * @param reg - Register structure holding info about the register to be written
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_write_register(struct ad7124_dev *dev,
+			      struct ad7124_st_reg p_reg)
+{
+	int32_t ret;
+
+	if (dev->check_ready) {
+		ret = ad7124_wait_for_spi_ready(dev,
+						dev->spi_rdy_poll_cnt);
+		if (ret < 0)
+			return ret;
+	}
+	ret = ad7124_no_check_write_register(dev,
+					     p_reg);
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Resets the device.
+ *
+ * @param dev - The handler of the instance of the driver.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_reset(struct ad7124_dev *dev)
+{
+	int32_t ret = 0;
+	uint8_t wr_buf[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+
+	if(!dev)
+		return INVALID_VAL;
+
+	ret = spi_write_and_read(dev->spi_desc,
+				 wr_buf,
+				 8);
+
+	/* CRC is disabled after reset */
+	dev->use_crc = AD7124_DISABLE_CRC;
+
+	/* Read POR bit to clear */
+	ret = ad7124_wait_to_power_on(dev,
+				      dev->spi_rdy_poll_cnt);
+
+	mdelay(AD7124_POST_RESET_DELAY);
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Waits until the device can accept read and write user actions.
+ *
+ * @param dev     - The handler of the instance of the driver.
+ * @param timeout - Count representing the number of polls to be done until the
+ *                  function returns.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_wait_for_spi_ready(struct ad7124_dev *dev,
+				  uint32_t timeout)
+{
+	struct ad7124_st_reg *regs;
+	int32_t ret;
+	int8_t ready = 0;
+
+	if(!dev)
+		return INVALID_VAL;
+
+	regs = dev->regs;
+
+	while(!ready && --timeout) {
+		/* Read the value of the Error Register */
+		ret = ad7124_read_register(dev, &regs[AD7124_Error]);
+		if(ret < 0)
+			return ret;
+
+		/* Check the SPI IGNORE Error bit in the Error Register */
+		ready = (regs[AD7124_Error].value &
+			 AD7124_ERR_REG_SPI_IGNORE_ERR) == 0;
+	}
+
+	return timeout ? 0 : TIMEOUT;
+}
+
+/***************************************************************************//**
+ * @brief Waits until the device finishes the power-on reset operation.
+ *
+ * @param dev     - The handler of the instance of the driver.
+ * @param timeout - Count representing the number of polls to be done until the
+ *                  function returns.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_wait_to_power_on(struct ad7124_dev *dev,
+				uint32_t timeout)
+{
+	struct ad7124_st_reg *regs;
+	int32_t ret;
+	int8_t powered_on = 0;
+
+	if(!dev)
+		return INVALID_VAL;
+
+	regs = dev->regs;
+
+	while(!powered_on && timeout--) {
+		ret = ad7124_read_register(dev,
+					   &regs[AD7124_Status]);
+		if(ret < 0)
+			return ret;
+
+		/* Check the POR_FLAG bit in the Status Register */
+		powered_on = (regs[AD7124_Status].value &
+			      AD7124_STATUS_REG_POR_FLAG) == 0;
+	}
+
+	return (timeout || powered_on) ? 0 : TIMEOUT;
+}
+
+/***************************************************************************//**
+ * @brief Waits until a new conversion result is available.
+ *
+ * @param dev     - The handler of the instance of the driver.
+ * @param timeout - Count representing the number of polls to be done until the
+ *                  function returns if no new data is available.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_wait_for_conv_ready(struct ad7124_dev *dev,
+				   uint32_t timeout)
+{
+	struct ad7124_st_reg *regs;
+	int32_t ret;
+	int8_t ready = 0;
+
+	if(!dev)
+		return INVALID_VAL;
+
+	regs = dev->regs;
+
+	while(!ready && --timeout) {
+		/* Read the value of the Status Register */
+		ret = ad7124_read_register(dev, &regs[AD7124_Status]);
+		if(ret < 0)
+			return ret;
+
+		/* Check the RDY bit in the Status Register */
+		ready = (regs[AD7124_Status].value &
+			 AD7124_STATUS_REG_RDY) == 0;
+	}
+
+	return timeout ? 0 : TIMEOUT;
+}
+
+/***************************************************************************//**
+ * @brief Reads the conversion result from the device.
+ *
+ * @param dev     - The handler of the instance of the driver.
+ * @param p_data  - Pointer to store the read data.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_read_data(struct ad7124_dev *dev,
+			 int32_t* p_data)
+{
+	struct ad7124_st_reg *regs;
+	int32_t ret;
+
+	if(!dev)
+		return INVALID_VAL;
+
+	regs = dev->regs;
+
+	/* Read the value of the Status Register */
+	ret = ad7124_read_register(dev, &regs[AD7124_Data]);
+
+	/* Get the read result */
+	*p_data = regs[AD7124_Data].value;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Computes the CRC checksum for a data buffer.
+ *
+ * @param p_buf    - Data buffer
+ * @param buf_size - Data buffer size in bytes
+ *
+ * @return Returns the computed CRC checksum.
+*******************************************************************************/
+uint8_t ad7124_compute_crc8(uint8_t * p_buf, uint8_t buf_size)
+{
+	uint8_t i = 0;
+	uint8_t crc = 0;
+
+	while(buf_size) {
+		for(i = 0x80; i != 0; i >>= 1) {
+			bool cmp1 = (crc & 0x80) != 0;
+			bool cmp2 = (*p_buf & i) != 0;
+			if(cmp1 != cmp2) { /* MSB of CRC register XOR input Bit from Data */
+				crc <<= 1;
+				crc ^= AD7124_CRC8_POLYNOMIAL_REPRESENTATION;
+			} else {
+				crc <<= 1;
+			}
+		}
+		p_buf++;
+		buf_size--;
+	}
+	return crc;
+}
+
+/***************************************************************************//**
+ * @brief Updates the CRC settings.
+ *
+ * @param dev - The handler of the instance of the driver.
+ *
+ * @return None.
+*******************************************************************************/
+void ad7124_update_crcsetting(struct ad7124_dev *dev)
+{
+	struct ad7124_st_reg *regs;
+
+	if(!dev)
+		return;
+
+	regs = dev->regs;
+
+	/* Get CRC State. */
+	if (regs[AD7124_Error_En].value & AD7124_ERREN_REG_SPI_CRC_ERR_EN) {
+		dev->use_crc = AD7124_USE_CRC;
+	} else {
+		dev->use_crc = AD7124_DISABLE_CRC;
+	}
+}
+
+/***************************************************************************//**
+ * @brief Updates the device SPI interface settings.
+ *
+ * @param dev - The handler of the instance of the driver.
+ *
+ * @return None.
+*******************************************************************************/
+void ad7124_update_dev_spi_settings(struct ad7124_dev *dev)
+{
+	struct ad7124_st_reg *regs;
+
+	if(!dev)
+		return;
+
+	regs = dev->regs;
+
+	if (regs[AD7124_Error_En].value & AD7124_ERREN_REG_SPI_IGNORE_ERR_EN) {
+		dev->check_ready = 1;
+	} else {
+		dev->check_ready = 0;
+	}
+}
+
+/***************************************************************************//**
+ * @brief Initializes the AD7124.
+ *
+ * @param device     - The device structure.
+ * @param init_param - The structure that contains the device initial
+ * 		       parameters.
+ *
+ * @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t ad7124_setup(struct ad7124_dev **device,
+		     struct ad7124_init_param init_param)
+{
+	int32_t ret;
+	enum ad7124_registers reg_nr;
+	struct ad7124_dev *dev;
+
+	dev = (struct ad7124_dev *)malloc(sizeof(*dev));
+	if (!dev)
+		return INVALID_VAL;
+
+	dev->regs = init_param.regs;
+	dev->spi_rdy_poll_cnt = init_param.spi_rdy_poll_cnt;
+
+	/* Initialize the SPI communication. */
+	ret = spi_init(&dev->spi_desc, &init_param.spi_init);
+	if (ret < 0)
+		return ret;
+
+	/*  Reset the device interface.*/
+	ret = ad7124_reset(dev);
+	if (ret < 0)
+		return ret;
+
+	/* Update the device structure with power-on/reset settings */
+	dev->check_ready = 1;
+
+	/* Initialize registers AD7124_ADC_Control through AD7124_Filter_7. */
+	for(reg_nr = AD7124_Status; (reg_nr < AD7124_Offset_0) && !(ret < 0);
+	    reg_nr++) {
+		if (dev->regs[reg_nr].rw == AD7124_RW) {
+			ret = ad7124_write_register(dev, dev->regs[reg_nr]);
+			if (ret < 0)
+				break;
+		}
+
+		/* Get CRC State and device SPI interface settings */
+		if (reg_nr == AD7124_Error_En) {
+			ad7124_update_crcsetting(dev);
+			ad7124_update_dev_spi_settings(dev);
+		}
+	}
+
+	*device = dev;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Free the resources allocated by AD7124_Setup().
+ *
+ * @param dev - The device structure.
+ *
+ * @return SUCCESS in case of success, negative error code otherwise.
+*******************************************************************************/
+int32_t ad7124_remove(struct ad7124_dev *dev)
+{
+	int32_t ret;
+
+	ret = spi_remove(dev->spi_desc);
+
+	free(dev);
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7124/ad7124.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7124/ad7124.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,462 @@
+/***************************************************************************//**
+*   @file    ad7124.h
+*   @brief   AD7124 header file.
+*   	     Devices AD7124-4, AD7124-8
+*
+********************************************************************************
+* Copyright 2015-2020(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef __AD7124_H__
+#define __AD7124_H__
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/******************* Register map and register definitions ********************/
+/******************************************************************************/
+/*
+ * Create a contiguous bitmask starting at bit position @l and ending at
+ * position @h.
+ */
+#ifndef GENMASK
+#define GENMASK(h, l) (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (31 - (h))))
+#endif
+#define BIT(x)        (1UL << (x))
+
+#define	AD7124_RW 1   /* Read and Write */
+#define	AD7124_R  2   /* Read only */
+#define AD7124_W  3   /* Write only */
+
+/* AD7124 Register Map */
+#define AD7124_COMM_REG      0x00
+#define AD7124_STATUS_REG    0x00
+#define AD7124_ADC_CTRL_REG  0x01
+#define AD7124_DATA_REG      0x02
+#define AD7124_IO_CTRL1_REG  0x03
+#define AD7124_IO_CTRL2_REG  0x04
+#define AD7124_ID_REG        0x05
+#define AD7124_ERR_REG       0x06
+#define AD7124_ERREN_REG     0x07
+#define AD7124_CH0_MAP_REG   0x09
+#define AD7124_CH1_MAP_REG   0x0A
+#define AD7124_CH2_MAP_REG   0x0B
+#define AD7124_CH3_MAP_REG   0x0C
+#define AD7124_CH4_MAP_REG   0x0D
+#define AD7124_CH5_MAP_REG   0x0E
+#define AD7124_CH6_MAP_REG   0x0F
+#define AD7124_CH7_MAP_REG   0x10
+#define AD7124_CH8_MAP_REG   0x11
+#define AD7124_CH9_MAP_REG   0x12
+#define AD7124_CH10_MAP_REG  0x13
+#define AD7124_CH11_MAP_REG  0x14
+#define AD7124_CH12_MAP_REG  0x15
+#define AD7124_CH13_MAP_REG  0x16
+#define AD7124_CH14_MAP_REG  0x17
+#define AD7124_CH15_MAP_REG  0x18
+#define AD7124_CFG0_REG      0x19
+#define AD7124_CFG1_REG      0x1A
+#define AD7124_CFG2_REG      0x1B
+#define AD7124_CFG3_REG      0x1C
+#define AD7124_CFG4_REG      0x1D
+#define AD7124_CFG5_REG      0x1E
+#define AD7124_CFG6_REG      0x1F
+#define AD7124_CFG7_REG      0x20
+#define AD7124_FILT0_REG     0x21
+#define AD7124_FILT1_REG     0x22
+#define AD7124_FILT2_REG     0x23
+#define AD7124_FILT3_REG     0x24
+#define AD7124_FILT4_REG     0x25
+#define AD7124_FILT5_REG     0x26
+#define AD7124_FILT6_REG     0x27
+#define AD7124_FILT7_REG     0x28
+#define AD7124_OFFS0_REG     0x29
+#define AD7124_OFFS1_REG     0x2A
+#define AD7124_OFFS2_REG     0x2B
+#define AD7124_OFFS3_REG     0x2C
+#define AD7124_OFFS4_REG     0x2D
+#define AD7124_OFFS5_REG     0x2E
+#define AD7124_OFFS6_REG     0x2F
+#define AD7124_OFFS7_REG     0x30
+#define AD7124_GAIN0_REG     0x31
+#define AD7124_GAIN1_REG     0x32
+#define AD7124_GAIN2_REG     0x33
+#define AD7124_GAIN3_REG     0x34
+#define AD7124_GAIN4_REG     0x35
+#define AD7124_GAIN5_REG     0x36
+#define AD7124_GAIN6_REG     0x37
+#define AD7124_GAIN7_REG     0x38
+
+/* Communication Register bits */
+#define AD7124_COMM_REG_WEN    (0 << 7)
+#define AD7124_COMM_REG_WR     (0 << 6)
+#define AD7124_COMM_REG_RD     (1 << 6)
+#define AD7124_COMM_REG_RA(x)  ((x) & 0x3F)
+
+/* Status Register bits */
+#define AD7124_STATUS_REG_RDY          (1 << 7)
+#define AD7124_STATUS_REG_ERROR_FLAG   (1 << 6)
+#define AD7124_STATUS_REG_POR_FLAG     (1 << 4)
+#define AD7124_STATUS_REG_CH_ACTIVE(x) ((x) & 0xF)
+
+/* ADC_Control Register bits */
+#define AD7124_ADC_CTRL_REG_DOUT_RDY_DEL   (1 << 12)
+#define AD7124_ADC_CTRL_REG_CONT_READ      (1 << 11)
+#define AD7124_ADC_CTRL_REG_DATA_STATUS    (1 << 10)
+#define AD7124_ADC_CTRL_REG_CS_EN          (1 << 9)
+#define AD7124_ADC_CTRL_REG_REF_EN         (1 << 8)
+#define AD7124_ADC_CTRL_REG_POWER_MODE_MSK    GENMASK(7,6)
+#define AD7124_ADC_CTRL_REG_POWER_MODE_RD(x)  (((x) >> 6) & 0x3)
+#define AD7124_ADC_CTRL_REG_POWER_MODE(x)  (((x) & 0x3) << 6)
+#define AD7124_ADC_CTRL_REG_MSK            GENMASK(5,2)
+#define AD7124_ADC_CTRL_REG_MODE_OUT(x)    (((x) >> 2) & 0xF)
+#define AD7124_ADC_CTRL_REG_MODE(x)        (((x) & 0xF) << 2)
+#define AD7124_ADC_CTRL_REG_CLK_SEL_MSK   GENMASK(1,0)
+#define AD7124_ADC_CTRL_REG_CLK_SEL_RD(x) (((x) >> 0) & 0x3)
+#define AD7124_ADC_CTRL_REG_CLK_SEL(x)     (((x) & 0x3) << 0)
+
+/* IO_Control_1 Register bits */
+#define AD7124_IO_CTRL1_REG_GPIO_DAT2     (1 << 23)
+#define AD7124_IO_CTRL1_REG_GPIO_DAT1     (1 << 22)
+#define AD7124_IO_CTRL1_REG_GPIO_CTRL2    (1 << 19)
+#define AD7124_IO_CTRL1_REG_GPIO_CTRL1    (1 << 18)
+#define AD7124_IO_CTRL1_REG_PDSW          (1 << 15)
+#define AD7124_IO_CTRL1_REG_IOUT1(x)      (((x) & 0x7) << 11)
+#define AD7124_IO_CTRL1_REG_IOUT0(x)      (((x) & 0x7) << 8)
+#define AD7124_IO_CTRL1_REG_IOUT_CH1(x)   (((x) & 0xF) << 4)
+#define AD7124_IO_CTRL1_REG_IOUT_CH0(x)   (((x) & 0xF) << 0)
+
+/* IO_Control_1 AD7124-8 specific bits */
+#define AD7124_8_IO_CTRL1_REG_GPIO_DAT4     (1 << 23)
+#define AD7124_8_IO_CTRL1_REG_GPIO_DAT3     (1 << 22)
+#define AD7124_8_IO_CTRL1_REG_GPIO_DAT2     (1 << 21)
+#define AD7124_8_IO_CTRL1_REG_GPIO_DAT1     (1 << 20)
+#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL4    (1 << 19)
+#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL3    (1 << 18)
+#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL2    (1 << 17)
+#define AD7124_8_IO_CTRL1_REG_GPIO_CTRL1    (1 << 16)
+
+/* IO_Control_2 Register bits */
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS7   (1 << 15)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS6   (1 << 14)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS5   (1 << 11)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS4   (1 << 10)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS3   (1 << 5)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS2   (1 << 4)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS1   (1 << 1)
+#define AD7124_IO_CTRL2_REG_GPIO_VBIAS0   (1 << 0)
+
+/* IO_Control_2 AD7124-8 specific bits */
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS15  (1 << 15)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS14  (1 << 14)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS13  (1 << 13)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS12  (1 << 12)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS11  (1 << 11)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS10  (1 << 10)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS9   (1 << 9)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS8   (1 << 8)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS7   (1 << 7)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS6   (1 << 6)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS5   (1 << 5)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS4   (1 << 4)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS3   (1 << 3)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS2   (1 << 2)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS1   (1 << 1)
+#define AD7124_8_IO_CTRL2_REG_GPIO_VBIAS0   (1 << 0)
+
+/* ID Register bits */
+#define AD7124_ID_REG_DEVICE_ID(x)   (((x) & 0xF) << 4)
+#define AD7124_ID_REG_SILICON_REV(x) (((x) & 0xF) << 0)
+
+/* Error Register bits */
+#define AD7124_ERR_REG_LDO_CAP_ERR        (1 << 19)
+#define AD7124_ERR_REG_ADC_CAL_ERR        (1 << 18)
+#define AD7124_ERR_REG_ADC_CONV_ERR       (1 << 17)
+#define AD7124_ERR_REG_ADC_SAT_ERR        (1 << 16)
+#define AD7124_ERR_REG_AINP_OV_ERR        (1 << 15)
+#define AD7124_ERR_REG_AINP_UV_ERR        (1 << 14)
+#define AD7124_ERR_REG_AINM_OV_ERR        (1 << 13)
+#define AD7124_ERR_REG_AINM_UV_ERR        (1 << 12)
+#define AD7124_ERR_REG_REF_DET_ERR        (1 << 11)
+#define AD7124_ERR_REG_DLDO_PSM_ERR       (1 << 9)
+#define AD7124_ERR_REG_ALDO_PSM_ERR       (1 << 7)
+#define AD7124_ERR_REG_SPI_IGNORE_ERR     (1 << 6)
+#define AD7124_ERR_REG_SPI_SLCK_CNT_ERR   (1 << 5)
+#define AD7124_ERR_REG_SPI_READ_ERR       (1 << 4)
+#define AD7124_ERR_REG_SPI_WRITE_ERR      (1 << 3)
+#define AD7124_ERR_REG_SPI_CRC_ERR        (1 << 2)
+#define AD7124_ERR_REG_MM_CRC_ERR         (1 << 1)
+#define AD7124_ERR_REG_ROM_CRC_ERR        (1 << 0)
+
+/* Error_En Register bits */
+#define AD7124_ERREN_REG_MCLK_CNT_EN           (1 << 22)
+#define AD7124_ERREN_REG_LDO_CAP_CHK_TEST_EN   (1 << 21)
+#define AD7124_ERREN_REG_LDO_CAP_CHK(x)        (((x) & 0x3) << 19)
+#define AD7124_ERREN_REG_ADC_CAL_ERR_EN        (1 << 18)
+#define AD7124_ERREN_REG_ADC_CONV_ERR_EN       (1 << 17)
+#define AD7124_ERREN_REG_ADC_SAT_ERR_EN        (1 << 16)
+#define AD7124_ERREN_REG_AINP_OV_ERR_EN        (1 << 15)
+#define AD7124_ERREN_REG_AINP_UV_ERR_EN        (1 << 14)
+#define AD7124_ERREN_REG_AINM_OV_ERR_EN        (1 << 13)
+#define AD7124_ERREN_REG_AINM_UV_ERR_EN        (1 << 12)
+#define AD7124_ERREN_REG_REF_DET_ERR_EN        (1 << 11)
+#define AD7124_ERREN_REG_DLDO_PSM_TRIP_TEST_EN (1 << 10)
+#define AD7124_ERREN_REG_DLDO_PSM_ERR_ERR      (1 << 9)
+#define AD7124_ERREN_REG_ALDO_PSM_TRIP_TEST_EN (1 << 8)
+#define AD7124_ERREN_REG_ALDO_PSM_ERR_EN       (1 << 7)
+#define AD7124_ERREN_REG_SPI_IGNORE_ERR_EN     (1 << 6)
+#define AD7124_ERREN_REG_SPI_SCLK_CNT_ERR_EN   (1 << 5)
+#define AD7124_ERREN_REG_SPI_READ_ERR_EN       (1 << 4)
+#define AD7124_ERREN_REG_SPI_WRITE_ERR_EN      (1 << 3)
+#define AD7124_ERREN_REG_SPI_CRC_ERR_EN        (1 << 2)
+#define AD7124_ERREN_REG_MM_CRC_ERR_EN         (1 << 1)
+#define AD7124_ERREN_REG_ROM_CRC_ERR_EN        (1 << 0)
+
+/* Channel Registers 0-15 bits */
+#define AD7124_CH_MAP_REG_CH_ENABLE_RD(x) (((x) >> 15) & 0x1)
+#define AD7124_CH_MAP_REG_CH_ENABLE    (1 << 15)
+#define AD7124_CH_MAP_REG_SETUP_MSK    GENMASK(14, 12)
+#define AD7124_CH_MAP_REG_SETUP_RD(x)  (((x) >> 12) & 0x7)
+#define AD7124_CH_MAP_REG_SETUP(x)     (((x) & 0x7) << 12)
+#define AD7124_CH_MAP_REG_AINP_MSK     GENMASK(9, 5)
+#define AD7124_CH_MAP_REG_AINP_RD(x)   (((x) >> 5) & 0x1F)
+#define AD7124_CH_MAP_REG_AINP(x)      (((x) & 0x1F) << 5)
+#define AD7124_CH_MAP_REG_AINM_MSK     GENMASK(4, 0)
+#define AD7124_CH_MAP_REG_AINM_RD(x)   (((x) >> 0) & 0x1F)
+#define AD7124_CH_MAP_REG_AINM(x)      (((x) & 0x1F) << 0)
+
+/* Configuration Registers 0-7 bits */
+#define AD7124_CFG_REG_BIPOLAR_RD(x)  (((x) >> 11) & 0x1)
+#define AD7124_CFG_REG_BIPOLAR     (1 << 11)
+#define AD7124_CFG_REG_BURNOUT_RD(x)  (((x) >> 9) & 0x3)
+#define AD7124_CFG_REG_BURNOUT(x)  (((x) & 0x3) << 9)
+#define AD7124_CFG_REG_REF_BUFP_RD(x)  (((x) >> 8) & 0x1)
+#define AD7124_CFG_REG_REF_BUFP    (1 << 8)
+#define AD7124_CFG_REG_REF_BUFM_RD(x)  (((x) >> 7) & 0x1)
+#define AD7124_CFG_REG_REF_BUFM    (1 << 7)
+#define AD7124_CFG_REG_AIN_BUFP_RD(x)  (((x) >> 6) & 0x1)
+#define AD7124_CFG_REG_AIN_BUFP    (1 << 6)
+#define AD7124_CFG_REG_AINM_BUFP_RD(x) (((x) >> 5) & 0x1)
+#define AD7124_CFG_REG_AINN_BUFM   (1 << 5)
+#define AD7124_CFG_REG_REF_SEL_MSK    GENMASK(4, 3)
+#define AD7124_CFG_REG_REF_SEL_RD(x)  (((x) >> 3) & 0x3)
+#define AD7124_CFG_REG_REF_SEL(x)  (((x) & 0x3) << 3)
+#define AD7124_CFG_REG_PGA_MSK     GENMASK(2, 0)
+#define AD7124_CFG_REG_PGA_RD(x)   (((x) >> 0) & 0x7)
+#define AD7124_CFG_REG_PGA(x)      (((x) & 0x7) << 0)
+
+/* Filter Register 0-7 bits */
+#define AD7124_FILT_REG_FILTER_MSK        GENMASK(23, 21)
+#define AD7124_FILT_REG_FILTER_RD(x)      (((x) >> 21) & 0x7)
+#define AD7124_FILT_REG_FILTER(x)         (((x) & 0x7) << 21)
+#define AD7124_FILT_REG_REJ60             (1 << 20)
+#define AD7124_FILT_REG_POST_FILTER_MSK   GENMASK(19, 17)
+#define AD7124_FILT_REG_POST_FILTER_RD(x) (((x) >> 17) & 0x7)
+#define AD7124_FILT_REG_POST_FILTER(x)    (((x) & 0x7) << 17)
+#define AD7124_FILT_REG_SINGLE_CYCLE      (1 << 16)
+#define AD7124_FILT_REG_FS_MSK            GENMASK(10, 0)
+#define AD7124_FILT_REG_FS_RD(x)          (((x) >> 0) & 0x7FF)
+#define AD7124_FILT_REG_FS(x)             (((x) & 0x7FF) << 0)
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/*! Device register info */
+struct ad7124_st_reg {
+	int32_t addr;
+	int32_t value;
+	int32_t size;
+	int32_t rw;
+};
+
+/*! AD7124 registers list*/
+enum ad7124_registers {
+	AD7124_Status = 0x00,
+	AD7124_ADC_Control,
+	AD7124_Data,
+	AD7124_IOCon1,
+	AD7124_IOCon2,
+	AD7124_ID,
+	AD7124_Error,
+	AD7124_Error_En,
+	AD7124_Mclk_Count,
+	AD7124_Channel_0,
+	AD7124_Channel_1,
+	AD7124_Channel_2,
+	AD7124_Channel_3,
+	AD7124_Channel_4,
+	AD7124_Channel_5,
+	AD7124_Channel_6,
+	AD7124_Channel_7,
+	AD7124_Channel_8,
+	AD7124_Channel_9,
+	AD7124_Channel_10,
+	AD7124_Channel_11,
+	AD7124_Channel_12,
+	AD7124_Channel_13,
+	AD7124_Channel_14,
+	AD7124_Channel_15,
+	AD7124_Config_0,
+	AD7124_Config_1,
+	AD7124_Config_2,
+	AD7124_Config_3,
+	AD7124_Config_4,
+	AD7124_Config_5,
+	AD7124_Config_6,
+	AD7124_Config_7,
+	AD7124_Filter_0,
+	AD7124_Filter_1,
+	AD7124_Filter_2,
+	AD7124_Filter_3,
+	AD7124_Filter_4,
+	AD7124_Filter_5,
+	AD7124_Filter_6,
+	AD7124_Filter_7,
+	AD7124_Offset_0,
+	AD7124_Offset_1,
+	AD7124_Offset_2,
+	AD7124_Offset_3,
+	AD7124_Offset_4,
+	AD7124_Offset_5,
+	AD7124_Offset_6,
+	AD7124_Offset_7,
+	AD7124_Gain_0,
+	AD7124_Gain_1,
+	AD7124_Gain_2,
+	AD7124_Gain_3,
+	AD7124_Gain_4,
+	AD7124_Gain_5,
+	AD7124_Gain_6,
+	AD7124_Gain_7,
+	AD7124_REG_NO
+};
+
+/*
+ * The structure describes the device and is used with the ad7124 driver.
+ * @spi_desc: A reference to the SPI configuration of the device.
+ * @regs: A reference to the register list of the device that the user must
+ *       provide when calling the Setup() function.
+ * @userCRC: Whether to do or not a cyclic redundancy check on SPI transfers.
+ * @check_ready: When enabled all register read and write calls will first wait
+ *               until the device is ready to accept user requests.
+ * @spi_rdy_poll_cnt: Number of times the driver should read the Error register
+ *                    to check if the device is ready to accept user requests,
+ *                    before a timeout error will be issued.
+ */
+struct ad7124_dev {
+	/* SPI */
+	spi_desc		*spi_desc;
+	/* Device Settings */
+	struct ad7124_st_reg	*regs;
+	int16_t use_crc;
+	int16_t check_ready;
+	int16_t spi_rdy_poll_cnt;
+};
+
+struct ad7124_init_param {
+	/* SPI */
+	spi_init_param		spi_init;
+	/* Device Settings */
+	struct ad7124_st_reg	*regs;
+	int16_t spi_rdy_poll_cnt;
+};
+
+/******************************************************************************/
+/******************* AD7124 Constants *****************************************/
+/******************************************************************************/
+#define AD7124_CRC8_POLYNOMIAL_REPRESENTATION 0x07 /* x8 + x2 + x + 1 */
+#define AD7124_DISABLE_CRC 0
+#define AD7124_USE_CRC 1
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/*! Reads the value of the specified register. */
+int32_t ad7124_read_register(struct ad7124_dev *dev,
+			     struct ad7124_st_reg* p_reg);
+
+/*! Writes the value of the specified register. */
+int32_t ad7124_write_register(struct ad7124_dev *dev,
+			      struct ad7124_st_reg reg);
+
+/*! Reads the value of the specified register without a device state check. */
+int32_t ad7124_no_check_read_register(struct ad7124_dev *dev,
+				      struct ad7124_st_reg* p_reg);
+
+/*! Writes the value of the specified register without a device state check. */
+int32_t ad7124_no_check_write_register(struct ad7124_dev *dev,
+				       struct ad7124_st_reg reg);
+
+/*! Resets the device. */
+int32_t ad7124_reset(struct ad7124_dev *dev);
+
+/*! Waits until the device can accept read and write user actions. */
+int32_t ad7124_wait_for_spi_ready(struct ad7124_dev *dev,
+				  uint32_t timeout);
+
+/*! Waits until the device finishes the power-on reset operation. */
+int32_t ad7124_wait_to_power_on(struct ad7124_dev *dev,
+				uint32_t timeout);
+
+/*! Waits until a new conversion result is available. */
+int32_t ad7124_wait_for_conv_ready(struct ad7124_dev *dev,
+				   uint32_t timeout);
+
+/*! Reads the conversion result from the device. */
+int32_t ad7124_read_data(struct ad7124_dev *dev,
+			 int32_t* p_data);
+
+/*! Computes the CRC checksum for a data buffer. */
+uint8_t ad7124_compute_crc8(uint8_t* p_buf,
+			    uint8_t buf_size);
+
+/*! Updates the CRC settings. */
+void ad7124_update_crcsetting(struct ad7124_dev *dev);
+
+/*! Updates the device SPI interface settings. */
+void ad7124_update_dev_spi_settings(struct ad7124_dev *dev);
+
+/*! Initializes the AD7124. */
+int32_t ad7124_setup(struct ad7124_dev **device,
+		     struct ad7124_init_param init_param);
+/*! Free the resources allocated by AD7124_Setup(). */
+int32_t ad7124_remove(struct ad7124_dev *dev);
+
+#endif /* __AD7124_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7124/ad7124_regs.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7124/ad7124_regs.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,102 @@
+/***************************************************************************//**
+*   @file    ad7124-regs.c
+*   @brief   AD7124 register file.
+*   @devices AD7124-4, AD7124-8
+*
+********************************************************************************
+* Copyright 2015-2019(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+
+#include "ad7124_regs.h"
+
+struct ad7124_st_reg ad7124_regs[AD7124_REG_NO] = {
+	{0x00, 0x00,   1, 2}, /* AD7124_Status */
+	{0x01, 0x0000, 2, 1}, /* AD7124_ADC_Control */
+	{0x02, 0x0000, 3, 2}, /* AD7124_Data */
+	{0x03, 0x0000, 3, 1}, /* AD7124_IOCon1 */
+	{0x04, 0x0000, 2, 1}, /* AD7124_IOCon2 */
+	{0x05, 0x02,   1, 2}, /* AD7124_ID */
+	{0x06, 0x0000, 3, 2}, /* AD7124_Error */
+	{0x07, 0x0040, 3, 1}, /* AD7124_Error_En */
+	{0x08, 0x00,   1, 2}, /* AD7124_Mclk_Count */
+	{0x09, 0x8001, 2, 1}, /* AD7124_Channel_0 */
+	{0x0A, 0x0001, 2, 1}, /* AD7124_Channel_1 */
+	{0x0B, 0x0001, 2, 1}, /* AD7124_Channel_2 */
+	{0x0C, 0x0001, 2, 1}, /* AD7124_Channel_3 */
+	{0x0D, 0x0001, 2, 1}, /* AD7124_Channel_4 */
+	{0x0E, 0x0001, 2, 1}, /* AD7124_Channel_5 */
+	{0x0F, 0x0001, 2, 1}, /* AD7124_Channel_6 */
+	{0x10, 0x0001, 2, 1}, /* AD7124_Channel_7 */
+	{0x11, 0x0001, 2, 1}, /* AD7124_Channel_8 */
+	{0x12, 0x0001, 2, 1}, /* AD7124_Channel_9 */
+	{0x13, 0x0001, 2, 1}, /* AD7124_Channel_10 */
+	{0x14, 0x0001, 2, 1}, /* AD7124_Channel_11 */
+	{0x15, 0x0001, 2, 1}, /* AD7124_Channel_12 */
+	{0x16, 0x0001, 2, 1}, /* AD7124_Channel_13 */
+	{0x17, 0x0001, 2, 1}, /* AD7124_Channel_14 */
+	{0x18, 0x0001, 2, 1}, /* AD7124_Channel_15 */
+	{0x19, 0x0860, 2, 1}, /* AD7124_Config_0 */
+	{0x1A, 0x0860, 2, 1}, /* AD7124_Config_1 */
+	{0x1B, 0x0860, 2, 1}, /* AD7124_Config_2 */
+	{0x1C, 0x0860, 2, 1}, /* AD7124_Config_3 */
+	{0x1D, 0x0860, 2, 1}, /* AD7124_Config_4 */
+	{0x1E, 0x0860, 2, 1}, /* AD7124_Config_5 */
+	{0x1F, 0x0860, 2, 1}, /* AD7124_Config_6 */
+	{0x20, 0x0860, 2, 1}, /* AD7124_Config_7 */
+	{0x21, 0x060180, 3, 1}, /* AD7124_Filter_0 */
+	{0x22, 0x060180, 3, 1}, /* AD7124_Filter_1 */
+	{0x23, 0x060180, 3, 1}, /* AD7124_Filter_2 */
+	{0x24, 0x060180, 3, 1}, /* AD7124_Filter_3 */
+	{0x25, 0x060180, 3, 1}, /* AD7124_Filter_4 */
+	{0x26, 0x060180, 3, 1}, /* AD7124_Filter_5 */
+	{0x27, 0x060180, 3, 1}, /* AD7124_Filter_6 */
+	{0x28, 0x060180, 3, 1}, /* AD7124_Filter_7 */
+	{0x29, 0x800000, 3, 1}, /* AD7124_Offset_0 */
+	{0x2A, 0x800000, 3, 1}, /* AD7124_Offset_1 */
+	{0x2B, 0x800000, 3, 1}, /* AD7124_Offset_2 */
+	{0x2C, 0x800000, 3, 1}, /* AD7124_Offset_3 */
+	{0x2D, 0x800000, 3, 1}, /* AD7124_Offset_4 */
+	{0x2E, 0x800000, 3, 1}, /* AD7124_Offset_5 */
+	{0x2F, 0x800000, 3, 1}, /* AD7124_Offset_6 */
+	{0x30, 0x800000, 3, 1}, /* AD7124_Offset_7 */
+	{0x31, 0x500000, 3, 1}, /* AD7124_Gain_0 */
+	{0x32, 0x500000, 3, 1}, /* AD7124_Gain_1 */
+	{0x33, 0x500000, 3, 1}, /* AD7124_Gain_2 */
+	{0x34, 0x500000, 3, 1}, /* AD7124_Gain_3 */
+	{0x35, 0x500000, 3, 1}, /* AD7124_Gain_4 */
+	{0x36, 0x500000, 3, 1}, /* AD7124_Gain_5 */
+	{0x37, 0x500000, 3, 1}, /* AD7124_Gain_6 */
+	{0x38, 0x500000, 3, 1}, /* AD7124_Gain_7 */
+};
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7124/ad7124_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7124/ad7124_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,51 @@
+/***************************************************************************//**
+*   @file    ad7124-regs.h
+*   @brief   AD7124 register file.
+*   @devices AD7124-4, AD7124-8
+*
+********************************************************************************
+* Copyright 2015-2019(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+
+#ifndef __AD7124_REGS_H__
+#define __AD7124_REGS_H__
+
+#include "ad7124.h"
+
+/*! Array holding the info for the ad7124 registers - address, initial value,
+    size and access type. */
+extern struct ad7124_st_reg ad7124_regs[AD7124_REG_NO];
+
+#endif /* __AD7124_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad713x/ad713x.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad713x/ad713x.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,603 @@
+/***************************************************************************//**
+ *   @file   ad713x.c
+ *   @brief  Implementation of ad713x Driver.
+ *   @author SPopa (stefan.popa@analog.com)
+ *   @author Andrei Drimbarean (andrei.drimbarean@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdlib.h>
+#include "ad713x.h"
+
+/******************************************************************************/
+/***************************** Variable definition ****************************/
+/******************************************************************************/
+
+static const int ad713x_output_data_frame[3][9][2] = {
+	{
+		{ADC_16_BIT_DATA, CRC_6},
+		{ADC_24_BIT_DATA, CRC_6},
+		{ADC_32_BIT_DATA, NO_CRC},
+		{ADC_32_BIT_DATA, CRC_6},
+		{ADC_16_BIT_DATA, NO_CRC},
+		{ADC_24_BIT_DATA, NO_CRC},
+		{ADC_24_BIT_DATA, CRC_8},
+		{ADC_32_BIT_DATA, CRC_8},
+		{INVALID}
+	},
+	{
+		{ADC_16_BIT_DATA, NO_CRC},
+		{ADC_16_BIT_DATA, CRC_6},
+		{ADC_24_BIT_DATA, NO_CRC},
+		{ADC_24_BIT_DATA, CRC_6},
+		{ADC_16_BIT_DATA, CRC_8},
+		{ADC_24_BIT_DATA, CRC_8},
+		{INVALID}
+	},
+	{
+		{ADC_16_BIT_DATA, NO_CRC},
+		{ADC_16_BIT_DATA, CRC_6},
+		{ADC_16_BIT_DATA, CRC_8},
+		{INVALID}
+	},
+};
+
+/******************************************************************************/
+/************************** Functions Implementation **************************/
+/******************************************************************************/
+
+/**
+ * @brief Read from device.
+ * @param dev - The device structure.
+ * @param reg_addr - The register address.
+ * @param reg_data - The register data.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_spi_reg_read(struct ad713x_dev *dev,
+			    uint8_t reg_addr,
+			    uint8_t *reg_data)
+{
+	int32_t ret;
+	uint8_t buf[2];
+
+	buf[0] = AD713X_REG_READ(reg_addr);
+	buf[1] = 0x00;
+
+	ret = spi_write_and_read(dev->spi_desc, buf, 2);
+	if(IS_ERR_VALUE(ret))
+		return FAILURE;
+	*reg_data = buf[1];
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Write to device.
+ * @param dev - The device structure.
+ * @param reg_addr - The register address.
+ * @param reg_data - The register data.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_spi_reg_write(struct ad713x_dev *dev,
+			     uint8_t reg_addr,
+			     uint8_t reg_data)
+{
+	uint8_t buf[2];
+
+	buf[0] = reg_addr;
+	buf[1] = reg_data;
+
+	return spi_write_and_read(dev->spi_desc, buf, 2);
+}
+
+/**
+ * @brief SPI write to device using a mask.
+ * @param dev - The device structure.
+ * @param reg_addr - The register address.
+ * @param mask - The mask.
+ * @param data - The register data.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_spi_write_mask(struct ad713x_dev *dev,
+			      uint8_t reg_addr,
+			      uint32_t mask,
+			      uint8_t data)
+{
+	uint8_t reg_data;
+	int32_t ret;
+
+	ret = ad713x_spi_reg_read(dev, reg_addr, &reg_data);
+	if(IS_ERR_VALUE(ret))
+		return FAILURE;
+	reg_data &= ~mask;
+	reg_data |= data;
+
+	return ad713x_spi_reg_write(dev, reg_addr, reg_data);
+}
+
+/**
+ * @brief Device power mode control.
+ * @param dev - The device structure.
+ * @param mode - Type of power mode
+ * 			Accepted values: LOW_POWER
+ * 					 HIGH_POWER
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_set_power_mode(struct ad713x_dev *dev,
+			      enum ad713x_power_mode mode)
+{
+	if (mode == LOW_POWER)
+		return ad713x_spi_write_mask(dev, AD713X_REG_DEVICE_CONFIG,
+					     AD713X_DEV_CONFIG_PWR_MODE_MSK, 0);
+	else if (mode == HIGH_POWER)
+		return ad713x_spi_write_mask(dev, AD713X_REG_DEVICE_CONFIG,
+					     AD713X_DEV_CONFIG_PWR_MODE_MSK,
+					     1);
+
+	return FAILURE;
+}
+
+/**
+ * @brief ADC conversion data output frame control.
+ * @param dev - The device structure.
+ * @param adc_data_len - Data conversion length
+ * 				Accepted values: ADC_16_BIT_DATA
+ * 						 ADC_24_BIT_DATA
+ * 						 ADC_32_BIT_DATA
+ * @param crc_header - CRC header
+ * 				Accepted values: NO_CRC
+ * 						 CRC_6
+ * 						 CRC_8
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev,
+				  enum ad713x_adc_data_len adc_data_len,
+				  enum ad713x_crc_header crc_header)
+{
+	uint8_t id;
+	uint8_t i = 0;
+
+	id = dev->dev_id;
+
+	while (ad713x_output_data_frame[id][i][0] != INVALID) {
+		if((adc_data_len == ad713x_output_data_frame[id][i][0]) &&
+		    (crc_header == ad713x_output_data_frame[id][i][1])) {
+			return ad713x_spi_write_mask(dev,
+						     AD713X_REG_DATA_PACKET_CONFIG,
+						     AD713X_DATA_PACKET_CONFIG_FRAME_MSK,
+						     AD713X_DATA_PACKET_CONFIG_FRAME_MODE(i));
+		}
+		i++;
+	}
+
+	return FAILURE;
+}
+
+/**
+ * @brief DOUTx output format configuration.
+ * @param dev - The device structure.
+ * @param format - Single channel daisy chain mode. Dual channel daisy chain mode.
+ * 		   Quad channel parallel output mode. Channel data averaging mode.
+ * 			Accepted values: SINGLE_CH_DC
+ * 					 DUAL_CH_DC
+ * 					 QUAD_CH_PO
+ * 					 CH_AVG_MODE
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_dout_format_config(struct ad713x_dev *dev,
+				  enum ad713x_doutx_format format)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_DIGITAL_INTERFACE_CONFIG,
+				     AD713X_DIG_INT_CONFIG_FORMAT_MSK,
+				     AD713X_DIG_INT_CONFIG_FORMAT_MODE(format));
+}
+
+/**
+ * @brief Magnitude and phase matching calibration clock delay enable for all
+ *        channels at 2 clock delay.
+ *        This function is kept for backwards compatibility with the current
+ *        application source, but it is deprecated. Use
+ *        ad713x_mag_phase_clk_delay_chan().
+ * @param dev - The device structure.
+ * @param clk_delay_en - Enable or disable Mag/Phase clock delay.
+ * 				Accepted values: true
+ * 						         false
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev,
+				   bool clk_delay_en)
+{
+	int32_t ret;
+	int8_t i;
+	int8_t temp_clk_delay;
+
+	if (clk_delay_en)
+		temp_clk_delay = DELAY_2_CLOCKS;
+	else
+		temp_clk_delay = DELAY_NONE;
+
+	for (i = CH3; i >= 0; i--) {
+		ret = ad713x_spi_write_mask(dev, AD713X_REG_MPC_CONFIG,
+					    AD713X_MPC_CLKDEL_EN_CH_MSK(i),
+					    AD713X_MPC_CLKDEL_EN_CH_MODE(temp_clk_delay, i));
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Change magnitude and phase calibration clock delay mode for a specific
+ *        channel.
+ * @param dev - The device structure.
+ * @param chan - ID of the channel to be changed.
+ * 				Accepted values: CH0, CH1, CH2, CH3
+ * @param mode - Delay in clock periods.
+ * 				Accepted values: DELAY_NONE,
+ * 						 DELAY_1_CLOCKS,
+ *						 DELAY_2_CLOCKS
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_mag_phase_clk_delay_chan(struct ad713x_dev *dev,
+					enum ad713x_channels chan,
+					enum ad717x_mpc_clkdel mode)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_MPC_CONFIG,
+				     AD713X_MPC_CLKDEL_EN_CH_MSK(chan),
+				     AD713X_MPC_CLKDEL_EN_CH_MODE(mode, chan));
+}
+
+/**
+ * @brief Digital filter type selection for each channel
+ * @param dev - The device structure.
+ * @param filter - Type of filter: Wideband, Sinc6, Sinc3,
+ * 				   Sinc3 filter with simultaneous 50Hz and 60Hz rejection.
+ * 				   	Accepted values: FIR
+ * 							 SINC6
+ * 							 SINC3
+ * 							 SINC3_50_60_REJ
+ * @param ch - Channel to apply the filter to
+ * 					Accepted values: CH0
+ * 							 CH1
+ * 							 CH2
+ * 							 CH3
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev,
+				 enum ad713x_dig_filter_sel filter,
+				 enum ad713x_channels ch)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_CHAN_DIG_FILTER_SEL,
+				     AD713X_DIGFILTER_SEL_CH_MSK(ch),
+				     AD713X_DIGFILTER_SEL_CH_MODE(filter, ch));
+}
+
+/**
+ * @brief Enable/Disable CLKOUT output.
+ * @param [in] dev - The device structure.
+ * @param [in] enable - true to enable the clkout output;
+ *                      false to disable the clkout output.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_clkout_output_en(struct ad713x_dev *dev, bool enable)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_DEVICE_CONFIG1,
+				     AD713X_DEV_CONFIG1_CLKOUT_EN_MSK,
+				     enable ? AD713X_DEV_CONFIG1_CLKOUT_EN_MSK : 0);
+}
+
+/**
+ * @brief Enable/Disable reference gain correction.
+ * @param [in] dev - The device structure.
+ * @param [in] enable - true to enable the reference gain correction;
+ *                      false to disable the reference gain correction.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev, bool enable)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_DEVICE_CONFIG1,
+				     AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK,
+				     enable ? AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK : 0);
+}
+
+/**
+ * @brief Select the wideband filter bandwidth for a channel.
+ *        The option is relative to ODR, so it's a fraction of it.
+ * @param [in] dev - The device structure.
+ * @param [in] ch - Number of the channel to which to set the wideband filter
+ *                  option.
+ * @param [in] wb_opt - Option to set the wideband filter:
+ *                      Values are:
+ *                          0 - bandwidth of 0.443 * ODR;
+ *                          1 - bandwidth of 0.10825 * ODR.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev,
+			       enum ad713x_channels ch, uint8_t wb_opt)
+{
+	return ad713x_spi_write_mask(dev, AD713X_REG_FIR_BW_SEL,
+				     AD713X_FIR_BW_SEL_CH_MSK(ch),
+				     wb_opt ? AD713X_FIR_BW_SEL_CH_MSK(ch) : 0);
+}
+
+/**
+ * @brief Initialize GPIO driver handlers for the GPIOs in the system.
+ *        ad713x_init() helper function.
+ * @param [out] dev - AD713X device handler.
+ * @param [in] init_param - Pointer to the initialization structure.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+static int32_t ad713x_init_gpio(struct ad713x_dev *dev,
+				struct ad713x_init_param *init_param)
+{
+
+	int32_t ret;
+
+	ret = gpio_get_optional(&dev->gpio_mode, init_param->gpio_mode);
+	if (IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	ret = gpio_get_optional(&dev->gpio_dclkmode, init_param->gpio_dclkmode);
+	if (IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	ret = gpio_get_optional(&dev->gpio_dclkio, init_param->gpio_dclkio);
+	if (IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	ret = gpio_get_optional(&dev->gpio_resetn, init_param->gpio_resetn);
+	if (IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	ret = gpio_get_optional(&dev->gpio_pnd, init_param->gpio_pnd);
+	if (IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	/** Tie this pin to IOVDD for master mode operation, tie this pin to
+	 *  IOGND for slave mode operation. */
+	if (init_param->gpio_mode) {
+		ret = gpio_direction_output(dev->gpio_mode,
+					    init_param->mode_master_nslave);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	/* Tie this pin low to ground to make DLCK operating in gated mode */
+	if (init_param->gpio_dclkmode) {
+		ret = gpio_direction_output(dev->gpio_dclkmode,
+					    init_param->dclkmode_free_ngated);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	/** Tie this pin high to make DCLK an output, tie this pin low to make
+	 *  DLCK an input. */
+	if (init_param->gpio_dclkio) {
+		ret = gpio_direction_output(dev->gpio_dclkio,
+					    init_param->dclkio_out_nin);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	/** Get the ADCs out of power down state */
+	if (init_param->gpio_pnd) {
+		ret = gpio_direction_output(dev->gpio_pnd, init_param->pnd);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	/** Reset to configure pins */
+	if (init_param->gpio_resetn) {
+		ret = gpio_direction_output(dev->gpio_resetn, false);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+		mdelay(100);
+		ret = gpio_set_value(dev->gpio_resetn, true);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+		mdelay(100);
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Free the resources allocated by ad713x_init_gpio().
+ * @param dev - The device structure.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+static int32_t ad713x_remove_gpio(struct ad713x_dev *dev)
+{
+	int32_t ret;
+
+	if (dev->gpio_dclkio) {
+		ret = gpio_remove(dev->gpio_dclkio);
+		if(IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+	if (dev->gpio_dclkio) {
+		ret = gpio_remove(dev->gpio_dclkmode);
+		if(IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+	if (dev->gpio_mode) {
+		ret = gpio_remove(dev->gpio_mode);
+		if(IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+	if (dev->gpio_pnd) {
+		ret = gpio_remove(dev->gpio_pnd);
+		if(IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+	if (dev->gpio_resetn) {
+		ret = gpio_remove(dev->gpio_resetn);
+		if(IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Initialize the wideband filter bandwidth for every channel.
+ *        ad713x_init() helper function.
+ * @param [in] dev - AD713X device handler.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+static int32_t ad713x_init_chan_bw(struct ad713x_dev *dev)
+{
+	int8_t i;
+	int32_t ret;
+
+	for (i = CH3; i >= 0; i--) {
+		ret = ad713x_wideband_bw_sel(dev, i, 0);
+		if (IS_ERR_VALUE(ret))
+			return FAILURE;
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Initialize the device.
+ * @param device - The device structure.
+ * @param init_param - The structure that contains the device initial
+ *                     parameters.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t ad713x_init(struct ad713x_dev **device,
+		    struct ad713x_init_param *init_param)
+{
+	struct ad713x_dev *dev;
+	int32_t ret;
+	uint8_t data;
+
+	dev = (struct ad713x_dev *)calloc(1, sizeof(*dev));
+	if (!dev)
+		return FAILURE;
+
+	if (!init_param->spi_common_dev) {
+		ret = spi_init(&dev->spi_desc, &init_param->spi_init_prm);
+		if (IS_ERR_VALUE(ret))
+			goto error_dev;
+	} else {
+		dev->spi_desc = calloc(1, sizeof *dev->spi_desc);
+		dev->spi_desc->chip_select = init_param->spi_init_prm.chip_select;
+		dev->spi_desc->extra = init_param->spi_common_dev->extra;
+		dev->spi_desc->max_speed_hz = init_param->spi_init_prm.max_speed_hz;
+		dev->spi_desc->mode = init_param->spi_init_prm.mode;
+	}
+
+	ret = ad713x_init_gpio(dev, init_param);
+	if(IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	dev->dev_id = init_param->dev_id;
+
+	ret = ad713x_spi_reg_read(dev, AD713X_REG_DEVICE_CONFIG, &data);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+	data |= AD713X_DEV_CONFIG_PWR_MODE_MSK;
+	ret = ad713x_spi_reg_write(dev, AD713X_REG_DEVICE_CONFIG, data);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_clkout_output_en(dev, true);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_ref_gain_correction_en(dev, true);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_set_out_data_frame(dev, init_param->adc_data_len,
+					init_param->crc_header);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_dout_format_config(dev, init_param->format);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_mag_phase_clk_delay(dev, init_param->clk_delay_en);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	ret = ad713x_init_chan_bw(dev);
+	if (IS_ERR_VALUE(ret))
+		goto error_gpio;
+
+	*device = dev;
+
+	return SUCCESS;
+
+error_gpio:
+	ad713x_remove_gpio(dev);
+error_dev:
+	ad713x_remove(dev);
+
+	return FAILURE;
+}
+
+/**
+ * @brief Free the resources allocated by ad713x_init().
+ * @param dev - The device structure.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t ad713x_remove(struct ad713x_dev *dev)
+{
+	int32_t ret;
+
+	if(!dev)
+		return FAILURE;
+
+	ret = spi_remove(dev->spi_desc);
+	if(IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	ret = ad713x_remove_gpio(dev);
+	if(IS_ERR_VALUE(ret))
+		return FAILURE;
+
+	free(dev);
+
+	return SUCCESS;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad713x/ad713x.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad713x/ad713x.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,789 @@
+/***************************************************************************//**
+ *   @file   ad713x.h
+ *   @brief  Header file for the ad713x Driver.
+ *   @author SPopa (stefan.popa@analog.com)
+ *   @author Andrei Drimbarean (andrei.drimbarean@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef SRC_AD713X_H_
+#define SRC_AD713X_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdbool.h>
+#include <stdio.h>
+
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+/*
+ * AD713X registers definition
+ */
+#define AD713X_REG_INTERFACE_CONFIG_A		0x00
+#define AD713X_REG_INTERFACE_CONFIG_B		0x01
+#define AD713X_REG_DEVICE_CONFIG		0x02
+#define AD713X_REG_CHIP_TYPE			0x03
+#define AD713X_REG_PRODUCT_ID_LSB		0x04
+#define AD713X_REG_PRODUCT_ID_MSB		0x05
+#define AD713X_REG_CHIP_GRADE			0x06
+#define AD713X_REG_CHIP_INDEX			0x07
+#define AD713X_REG_SCTATCH_PAD			0x0A
+#define AD713X_REG_SPI_REVISION			0x0B
+#define AD713X_REG_VENDOR_ID_LSB		0x0C
+#define AD713X_REG_VENDOR_ID_MSB		0x0D
+#define AD713X_REG_STREAM_MODE			0x0E
+#define AD713X_REG_TRANSFER_REGISTER		0x0F
+#define AD713X_REG_DEVICE_CONFIG1		0x10
+#define AD713X_REG_DATA_PACKET_CONFIG		0x11
+#define AD713X_REG_DIGITAL_INTERFACE_CONFIG	0x12
+#define AD713X_REG_POWER_DOWN_CONTROL		0x13
+#define AD713X_REG_AIN_RANGE_SELECT		0x14
+#define AD713X_REG_DEVICE_STATUS		0x15
+#define AD713X_REG_ODR_VAL_INT_LSB		0x16
+#define AD713X_REG_ODR_VAL_INT_MID		0x17
+#define AD713X_REG_ODR_VAL_INT_MSB		0x18
+#define AD713X_REG_ODR_VAL_FLT_LSB		0x19
+#define AD713X_REG_ODR_VAL_FLT_MID0		0x1A
+#define AD713X_REG_ODR_VAL_FLT_MID1		0x1B
+#define AD713X_REG_ODR_VAL_FLT_MSB		0x1C
+#define AD713X_REG_CHANNEL_ODR_SELECT		0x1D
+#define AD713X_REG_CHAN_DIG_FILTER_SEL		0x1E
+#define AD713X_REG_FIR_BW_SEL			0x1F
+#define AD713X_REG_GPIO_DIR_CTRL		0x20
+#define AD713X_REG_GPIO_DATA			0x21
+#define AD713X_REG_ERROR_PIN_SRC_CONTROL	0x22
+#define AD713X_REG_ERROR_PIN_CONTROL		0x23
+#define AD713X_REG_VCMBUF_CTRL			0x24
+#define AD713X_REG_DIAGNOSTIC_CONTROL		0x25
+#define AD713X_REG_MPC_CONFIG			0x26
+#define AD713X_REG_CH0_GAIN_LSB			0x27
+#define AD713X_REG_CH0_GAIN_MID			0x28
+#define AD713X_REG_CH0_GAIN_MSB			0x29
+#define AD713X_REG_CH0_OFFSET_LSB		0x2A
+#define AD713X_REG_CH0_OFFSET_MID		0x2B
+#define AD713X_REG_CH0_OFFSET_MSB		0x2C
+#define AD713X_REG_CH1_GAIN_LSB			0x2D
+#define AD713X_REG_CH1_GAIN_MID			0x2E
+#define AD713X_REG_CH1_GAIN_MSB			0x2F
+#define AD713X_REG_CH1_OFFSET_LSB		0x30
+#define AD713X_REG_CH1_OFFSET_MID		0x31
+#define AD713X_REG_CH1_OFFSET_MSB		0x32
+#define AD713X_REG_CH2_GAIN_LSB			0x33
+#define AD713X_REG_CH2_GAIN_MID			0x34
+#define AD713X_REG_CH2_GAIN_MSB			0x35
+#define AD713X_REG_CH2_OFFSET_LSB		0x36
+#define AD713X_REG_CH2_OFFSET_MID		0x37
+#define AD713X_REG_CH2_OFFSET_MSB		0x38
+#define AD713X_REG_CH3_GAIN_LSB			0x39
+#define AD713X_REG_CH3_GAIN_MID			0x3A
+#define AD713X_REG_CH3_GAIN_MSB			0x3B
+#define AD713X_REG_CH3_OFFSET_LSB		0x3C
+#define AD713X_REG_CH3_OFFSET_MID		0x3D
+#define AD713X_REG_CH3_OFFSET_MSB		0x3E
+#define AD713X_REG_MCLK_COUNTER			0x3F
+#define AD713X_REG_DIG_FILTER_OFUF		0x40
+#define AD713X_REG_DIG_FILTER_SETTLED		0x41
+#define AD713X_REG_INTERNAL_ERROR		0x42
+#define AD713X_REG_POWER_OV_ERROR_1		0x43
+#define AD713X_REG_POWER_UV_ERROR_1		0x44
+#define AD713X_REG_POWER_OV_ERROR_2		0x45
+#define AD713X_REG_POWER_UV_ERROR_2		0x46
+#define AD713X_REG_SPI_ERROR			0x47
+#define AD713X_REG_AIN_OR_ERROR			0x48
+#define AD713X_REG_AVDD5_VALUE			0x49
+#define AD713X_REG_DVDD5_VALUE			0x4A
+#define AD713X_REG_VREF_VALUE			0x4B
+#define AD713X_REG_LDOIN_VALUE			0x4C
+#define AD713X_REG_AVDD1V8_VALUE		0x4D
+#define AD713X_REG_DVDD1V8_VALUE		0x4E
+#define AD713X_REG_CLKVDD_VALUE			0x4F
+#define AD713X_REG_IOVDD_VALUE			0x50
+#define AD713X_REG_TEMPERATURE_DATA		0x51
+
+/*
+ * AD713X_REG_INTERFACE_CONFIG_A
+ */
+#define AD713X_INT_CONFIG_A_SOFT_RESET_MSK		BIT(7)
+#define AD713X_INT_CONFIG_A_ADDR_ASC_BIT_MSK		BIT(5)
+#define AD713X_INT_CONFIG_A_SDO_ACTIVE_BIT_MSK		BIT(4)
+#define AD713X_INT_CONFIG_A_SOFT_RESET_MIRR_MSK		BIT(0)
+#define AD713X_INT_CONFIG_A_ADDR_ASC_MIRR_MSK		BIT(2)
+#define AD713X_INT_CONFIG_A_SDO_ACTIVE_MIRR_MSK		BIT(3)
+
+/*
+ * AD713X_REG_INTERFACE_CONFIG_B
+ */
+#define AD713X_INT_CONFIG_B_SINGLE_INSTR_MSK		BIT(7)
+#define AD713X_INT_CONFIG_B_M_S_RD_CTRL_MSK		BIT(5)
+#define AD713X_INT_CONFIG_B_DIG_IF_RST_MSK		BIT(1)
+
+/*
+ * AD713X_REG_DEVICE_CONFIG
+ */
+#define AD713X_DEV_CONFIG_OP_IN_PROGRESS_MSK		BIT(5)
+#define AD713X_DEV_CONFIG_NO_CHIP_ERR_MSK		BIT(4)
+#define AD713X_DEV_CONFIG_PWR_MODE_MSK			BIT(0)
+
+/*
+ * AD713X_REG_CHIP_TYPE
+ */
+#define AD713X_CHIP_TYPE_BITS_MSK			GENMASK(7, 0)
+#define AD713X_CHIP_TYPE_BITS_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_PRODUCT_ID_LSB
+ */
+#define AD713X_PRODUCT_ID_LSB_BITS_MSK			GENMASK(7, 0)
+#define AD713X_PRODUCT_ID_LSB_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_PRODUCT_ID_MSB
+ */
+#define AD713X_PRODUCT_ID_MSB_BITS_MSK			GENMASK(7, 0)
+#define AD713X_PRODUCT_ID_MSB_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHIP_GRADE
+ */
+#define AD713X_CHIP_GRADE_PROD_GRADE_BITS_MSK		GENMASK(7, 4)
+#define AD713X_CHIP_GRADE_PROD_GRADE_BITS_MODE(x) 	(((x) & 0x0F) << 4)
+#define AD713X_CHIP_GRADE_DEV_VERSION_BITS_MSK		GENMASK(3, 0)
+#define AD713X_CHIP_GRADE_DEV_VERSION_BITS_MODE(x) 	(((x) & 0x0F) << 0)
+
+/*
+ * AD713X_REG_CHIP_INDEX
+ */
+#define AD713X_SILICON_REV_ID_BITS_MSK			GENMASK(7, 0)
+#define AD713X_SILICON_REV_ID_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_SCRATCH_PAD
+ */
+#define AD713X_SCRATCH_PAD_BITS_MSK			GENMASK(7, 0)
+#define AD713X_SCRATCH_PAD_BITS_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_SPI_REVISION
+ */
+#define AD713X_SPI_REVISION_BITS_MSK			GENMASK(7, 0)
+#define AD713X_SPI_REVISION_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_VENDOR_ID_LSB
+ */
+#define AD713X_VENDOR_ID_LSB_BITS_MSK			GENMASK(7, 0)
+#define AD713X_VENDOR_ID_LSB_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_VENDOR_ID_MSB
+ */
+#define AD713X_VENDOR_ID_MSB_BITS_MSK			GENMASK(7, 0)
+#define AD713X_VENDOR_ID_MSB_BITS_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_STREAM_MODE
+ */
+#define AD713X_STREAM_MODE_BITS_MSK			GENMASK(7, 0)
+#define AD713X_STREAM_MODE_BITS_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_TRANSFER_REGISTER
+ */
+#define AD713X_TRANSFER_MASTER_SLAVE_TX_BIT_MSK		BIT(0)
+
+/*
+ * AD713X_REG_DEVICE_CONFIG1
+ */
+#define AD713X_DEV_CONFIG1_MPC_MAGPHA_EN_MSK		BIT(6)
+#define AD713X_DEV_CONFIG1_MPC_MAG_EN_MSK		BIT(5)
+#define AD713X_DEV_CONFIG1_AA_MODE_MSK			BIT(4)
+#define AD713X_DEV_CONFIG1_SDO_PIN_SRC_SEL_MSK		BIT(2)
+#define AD713X_DEV_CONFIG1_REF_GAIN_CORR_EN_MSK		BIT(1)
+#define AD713X_DEV_CONFIG1_CLKOUT_EN_MSK		BIT(0)
+
+/*
+ * AD713X_REG_DATA_PACKET_CONFIG
+ */
+#define AD713X_DATA_PACKET_CONFIG_CRC_POLY_RST_MSK	BIT(7)
+#define AD713X_DATA_PACKET_CONFIG_FRAME_MSK		GENMASK(6, 4)
+#define AD713X_DATA_PACKET_CONFIG_FRAME_MODE(x)		(((x) & 0x7) << 4)
+#define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MSK		GENMASK(3, 0)
+#define AD713X_DATA_PACKET_CONFIG_DCLK_FREQ_MODE(x)	(((x) & 0xF) << 0)
+
+/*
+ * AD713X_REG_DIGITAL_INTERFACE_CONFIG
+ */
+#define AD713X_DIG_INT_CONFIG_DAISY_CHAIN_NUM_MSK	GENMASK(7, 4)
+#define AD713X_DIG_INT_CONFIG_DAISY_CHAIN_NUM_MODE(x)	(((x) & 0xF) << 4)
+#define AD713X_DIG_INT_CONFIG_AVG_SEL_MSK		GENMASK(3, 2)
+#define AD713X_DIG_INT_CONFIG_AVG_SEL_MODE(x)		(((x) & 0x3) << 2)
+#define AD713X_DIG_INT_CONFIG_FORMAT_MSK		GENMASK(1, 0)
+#define AD713X_DIG_INT_CONFIG_FORMAT_MODE(x)		(((x) & 0x3) << 0)
+
+/*
+ * AD713X_REG_POWER_DOWN_CONTROL
+ */
+#define AD713X_PWRDN_CTRL_PWRDN_CH_MSK(ch)		BIT(ch)
+#define AD713X_PWRDN_CTRL_PWRDN_AUXADC_MSK		BIT(2)
+#define AD713X_PWRDN_CTRL_PWRDN_LDO_MSK			BIT(1)
+#define AD713X_PWRDN_CTRL_PWRDN_SLEEP_MODE_EN_MSK	BIT(0)
+
+/*
+ * AD713X_REG_AIN_RANGE_SELECT
+ */
+#define AD713X_AIN_RANGE_SEL_CH_MSK(ch)			BIT(ch)
+
+/*
+ * AD713X_REG_DEVICE_STATUS
+ */
+#define AD713X_DEV_STAT_DCLKMODE_MSK			BIT(5)
+#define AD713X_DEV_STAT_DCLKIO_MSK			BIT(4)
+#define AD713X_DEV_STAT_MODE_MSK			BIT(3)
+#define AD713X_DEV_STAT_CLKSEL_MSK			BIT(2)
+#define AD713X_DEV_STAT_FUSE_ECC_MSK			BIT(1)
+#define AD713X_DEV_STAT_PLL_LOCK_MSK			BIT(0)
+
+/*
+ * AD713X_REG_ODR_VAL_INT_LSB
+ */
+#define AD713X_ODR_VAL_INT_LSB_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_INT_LSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_INT_MID
+ */
+#define AD713X_ODR_VAL_INT_MID_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_INT_MID_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_INT_MSB
+ */
+#define AD713X_ODR_VAL_INT_MSB_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_INT_MSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_FLT_LSB
+ */
+#define AD713X_ODR_VAL_FLT_LSB_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_FLT_LSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_FLT_MID0
+ */
+#define AD713X_ODR_VAL_FLT_MID0_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_FLT_MID0_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_FLT_MID1
+ */
+#define AD713X_ODR_VAL_FLT_MID1_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_FLT_MID1_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ODR_VAL_FLT_MSB
+ */
+#define AD713X_ODR_VAL_FLT_MSB_MSK			GENMASK(7, 0)
+#define AD713X_ODR_VAL_FLT_MSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHANNEL_ODR_SELECT
+ */
+#define AD713X_ODR_RATE_SEL_CH_MSK(ch)			(GENMASK(1, 0) << (2 * ch))
+#define AD713X_ODR_RATE_SEL_CH_MODE(x, ch)		(((x) & 0x3) << (2 * ch))
+
+/*
+ * AD713X_REG_CHAN_DIG_FILTER_SEL
+ */
+#define AD713X_DIGFILTER_SEL_CH_MSK(ch)			(GENMASK(1, 0) << (2 * ch))
+#define AD713X_DIGFILTER_SEL_CH_MODE(x, ch)		(((x) & 0x3) << (2 * ch))
+
+/*
+ * AD713X_REG_FIR_BW_SEL
+ */
+#define AD713X_FIR_BW_SEL_CH_MSK(ch)			BIT(ch)
+
+/*
+ * AD713X_REG_GPIO_DIR_CTRL
+ */
+#define AD713X_GPIO_IO_CTRL_MSK				GENMASK(7, 0)
+#define AD713X_GPIO_IO_CTRL_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_GPIO_DATA
+ */
+#define AD713X_GPIO_DATA_MSK				GENMASK(7, 0)
+#define AD713X_GPIO_DATA_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_ERROR_PIN_SRC_CONTROL
+ */
+#define AD713X_ERR_PIN_EN_OR_AIN_MSK			BIT(5)
+#define AD713X_ERR_PIN_EN_INTERNAL_MSK			BIT(4)
+#define AD713X_ERR_PIN_EN_SPI_MSK			BIT(3)
+#define AD713X_ERR_PIN_EN_LDO_XOSC_MSK			BIT(2)
+#define AD713X_ERR_PIN_EN_TEMP_MSK			BIT(1)
+#define AD713X_ERR_PIN_EN_PWR_MSK			BIT(0)
+
+/*
+ * AD713X_REG_ERROR_PIN_CONTROL
+ */
+#define AD713X_ERR_PIN_IN_STATUS_MSK			BIT(2)
+#define AD713X_ERR_PIN_IN_EN_MSK			BIT(1)
+#define AD713X_ERR_PIN_OUT_EN_MSK			BIT(0)
+
+/*
+ * AD713X_REG_VCMBUF_CTRL
+ */
+#define AD713X_VCMBUF_CTRL_PWRDN_MSK			BIT(6)
+#define AD713X_VCMBUF_CTRL_REF_DIV_SEL_MSK		GENMASK(5, 1)
+#define AD713X_VCMBUF_CTRL_REF_DIV_SEL_MODE(x)		(((x) & 0x1F) << 1)
+#define AD713X_VCMBUF_CTRL_REF_SEL_MSK			BIT(0)
+
+/*
+ * AD713X_REG_DIAGNOSTIC_CONTROL
+ */
+#define AD713X_DIAGCTRL_ERR_OR_AIN_EN_MSK		BIT(5)
+#define AD713X_DIAGCTRL_ERR_PWR_MON_EN_MSK		BIT(4)
+#define AD713X_DIAGCTRL_MCLK_CNT_EN_MSK			BIT(3)
+#define AD713X_DIAGCTRL_ERR_SPI_CRC_EN_MSK		BIT(2)
+#define AD713X_DIAGCTRL_ERR_MM_CRC_EN_MSK		BIT(1)
+#define AD713X_DIAGCTRL_FUSE_CRC_CHECK_MSK		BIT(0)
+
+/*
+ * AD713X_REG_MPC_CONFIG
+ */
+#define AD713X_MPC_CLKDEL_EN_CH_MSK(ch)			(GENMASK(1, 0) << (2 * ch))
+#define AD713X_MPC_CLKDEL_EN_CH_MODE(x, ch)		(((x) & 0x3) << (2 * ch))
+
+/*
+ * AD713X_REG_CHx_GAIN_LSB
+ */
+#define AD713X_CH_GAIN_LSB_MSK				GENMASK(7, 0)
+#define AD713X_CH_GAIN_LSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHx_GAIN_MID
+ */
+#define AD713X_CH_GAIN_MID_MSK				GENMASK(7, 0)
+#define AD713X_CH_GAIN_MID_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHx_GAIN_MSB
+ */
+#define AD713X_CH_GAIN_CAL_SEL_MSK			BIT(4)
+#define AD713X_CH_GAIN_MSB_MSK				GENMASK(3, 0)
+#define AD713X_CH_GAIN_MSB_MODE(x)			(((x) & 0xF) << 0)
+
+/*
+ * AD713X_REG_CHx_OFFSET_LSB
+ */
+#define AD713X_CH_OFFSET_LSB_MSK			GENMASK(7, 0)
+#define AD713X_CH_OFFSET_LSB_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHx_OFFSET_MID
+ */
+#define AD713X_CH_OFFSET_MID_MSK			GENMASK(7, 0)
+#define AD713X_CH_OFFSET_MID_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CHx_OFFSET_MSB
+ */
+#define AD713X_CH_OFFSET_CAL_EN_MSK			BIT(7)
+#define AD713X_CH_OFFSET_MSB_MSK			GENMASK(6, 0)
+#define AD713X_CH_OFFSET_MSB_MODE(x)			(((x) & 0x7F) << 0)
+
+/*
+ * AD713X_REG_MCLK_COUNTER
+ */
+#define AD713X_MCLK_COUNT_MSK				GENMASK(7, 0)
+#define AD713X_MCLK_COUNT_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_DIG_FILTER_OFUF
+ */
+#define AD713X_DIGFILTER_ERR_OFUF_CH_MSK(ch)		BIT(ch)
+
+/*
+ * AD713X_REG_DIG_FILTER_SETTLED
+ */
+#define AD713X_DIGFILTER_CH_SETTLED_MSK(ch)		BIT(ch)
+
+/*
+ * AD713X_REG_INTERNAL_ERROR
+ */
+#define AD713X_INT_ERR_NO_CLOCK_MSK			BIT(5)
+#define AD713X_INT_ERR_TEMP_MSK				BIT(4)
+#define AD713X_INT_ERR_DCLK_MSK				BIT(3)
+#define AD713X_INT_ERR_FUSE_CRC_MSK			BIT(2)
+#define AD713X_INT_ERR_ASRC_MSK				BIT(1)
+#define AD713X_INT_ERR_MM_CRC_MSK			BIT(0)
+
+/*
+ * AD713X_REG_POWER_OV_ERROR_1
+ */
+#define AD713X_POWER_ERR_OV_IOVDD_MSK			BIT(3)
+#define AD713X_POWER_ERR_OV_CLKVDD_MSK			BIT(2)
+#define AD713X_POWER_ERR_OV_DVDD1V8_MSK			BIT(1)
+#define AD713X_POWER_ERR_OV_AVDD1V8_MSK			BIT(0)
+
+/*
+ * AD713X_REG_POWER_UV_ERROR_1
+ */
+#define AD713X_POWER_ERR_UV_IOVDD_MSK			BIT(3)
+#define AD713X_POWER_ERR_UV_CLKVDD_MSK			BIT(2)
+#define AD713X_POWER_ERR_UV_DVDD1V8_MSK			BIT(1)
+#define AD713X_POWER_ERR_UV_AVDD1V8_MSK			BIT(0)
+
+/*
+ * AD713X_REG_POWER_OV_ERROR_2
+ */
+#define AD713X_POWER_ERR_OV_VREF_MSK			BIT(3)
+#define AD713X_POWER_ERR_OV_LDOIN_MSK			BIT(2)
+#define AD713X_POWER_ERR_OV_DVDD5_MSK			BIT(1)
+#define AD713X_POWER_ERR_OV_AVDD5_MSK			BIT(0)
+
+/*
+ * AD713X_REG_POWER_UV_ERROR_2
+ */
+#define AD713X_POWER_ERR_UV_VREF_MSK			BIT(3)
+#define AD713X_POWER_ERR_UV_LDOIN_MSK			BIT(2)
+#define AD713X_POWER_ERR_UV_DVDD5_MSK			BIT(1)
+#define AD713X_POWER_ERR_UV_AVDD5_MSK			BIT(0)
+
+/*
+ * AD713X_REG_SPI_ERROR
+ */
+#define AD713X_SPI_ERROR_CRC_MSK			BIT(3)
+#define AD713X_SPI_ERROR_SCLK_CNT_MSK			BIT(2)
+#define AD713X_SPI_ERROR_WRITE_MSK			BIT(1)
+#define AD713X_SPI_ERROR_READ_MSK			BIT(0)
+
+/*
+ * AD713X_REG_AIN_OR_ERROR
+ */
+#define AD713X_ERR_OR_AIN_MSK(ch)			BIT(ch)
+
+/*
+ * AD713X_REG_AVDD5_VALUE
+ */
+#define AD713X_AVDD5_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_AVDD5_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_DVDD5_VALUE
+ */
+#define AD713X_DVDD5_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_DVDD5_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_VREF_VALUE
+ */
+#define AD713X_VREF_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_VREF_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_LDOIN_VALUE
+ */
+#define AD713X_LDOIN_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_LDOIN_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_AVDD1V8_VALUE
+ */
+#define AD713X_AVDD1V8_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_AVDD1V8_VALUE_PIN_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_DVDD1V8_VALUE
+ */
+#define AD713X_DVDD1V8_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_DVDD1V8_VALUE_PIN_MODE(x)		(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_CLKVDD_VALUE
+ */
+#define AD713X_CLKVDD_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_CLKVDD_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_IOVDD_VALUE
+ */
+#define AD713X_IOVDD_VALUE_PIN_MSK			GENMASK(7, 0)
+#define AD713X_IOVDD_VALUE_PIN_MODE(x)			(((x) & 0xFF) << 0)
+
+/*
+ * AD713X_REG_TEMPERATURE_DATA
+ */
+#define AD713X_TEMP_DATA_MSK				GENMASK(7, 0)
+#define AD713X_TEMP_DATA_MODE(x)			(((x) & 0xFF) << 0)
+
+#define AD713X_REG_READ(x)				((1 << 7) | (x & 0x7F))
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @enum ad713x_supported_dev_ids
+ * @brief ID of devices supported by the driver
+ */
+enum ad713x_supported_dev_ids {
+	ID_AD7132,
+	ID_AD7134,
+	ID_AD7136
+};
+
+/**
+ * @enum ad713x_power_mode
+ * @brief AD713x power modes
+ */
+enum ad713x_power_mode {
+	/** Low power mode option */
+	LOW_POWER,
+	/** Full power mode option */
+	HIGH_POWER
+};
+
+/**
+ * @enum ad713x_adc_data_len
+ * @brief AD713x possible number of bits per data sample
+ */
+enum ad713x_adc_data_len {
+	/** 16 bit data sample */
+	ADC_16_BIT_DATA,
+	/** 24 bit data sample */
+	ADC_24_BIT_DATA,
+	/** 32 bit data sample */
+	ADC_32_BIT_DATA,
+	/** To know when to stop when cycling between them */
+	INVALID
+};
+
+/**
+ * @enum ad713x_crc_header
+ * @brief AD713x possible data CRC header choices
+ */
+enum ad713x_crc_header {
+	/** Data sample comes with no CRC attached */
+	NO_CRC,
+	/** Data sample comes with 6-bit CRC attached */
+	CRC_6,
+	/** Data sample comes with 8-bit CRC attached */
+	CRC_8
+};
+
+/**
+ * @enum ad713x_doutx_format
+ * @brief AD713x list for possible output modes
+ */
+enum ad713x_doutx_format {
+	/** Single channel Daisy-chain mode */
+	SINGLE_CH_DC,
+	/** Dual channel Daisy-chain mode */
+	DUAL_CH_DC,
+	/** Quad-channel parallel output mode */
+	QUAD_CH_PO,
+	/** Channel average mode */
+	CH_AVG_MODE
+};
+
+/**
+ * @enum ad713x_dig_filter_sel
+ * @brief AD713x list of input filters.
+ */
+enum ad713x_dig_filter_sel {
+	/** Wideband filter (Finite impulse response) */
+	FIR,
+	/** Sinc6 filter */
+	SINC6,
+	/** Sinc3 filter */
+	SINC3,
+	/** Sinc3 filter with 50Hz and 60Hz rejection */
+	SINC3_50_60_REJ
+};
+
+/**
+ * @enum ad713x_channels
+ * @brief AD713x list of channels
+ */
+enum ad713x_channels {
+	/** Channel 0 */
+	CH0,
+	/** Channel 1 */
+	CH1,
+	/** Channel 2 */
+	CH2,
+	/** Channel 3 */
+	CH3
+};
+
+/**
+ * @enum ad717x_mpc_clkdel
+ * @brief AD713x list of clock delays
+ */
+enum ad717x_mpc_clkdel {
+	/** No delay */
+	DELAY_NONE,
+	/** One clock cycle delay */
+	DELAY_1_CLOCKS,
+	/** Two clock cycles delay */
+	DELAY_2_CLOCKS
+};
+
+/**
+ * @struct ad713x_dev
+ * @brief AD713x driver handler structure
+ */
+struct ad713x_dev {
+	/** SPI layer handler. */
+	struct spi_desc        	*spi_desc;
+	/** MODE GPIO handler. */
+	struct gpio_desc		*gpio_mode;
+	/** DCLKMODE GPIO handler. */
+	struct gpio_desc		*gpio_dclkmode;
+	/** DCLKIO GPIO handler. */
+	struct gpio_desc		*gpio_dclkio;
+	/** RESET GPIO handler. */
+	struct gpio_desc		*gpio_resetn;
+	/** PDN GPIO handler. */
+	struct gpio_desc		*gpio_pnd;
+	/** ID of supported device. */
+	enum ad713x_supported_dev_ids dev_id;
+	/** Length of data in bits. */
+	enum ad713x_adc_data_len	adc_data_len;
+	/** CRC option. */
+	enum ad713x_crc_header	crc_header;
+};
+
+/**
+ * @struct ad713x_init_param
+ * @brief AD713x driver initialization structure
+ */
+struct ad713x_init_param {
+	/** SPI layer initialization structure. */
+	struct spi_init_param spi_init_prm;
+	/** MODE GPIO initialization structure. */
+	struct gpio_init_param *gpio_mode;
+	/** DCLKMODE GPIO initialization structure. */
+	struct gpio_init_param *gpio_dclkmode;
+	/** DCLKIO GPIO initialization structure. */
+	struct gpio_init_param *gpio_dclkio;
+	/** RESET GPIO initialization structure. */
+	struct gpio_init_param *gpio_resetn;
+	/** PDN GPIO initialization structure. */
+	struct gpio_init_param *gpio_pnd;
+	/** MODE GPIO starting value */
+	bool mode_master_nslave;
+	/** DCLKMODE GPIO starting value */
+	bool dclkmode_free_ngated;
+	/** DCLKIO GPIO starting value */
+	bool dclkio_out_nin;
+	/** PDN GPIO starting value */
+	bool pnd;
+	/** ID of supported device. */
+	enum ad713x_supported_dev_ids dev_id;
+	/** Length of data in bits. */
+	enum ad713x_adc_data_len	adc_data_len;
+	/** CRC option. */
+	enum ad713x_crc_header	crc_header;
+	enum ad713x_doutx_format	format;
+	/** Clock delay state. */
+	bool 			clk_delay_en;
+	/** SPI layer handler if the SPI bus is shared with another device. In this
+	 *  case the SPI should not be initialized again. */
+	struct spi_desc *spi_common_dev;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/** Read from device. */
+int32_t ad713x_spi_reg_read(struct ad713x_dev *dev, uint8_t reg_addr,
+			    uint8_t *reg_data);
+
+/** Write to device. */
+int32_t ad713x_spi_reg_write(struct ad713x_dev *dev, uint8_t reg_addr,
+			     uint8_t reg_data);
+
+/** SPI write to device using a mask. */
+int32_t ad713x_spi_write_mask(struct ad713x_dev *dev, uint8_t reg_addr,
+			      uint32_t mask, uint8_t data);
+
+/** Device power mode control. */
+int32_t ad713x_set_power_mode(struct ad713x_dev *dev,
+			      enum ad713x_power_mode mode);
+
+/** ADC conversion data output frame control. */
+int32_t ad713x_set_out_data_frame(struct ad713x_dev *dev,
+				  enum ad713x_adc_data_len adc_data_len,
+				  enum ad713x_crc_header crc_header);
+
+/** DOUTx output format configuration. */
+int32_t ad713x_dout_format_config(struct ad713x_dev *dev,
+				  enum ad713x_doutx_format format);
+
+/** Magnitude and phase matching calibration clock delay enable for all channels
+ *  at 2 clock delay. */
+int32_t ad713x_mag_phase_clk_delay(struct ad713x_dev *dev, bool clk_delay_en);
+
+/** Digital filter type selection for each channel. */
+int32_t ad713x_dig_filter_sel_ch(struct ad713x_dev *dev,
+				 enum ad713x_dig_filter_sel filter, enum ad713x_channels ch);
+
+/** Enable/Disable CLKOUT output. */
+int32_t ad713x_clkout_output_en(struct ad713x_dev *dev, bool enable);
+
+/** Enable/Disable reference gain correction. */
+int32_t ad713x_ref_gain_correction_en(struct ad713x_dev *dev, bool enable);
+
+/** Select the wideband filter bandwidth for a channel. */
+int32_t ad713x_wideband_bw_sel(struct ad713x_dev *dev,
+			       enum ad713x_channels ch, uint8_t wb_opt);
+
+/** Initialize the device. */
+int32_t ad713x_init(struct ad713x_dev **device,
+		    struct ad713x_init_param *init_param);
+
+/** Free the resources allocated by ad713x_init(). */
+int32_t ad713x_remove(struct ad713x_dev *dev);
+
+#endif /* SRC_AD713X_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad411x_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad411x_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,127 @@
+/***************************************************************************//**
+*   @file   ad411x_regs.h
+*   @brief  ad4111 Registers Definitions.
+*   @author Andrei Drimbarean (andrei.drimbarean@analog.com)
+********************************************************************************
+* Copyright 2018(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef AD4111_CFG_H_
+#define AD4111_CFG_H_
+
+#include "ad717x.h"
+
+ad717x_st_reg ad4111_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{
+		AD717X_ADCMODE_REG,
+		AD717X_ADCMODE_REG_MODE(0),
+		2
+	},
+	{ AD717X_IFMODE_REG, 0x0000, 2 },
+	{ AD717X_REGCHECK_REG, 0x0000, 3 },
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{
+		AD717X_GPIOCON_REG,
+		AD717X_GPIOCON_REG_SYNC_EN,
+		2
+	},
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{ AD717X_CHMAP0_REG, 0x0000, 2 },
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_CHMAP4_REG, 0x0000, 2 },
+	{ AD717X_CHMAP5_REG, 0x0000, 2 },
+	{ AD717X_CHMAP6_REG, 0x0000, 2 },
+	{ AD717X_CHMAP7_REG, 0x0000, 2 },
+	{ AD717X_CHMAP8_REG, 0x0000, 2 },
+	{ AD717X_CHMAP9_REG, 0x0000, 2 },
+	{ AD717X_CHMAP10_REG, 0x0000, 2 },
+	{ AD717X_CHMAP11_REG, 0x0000, 2 },
+	{ AD717X_CHMAP12_REG, 0x0000, 2 },
+	{ AD717X_CHMAP13_REG, 0x0000, 2 },
+	{ AD717X_CHMAP14_REG, 0x0000, 2 },
+	{ AD717X_CHMAP15_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON1_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON2_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON3_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON4_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON5_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON6_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{ AD717X_SETUPCON7_REG, 0x0000 | AD717X_SETUP_CONF_REG_REF_SEL(2), 2 },
+	{
+		AD717X_FILTCON0_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON1_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON2_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON3_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON4_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON5_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON6_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{
+		AD717X_FILTCON7_REG, AD717X_FILT_CONF_REG_ENHFILT(2), 2
+	},
+	{AD717X_OFFSET0_REG, 0, 3 },
+	{AD717X_OFFSET1_REG, 0, 3 },
+	{AD717X_OFFSET2_REG, 0, 3 },
+	{AD717X_OFFSET3_REG, 0, 3 },
+	{AD717X_OFFSET4_REG, 0, 3 },
+	{AD717X_OFFSET5_REG, 0, 3 },
+	{AD717X_OFFSET6_REG, 0, 3 },
+	{AD717X_OFFSET7_REG, 0, 3 },
+	{AD717X_GAIN0_REG, 0, 3 },
+	{AD717X_GAIN1_REG, 0, 3 },
+	{AD717X_GAIN2_REG, 0, 3 },
+	{AD717X_GAIN3_REG, 0, 3 },
+	{AD717X_GAIN4_REG, 0, 3 },
+	{AD717X_GAIN5_REG, 0, 3 },
+	{AD717X_GAIN6_REG, 0, 3 },
+	{AD717X_GAIN7_REG, 0, 3 },
+};
+
+#endif /* AD4111_CFG_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7172_2_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7172_2_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,105 @@
+/**************************************************************************//**
+*   @file   AD7172_2_regs.h
+*   @brief  AD7172_2 Registers Definitions.
+*   @author dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7172_2_REGS_H__
+#define __AD7172_2_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7172_2_INIT
+/*! Array holding the info for the AD7172_2 registers - address, initial value, size */
+ad717x_st_reg ad7172_2_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2	},
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3},
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG,	0x0000,	2 },
+	{ AD717X_SETUPCON2_REG, 0x0000,	2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{ AD717X_OFFSET0_REG, 0, 3 },
+	{ AD717X_OFFSET1_REG, 0, 3 },
+	{ AD717X_OFFSET2_REG, 0, 3 },
+	{ AD717X_OFFSET3_REG, 0, 3 },
+	{ AD717X_GAIN0_REG, 0, 3 },
+	{ AD717X_GAIN1_REG, 0, 3 },
+	{ AD717X_GAIN2_REG, 0, 3 },
+	{ AD717X_GAIN3_REG, 0, 3 },
+};
+#endif
+
+#define AD7172_2_SLAVE_ID    1
+
+#endif /*__AD7172_2_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7172_4_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7172_4_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,141 @@
+/**************************************************************************//**
+*   @file   AD7172_4_regs.h
+*   @brief  AD7172_4 Registers Definitions.
+*   @author dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7172_4_REGS_H__
+#define __AD7172_4_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7172_4_INIT
+/*! Array holding the info for the AD7172_4 registers - address, initial value, size */
+ad717x_st_reg ad7172_4_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2 },
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3 },
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_CHMAP4_REG, 0x0000, 2 },
+	{ AD717X_CHMAP5_REG, 0x0000, 2 },
+	{ AD717X_CHMAP6_REG, 0x0000, 2 },
+	{ AD717X_CHMAP7_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON2_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON4_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON5_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON6_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON7_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON4_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON5_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON6_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON7_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{AD717X_OFFSET0_REG, 0, 3 },
+	{AD717X_OFFSET1_REG, 0, 3 },
+	{AD717X_OFFSET2_REG, 0, 3 },
+	{AD717X_OFFSET3_REG, 0, 3 },
+	{AD717X_OFFSET4_REG, 0, 3 },
+	{AD717X_OFFSET5_REG, 0, 3 },
+	{AD717X_OFFSET6_REG, 0, 3 },
+	{AD717X_OFFSET7_REG, 0, 3 },
+	{AD717X_GAIN0_REG, 0, 3 },
+	{AD717X_GAIN1_REG, 0, 3 },
+	{AD717X_GAIN2_REG, 0, 3 },
+	{AD717X_GAIN3_REG, 0, 3 },
+	{AD717X_GAIN5_REG, 0, 3 },
+	{AD717X_GAIN6_REG, 0, 3 },
+	{AD717X_GAIN7_REG, 0, 3 },
+	{AD717X_GAIN8_REG, 0, 3 },
+};
+#endif
+
+#define AD7172_4_SLAVE_ID    1
+
+#endif /*__AD7172_4_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7173_8_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7173_8_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,149 @@
+/**************************************************************************//**
+*   @file   AD7173_8_regs.h
+*   @brief  AD7173_8 Registers Definitions.
+*   @author dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7173_8_REGS_H__
+#define __AD7173_8_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7173_8_INIT
+/*! Array holding the info for the AD7173_8 registers - address, initial value, size */
+ad717x_st_reg ad7173_8_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2 },
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3 },
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_CHMAP4_REG, 0x0000, 2 },
+	{ AD717X_CHMAP5_REG, 0x0000, 2 },
+	{ AD717X_CHMAP6_REG, 0x0000, 2 },
+	{ AD717X_CHMAP7_REG, 0x0000, 2 },
+	{ AD717X_CHMAP8_REG, 0x0000, 2 },
+	{ AD717X_CHMAP9_REG, 0x0000, 2 },
+	{ AD717X_CHMAP10_REG, 0x0000, 2 },
+	{ AD717X_CHMAP11_REG, 0x0000, 2 },
+	{ AD717X_CHMAP12_REG, 0x0000, 2 },
+	{ AD717X_CHMAP13_REG, 0x0000, 2 },
+	{ AD717X_CHMAP14_REG, 0x0000, 2 },
+	{ AD717X_CHMAP15_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON2_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON4_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON5_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON6_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON7_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON4_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON5_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON6_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON7_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{AD717X_OFFSET0_REG, 0, 3 },
+	{AD717X_OFFSET1_REG, 0, 3 },
+	{AD717X_OFFSET2_REG, 0, 3 },
+	{AD717X_OFFSET3_REG, 0, 3 },
+	{AD717X_OFFSET4_REG, 0, 3 },
+	{AD717X_OFFSET5_REG, 0, 3 },
+	{AD717X_OFFSET6_REG, 0, 3 },
+	{AD717X_OFFSET7_REG, 0, 3 },
+	{AD717X_GAIN0_REG, 0, 3 },
+	{AD717X_GAIN1_REG, 0, 3 },
+	{AD717X_GAIN2_REG, 0, 3 },
+	{AD717X_GAIN3_REG, 0, 3 },
+	{AD717X_GAIN5_REG, 0, 3 },
+	{AD717X_GAIN6_REG, 0, 3 },
+	{AD717X_GAIN7_REG, 0, 3 },
+	{AD717X_GAIN8_REG, 0, 3 },
+};
+#endif
+
+#define AD7173_8_SLAVE_ID    1
+
+#endif /*__AD7173_8_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7175_2_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7175_2_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,105 @@
+/**************************************************************************//**
+*   @file   AD7175_2_regs.h
+*   @brief  AD7175_2 Registers Definitions.
+*   @author dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7175_2_REGS_H__
+#define __AD7175_2_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7175_2_INIT
+/*! Array holding the info for the AD7175_2 registers - address, initial value, size */
+ad717x_st_reg ad7175_2_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2	},
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3},
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG,	0x0000,	2 },
+	{ AD717X_SETUPCON2_REG, 0x0000,	2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{ AD717X_OFFSET0_REG, 0, 3 },
+	{ AD717X_OFFSET1_REG, 0, 3 },
+	{ AD717X_OFFSET2_REG, 0, 3 },
+	{ AD717X_OFFSET3_REG, 0, 3 },
+	{ AD717X_GAIN0_REG, 0, 3 },
+	{ AD717X_GAIN1_REG, 0, 3 },
+	{ AD717X_GAIN2_REG, 0, 3 },
+	{ AD717X_GAIN3_REG, 0, 3 },
+};
+#endif
+
+#define AD7175_2_SLAVE_ID    1
+
+#endif /*__AD7175_2_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7175_8_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7175_8_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,149 @@
+/**************************************************************************//**
+*   @file   AD7175_8_regs.h
+*   @brief  AD7175_8 Registers Definitions.
+*   @author dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7175_8_REGS_H__
+#define __AD7175_8_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7175_8_INIT
+/*! Array holding the info for the AD7175_8 registers - address, initial value, size */
+ad717x_st_reg ad7175_8_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2 },
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3 },
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_CHMAP4_REG, 0x0000, 2 },
+	{ AD717X_CHMAP5_REG, 0x0000, 2 },
+	{ AD717X_CHMAP6_REG, 0x0000, 2 },
+	{ AD717X_CHMAP7_REG, 0x0000, 2 },
+	{ AD717X_CHMAP8_REG, 0x0000, 2 },
+	{ AD717X_CHMAP9_REG, 0x0000, 2 },
+	{ AD717X_CHMAP10_REG, 0x0000, 2 },
+	{ AD717X_CHMAP11_REG, 0x0000, 2 },
+	{ AD717X_CHMAP12_REG, 0x0000, 2 },
+	{ AD717X_CHMAP13_REG, 0x0000, 2 },
+	{ AD717X_CHMAP14_REG, 0x0000, 2 },
+	{ AD717X_CHMAP15_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON2_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON4_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON5_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON6_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON7_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON4_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON5_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON6_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON7_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{AD717X_OFFSET0_REG, 0, 3 },
+	{AD717X_OFFSET1_REG, 0, 3 },
+	{AD717X_OFFSET2_REG, 0, 3 },
+	{AD717X_OFFSET3_REG, 0, 3 },
+	{AD717X_OFFSET4_REG, 0, 3 },
+	{AD717X_OFFSET5_REG, 0, 3 },
+	{AD717X_OFFSET6_REG, 0, 3 },
+	{AD717X_OFFSET7_REG, 0, 3 },
+	{AD717X_GAIN0_REG, 0, 3 },
+	{AD717X_GAIN1_REG, 0, 3 },
+	{AD717X_GAIN2_REG, 0, 3 },
+	{AD717X_GAIN3_REG, 0, 3 },
+	{AD717X_GAIN4_REG, 0, 3 },
+	{AD717X_GAIN5_REG, 0, 3 },
+	{AD717X_GAIN6_REG, 0, 3 },
+	{AD717X_GAIN7_REG, 0, 3 },
+};
+#endif
+
+#define AD7175_8_SLAVE_ID    1
+
+#endif /*__AD7175_8_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad7176_2_regs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad7176_2_regs.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,106 @@
+/**************************************************************************//**
+*   @file   AD7176_2_regs.h
+*   @brief  AD7176_2 Registers Definitions.
+*   @author acozma (andrei.cozma@analog.com)
+*           dnechita (dan.nechita@analog.com)
+*
+*******************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD7176_2_REGS_H__
+#define __AD7176_2_REGS_H__
+
+#include "ad717x.h"
+
+#ifdef AD7176_2_INIT
+/*! Array holding the info for the AD7176_2 registers - address, initial value, size */
+ad717x_st_reg ad7176_2_regs[] = {
+	{ AD717X_STATUS_REG, 0x00, 1 },
+	{ AD717X_ADCMODE_REG, 0x0000, 2 },
+	{
+		AD717X_IFMODE_REG,
+		AD717X_IFMODE_REG_DOUT_RESET | AD717X_IFMODE_REG_CRC_EN,
+		2
+	},
+	{ AD717X_REGCHECK_REG, 0x0000, 3 },
+	{ AD717X_DATA_REG, 0x0000, 3 },
+	{ AD717X_GPIOCON_REG, 0x0000, 2 },
+	{ AD717X_ID_REG, 0x0000, 2 },
+	{
+		AD717X_CHMAP0_REG,
+		AD717X_CHMAP_REG_CH_EN | AD717X_CHMAP_REG_AINNEG(2),
+		2
+	},
+	{ AD717X_CHMAP1_REG, 0x0000, 2 },
+	{ AD717X_CHMAP2_REG, 0x0000, 2 },
+	{ AD717X_CHMAP3_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON0_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON1_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON2_REG, 0x0000, 2 },
+	{ AD717X_SETUPCON3_REG, 0x0000, 2 },
+	{
+		AD717X_FILTCON0_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2) | AD717X_FILT_CONF_REG_ODR(10),
+		2
+	},
+	{
+		AD717X_FILTCON1_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON2_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{
+		AD717X_FILTCON3_REG,
+		AD717X_FILT_CONF_REG_ENHFILT(2),
+		2
+	},
+	{ AD717X_OFFSET0_REG, 0, 3 },
+	{ AD717X_OFFSET1_REG, 0, 3 },
+	{ AD717X_OFFSET2_REG, 0, 3 },
+	{ AD717X_OFFSET3_REG, 0, 3 },
+	{ AD717X_GAIN0_REG, 0, 3 },
+	{ AD717X_GAIN1_REG, 0, 3 },
+	{ AD717X_GAIN2_REG, 0, 3 },
+	{ AD717X_GAIN3_REG, 0, 3 },
+};
+#endif
+
+#define AD7176_2_SLAVE_ID    1
+
+#endif /*__AD7176_2_REGS_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad717x.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad717x.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,506 @@
+/***************************************************************************//**
+*   @file    AD717X.c
+*   @brief   AD717X implementation file.
+*   	     Devices: AD7172-2, AD7172-4, AD7173-8, AD7175-2, AD7175-8, AD7176-2
+*            AD7177-2, AD4111, AD4112, AD4114, AD4115
+*   @author  acozma (andrei.cozma@analog.com)
+*            dnechita (dan.nechita@analog.com)
+*
+********************************************************************************
+* Copyright 2015(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdlib.h>
+#include "ad717x.h"
+
+/* Error codes */
+#define INVALID_VAL -1 /* Invalid argument */
+#define COMM_ERR    -2 /* Communication error on receive */
+#define TIMEOUT     -3 /* A timeout has occured */
+
+/***************************************************************************//**
+* @brief  Searches through the list of registers of the driver instance and
+*         retrieves a pointer to the register that matches the given address.
+*
+* @param device - The handler of the instance of the driver.
+* @param reg_address - The address to be used to find the register.
+*
+* @return A pointer to the register if found or 0.
+*******************************************************************************/
+ad717x_st_reg *AD717X_GetReg(ad717x_dev *device,
+			     uint8_t reg_address)
+{
+	uint8_t i;
+	ad717x_st_reg *reg = 0;
+
+	if (!device || !device->regs)
+		return 0;
+
+	for (i = 0; i < device->num_regs; i++) {
+		if (device->regs[i].addr == reg_address) {
+			reg = &device->regs[i];
+			break;
+		}
+	}
+
+	return reg;
+}
+
+/***************************************************************************//**
+* @brief Reads the value of the specified register.
+*
+* @param device - The handler of the instance of the driver.
+* @param addr - The address of the register to be read. The value will be stored
+*         inside the register structure that holds info about this register.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_ReadRegister(ad717x_dev *device,
+			    uint8_t addr)
+{
+	int32_t ret       = 0;
+	uint8_t buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	uint8_t i         = 0;
+	uint8_t check8    = 0;
+	uint8_t msgBuf[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	ad717x_st_reg *pReg;
+
+	if(!device)
+		return INVALID_VAL;
+
+	pReg = AD717X_GetReg(device, addr);
+	if (!pReg)
+		return INVALID_VAL;
+
+	/* Build the Command word */
+	buffer[0] = AD717X_COMM_REG_WEN | AD717X_COMM_REG_RD |
+		    AD717X_COMM_REG_RA(pReg->addr);
+
+	/* Read data from the device */
+	ret = spi_write_and_read(device->spi_desc,
+				 buffer,
+				 ((device->useCRC != AD717X_DISABLE) ? pReg->size + 1
+				  : pReg->size) + 1);
+	if(ret < 0)
+		return ret;
+
+	/* Check the CRC */
+	if(device->useCRC == AD717X_USE_CRC) {
+		msgBuf[0] = AD717X_COMM_REG_WEN | AD717X_COMM_REG_RD |
+			    AD717X_COMM_REG_RA(pReg->addr);
+		for(i = 1; i < pReg->size + 2; ++i) {
+			msgBuf[i] = buffer[i];
+		}
+		check8 = AD717X_ComputeCRC8(msgBuf, pReg->size + 2);
+	}
+	if(device->useCRC == AD717X_USE_XOR) {
+		msgBuf[0] = AD717X_COMM_REG_WEN | AD717X_COMM_REG_RD |
+			    AD717X_COMM_REG_RA(pReg->addr);
+		for(i = 1; i < pReg->size + 2; ++i) {
+			msgBuf[i] = buffer[i];
+		}
+		check8 = AD717X_ComputeXOR8(msgBuf, pReg->size + 2);
+	}
+
+	if(check8 != 0) {
+		/* ReadRegister checksum failed. */
+		return COMM_ERR;
+	}
+
+	/* Build the result */
+	pReg->value = 0;
+	for(i = 1; i < pReg->size + 1; i++) {
+		pReg->value <<= 8;
+		pReg->value += buffer[i];
+	}
+
+	return ret;
+}
+
+/***************************************************************************//**
+* @brief Writes the value of the specified register.
+*
+* @param device - The handler of the instance of the driver.
+* @param addr   - The address of the register to be written with the value stored
+*               inside the register structure that holds info about this
+*               register.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_WriteRegister(ad717x_dev *device,
+			     uint8_t addr)
+{
+	int32_t ret      = 0;
+	int32_t regValue = 0;
+	uint8_t wrBuf[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+	uint8_t i        = 0;
+	uint8_t crc8     = 0;
+	ad717x_st_reg *preg;
+
+	if(!device)
+		return INVALID_VAL;
+
+	preg = AD717X_GetReg(device, addr);
+	if (!preg)
+		return INVALID_VAL;
+
+	/* Build the Command word */
+	wrBuf[0] = AD717X_COMM_REG_WEN | AD717X_COMM_REG_WR |
+		   AD717X_COMM_REG_RA(preg->addr);
+
+	/* Fill the write buffer */
+	regValue = preg->value;
+	for(i = 0; i < preg->size; i++) {
+		wrBuf[preg->size - i] = regValue & 0xFF;
+		regValue >>= 8;
+	}
+
+	/* Compute the CRC */
+	if(device->useCRC != AD717X_DISABLE) {
+		crc8 = AD717X_ComputeCRC8(wrBuf, preg->size + 1);
+		wrBuf[preg->size + 1] = crc8;
+	}
+
+	/* Write data to the device */
+	ret = spi_write_and_read(device->spi_desc,
+				 wrBuf,
+				 (device->useCRC != AD717X_DISABLE) ?
+				 preg->size + 2 : preg->size + 1);
+
+	return ret;
+}
+
+/***************************************************************************//**
+* @brief Resets the device.
+*
+* @param device - The handler of the instance of the driver.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_Reset(ad717x_dev *device)
+{
+	int32_t ret = 0;
+	uint8_t wrBuf[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+
+	if(!device)
+		return INVALID_VAL;
+
+	ret = spi_write_and_read(device->spi_desc,
+				 wrBuf,
+				 8);
+
+	return ret;
+}
+
+/***************************************************************************//**
+* @brief Waits until a new conversion result is available.
+*
+* @param device  - The handler of the instance of the driver.
+* @param timeout - Count representing the number of polls to be done until the
+*                  function returns if no new data is available.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_WaitForReady(ad717x_dev *device,
+			    uint32_t timeout)
+{
+	ad717x_st_reg *statusReg;
+	int32_t ret;
+	int8_t ready = 0;
+
+	if(!device || !device->regs)
+		return INVALID_VAL;
+
+	statusReg = AD717X_GetReg(device, AD717X_STATUS_REG);
+	if (!statusReg)
+		return INVALID_VAL;
+
+	while(!ready && --timeout) {
+		/* Read the value of the Status Register */
+		ret = AD717X_ReadRegister(device, AD717X_STATUS_REG);
+		if(ret < 0)
+			return ret;
+
+		/* Check the RDY bit in the Status Register */
+		ready = (statusReg->value & AD717X_STATUS_REG_RDY) == 0;
+	}
+
+	return timeout ? 0 : TIMEOUT;
+}
+
+/***************************************************************************//**
+* @brief Reads the conversion result from the device.
+*
+* @param device - The handler of the instance of the driver.
+* @param pData  - Pointer to store the read data.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_ReadData(ad717x_dev *device,
+			int32_t* pData)
+{
+	ad717x_st_reg *dataReg;
+	int32_t ret;
+
+	if(!device || !device->regs)
+		return INVALID_VAL;
+
+	dataReg = AD717X_GetReg(device, AD717X_DATA_REG);
+	if (!dataReg)
+		return INVALID_VAL;
+
+	/* Update the data register length with respect to device and options */
+	ret = AD717X_ComputeDataregSize(device);
+
+	/* Read the value of the Status Register */
+	ret |= AD717X_ReadRegister(device, AD717X_DATA_REG);
+
+	/* Get the read result */
+	*pData = dataReg->value;
+
+	return ret;
+}
+
+/***************************************************************************//**
+* @brief Computes data register read size to account for bit number and status
+* 		 read.
+*
+* @param device - The handler of the instance of the driver.
+*
+* @return 0in case of success or negative code in case of failure.
+*******************************************************************************/
+int32_t AD717X_ComputeDataregSize(ad717x_dev *device)
+{
+	ad717x_st_reg *reg_ptr;
+	ad717x_st_reg *datareg_ptr;
+	uint16_t case_var;
+
+	/* Get interface mode register pointer */
+	reg_ptr = AD717X_GetReg(device, AD717X_IFMODE_REG);
+	/* Get data register pointer */
+	datareg_ptr = AD717X_GetReg(device, AD717X_DATA_REG);
+	case_var = reg_ptr->value & (AD717X_IFMODE_REG_DATA_STAT |
+				     AD717X_IFMODE_REG_DATA_WL16);
+
+	/* Compute data register size */
+	datareg_ptr->size = 3;
+	if ((case_var & AD717X_IFMODE_REG_DATA_WL16) == AD717X_IFMODE_REG_DATA_WL16)
+		datareg_ptr->size--;
+	if ((case_var & AD717X_IFMODE_REG_DATA_STAT) == AD717X_IFMODE_REG_DATA_STAT)
+		datareg_ptr->size++;
+
+	/* Get ID register pointer */
+	reg_ptr = AD717X_GetReg(device, AD717X_ID_REG);
+
+	/* If the part is 32/24 bit wide add a byte to the read */
+	if((reg_ptr->value & AD717X_ID_REG_MASK) == AD7177_2_ID_REG_VALUE)
+		datareg_ptr->size++;
+
+	return 0;
+}
+
+/***************************************************************************//**
+* @brief Computes the CRC checksum for a data buffer.
+*
+* @param pBuf    - Data buffer
+* @param bufSize - Data buffer size in bytes
+*
+* @return Returns the computed CRC checksum.
+*******************************************************************************/
+uint8_t AD717X_ComputeCRC8(uint8_t * pBuf,
+			   uint8_t bufSize)
+{
+	uint8_t i   = 0;
+	uint8_t crc = 0;
+
+	while(bufSize) {
+		for(i = 0x80; i != 0; i >>= 1) {
+			if(((crc & 0x80) != 0) != ((*pBuf & i) !=
+						   0)) { /* MSB of CRC register XOR input Bit from Data */
+				crc <<= 1;
+				crc ^= AD717X_CRC8_POLYNOMIAL_REPRESENTATION;
+			} else {
+				crc <<= 1;
+			}
+		}
+		pBuf++;
+		bufSize--;
+	}
+	return crc;
+}
+
+/***************************************************************************//**
+* @brief Computes the XOR checksum for a data buffer.
+*
+* @param pBuf    - Data buffer
+* @param bufSize - Data buffer size in bytes
+*
+* @return Returns the computed XOR checksum.
+*******************************************************************************/
+uint8_t AD717X_ComputeXOR8(uint8_t * pBuf,
+			   uint8_t bufSize)
+{
+	uint8_t xor = 0;
+
+	while(bufSize) {
+		xor ^= *pBuf;
+		pBuf++;
+		bufSize--;
+	}
+	return xor;
+}
+
+/***************************************************************************//**
+* @brief Updates the CRC settings.
+*
+* @param device - The handler of the instance of the driver.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_UpdateCRCSetting(ad717x_dev *device)
+{
+	ad717x_st_reg *interfaceReg;
+
+	if(!device || !device->regs)
+		return INVALID_VAL;
+
+	interfaceReg = AD717X_GetReg(device, AD717X_IFMODE_REG);
+	if (!interfaceReg)
+		return INVALID_VAL;
+
+	/* Get CRC State. */
+	if(AD717X_IFMODE_REG_CRC_STAT(interfaceReg->value)) {
+		device->useCRC = AD717X_USE_CRC;
+	} else if(AD717X_IFMODE_REG_XOR_STAT(interfaceReg->value)) {
+		device->useCRC = AD717X_USE_XOR;
+	} else {
+		device->useCRC = AD717X_DISABLE;
+	}
+
+	return 0;
+}
+
+/***************************************************************************//**
+* @brief Initializes the AD717X.
+*
+* @param device     - The device structure.
+* @param init_param - The structure that contains the device initial
+* 		       parameters.
+*
+* @return Returns 0 for success or negative error code.
+*******************************************************************************/
+int32_t AD717X_Init(ad717x_dev **device,
+		    ad717x_init_param init_param)
+{
+	ad717x_dev *dev;
+	int32_t ret;
+	ad717x_st_reg *preg;
+
+	dev = (ad717x_dev *)malloc(sizeof(*dev));
+	if (!dev)
+		return -1;
+
+	dev->regs = init_param.regs;
+	dev->num_regs = init_param.num_regs;
+
+	/* Initialize the SPI communication. */
+	ret = spi_init(&dev->spi_desc, &init_param.spi_init);
+	if (ret < 0)
+		return ret;
+
+	/*  Reset the device interface.*/
+	ret = AD717X_Reset(dev);
+	if (ret < 0)
+		return ret;
+
+	/* Initialize ADC mode register. */
+	ret = AD717X_WriteRegister(dev, AD717X_ADCMODE_REG);
+	if(ret < 0)
+		return ret;
+
+	/* Initialize Interface mode register. */
+	ret = AD717X_WriteRegister(dev, AD717X_IFMODE_REG);
+	if(ret < 0)
+		return ret;
+
+	/* Get CRC State */
+	ret = AD717X_UpdateCRCSetting(dev);
+	if(ret < 0)
+		return ret;
+
+	/* Initialize registers AD717X_GPIOCON_REG through AD717X_OFFSET0_REG */
+	preg = AD717X_GetReg(dev, AD717X_GPIOCON_REG);
+	if (!preg)
+		return INVALID_VAL;
+
+	while (preg && preg->addr != AD717X_OFFSET0_REG) {
+		if (preg->addr == AD717X_ID_REG) {
+			preg ++;
+			continue;
+		}
+
+		ret = AD717X_WriteRegister(dev, preg->addr);
+		if (ret < 0)
+			break;
+		preg ++;
+	}
+
+	/* Read ID register to identify the part */
+	ret = AD717X_ReadRegister(dev, AD717X_ID_REG);
+	if(ret < 0)
+		return ret;
+
+	*device = dev;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Free the resources allocated by AD717X_Init().
+ * @param dev - The device structure.
+ * @return SUCCESS in case of success, negative error code otherwise.
+*******************************************************************************/
+int32_t AD717X_remove(ad717x_dev *dev)
+{
+	int32_t ret;
+
+	ret = spi_remove(dev->spi_desc);
+
+	free(dev);
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad717x/ad717x.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad717x/ad717x.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,334 @@
+/**************************************************************************//**
+*   @file    AD717X.h
+*   @brief   AD717X header file.
+*   	     Devices: AD7172-2, AD7172-4, AD7173-8, AD7175-2, AD7175-8, AD7176-2,
+*            AD7177-2, AD4111, AD4112, AD4114, AD4115
+*   @author  acozma (andrei.cozma@analog.com)
+*            dnechita (dan.nechita@analog.com)
+*******************************************************************************
+* Copyright 2015, 2020(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef __AD717X_H__
+#define __AD717X_H__
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+typedef enum {
+	AD717X_DISABLE,
+	AD717X_USE_CRC,
+	AD717X_USE_XOR,
+} ad717x_crc_mode;
+
+/*! AD717X register info */
+typedef struct {
+	int32_t addr;
+	int32_t value;
+	int32_t size;
+} ad717x_st_reg;
+
+/*
+ * The structure describes the device and is used with the ad717x driver.
+ * @slave_select_id: The ID of the Slave Select to be passed to the SPI calls.
+ * @regs: A reference to the register list of the device that the user must
+ *       provide when calling the Setup() function.
+ * @num_regs: The length of the register list.
+ * @userCRC: Error check type to use on SPI transfers.
+ */
+typedef struct {
+	/* SPI */
+	spi_desc		*spi_desc;
+	/* Device Settings */
+	ad717x_st_reg		*regs;
+	uint8_t			num_regs;
+	ad717x_crc_mode		useCRC;
+} ad717x_dev;
+
+typedef struct {
+	/* SPI */
+	spi_init_param		spi_init;
+	/* Device Settings */
+	ad717x_st_reg		*regs;
+	uint8_t			num_regs;
+} ad717x_init_param;
+
+/*****************************************************************************/
+/***************** AD717X Register Definitions *******************************/
+/*****************************************************************************/
+
+/* AD717X Register Map */
+#define AD717X_COMM_REG       0x00
+#define AD717X_STATUS_REG     0x00
+#define AD717X_ADCMODE_REG    0x01
+#define AD717X_IFMODE_REG     0x02
+#define AD717X_REGCHECK_REG   0x03
+#define AD717X_DATA_REG       0x04
+#define AD717X_GPIOCON_REG    0x06
+#define AD717X_ID_REG         0x07
+#define AD717X_CHMAP0_REG     0x10
+#define AD717X_CHMAP1_REG     0x11
+#define AD717X_CHMAP2_REG     0x12
+#define AD717X_CHMAP3_REG     0x13
+#define AD717X_CHMAP4_REG     0x14
+#define AD717X_CHMAP5_REG     0x15
+#define AD717X_CHMAP6_REG     0x16
+#define AD717X_CHMAP7_REG     0x17
+#define AD717X_CHMAP8_REG     0x18
+#define AD717X_CHMAP9_REG     0x19
+#define AD717X_CHMAP10_REG    0x1A
+#define AD717X_CHMAP11_REG    0x1B
+#define AD717X_CHMAP12_REG    0x1C
+#define AD717X_CHMAP13_REG    0x1D
+#define AD717X_CHMAP14_REG    0x1E
+#define AD717X_CHMAP15_REG    0x1F
+#define AD717X_SETUPCON0_REG  0x20
+#define AD717X_SETUPCON1_REG  0x21
+#define AD717X_SETUPCON2_REG  0x22
+#define AD717X_SETUPCON3_REG  0x23
+#define AD717X_SETUPCON4_REG  0x24
+#define AD717X_SETUPCON5_REG  0x25
+#define AD717X_SETUPCON6_REG  0x26
+#define AD717X_SETUPCON7_REG  0x27
+#define AD717X_FILTCON0_REG   0x28
+#define AD717X_FILTCON1_REG   0x29
+#define AD717X_FILTCON2_REG   0x2A
+#define AD717X_FILTCON3_REG   0x2B
+#define AD717X_FILTCON4_REG   0x2C
+#define AD717X_FILTCON5_REG   0x2D
+#define AD717X_FILTCON6_REG   0x2E
+#define AD717X_FILTCON7_REG   0x2F
+#define AD717X_OFFSET0_REG    0x30
+#define AD717X_OFFSET1_REG    0x31
+#define AD717X_OFFSET2_REG    0x32
+#define AD717X_OFFSET3_REG    0x33
+#define AD717X_OFFSET4_REG    0x34
+#define AD717X_OFFSET5_REG    0x35
+#define AD717X_OFFSET6_REG    0x36
+#define AD717X_OFFSET7_REG    0x37
+#define AD717X_GAIN0_REG      0x38
+#define AD717X_GAIN1_REG      0x39
+#define AD717X_GAIN2_REG      0x3A
+#define AD717X_GAIN3_REG      0x3B
+#define AD717X_GAIN4_REG      0x3C
+#define AD717X_GAIN5_REG      0x3D
+#define AD717X_GAIN6_REG      0x3E
+#define AD717X_GAIN7_REG      0x3F
+
+/* Communication Register bits */
+#define AD717X_COMM_REG_WEN    (0 << 7)
+#define AD717X_COMM_REG_WR     (0 << 6)
+#define AD717X_COMM_REG_RD     (1 << 6)
+#define AD717X_COMM_REG_RA(x)  ((x) & 0x3F)
+
+/* Status Register bits */
+#define AD717X_STATUS_REG_RDY      (1 << 7)
+#define AD717X_STATUS_REG_ADC_ERR  (1 << 6)
+#define AD717X_STATUS_REG_CRC_ERR  (1 << 5)
+#define AD717X_STATUS_REG_REG_ERR  (1 << 4)
+#define AD717X_STATUS_REG_CH(x)    ((x) & 0x0F)
+
+/* ADC Mode Register bits */
+#define AD717X_ADCMODE_REG_REF_EN     (1 << 15)
+#define AD717X_ADCMODE_SING_CYC       (1 << 13)
+#define AD717X_ADCMODE_REG_DELAY(x)   (((x) & 0x7) << 8)
+#define AD717X_ADCMODE_REG_MODE(x)    (((x) & 0x7) << 4)
+#define AD717X_ADCMODE_REG_CLKSEL(x)  (((x) & 0x3) << 2)
+
+/* ADC Mode Register additional bits for AD7172-2, AD7172-4, AD4111 and AD4112 */
+#define AD717X_ADCMODE_REG_HIDE_DELAY   (1 << 14)
+
+/* Interface Mode Register bits */
+#define AD717X_IFMODE_REG_ALT_SYNC      (1 << 12)
+#define AD717X_IFMODE_REG_IOSTRENGTH    (1 << 11)
+#define AD717X_IFMODE_REG_HIDE_DELAY    (1 << 10)
+#define AD717X_IFMODE_REG_DOUT_RESET    (1 << 8)
+#define AD717X_IFMODE_REG_CONT_READ     (1 << 7)
+#define AD717X_IFMODE_REG_DATA_STAT     (1 << 6)
+#define AD717X_IFMODE_REG_REG_CHECK     (1 << 5)
+#define AD717X_IFMODE_REG_XOR_EN        (0x01 << 2)
+#define AD717X_IFMODE_REG_CRC_EN        (0x02 << 2)
+#define AD717X_IFMODE_REG_XOR_STAT(x)   (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
+#define AD717X_IFMODE_REG_CRC_STAT(x)   (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
+#define AD717X_IFMODE_REG_DATA_WL16     (1 << 0)
+
+/* GPIO Configuration Register bits */
+#define AD717X_GPIOCON_REG_MUX_IO      (1 << 12)
+#define AD717X_GPIOCON_REG_SYNC_EN     (1 << 11)
+#define AD717X_GPIOCON_REG_ERR_EN(x)   (((x) & 0x3) << 9)
+#define AD717X_GPIOCON_REG_ERR_DAT     (1 << 8)
+#define AD717X_GPIOCON_REG_IP_EN1      (1 << 5)
+#define AD717X_GPIOCON_REG_IP_EN0      (1 << 4)
+#define AD717X_GPIOCON_REG_OP_EN1      (1 << 3)
+#define AD717X_GPIOCON_REG_OP_EN0      (1 << 2)
+#define AD717X_GPIOCON_REG_DATA1       (1 << 1)
+#define AD717X_GPIOCON_REG_DATA0       (1 << 0)
+
+/* GPIO Configuration Register additional bits for AD7172-4, AD7173-8 */
+#define AD717X_GPIOCON_REG_GP_DATA3    (1 << 7)
+#define AD717X_GPIOCON_REG_GP_DATA2    (1 << 6)
+#define AD717X_GPIOCON_REG_GP_DATA1    (1 << 1)
+#define AD717X_GPIOCON_REG_GP_DATA0    (1 << 0)
+
+/* GPIO Configuration Register additional bits for AD7173-8 */
+#define AD717X_GPIOCON_REG_PDSW        (1 << 14)
+#define AD717X_GPIOCON_REG_OP_EN2_3    (1 << 13)
+
+/* GPIO Configuration Register additional bits for AD4111, AD4112, AD4114, AD4115 */
+#define AD4111_GPIOCON_REG_OP_EN0_1    (1 << 13)
+#define AD4111_GPIOCON_REG_DATA1       (1 << 7)
+#define AD4111_GPIOCON_REG_DATA0       (1 << 6)
+
+/* GPIO Configuration Register additional bits for AD4111 */
+#define AD4111_GPIOCON_REG_OW_EN       (1 << 12)
+
+/* Channel Map Register 0-3 bits */
+#define AD717X_CHMAP_REG_CH_EN         (1 << 15)
+#define AD717X_CHMAP_REG_SETUP_SEL(x)  (((x) & 0x7) << 12)
+#define AD717X_CHMAP_REG_AINPOS(x)     (((x) & 0x1F) << 5)
+#define AD717X_CHMAP_REG_AINNEG(x)     (((x) & 0x1F) << 0)
+
+/* Channel Map Register additional bits for AD4111, AD4112 */
+#define AD4111_CHMAP_REG_INPUT(x)      (((x) & 0x3FF) << 0)
+
+/* Setup Configuration Register 0-3 bits */
+#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR  (1 << 12)
+#define AD717X_SETUP_CONF_REG_REF_SEL(x)   (((x) & 0x3) << 4)
+
+/* Setup Configuration Register additional bits for AD7173-8 */
+#define AD717X_SETUP_CONF_REG_REF_BUF(x)  (((x) & 0x3) << 10)
+#define AD717X_SETUP_CONF_REG_AIN_BUF(x)  (((x) & 0x3) << 8)
+#define AD717X_SETUP_CONF_REG_BURNOUT_EN  (1 << 7)
+#define AD717X_SETUP_CONF_REG_BUFCHOPMAX  (1 << 6)
+
+/* Setup Configuration Register additional bits for AD7172-2, AD7172-4, AD7175-2 */
+#define AD717X_SETUP_CONF_REG_REFBUF_P    (1 << 11)
+#define AD717X_SETUP_CONF_REG_REFBUF_N    (1 << 10)
+#define AD717X_SETUP_CONF_REG_AINBUF_P    (1 << 9)
+#define AD717X_SETUP_CONF_REG_AINBUF_N    (1 << 8)
+
+/* Setup Configuration Register additional bits for AD4111, AD4112 */
+#define AD4111_SETUP_CONF_REG_REFPOS_BUF   (1 << 11)
+#define AD4111_SETUP_CONF_REG_REFNEG_BUF   (1 << 10)
+#define AD4111_SETUP_CONF_REG_AIN_BUF(x)   (((x) & 0x3) << 8)
+#define AD4111_SETUP_CONF_REG_BUFCHOPMAX   (1 << 6)
+
+/* Filter Configuration Register 0-3 bits */
+#define AD717X_FILT_CONF_REG_SINC3_MAP    (1 << 15)
+#define AD717X_FILT_CONF_REG_ENHFILTEN    (1 << 11)
+#define AD717X_FILT_CONF_REG_ENHFILT(x)   (((x) & 0x7) << 8)
+#define AD717X_FILT_CONF_REG_ORDER(x)     (((x) & 0x3) << 5)
+#define AD717X_FILT_CONF_REG_ODR(x)       (((x) & 0x1F) << 0)
+
+/* ID register mask for relevant bits */
+#define AD717X_ID_REG_MASK	  0xFFF0
+/* AD7172-2 ID */
+#define AD7172_2_ID_REG_VALUE 0x00D0
+/* AD7172-4 ID */
+#define AD7172_4_ID_REG_VALUE 0x2050
+/* AD7173-8 ID */
+#define AD7173_8_ID_REG_VALUE 0x30D0
+/* AD7175-2 ID */
+#define AD7175_2_ID_REG_VALUE 0x0CD0
+/* AD7175-8 ID */
+#define AD7175_8_ID_REG_VALUE 0x3CD0
+/* AD7176-2 ID */
+#define AD7176_2_ID_REG_VALUE 0x0C90
+/* AD7177-2 ID */
+#define AD7177_2_ID_REG_VALUE 0x4FD0
+/* AD411x ID */
+#define AD411X_ID_REG_VALUE   0x30D0
+
+/*****************************************************************************/
+/******************* AD717X Constants ****************************************/
+/*****************************************************************************/
+#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION 0x07 /* x8 + x2 + x + 1 */
+
+/*****************************************************************************/
+/************************ Functions Declarations *****************************/
+/*****************************************************************************/
+
+/*! Retrieves a pointer to the register that matches the given address */
+ad717x_st_reg *AD717X_GetReg(ad717x_dev *device,
+			     uint8_t reg_address);
+
+/*! Reads the value of the specified register. */
+int32_t AD717X_ReadRegister(ad717x_dev *device,
+			    uint8_t addr);
+
+/*! Writes the value of the specified register. */
+int32_t AD717X_WriteRegister(ad717x_dev *device,
+			     uint8_t);
+
+/*! Resets the device. */
+int32_t AD717X_Reset(ad717x_dev *device);
+
+/*! Waits until a new conversion result is available. */
+int32_t AD717X_WaitForReady(ad717x_dev *device,
+			    uint32_t timeout);
+
+/*! Reads the conversion result from the device. */
+int32_t AD717X_ReadData(ad717x_dev *device,
+			int32_t* pData);
+
+/*! Computes data register read size to account for bit number and status
+ *  read. */
+int32_t AD717X_ComputeDataregSize(ad717x_dev *device);
+
+/*! Computes the CRC checksum for a data buffer. */
+uint8_t AD717X_ComputeCRC8(uint8_t* pBuf,
+			   uint8_t bufSize);
+
+/*! Computes the XOR checksum for a data buffer. */
+uint8_t AD717X_ComputeXOR8(uint8_t * pBuf,
+			   uint8_t bufSize);
+
+/*! Updates the CRC settings. */
+int32_t AD717X_UpdateCRCSetting(ad717x_dev *device);
+
+/*! Initializes the AD717X. */
+int32_t AD717X_Init(ad717x_dev **device,
+		    ad717x_init_param init_param);
+
+/*! Free the resources allocated by AD717X_Init(). */
+int32_t AD717X_remove(ad717x_dev *dev);
+
+#endif /* __AD717X_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7606/ad7606.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7606/ad7606.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,1251 @@
+/***************************************************************************//**
+ *   @file   ad7606.c
+ *   @brief  Implementation of ad7606 Driver.
+ *   @author Stefan Popa (stefan.popa@analog.com)
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include "ad7606.h"
+#include "error.h"
+#include "util.h"
+#include "crc.h"
+
+struct ad7606_chip_info {
+	uint8_t num_channels;
+	uint8_t bits;
+	uint8_t max_dout_lines;
+	bool has_oversampling;
+	bool has_registers;
+	uint8_t device_id;
+	const struct ad7606_range *hw_range_table;
+	uint32_t hw_range_table_sz;
+	const struct ad7606_range *sw_range_table;
+	uint32_t sw_range_table_sz;
+};
+
+DECLARE_CRC8_TABLE(ad7606_crc8);
+DECLARE_CRC16_TABLE(ad7606_crc16);
+
+static const struct ad7606_range ad7606_range_table[] = {
+	{-5000, 5000, false},	/* RANGE pin LOW */
+	{-10000, 10000, false},	/* RANGE pin HIGH */
+};
+
+static const struct ad7606_range ad7609_range_table[] = {
+	{-10000, 10000, true},	/* RANGE pin LOW */
+	{-20000, 20000, true},	/* RANGE pin HIGH */
+};
+
+static const struct ad7606_range ad7606b_range_table[] = {
+	{-2500, 2500, false},	/* 0000 */
+	{-5000, 5000, false},	/* 0001 */
+	{-10000, 10000, false},	/* 0010 */
+	{-10000, 10000, false},	/* 0011 */
+	{-10000, 10000, false},	/* 0100 */
+	{-10000, 10000, false},	/* 0101 */
+	{-10000, 10000, false},	/* 0110 */
+	{-10000, 10000, false},	/* 0111 */
+	{-10000, 10000, false},	/* 1000 */
+	{-10000, 10000, false},	/* 1001 */
+	{-10000, 10000, false},	/* 1010 */
+	{-10000, 10000, false},	/* 1011 */
+};
+
+static const struct ad7606_range ad7606c_range_table[] = {
+	{-2500, 2500, false},	/* 0000 */
+	{-5000, 5000, false},	/* 0001 */
+	{-6250, 6250, false},	/* 0010 */
+	{-10000, 10000, false},	/* 0011 */
+	{-12500, 12500, false},	/* 0100 */
+	{0, 5000, false},	/* 0101 */
+	{0, 10000, false},	/* 0110 */
+	{0, 12500, false},	/* 0111 */
+	{-5000, 5000, true},	/* 1000 */
+	{-10000, 10000, true},	/* 1001 */
+	{-12500, 12500, true},	/* 1010 */
+	{-20000, 20000, true},	/* 1011 */
+	{-20000, 20000, true},	/* 1100 */
+	{-20000, 20000, true},	/* 1101 */
+	{-20000, 20000, true},	/* 1110 */
+	{-20000, 20000, true},	/* 1111 */
+};
+
+static const struct ad7606_chip_info ad7606_chip_info_tbl[] = {
+	[ID_AD7605_4] = {
+		.num_channels = 4,
+		.bits = 16,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = false,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+	},
+	[ID_AD7606_4] = {
+		.num_channels = 4,
+		.bits = 16,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = true,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+	},
+	[ID_AD7606_6] = {
+		.num_channels = 6,
+		.bits = 16,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = true,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+	},
+	[ID_AD7606_8] = {
+		.num_channels = 8,
+		.bits = 16,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = true,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+	},
+	[ID_AD7606B] = {
+		.num_channels = 8,
+		.bits = 16,
+		.max_dout_lines = AD7606_4_DOUT,
+		.has_oversampling = true,
+		.has_registers = true,
+		.device_id = 0x1,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+		.sw_range_table = ad7606b_range_table,
+		.sw_range_table_sz = ARRAY_SIZE(ad7606b_range_table),
+	},
+	[ID_AD7606C_16] = {
+		.num_channels = 8,
+		.bits = 16,
+		.max_dout_lines = AD7606_8_DOUT,
+		.has_oversampling = true,
+		.has_registers = true,
+		.device_id = 0x3,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+		.sw_range_table = ad7606c_range_table,
+		.sw_range_table_sz = ARRAY_SIZE(ad7606c_range_table),
+	},
+	[ID_AD7606C_18] = {
+		.num_channels = 8,
+		.bits = 18,
+		.max_dout_lines = AD7606_8_DOUT,
+		.has_oversampling = true,
+		.has_registers = true,
+		.device_id = 0x3,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+		.sw_range_table = ad7606c_range_table,
+		.sw_range_table_sz = ARRAY_SIZE(ad7606c_range_table),
+	},
+	[ID_AD7608] = {
+		.num_channels = 8,
+		.bits = 18,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = true,
+		.hw_range_table = ad7606_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7606_range_table),
+	},
+	[ID_AD7609] = {
+		.num_channels = 8,
+		.bits = 18,
+		.max_dout_lines = AD7606_2_DOUT,
+		.has_oversampling = true,
+		.hw_range_table = ad7609_range_table,
+		.hw_range_table_sz = ARRAY_SIZE(ad7609_range_table),
+	},
+};
+
+static const uint16_t tconv_max[] = {
+	1, 	/* AD7606_OSR_1 */
+	3,	/* AD7606_OSR_2 */
+	5,	/* AD7606_OSR_4 */
+	10,	/* AD7606_OSR_8 */
+	20,	/* AD7606_OSR_16 */
+	41,	/* AD7606_OSR_32 */
+	81,	/* AD7606_OSR_64 */
+	162,	/* AD7606_OSR_128 */
+	324	/* AD7606_OSR_256 */
+};
+
+
+/***************************************************************************//**
+ * @brief Read a device register via SPI.
+ *
+ * This function performs CRC8 computation and checking if enabled in the device.
+ *
+ * @param dev        - The device structure.
+ * @param reg_addr   - Register address in device memory.
+ * @param reg_data   - Pointer to the location where to store the register value.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_spi_reg_read(struct ad7606_dev *dev,
+			    uint8_t reg_addr,
+			    uint8_t *reg_data)
+{
+	uint8_t buf[3];
+	uint8_t crc;
+	uint32_t sz = 2;
+	int32_t ret;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	buf[0] = AD7606_RD_FLAG_MSK(reg_addr);
+	buf[1] = 0x00;
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		crc = crc8(ad7606_crc8, buf, 2, 0);
+		buf[2] = crc;
+		sz += 1;
+	}
+	ret = spi_write_and_read(dev->spi_desc, buf, sz);
+	if (ret < 0)
+		return ret;
+
+	dev->reg_mode = true;
+
+	buf[0] = AD7606_RD_FLAG_MSK(reg_addr);
+	buf[1] = 0x00;
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		crc = crc8(ad7606_crc8, buf, 2, 0);
+		buf[2] = crc;
+	}
+	ret = spi_write_and_read(dev->spi_desc, buf, sz);
+	if (ret < 0)
+		return ret;
+
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		crc = crc8(ad7606_crc8, buf, 2, 0);
+		if (crc != buf[2])
+			return -EBADMSG;
+	}
+
+	if (reg_data)
+		*reg_data = buf[1];
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Write a device register via SPI.
+ *
+ * This function performs CRC8 computation and checking if enabled in the device.
+ *
+ * @param dev        - The device structure.
+ * @param reg_addr   - Register address in device memory.
+ * @param reg_data   - Value to write to register.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_spi_reg_write(struct ad7606_dev *dev,
+			     uint8_t reg_addr,
+			     uint8_t reg_data)
+{
+	uint8_t buf[3];
+	int32_t ret;
+	uint8_t crc;
+	uint32_t sz = 2;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	/* Dummy read to place the chip in register mode. */
+	if (!dev->reg_mode) {
+		ret = ad7606_spi_reg_read(dev, reg_addr, NULL);
+		if (ret < 0)
+			return ret;
+	}
+
+	buf[0] = AD7606_WR_FLAG_MSK(reg_addr);
+	buf[1] = reg_data;
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		crc = crc8(ad7606_crc8, buf, 2, 0);
+		buf[2] = crc;
+		sz += 1;
+	}
+
+	ret = spi_write_and_read(dev->spi_desc, buf, sz);
+	if (ret < 0)
+		return ret;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Write a device register via SPI with masking.
+ *
+ * @param dev        - The device structure.
+ * @param addr       - Register address in device memory.
+ * @param mask       - Only bits set to 1 in mask will be modified.
+ * @param val        - Value to write to register.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_spi_write_mask(struct ad7606_dev *dev,
+			      uint32_t addr,
+			      uint32_t mask,
+			      uint32_t val)
+{
+	uint8_t reg_data;
+	int ret;
+
+	ret = ad7606_spi_reg_read(dev, addr, &reg_data);
+	if (ret < 0)
+		return ret;
+
+	reg_data &= ~mask;
+	reg_data |= val;
+
+	return ad7606_spi_reg_write(dev, addr, reg_data);
+}
+
+/* Internal function to copy the content of a buffer in 18-bit chunks to a 32-bit buffer by
+ * extending the chunks to 32-bit size. */
+static int32_t cpy18b32b(uint8_t *psrc, uint32_t srcsz, uint32_t *pdst)
+{
+	unsigned int i, j;
+
+	if (srcsz % 9)
+		return -EINVAL;
+
+	for(i = 0; i < srcsz; i += 9) {
+		j = 4 * (i / 9);
+		pdst[j+0] = ((uint32_t)(psrc[i+0] & 0xff) << 10) | ((uint32_t)psrc[i+1] << 2)
+			    | ((uint32_t)psrc[i+2] >> 6);
+		pdst[j+1] = ((uint32_t)(psrc[i+2] & 0x3f) << 12) | ((uint32_t)psrc[i+3] << 4)
+			    | ((uint32_t)psrc[i+4] >> 4);
+		pdst[j+2] = ((uint32_t)(psrc[i+4] & 0x0f) << 14) | ((uint32_t)psrc[i+5] << 6)
+			    | ((uint32_t)psrc[i+6] >> 2);
+		pdst[j+3] = ((uint32_t)(psrc[i+6] & 0x03) << 16) | ((uint32_t)psrc[i+7] << 8)
+			    | ((uint32_t)psrc[i+8] >> 0);
+	}
+	return SUCCESS;
+}
+
+/* Internal function to copy the content of a buffer in 26-bit chunks to a 32-bit buffer by
+ * extending the chunks to 32-bit size. */
+static int32_t cpy26b32b(uint8_t *psrc, uint32_t srcsz, uint32_t *pdst)
+{
+	unsigned int i, j;
+
+	if (srcsz % 13)
+		return -EINVAL;
+
+	for(i = 0; i < srcsz; i += 13) {
+		j = 4 * (i / 13);
+		pdst[j+0] = ((uint32_t)(psrc[i+0] & 0xff) << 18) | ((uint32_t)psrc[i+1] << 10)
+			    | ((uint32_t)psrc[i+2] << 2) | ((uint32_t)psrc[i+3] >> 6);
+		pdst[j+1] = ((uint32_t)(psrc[i+3] & 0x3f) << 20) | ((uint32_t)psrc[i+4] << 12)
+			    | ((uint32_t)psrc[i+5] << 4) | ((uint32_t)psrc[i+6] >> 4);
+		pdst[j+2] = ((uint32_t)(psrc[i+6] & 0x0f) << 22) | ((uint32_t)psrc[i+7] << 14)
+			    | ((uint32_t)psrc[i+8] << 6) | ((uint32_t)psrc[i+9] >> 2);
+		pdst[j+3] = ((uint32_t)(psrc[i+9] & 0x03) << 24) | ((uint32_t)psrc[i+10] << 16)
+			    | ((uint32_t)psrc[i+11] << 8) | ((uint32_t)psrc[i+12] >> 0);
+	}
+	return SUCCESS;
+}
+
+/***************************************************************************//**
+ * @brief Toggle the CONVST pin to start a conversion.
+ *
+ * If needed, this function also puts the device in ADC reading mode by a write
+ * at address zero.
+ *
+ * @param dev        - The device structure.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EIO - CONVST GPIO not available.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_convst(struct ad7606_dev *dev)
+{
+	int32_t ret;
+
+	if (dev->reg_mode) {
+		/* Enter ADC reading mode by writing at address zero. */
+		ret = ad7606_spi_reg_write(dev, 0, 0);
+		if (ret < 0)
+			return ret;
+
+		dev->reg_mode = false;
+	}
+
+	ret = gpio_set_value(dev->gpio_convst, 0);
+	if (ret < 0)
+		return ret;
+
+	/* wait LP_CNV time */
+	udelay(1);
+
+	return gpio_set_value(dev->gpio_convst, 1);
+}
+
+/***************************************************************************//**
+ * @brief Read conversion data.
+ *
+ * This function performs CRC16 computation and checking if enabled in the device.
+ * If the status is enabled in device settings, each sample of data will contain
+ * status information in the lowest 8 bits.
+ *
+ * The output buffer provided by the user should be as wide as to be able to
+ * contain 1 sample from each channel since this function reads conversion data
+ * across all channels.
+ *
+ * @param dev        - The device structure.
+ * @param data       - Pointer to location of buffer where to store the data.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  -ENOTSUP - Device bits per sample not supported.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_spi_data_read(struct ad7606_dev *dev, uint32_t *data)
+{
+	uint32_t sz;
+	int32_t ret, i;
+	uint16_t crc, icrc;
+	uint8_t bits = ad7606_chip_info_tbl[dev->device_id].bits;
+	uint8_t sbits = dev->config.status_header ? 8 : 0;
+	uint8_t nchannels = ad7606_chip_info_tbl[dev->device_id].num_channels;
+
+	sz = nchannels * (bits + sbits);
+
+	/* Number of bits to read, corresponds to SCLK cycles in transfer.
+	 * This should always be a multiple of 8 to work with most SPI's.
+	 * With this chip family this holds true because we either:
+	 *  - multiply 8 channels * bits per sample
+	 *  - multiply 4 channels * bits per sample (always multiple of 2)
+	 * Therefore, due to design reasons, we don't check for the
+	 * remainder of this division because it is zero by design.
+	 */
+	sz /= 8;
+
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		sz += 2;
+	}
+
+	memset(dev->data, 0, sz);
+	ret = spi_write_and_read(dev->spi_desc, dev->data, sz);
+	if (ret < 0)
+		return ret;
+
+	if (dev->digital_diag_enable.int_crc_err_en) {
+		sz -= 2;
+		crc = crc16(ad7606_crc16, dev->data, sz, 0);
+		icrc = ((uint16_t)dev->data[sz] << 8) |
+		       dev->data[sz+1];
+		if (icrc != crc)
+			return -EBADMSG;
+	}
+
+	switch(bits) {
+	case 18:
+		if (dev->config.status_header)
+			ret = cpy26b32b(dev->data, sz, data);
+		else
+			ret = cpy18b32b(dev->data, sz, data);
+		if (ret < 0)
+			return ret;
+		break;
+	case 16:
+		for(i = 0; i < nchannels; i++) {
+			if (dev->config.status_header) {
+				data[i] = (uint32_t)dev->data[i*3] << 16;
+				data[i] |= (uint32_t)dev->data[i*3+1] << 8;
+				data[i] |= (uint32_t)dev->data[i*3+2];
+			} else {
+				data[i] = (uint32_t)dev->data[i*2] << 8;
+				data[i] |= (uint32_t)dev->data[i*2+1];
+			}
+		}
+		break;
+	default:
+		ret = -ENOTSUP;
+		break;
+	};
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Blocking conversion start and data read.
+ *
+ * This function performs a conversion start and then proceeds to reading
+ * the conversion data.
+ *
+ * @param dev        - The device structure.
+ * @param data       - Pointer to location of buffer where to store the data.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -ETIME - Timeout while waiting for the BUSY signal.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_read(struct ad7606_dev *dev, uint32_t * data)
+{
+	int32_t ret;
+	uint8_t busy;
+	uint32_t timeout = tconv_max[AD7606_OSR_256];
+
+	ret = ad7606_convst(dev);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_busy) {
+		/* Wait for BUSY falling edge */
+		while(timeout) {
+			ret = gpio_get_value(dev->gpio_busy, &busy);
+			if (ret < 0)
+				return ret;
+
+			if (busy == 0)
+				break;
+
+			udelay(1);
+			timeout--;
+		}
+
+		if (timeout == 0)
+			return -ETIME;
+	} else {
+		/* wait CONV time */
+		udelay(tconv_max[dev->oversampling.os_ratio]);
+	}
+
+	return ad7606_spi_data_read(dev, data);
+}
+
+/* Internal function to reset device settings to default state after chip reset. */
+static inline void ad7606_reset_settings(struct ad7606_dev *dev)
+{
+	int i;
+	const struct ad7606_range *rt = dev->sw_mode ?
+						ad7606_chip_info_tbl[dev->device_id].sw_range_table:
+						ad7606_chip_info_tbl[dev->device_id].hw_range_table;
+
+	for(i = 0; i < dev->num_channels; i++) {
+		if (dev->sw_mode)
+			dev->range_ch[i] = rt[3];
+		else
+			dev->range_ch[i] = rt[0];
+
+		dev->offset_ch[i] = 0;
+		dev->phase_ch[i] = 0;
+		dev->gain_ch[i] = 0;
+	}
+
+	dev->oversampling.os_ratio = AD7606_OSR_1;
+	dev->oversampling.os_pad = 0;
+	dev->config.op_mode = AD7606_NORMAL;
+	dev->config.dout_format = AD7606_2_DOUT;
+	dev->config.ext_os_clock = false;
+	dev->config.status_header = false;
+	dev->digital_diag_enable.rom_crc_err_en = true;
+	dev->digital_diag_enable.mm_crc_err_en = false;
+	dev->digital_diag_enable.int_crc_err_en = false;
+	dev->digital_diag_enable.spi_write_err_en = false;
+	dev->digital_diag_enable.spi_read_err_en = false;
+	dev->digital_diag_enable.busy_stuck_high_err_en = false;
+	dev->digital_diag_enable.clk_fs_os_counter_en = false;
+	dev->digital_diag_enable.interface_check_en = false;
+	dev->reg_mode = false;
+}
+
+/***************************************************************************//**
+ * @brief Reset the device by toggling the reset GPIO.
+ *
+ * @param dev        - The device structure.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - Reset GPIO not available.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_reset(struct ad7606_dev *dev)
+{
+	int32_t ret;
+
+	ret = gpio_set_value(dev->gpio_reset, 1);
+	if (ret < 0)
+		return ret;
+
+	udelay(3);
+
+	ret = gpio_set_value(dev->gpio_reset, 0);
+	if (ret < 0)
+		return ret;
+
+	ad7606_reset_settings(dev);
+
+	return ret;
+}
+
+/* Internal function that initializes GPIOs. */
+static int32_t ad7606_request_gpios(struct ad7606_dev *dev,
+				    struct ad7606_init_param *init_param)
+{
+	int32_t ret;
+
+	ret = gpio_get_optional(&dev->gpio_reset, init_param->gpio_reset);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_reset) {
+		ret = gpio_direction_output(dev->gpio_reset, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_convst, init_param->gpio_convst);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_convst) {
+		ret = gpio_direction_output(dev->gpio_convst, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_busy, init_param->gpio_busy);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_busy) {
+		ret = gpio_direction_input(dev->gpio_busy);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_stby_n, init_param->gpio_stby_n);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_stby_n) {
+		ret = gpio_direction_output(dev->gpio_stby_n, GPIO_HIGH);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_range, init_param->gpio_range);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_range) {
+		ret = gpio_direction_output(dev->gpio_range, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	if (!ad7606_chip_info_tbl[dev->device_id].has_oversampling)
+		return ret;
+
+	ret = gpio_get_optional(&dev->gpio_os0, init_param->gpio_os0);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_os0) {
+		ret = gpio_direction_output(dev->gpio_os0, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_os1, init_param->gpio_os1);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_os1) {
+		ret = gpio_direction_output(dev->gpio_os1, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_os2, init_param->gpio_os2);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_os2) {
+		ret = gpio_direction_output(dev->gpio_os2, GPIO_LOW);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = gpio_get_optional(&dev->gpio_par_ser, init_param->gpio_par_ser);
+	if (ret < 0)
+		return ret;
+
+	if (dev->gpio_par_ser) {
+		/* Driver currently supports only serial interface, therefore,
+		 * if available, pull the GPIO HIGH. */
+		ret = gpio_direction_output(dev->gpio_par_ser, GPIO_HIGH);
+		if (ret < 0)
+			return ret;
+	}
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the oversampling ratio.
+ *
+ * In hardware mode, it silently sets AD7606_OSR_64 if higher oversampling
+ * is provided.
+ *
+ * @param dev          - The device structure.
+ * @param oversampling - Oversampling settings.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_oversampling(struct ad7606_dev *dev,
+				struct ad7606_oversampling oversampling)
+{
+	int32_t ret;
+	uint8_t val;
+
+	if (dev->sw_mode) {
+		val = field_prep(AD7606_OS_RATIO_MSK, oversampling.os_ratio);
+		val |= field_prep(AD7606_OS_PAD_MSK, oversampling.os_pad);
+		ret = ad7606_spi_reg_write(dev, AD7606_REG_OVERSAMPLING, val);
+		if (ret < 0)
+			return ret;
+	} else {
+		/* In hardware mode, OSR 128 and 256 are not avaialable */
+		if (oversampling.os_ratio > AD7606_OSR_64)
+			oversampling.os_ratio = AD7606_OSR_64;
+
+		ret = gpio_set_value(dev->gpio_os0, ((oversampling.os_ratio & 0x01) >> 0));
+		if (ret < 0)
+			return ret;
+
+		ret = gpio_set_value(dev->gpio_os1, ((oversampling.os_ratio & 0x02) >> 1));
+		if (ret < 0)
+			return ret;
+
+		ret = gpio_set_value(dev->gpio_os2, ((oversampling.os_ratio & 0x04) >> 2));
+		if (ret < 0)
+			return ret;
+	}
+
+	dev->oversampling = oversampling;
+
+	return SUCCESS;
+}
+
+/* Internal function to find the index of a given operation range in the
+ * operation range table specific to a device. */
+static int8_t ad7606_find_range(struct ad7606_dev *dev,
+				struct ad7606_range range)
+{
+	uint8_t i;
+	int8_t v = -1;
+	const struct ad7606_range *rt = dev->sw_mode ?
+						ad7606_chip_info_tbl[dev->device_id].sw_range_table:
+						ad7606_chip_info_tbl[dev->device_id].hw_range_table;
+
+	uint32_t rtsz = dev->sw_mode ?
+			ad7606_chip_info_tbl[dev->device_id].sw_range_table_sz:
+			ad7606_chip_info_tbl[dev->device_id].hw_range_table_sz;
+
+	for (i = 0; i < rtsz; i++) {
+		if (range.min != rt[i].min)
+			continue;
+		if (range.max != rt[i].max)
+			continue;
+		if (range.differential != rt[i].differential)
+			continue;
+		v = i;
+		break;
+	}
+
+	return v;
+}
+
+/***************************************************************************//**
+ * @brief Set the channel operation range.
+ *
+ * @param dev        - The device structure.
+ * @param ch         - Channel number (0-7).
+ * @param range      - Operation range.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EINVAL - Invalid input.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_ch_range(struct ad7606_dev *dev, uint8_t ch,
+			    struct ad7606_range range)
+{
+	int value;
+	int32_t ret;
+
+	if (range.min > range.max)
+		return -EINVAL;
+
+	if (ch >= dev->num_channels)
+		return -EINVAL;
+
+	value = ad7606_find_range(dev, range);
+	if (value < 0)
+		return -EINVAL;
+
+	if (dev->sw_mode)
+		ret = ad7606_spi_write_mask(dev, AD7606_REG_RANGE_CH_ADDR(ch),
+					    AD7606_RANGE_CH_MSK(ch),
+					    AD7606_RANGE_CH_MODE(ch, value));
+	else
+		ret = gpio_set_value(dev->gpio_range, value);
+
+	if (ret)
+		return ret;
+
+	dev->range_ch[ch] = range;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the channel offset.
+ *
+ * The offset parameter is a signed 8-bit integer ranging from -128 to 127 to
+ * make it intuitive and user-friendly.
+ *
+ * This offset gets converted to the register representation where 0x80 is
+ * calibration offset 0, 0x0 is calibration offset -128 and 0xFF is calibration
+ * offset 127, etc.
+ *
+ * @param dev        - The device structure.
+ * @param ch         - Channel number (0-7).
+ * @param offset     - Offset calibration amount (-128...127).
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EINVAL - Invalid input.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_ch_offset(struct ad7606_dev *dev, uint8_t ch,
+			     int8_t offset)
+{
+	int ret;
+	uint8_t value = (uint8_t)(offset - 0x80);
+
+	if (ch >= dev->num_channels)
+		return -EINVAL;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	ret = ad7606_spi_reg_write(dev, AD7606_REG_OFFSET_CH(ch), value);
+	if (ret < 0)
+		return ret;
+
+	dev->offset_ch[ch] = offset;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the channel phase.
+ *
+ * @param dev        - The device structure.
+ * @param ch         - Channel number (0-7).
+ * @param phase      - Phase calibration amount.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EINVAL - Invalid input.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_ch_phase(struct ad7606_dev *dev, uint8_t ch,
+			    uint8_t phase)
+{
+	int ret;
+
+	if (ch >= dev->num_channels)
+		return -EINVAL;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	ret = ad7606_spi_reg_write(dev, AD7606_REG_PHASE_CH(ch), phase);
+	if (ret < 0)
+		return ret;
+
+	dev->phase_ch[ch] = phase;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the channel gain.
+ *
+ * @param dev        - The device structure.
+ * @param ch         - Channel number (0-7).
+ * @param gain       - Gain calibration amount.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EINVAL - Invalid input.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_ch_gain(struct ad7606_dev *dev, uint8_t ch,
+			   uint8_t gain)
+{
+	int ret;
+
+	if (ch >= dev->num_channels)
+		return -EINVAL;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	gain = field_get(AD7606_GAIN_MSK, gain);
+	ret = ad7606_spi_reg_write(dev, AD7606_REG_GAIN_CH(ch), gain);
+	if (ret < 0)
+		return ret;
+
+	dev->gain_ch[ch] = gain;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the device config register.
+ *
+ * Configuration structure affects the CONFIG register of the device.
+ *
+ * @param dev        - The device structure.
+ * @param config     - Configuration structure.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -EIO - GPIO not available.
+ *                  -EINVAL - Invalid input.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_config(struct ad7606_dev *dev,
+			  struct ad7606_config config)
+{
+	int32_t ret;
+	uint8_t val = 0;
+	uint8_t range_pin, stby_n_pin;
+
+	if (dev->sw_mode) {
+
+		val |= field_prep(AD7606_CONFIG_OPERATION_MODE_MSK, config.op_mode);
+		/* This driver currently supports only normal SPI with 1 DOUT line.
+		 * TODO: remove this check when implementing multi-line DOUT. */
+		if ((uint8_t)config.dout_format > AD7606_1_DOUT)
+			return -EINVAL;
+		if ((uint8_t)config.dout_format > (uint8_t)dev->max_dout_lines)
+			return -EINVAL;
+		val |= field_prep(AD7606_CONFIG_DOUT_FORMAT_MSK, config.dout_format);
+		val |= field_prep(AD7606_CONFIG_EXT_OS_CLOCK_MSK, config.ext_os_clock);
+		val |= field_prep(AD7606_CONFIG_STATUS_HEADER_MSK, config.status_header);
+
+		ret = ad7606_spi_reg_write(dev, AD7606_REG_CONFIG, val);
+		if (ret)
+			return ret;
+	} else {
+		switch(config.op_mode) {
+		case AD7606_NORMAL:
+			range_pin = GPIO_LOW;
+			stby_n_pin = GPIO_HIGH;
+			break;
+		case AD7606_STANDBY:
+			range_pin = GPIO_LOW;
+			stby_n_pin = GPIO_LOW;
+			break;
+		case AD7606_SHUTDOWN:
+			range_pin = GPIO_HIGH;
+			stby_n_pin = GPIO_LOW;
+			break;
+		default:
+			return -EINVAL;
+		};
+
+		ret = gpio_set_value(dev->gpio_stby_n, stby_n_pin);
+		if (ret)
+			return ret;
+
+		ret = gpio_set_value(dev->gpio_range, range_pin);
+		if (ret)
+			return ret;
+	}
+
+	dev->config = config;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Set the device digital diagnostics configuration.
+ *
+ * Digital diagnostics structure affects the DIGITAL_DIAG register of the device.
+ *
+ * @param dev        - The device structure.
+ * @param diag       - Configuration structure.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  -ENOTSUP - Device not in software mode.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_set_digital_diag(struct ad7606_dev *dev,
+				struct ad7606_digital_diag diag)
+{
+	int32_t ret;
+	uint8_t val = 0;
+
+	if (!dev->sw_mode)
+		return -ENOTSUP;
+
+	val |= field_prep(AD7606_ROM_CRC_ERR_EN_MSK, diag.rom_crc_err_en);
+	val |= field_prep(AD7606_MM_CRC_ERR_EN_MSK, diag.mm_crc_err_en);
+	val |= field_prep(AD7606_INT_CRC_ERR_EN_MSK, diag.int_crc_err_en);
+	val |= field_prep(AD7606_SPI_WRITE_ERR_EN_MSK, diag.spi_write_err_en);
+	val |= field_prep(AD7606_SPI_READ_ERR_EN_MSK, diag.spi_read_err_en);
+	val |= field_prep(AD7606_BUSY_STUCK_HIGH_ERR_EN_MSK,
+			  diag.busy_stuck_high_err_en);
+	val |= field_prep(AD7606_CLK_FS_OS_COUNTER_EN_MSK, diag.clk_fs_os_counter_en);
+	val |= field_prep(AD7606_INTERFACE_CHECK_EN_MSK, diag.interface_check_en);
+
+	ret = ad7606_spi_reg_write(dev, AD7606_REG_DIGITAL_DIAG_ENABLE, val);
+	if (ret < 0)
+		return ret;
+
+	dev->digital_diag_enable = diag;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Initialize the ad7606 device structure.
+ *
+ * Performs memory allocation of the device structure.
+ *
+ * @param device     - Pointer to location of device structure to write.
+ * @param init_param - Pointer to configuration of the driver.
+ *
+ * @return ret - return code.
+ *         Example: -ENOMEM - Memory allocation error.
+ *                  -EIO - SPI communication error.
+ *                  -EIO - GPIO initialization error.
+ *                  -ENODEV - Unexpected device id.
+ *                  -EBADMSG - CRC computation mismatch.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_init(struct ad7606_dev **device,
+		    struct ad7606_init_param *init_param)
+{
+	struct ad7606_dev *dev;
+	uint8_t reg, id;
+	int32_t i, ret;
+
+	crc8_populate_msb(ad7606_crc8, 0x7);
+	crc16_populate_msb(ad7606_crc16, 0x755b);
+
+	dev = (struct ad7606_dev *)calloc(1, sizeof(*dev));
+	if (!dev)
+		return -ENOMEM;
+
+	dev->device_id = init_param->device_id;
+	dev->num_channels = ad7606_chip_info_tbl[dev->device_id].num_channels;
+	dev->max_dout_lines = ad7606_chip_info_tbl[dev->device_id].max_dout_lines;
+	if (ad7606_chip_info_tbl[dev->device_id].has_registers)
+		dev->sw_mode = init_param->sw_mode;
+
+	ret = ad7606_request_gpios(dev, init_param);
+	if (ret < 0)
+		goto error;
+
+	if (init_param->sw_mode) {
+		ret = gpio_set_value(dev->gpio_os0, GPIO_HIGH);
+		if (ret < 0)
+			goto error;
+
+		ret = gpio_set_value(dev->gpio_os1, GPIO_HIGH);
+		if (ret < 0)
+			goto error;
+
+		ret = gpio_set_value(dev->gpio_os2, GPIO_HIGH);
+		if (ret < 0)
+			goto error;
+	}
+
+	ret = ad7606_reset(dev);
+	if (ret < 0)
+		goto error;
+
+	/* wait DEVICE_SETUP time */
+	udelay(253);
+
+	ret = spi_init(&dev->spi_desc, &init_param->spi_init);
+	if (ret < 0)
+		goto error;
+
+	if (dev->sw_mode) {
+		ret = ad7606_spi_reg_read(dev, AD7606_REG_ID, &reg);
+		if (ret < 0)
+			goto error;
+
+		id = ad7606_chip_info_tbl[dev->device_id].device_id;
+		if (field_get(AD7606_ID_DEVICE_ID_MSK, reg) != id) {
+			printf("ad7606: device id mismatch, expected 0x%.2x, got 0x%.2x\n",
+			       id,
+			       (int)field_get(AD7606_ID_DEVICE_ID_MSK, reg));
+			ret = -ENODEV;
+			goto error;
+		}
+
+		ret = ad7606_set_digital_diag(dev, init_param->digital_diag_enable);
+		if (ret < 0)
+			goto error;
+
+		ret = ad7606_set_config(dev, init_param->config);
+		if (ret < 0)
+			goto error;
+
+		for (i = 0; i < dev->num_channels; i++) {
+			ret = ad7606_set_ch_range(dev, i, init_param->range_ch[i]);
+			if (ret < 0)
+				goto error;
+		}
+
+		for(i = 0; i < dev->num_channels; i++) {
+			ret = ad7606_set_ch_offset(dev, i, init_param->offset_ch[i]);
+			if (ret < 0)
+				goto error;
+		}
+
+		for(i = 0; i < dev->num_channels; i++) {
+			ret = ad7606_set_ch_phase(dev, i, init_param->phase_ch[i]);
+			if (ret < 0)
+				goto error;
+		}
+
+		for(i = 0; i < dev->num_channels; i++) {
+			ret = ad7606_set_ch_gain(dev, i, init_param->gain_ch[i]);
+			if (ret < 0)
+				goto error;
+		}
+	} else {
+		ret = ad7606_set_ch_range(dev, 0, init_param->range_ch[0]);
+		if (ret < 0)
+			goto error;
+	}
+
+	ret = gpio_set_value(dev->gpio_convst, 1);
+	if (ret < 0)
+		goto error;
+
+	if (ad7606_chip_info_tbl[dev->device_id].has_oversampling)
+		ad7606_set_oversampling(dev, init_param->oversampling);
+
+	*device = dev;
+
+	printf("ad7606 successfully initialized\n");
+
+	return ret;
+error:
+	printf("ad7606 initialization failed\n");
+	ad7606_remove(dev);
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Free any resource used by the driver.
+ *
+ * @param dev        - The device structure.
+ *
+ * @return ret - return code.
+ *         Example: -EIO - SPI communication error.
+ *                  SUCCESS - No errors encountered.
+*******************************************************************************/
+int32_t ad7606_remove(struct ad7606_dev *dev)
+{
+	int32_t ret;
+
+	gpio_remove(dev->gpio_reset);
+	gpio_remove(dev->gpio_convst);
+	gpio_remove(dev->gpio_busy);
+	gpio_remove(dev->gpio_stby_n);
+	gpio_remove(dev->gpio_range);
+	gpio_remove(dev->gpio_os0);
+	gpio_remove(dev->gpio_os1);
+	gpio_remove(dev->gpio_os2);
+	gpio_remove(dev->gpio_par_ser);
+
+	ret = spi_remove(dev->spi_desc);
+
+	free(dev);
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/adc/ad7606/ad7606.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/adc/ad7606/ad7606.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,412 @@
+/***************************************************************************//**
+ *   @file   ad7606.h
+ *   @brief  Header file for the ad7606 Driver.
+ *   @author Stefan Popa (stefan.popa@analog.com)
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef AD7606_H_
+#define AD7606_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include <stdbool.h>
+
+//#include "platform_drivers.h"
+#include "irq.h"
+#include "util.h"
+#include "delay.h"
+#include "error.h"
+#include "gpio.h"
+#include "i2c.h"
+#include "spi.h"
+#include "uart.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+/* Error codes defined in 'errno.h' file but can't find by Mbed online/offline
+ * compiler
+ * */
+#define ENOTSUP						134
+#define EBADMSG 					77	/* Bad message */
+#define ETIME 						62	/* Stream ioctl timeout */
+#define	ENODEV 						19	/* No such device */
+
+#define AD7606_REG_STATUS			0x01
+#define AD7606_REG_CONFIG			0x02
+#define AD7606_REG_RANGE_CH_ADDR(ch)		(0x03 + ((ch) >> 1))
+#define AD7606_REG_BANDWIDTH			0x07
+#define AD7606_REG_OVERSAMPLING			0x08
+#define AD7606_REG_GAIN_CH(ch)			(0x09 + (ch))
+#define AD7606_REG_OFFSET_CH(ch)		(0x11 + (ch))
+#define AD7606_REG_PHASE_CH(ch)			(0x19 + (ch))
+#define AD7606_REG_DIGITAL_DIAG_ENABLE		0x21
+#define AD7606_REG_DIGITAL_DIAG_ERR		0x22
+#define AD7606_REG_OPEN_DETECT_ENABLE		0x23
+#define AD7606_REG_OPEN_DETECTED		0x24
+#define AD7606_REG_AIN_OV_UV_DIAG_ENABLE	0x25
+#define AD7606_REG_AIN_OV_DIAG_ERROR		0x26
+#define AD7606_REG_AIN_UV_DIAG_ERROR		0x27
+#define AD7606_REG_DIAGNOSTIC_MUX_CH(ch)	(0x28 + ((ch) >> 1))
+#define AD7606_REG_OPEN_DETECT_QUEUE		0x2C
+#define AD7606_REG_CLK_FS_COUNTER		0x2D
+#define AD7606_REG_CLK_OS_COUNTER		0x2E
+#define AD7606_REG_ID				0x2F
+
+/* AD7606_REG_STATUS */
+#define AD7606_STATUS_CHANNEL_MSK		GENMASK(2,0)
+#define AD7606_AIN_UV_ERR_MSK			BIT(3)
+#define AD7606_AIN_OV_ERR_MSK			BIT(4)
+#define AD7606_OPEN_DETECTED_MSK		BIT(5)
+#define AD7606_DIGITAL_ERROR_MSK		BIT(6)
+#define AD7606_RESET_DETECT_MSK			BIT(7)
+
+/* AD7606_REG_CONFIG */
+#define AD7606_CONFIG_OPERATION_MODE_MSK	GENMASK(1,0)
+#define AD7606_CONFIG_DOUT_FORMAT_MSK		GENMASK(4,3)
+#define AD7606_CONFIG_EXT_OS_CLOCK_MSK		BIT(5)
+#define AD7606_CONFIG_STATUS_HEADER_MSK		BIT(6)
+
+/* AD7606_REG_RANGE_CH_X_Y */
+#define AD7606_RANGE_CH_MSK(ch)		(GENMASK(3, 0) << (4 * ((ch) % 2)))
+#define AD7606_RANGE_CH_MODE(ch, mode)	\
+	((GENMASK(3, 0) & mode) << (4 * ((ch) % 2)))
+
+/* AD7606_REG_OVERSAMPLING */
+#define AD7606_OS_PAD_MSK			GENMASK(7,4)
+#define AD7606_OS_RATIO_MSK			GENMASK(3,0)
+
+/* AD7606_REG_ID */
+#define AD7606_ID_DEVICE_ID_MSK			GENMASK(7,4)
+#define AD7606_ID_SILICON_REVISION_MSK		GENMASK(3,0)
+
+/* AD7606_REG_GAIN_CH */
+#define AD7606_GAIN_MSK				GENMASK(5,0)
+
+/* AD7606_REG_DIGITAL_DIAG_ENABLE */
+#define AD7606_ROM_CRC_ERR_EN_MSK		BIT(0)
+#define AD7606_MM_CRC_ERR_EN_MSK		BIT(1)
+#define AD7606_INT_CRC_ERR_EN_MSK		BIT(2)
+#define AD7606_SPI_WRITE_ERR_EN_MSK		BIT(3)
+#define AD7606_SPI_READ_ERR_EN_MSK		BIT(4)
+#define AD7606_BUSY_STUCK_HIGH_ERR_EN_MSK	BIT(5)
+#define AD7606_CLK_FS_OS_COUNTER_EN_MSK		BIT(6)
+#define AD7606_INTERFACE_CHECK_EN_MSK		BIT(7)
+
+/* AD7606_REG_DIAGNOSTIC_MUX_CH */
+#define AD7606_DIAGN_MUX_CH_MSK(ch)		(GENMASK(2, 0) << (3 * (ch & 0x1)))
+
+#define AD7606_RD_FLAG_MSK(x)		(BIT(6) | ((x) & 0x3F))
+#define AD7606_WR_FLAG_MSK(x)		((x) & 0x3F)
+
+#define AD7606_MAX_CHANNELS		8
+
+/**
+ * @enum ad7606_device_id
+ * @brief Device ID definitions
+ */
+enum ad7606_device_id {
+	/** 4-Channel DAS with 16-Bit, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7605_4,
+	/** 4-Channel DAS with 16-Bit, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606_4,
+	/** 6-Channel DAS with 16-Bit, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606_6,
+	/** 8-Channel DAS with 16-Bit, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606_8,
+	/** 8-Channel DAS with 16-Bit, 800 kSPS, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606B,
+	/** 8-Channel DAS with 16-Bit, 1 MSPS, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606C_16,
+	/** 8-Channel DAS with 18-Bit, 1 MSPS, Bipolar Input, Simultaneous Sampling ADC */
+	ID_AD7606C_18,
+	/** 8-Channel DAS with 18-Bit, Bipolar, Simultaneous Sampling ADC */
+	ID_AD7608,
+	/** 8-Channel Differential DAS with 18-Bit, Bipolar, Simultaneous Sampling ADC */
+	ID_AD7609,
+};
+
+/**
+ * @enum ad7606_osr
+ * @brief Oversampling ratio
+ */
+enum ad7606_osr {
+	/** Oversample by 1 */
+	AD7606_OSR_1,
+	/** Oversample by 2 */
+	AD7606_OSR_2,
+	/** Oversample by 4 */
+	AD7606_OSR_4,
+	/** Oversample by 8 */
+	AD7606_OSR_8,
+	/** Oversample by 16 */
+	AD7606_OSR_16,
+	/** Oversample by 32 */
+	AD7606_OSR_32,
+	/** Oversample by 64 */
+	AD7606_OSR_64,
+	/** Oversample by 128, available for chips that have software mode only */
+	AD7606_OSR_128,
+	/** Oversample by 256, available for chips that have software mode only */
+	AD7606_OSR_256
+};
+
+/**
+ * @enum ad7606_op_mode
+ * @brief Operation mode
+ */
+enum ad7606_op_mode {
+	/** Normal operation mode */
+	AD7606_NORMAL,
+	/** Standby mode, all the PGAs, and all the SAR ADCs enter a low power mode */
+	AD7606_STANDBY,
+	/** Autostandby mode, available only in software mode */
+	AD7606_AUTOSTANDBY,
+	/** Shutdown mode, all circuitry is powered down */
+	AD7606_SHUTDOWN
+};
+
+/**
+ * @enum ad7606_dout_format
+ * @brief Number of DOUT lines
+ */
+enum ad7606_dout_format {
+	/** DOUT A line is used */
+	AD7606_1_DOUT,
+	/** DOUT A,B lines are used. */
+	AD7606_2_DOUT,
+	/** DOUT A,B,C,D lines are used. */
+	AD7606_4_DOUT,
+	/** DOUT A,B,C,D,E,F,G,H lines are used. */
+	AD7606_8_DOUT
+};
+
+/**
+ * @struct ad7606_config
+ * @brief AD7606_REG_CONFIG configuration parameters
+ */
+struct ad7606_config {
+	/** Operation mode */
+	enum ad7606_op_mode op_mode;
+	/** Number of DOUT lines */
+	enum ad7606_dout_format dout_format;
+	/** External oversampling clock switch */
+	bool ext_os_clock;
+	/** Status header switch */
+	bool status_header;
+};
+
+/**
+ * @struct ad7606_range
+ * @brief Operation range as specified in datasheet (in uV)
+ */
+struct ad7606_range {
+	/** Minimum range value (may be negative) */
+	int32_t min;
+	/** Maximum range value */
+	int32_t max;
+	/** Whether the range is differential */
+	bool differential;
+};
+
+/**
+ * @struct ad7606_digital_diag
+ * @brief Oversampling settings
+ */
+struct ad7606_oversampling {
+	/** Oversampling padding */
+	uint8_t os_pad:4;
+	/** Oversampling ratio */
+	enum ad7606_osr os_ratio:4;
+};
+
+/**
+ * @struct ad7606_digital_diag
+ * @brief Digital diagnostics configuration switches
+ */
+struct ad7606_digital_diag {
+	/** ROM CRC check switch */
+	bool rom_crc_err_en: 1;
+	/** Mempry map CRC check switch */
+	bool mm_crc_err_en: 1;
+	/** Conversion and register data CRC check switch */
+	bool int_crc_err_en: 1;
+	/** SPI write error switch  */
+	bool spi_write_err_en: 1;
+	/** SPI read error switch  */
+	bool spi_read_err_en: 1;
+	/** Busy stuck high for more than 4us error switch  */
+	bool busy_stuck_high_err_en: 1;
+	/** Frame sync and oversampling clock counter switch  */
+	bool clk_fs_os_counter_en: 1;
+	/** Interface check switch */
+	bool interface_check_en: 1;
+};
+
+/**
+ * @struct ad7606_dev
+ * @brief Device driver structure
+ */
+struct ad7606_dev {
+	/** SPI descriptor*/
+	spi_desc *spi_desc;
+	/** RESET GPIO descriptor */
+	struct gpio_desc *gpio_reset;
+	/** CONVST GPIO descriptor */
+	struct gpio_desc *gpio_convst;
+	/** BUSY GPIO descriptor */
+	struct gpio_desc *gpio_busy;
+	/** STBYn GPIO descriptor */
+	struct gpio_desc *gpio_stby_n;
+	/** RANGE GPIO descriptor */
+	struct gpio_desc *gpio_range;
+	/** OS0 GPIO descriptor */
+	struct gpio_desc *gpio_os0;
+	/** OS1 GPIO descriptor */
+	struct gpio_desc *gpio_os1;
+	/** OS2 GPIO descriptor */
+	struct gpio_desc *gpio_os2;
+	/** PARn/SER GPIO descriptor */
+	struct gpio_desc *gpio_par_ser;
+	/** Device ID */
+	enum ad7606_device_id device_id;
+	/** Oversampling settings */
+	struct ad7606_oversampling oversampling;
+	/** Whether the device is running in hardware or software mode */
+	bool sw_mode;
+	/** Whether the device is running in register or ADC reading mode */
+	bool reg_mode;
+	/** Number of DOUT lines supported by the device */
+	enum ad7606_dout_format max_dout_lines;
+	/** Configuration register settings */
+	struct ad7606_config config;
+	/** Digital diagnostics register settings */
+	struct ad7606_digital_diag digital_diag_enable;
+	/** Number of input channels of the device */
+	uint8_t num_channels;
+	/** Channel offset calibration */
+	int8_t offset_ch[AD7606_MAX_CHANNELS];
+	/** Channel phase calibration */
+	uint8_t phase_ch[AD7606_MAX_CHANNELS];
+	/** Channel gain calibration */
+	uint8_t gain_ch[AD7606_MAX_CHANNELS];
+	/** Channel operating range */
+	struct ad7606_range range_ch[AD7606_MAX_CHANNELS];
+	/** Data buffer (used internally by the SPI communication functions) */
+	uint8_t data[28];
+};
+
+/**
+ * @struct ad7606_dev
+ * @brief Device driver initialization parameters
+ */
+struct ad7606_init_param {
+	/** SPI initialization parameters */
+	spi_init_param spi_init;
+	/** RESET GPIO initialization parameters */
+	struct gpio_init_param *gpio_reset;
+	/** CONVST GPIO initialization parameters */
+	struct gpio_init_param *gpio_convst;
+	/** BUSY GPIO initialization parameters */
+	struct gpio_init_param *gpio_busy;
+	/** STBYn GPIO initialization parameters */
+	struct gpio_init_param *gpio_stby_n;
+	/** RANGE GPIO initialization parameters */
+	struct gpio_init_param *gpio_range;
+	/** OS0 GPIO initialization parameters */
+	struct gpio_init_param *gpio_os0;
+	/** OS1 GPIO initialization parameters */
+	struct gpio_init_param *gpio_os1;
+	/** OS2 GPIO initialization parameters */
+	struct gpio_init_param *gpio_os2;
+	/** PARn/SER GPIO initialization parameters */
+	struct gpio_init_param *gpio_par_ser;
+	/** Device ID */
+	enum ad7606_device_id device_id;
+	/** Oversampling settings */
+	struct ad7606_oversampling oversampling;
+	/** Whether the device is running in hardware or software mode */
+	bool sw_mode;
+	/** Configuration register settings */
+	struct ad7606_config config;
+	/** Digital diagnostics register settings */
+	struct ad7606_digital_diag digital_diag_enable;
+	/** Channel offset calibration */
+	int8_t offset_ch[AD7606_MAX_CHANNELS];
+	/** Channel phase calibration */
+	uint8_t phase_ch[AD7606_MAX_CHANNELS];
+	/** Channel gain calibration */
+	uint8_t gain_ch[AD7606_MAX_CHANNELS];
+	/** Channel operating range */
+	struct ad7606_range range_ch[AD7606_MAX_CHANNELS];
+};
+
+int32_t ad7606_spi_reg_read(struct ad7606_dev *dev,
+			    uint8_t reg_addr,
+			    uint8_t *reg_data);
+int32_t ad7606_spi_reg_write(struct ad7606_dev *dev,
+			     uint8_t reg_addr,
+			     uint8_t reg_data);
+int32_t ad7606_spi_write_mask(struct ad7606_dev *dev,
+			      uint32_t addr,
+			      uint32_t mask,
+			      uint32_t val);
+int32_t ad7606_spi_data_read(struct ad7606_dev *dev,
+			     uint32_t *data);
+int32_t ad7606_read(struct ad7606_dev *dev,
+		    uint32_t *data);
+int32_t ad7606_convst(struct ad7606_dev *dev);
+int32_t ad7606_reset(struct ad7606_dev *dev);
+int32_t ad7606_set_oversampling(struct ad7606_dev *dev,
+				struct ad7606_oversampling oversampling);
+int32_t ad7606_set_ch_range(struct ad7606_dev *dev, uint8_t ch,
+			    struct ad7606_range range);
+int32_t ad7606_set_ch_offset(struct ad7606_dev *dev, uint8_t ch,
+			     int8_t offset);
+int32_t ad7606_set_ch_phase(struct ad7606_dev *dev, uint8_t ch,
+			    uint8_t phase);
+int32_t ad7606_set_ch_gain(struct ad7606_dev *dev, uint8_t ch,
+			   uint8_t gain);
+int32_t ad7606_set_config(struct ad7606_dev *dev,
+			  struct ad7606_config config);
+int32_t ad7606_set_digital_diag(struct ad7606_dev *dev,
+				struct ad7606_digital_diag diag);
+int32_t ad7606_init(struct ad7606_dev **device,
+		    struct ad7606_init_param *init_param);
+int32_t ad7606_remove(struct ad7606_dev *dev);
+#endif /* AD7606_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/dac/ad5686/ad5686.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/dac/ad5686/ad5686.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,764 @@
+/***************************************************************************//**
+*   @file   ad5686.c
+*   @brief  Implementation of AD5686 Driver.
+*   @author Istvan Csomortani (istvan.csomortani@analog.com)
+*******************************************************************************
+* Copyright 2013, 2020(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS
+* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+******************************************************************************/
+
+/*****************************************************************************/
+/***************************** Include Files *********************************/
+/*****************************************************************************/
+#include <stdlib.h>
+#include "ad5686.h"
+
+/*****************************************************************************/
+/***************************** Constant definition ***************************/
+/*****************************************************************************/
+static const uint32_t ad5683_channel_addr [] = {
+	[AD5686_CH_0] = 0,
+};
+
+static const uint32_t ad5689_channel_addr[] = {
+	[AD5686_CH_0] = 1,
+	[AD5686_CH_1] = 8,
+};
+
+static const uint32_t ad5686_channel_addr[] = {
+	[AD5686_CH_0] = 1,
+	[AD5686_CH_1] = 2,
+	[AD5686_CH_2] = 4,
+	[AD5686_CH_3] = 8,
+};
+
+static const uint32_t ad5676_channel_addr[] = {
+	[AD5686_CH_0] = 0,
+	[AD5686_CH_1] = 1,
+	[AD5686_CH_2] = 2,
+	[AD5686_CH_3] = 3,
+	[AD5686_CH_4] = 4,
+	[AD5686_CH_5] = 5,
+	[AD5686_CH_6] = 6,
+	[AD5686_CH_7] = 7,
+};
+
+static const uint32_t ad5679_channel_addr[] = {
+	[AD5686_CH_0] = 0,
+	[AD5686_CH_1] = 1,
+	[AD5686_CH_2] = 2,
+	[AD5686_CH_3] = 3,
+	[AD5686_CH_4] = 4,
+	[AD5686_CH_5] = 5,
+	[AD5686_CH_6] = 6,
+	[AD5686_CH_7] = 7,
+	[AD5686_CH_8] = 8,
+	[AD5686_CH_9] = 9,
+	[AD5686_CH_10] = 10,
+	[AD5686_CH_11] = 11,
+	[AD5686_CH_12] = 12,
+	[AD5686_CH_13] = 13,
+	[AD5686_CH_14] = 14,
+	[AD5686_CH_15] = 15,
+};
+
+static const struct ad5686_chip_info chip_info[] = {
+	[ID_AD5671R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5676_channel_addr,
+	},
+	[ID_AD5672R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5676_channel_addr,
+	},
+	[ID_AD5673R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5674] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5674R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5675R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5676_channel_addr,
+	},
+	[ID_AD5676] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5676_channel_addr,
+	},
+	[ID_AD5676R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5676_channel_addr,
+	},
+	[ID_AD5677R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5679] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5679R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5679_channel_addr,
+	},
+	[ID_AD5684R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5685R] = {
+		.resolution = 14,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5686] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5686R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5687] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5689_channel_addr,
+	},
+	[ID_AD5687R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5689_channel_addr,
+	},
+	[ID_AD5689] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5689_channel_addr,
+	},
+	[ID_AD5689R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5689_channel_addr,
+	},
+	[ID_AD5697R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5689_channel_addr,
+	},
+	[ID_AD5694] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5694R] = {
+		.resolution = 12,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5695R] = {
+		.resolution = 14,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5696] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5696R] = {
+		.resolution = 16,
+		.register_map = AD5686_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5686_channel_addr,
+	},
+	[ID_AD5681R] = {
+		.resolution = 12,
+		.register_map = AD5683_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5682R] = {
+		.resolution = 14,
+		.register_map = AD5683_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5683R] = {
+		.resolution = 16,
+		.register_map = AD5683_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5683] = {
+		.resolution = 16,
+		.register_map = AD5683_REG_MAP,
+		.communication = SPI,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5691R] = {
+		.resolution = 12,
+		.register_map = AD5683_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5692R] = {
+		.resolution = 14,
+		.register_map = AD5683_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5693R] = {
+		.resolution = 16,
+		.register_map = AD5683_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5683_channel_addr,
+	},
+	[ID_AD5693] = {
+		.resolution = 16,
+		.register_map = AD5683_REG_MAP,
+		.communication = I2C,
+		.channel_addr = ad5683_channel_addr,
+	}
+};
+
+/***************************************************************************//**
+ * @brief Initializes the communication peripheral and the initial Values for
+ *        AD5686 Board.
+ *
+ * @param device     - The device structure.
+ * @param init_param - The structure that contains the device initial
+ * 		       parameters.
+ *
+ * @return ret - The result of the initialization procedure.
+ *               Example: -1 - I2C peripheral was not initialized or the
+ *                             device is not present.
+ *                         0 - I2C peripheral was initialized and the
+ *                             device is present.
+*******************************************************************************/
+int32_t ad5686_init(struct ad5686_dev **device,
+		    struct ad5686_init_param init_param)
+{
+	struct ad5686_dev *dev;
+	int32_t ret;
+
+	dev = (struct ad5686_dev *)malloc(sizeof(*dev));
+	if (!dev)
+		return -1;
+
+	dev->act_device = init_param.act_device;
+	dev->power_down_mask = 0;
+	dev->ldac_mask = 0;
+
+	if (chip_info[dev->act_device].communication == SPI)
+		ret = spi_init(&dev->spi_desc, &init_param.spi_init);
+	else
+		ret = i2c_init(&dev->i2c_desc, &init_param.i2c_init);
+
+
+	/* GPIO */
+	ret |= gpio_get(&dev->gpio_reset, &init_param.gpio_reset);
+	ret |= gpio_get(&dev->gpio_ldac, &init_param.gpio_ldac);
+	ret |= gpio_get(&dev->gpio_gain, &init_param.gpio_gain);
+
+	if (dev->gpio_ldac)
+		ret |= gpio_direction_output(dev->gpio_ldac, GPIO_LOW);
+
+	if (dev->gpio_reset)
+		ret |= gpio_direction_output(dev->gpio_reset, GPIO_HIGH);
+
+	if (dev->gpio_gain)
+		ret |= gpio_direction_output(dev->gpio_gain, GPIO_LOW);
+	*device = dev;
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Free the resources allocated by ad5686_init().
+ *
+ * @param dev - The device structure.
+ *
+ * @return ret - The result of the remove procedure.
+*******************************************************************************/
+int32_t ad5686_remove(struct ad5686_dev *dev)
+{
+	int32_t ret;
+
+	if (chip_info[dev->act_device].communication == SPI)
+		ret = spi_remove(dev->spi_desc);
+	else
+		ret = i2c_remove(dev->i2c_desc);
+
+	if (dev->gpio_ldac)
+		ret |= gpio_remove(dev->gpio_ldac);
+
+	if (dev->gpio_reset)
+		ret |= gpio_remove(dev->gpio_reset);
+
+	if (dev->gpio_gain)
+		ret |= gpio_remove(dev->gpio_gain);
+
+	free(dev);
+
+	return ret;
+}
+
+/**************************************************************************//**
+ * @brief Write to input shift register.
+ *
+ * @param dev     - The device structure.
+ * @param command - Command control bits.
+ * @param address - The address bits.
+ * @param data    - Data to be written in input register.
+ *
+ * @return  read_back_data - value read from register.
+******************************************************************************/
+uint16_t ad5686_set_shift_reg(struct ad5686_dev *dev,
+			      uint8_t command,
+			      uint8_t address,
+			      uint16_t data)
+{
+	uint8_t data_buff [ PKT_LENGTH ] = {0, 0, 0};
+	uint16_t read_back_data = 0;
+
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP) {
+		data_buff[0] = ((command & AD5686_CMD_MASK) << CMD_OFFSET) | \
+			       (address & ADDR_MASK);
+		data_buff[1] = (data & AD5686_MSB_MASK) >> AD5686_MSB_OFFSET;
+		data_buff[2] = (data & AD5686_LSB_MASK);
+	} else {
+		data_buff[0] = ((command & AD5683_CMD_MASK) << CMD_OFFSET) |
+			       ((data >> AD5683_MSB_OFFSET) & AD5683_MSB_MASK);
+		data_buff[1] = (data >> AD5683_MIDB_OFFSET) & AD5683_MIDB_MASK;
+		data_buff[2] = (data & AD5683_LSB_MASK) << AD5683_LSB_OFFSET;
+	}
+
+	if(chip_info[dev->act_device].communication == SPI) {
+		spi_write_and_read(dev->spi_desc, data_buff, PKT_LENGTH);
+		if(chip_info[dev->act_device].register_map == AD5686_REG_MAP)
+			read_back_data = (data_buff[1] << AD5686_MSB_OFFSET) | data_buff[2];
+		else
+			read_back_data = (data_buff[0] & AD5683_CMD_MASK) << AD5683_MSB_OFFSET |
+					 data_buff[1] << AD5683_MIDB_OFFSET |
+					 data_buff[2] >> AD5683_LSB_OFFSET;
+	} else
+		i2c_write(dev->i2c_desc, data_buff, PKT_LENGTH, 1);
+
+	return read_back_data;
+}
+
+/**************************************************************************//**
+ * @brief Write to Input Register n (dependent on LDAC)
+ *
+ * @param dev      - The device structure.
+ * @param channel  - The chosen channel to write to.
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+ * @param data - desired value to be written in register.
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_write_register(struct ad5686_dev *dev,
+			   enum ad5686_dac_channels channel,
+			   uint16_t data)
+{
+	uint8_t data_offset = MAX_RESOLUTION - \
+			      chip_info[dev->act_device].resolution;
+	uint8_t address = chip_info[dev->act_device].channel_addr[channel];
+
+	ad5686_set_shift_reg(dev, AD5686_CTRL_WRITE, address,
+			     data << data_offset);
+}
+
+/**************************************************************************//**
+ * @brief Update DAC Register n with contents of Input Register n
+ *
+ * @param dev     - The device structure.
+ * @param channel  - The chosen channel to write to.
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+  * @return None.
+******************************************************************************/
+void ad5686_update_register(struct ad5686_dev *dev,
+			    enum ad5686_dac_channels channel)
+{
+	uint8_t address = chip_info[dev->act_device].channel_addr[channel];
+
+	ad5686_set_shift_reg(dev, AD5686_CTRL_UPDATE, address, 0);
+}
+
+/**************************************************************************//**
+ * @brief Write to and update DAC channel n
+ *
+ * @param dev     - The device structure.
+ * @param channel  - The chosen channel to write to.
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+ * @param data    - Desired value to be written in register.
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_write_update_register(struct ad5686_dev *dev,
+				  enum ad5686_dac_channels channel,
+				  uint16_t data)
+{
+	uint8_t data_offset = MAX_RESOLUTION - \
+			      chip_info[dev->act_device].resolution;
+	uint8_t address = chip_info[dev->act_device].channel_addr[channel];
+
+	ad5686_set_shift_reg(dev, AD5686_CTRL_WRITEUPDATE, address,
+			     data << data_offset);
+}
+
+/**************************************************************************//**
+ * @brief Read back Input Register n
+ *
+ * @param dev     - The device structure.
+ * @param channel - The channel which will be read back. Note: only one
+ *                  channel should be selected, if there will be selected
+ *                  more than one channel, the channel A will be read back
+ *                  by default
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+ * @return read_back_data - value read from register.
+******************************************************************************/
+uint16_t ad5686_read_back_register(struct ad5686_dev *dev,
+				   enum ad5686_dac_channels channel)
+{
+
+	uint16_t read_back_data = 0;
+	uint16_t offset = MAX_RESOLUTION - \
+			  chip_info[dev->act_device].resolution;
+	uint8_t address = chip_info[dev->act_device].channel_addr[channel];
+	uint8_t rb_data_i2c[3] = { 0 };
+
+	if(chip_info[dev->act_device].communication == SPI) {
+		ad5686_set_shift_reg(dev, AD5686_CTRL_RB_REG, address, 0);
+		read_back_data = ad5686_set_shift_reg(dev, AD5686_CTRL_NOP, 0,
+						      0);
+		read_back_data >>= offset;
+	} else {
+		if (chip_info[dev->act_device].register_map == AD5683_REG_MAP)
+			rb_data_i2c[0] = (AD5683_CTRL_RB_REG << CMD_OFFSET) |
+					 address;
+		else
+			rb_data_i2c[0] = (AD5686_CTRL_RB_REG << CMD_OFFSET) |
+					 address;
+
+		i2c_write(dev->i2c_desc, rb_data_i2c, 3, 0);
+		i2c_read(dev->i2c_desc, rb_data_i2c, 2, 1);
+		read_back_data = (rb_data_i2c[0] << 8) | rb_data_i2c[1];
+	}
+
+	return read_back_data;
+}
+
+/**************************************************************************//**
+ * @brief Set Power-down mode for DAC channel n
+ *
+ * @param dev     - The device structure.
+ * @param channel  - The chosen channel to change the power-down mode.
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+ * @param mode    - Power-down operation modes.
+ *                  Accepted values:
+ *                  'AD5686_PWRM_NORMAL' - Normal Mode
+ *                  'AD5686_PWRM_1K' - Power-down mode 1kOhm to GND
+ *                  'AD5686_PWRM_100K' - Power-down mode 100kOhm to GND
+ *                  'AD5686_PWRM_THREESTATE' - Three-State
+ *                  'AD5686_PWRM_100K' is not available for AD5674R/AD5679R.
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_power_mode(struct ad5686_dev *dev,
+		       enum ad5686_dac_channels channel,
+		       uint8_t mode)
+{
+	uint8_t address = chip_info[dev->act_device].channel_addr[channel];
+
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP) {
+		/* AD5674R/AD5679R have 16 channels and 2 powerdown registers */
+		if (channel > AD5686_CH_7)
+			channel -= AD5686_CH_7 + 1;
+		dev->power_down_mask &= ~(0x3 << (channel *2));
+		dev->power_down_mask |= (mode << (channel *2));
+		ad5686_set_shift_reg(dev, AD5686_CTRL_PWR, address,
+				     dev->power_down_mask);
+	} else {
+		ad5686_set_shift_reg(dev, AD5683_CMD_WR_CTRL_REG, address,
+				     AD5683_CTRL_PWRM(mode));
+	}
+
+}
+
+/**************************************************************************//**
+ * @brief Set hardware LDAC mask register
+ *
+ * @param dev     - The device structure.
+ * @param channel - In case of which channel ignore transitions on the LDAC
+ *                    pin.
+ *                    Accepted values:	AD5686_CH_0
+ *					AD5686_CH_1
+ *					AD5686_CH_2
+ *					AD5686_CH_3
+ *					AD5686_CH_4
+ * 					AD5686_CH_5
+ *					AD5686_CH_6
+ * 					AD5686_CH_7
+ *					AD5686_CH_8
+ *                              	AD5686_CH_9
+ *					AD5686_CH_10
+ *					AD5686_CH_11
+ *					AD5686_CH_12
+ *					AD5686_CH_13
+ *					AD5686_CH_14
+ *					AD5686_CH_15
+ * @param enable - Enable/disable channel.
+ * @return None.
+******************************************************************************/
+void ad5686_ldac_mask(struct ad5686_dev *dev,
+		      enum ad5686_dac_channels channel,
+		      uint8_t enable)
+{
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP) {
+		dev->ldac_mask &= ~(0x1 << channel);
+		dev->ldac_mask |= (enable << channel);
+		ad5686_set_shift_reg(dev, AD5686_CTRL_LDAC_MASK, 0, dev->ldac_mask);
+	}
+}
+
+/**************************************************************************//**
+ * @brief Software reset (power-on reset)
+ *
+ * @param dev - The device structure.
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_software_reset(struct ad5686_dev *dev)
+{
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP)
+		ad5686_set_shift_reg(dev, AD5686_CTRL_SWRESET, 0, 0);
+	else
+		ad5686_set_shift_reg(dev, AD5683_CMD_WR_CTRL_REG, 0, AD5683_SW_RESET);
+}
+
+
+/**************************************************************************//**
+ * @brief Write to Internal reference setup register
+ *
+ * @param dev   - The device structure.
+ * @param value - The internal reference register value
+ *                Example : 'AD5686_INTREF_EN' - enable internal reference
+ *                            'AD5686_INTREF_DIS' - disable internal reference
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_internal_reference(struct ad5686_dev *dev,
+			       uint8_t value)
+{
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP)
+		ad5686_set_shift_reg(dev, AD5686_CTRL_IREF_REG, 0, value);
+	else
+		ad5686_set_shift_reg(dev, AD5683_CMD_WR_CTRL_REG, 0,
+				     AD5683_CTRL_INT_REF(value));
+}
+
+/**************************************************************************//**
+ * @brief Set up DCEN register (daisy-chain enable)
+ *
+ * @param dev   - The device structure.
+ * @param value - Enable or disable daisy-chain mode
+ *                Example : 'AD5686_DC_EN' - daisy-chain enable
+ *                          'AD5686_DC_DIS' - daisy-chain disable
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_daisy_chain_en(struct ad5686_dev *dev,
+			   uint8_t value)
+{
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP)
+		ad5686_set_shift_reg(dev, AD5686_CTRL_DCEN, 0, value);
+	else
+		ad5686_set_shift_reg(dev, AD5683_CMD_WR_CTRL_REG, 0, AD5683_CTRL_DCEN(value));
+}
+
+/**************************************************************************//**
+ * @brief Set up readback register (readback enable)
+ *
+ * @param dev   - The device structure.
+ * @param value - Enable or disable daisy-chain mode
+ *                Example : 'AD5686_RB_EN' - daisy-chain enable
+ *                          'AD5686_RB_DIS' - daisy-chain disable
+ *
+ * @return None.
+******************************************************************************/
+void ad5686_read_back_en(struct ad5686_dev *dev,
+			 uint8_t value)
+{
+	if(chip_info[dev->act_device].register_map == AD5686_REG_MAP)
+		ad5686_set_shift_reg(dev, AD5686_CTRL_RB_REG, 0, value);
+}
+
+/**************************************************************************//**
+ * @brief Set Gain mode
+ *
+ * @param dev   - The device structure.
+ * @param value - Gain modes.
+ *                Accepted values:
+ *                Example : 'AD5683_GB_VREF' - 0V to VREF
+ *                          'AD5683_GB_2VREF' - 0V to 2xVREF
+ *
+ * @return None.
+******************************************************************************/
+int32_t ad5686_gain_mode(struct ad5686_dev *dev, uint8_t value)
+{
+	if(chip_info[dev->act_device].register_map == AD5683_REG_MAP)
+		return ad5686_set_shift_reg(dev, AD5683_CMD_WR_CTRL_REG, 0,
+					    AD5683_CTRL_GM(value));
+	return -1;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/dac/ad5686/ad5686.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/dac/ad5686/ad5686.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,274 @@
+/***************************************************************************//**
+*   @file   ad5686.h
+*   @brief  Header file of AD5686 Driver. This driver supporting the following
+*              devices: AD5684R, AD5685R, AD5686R, AD5694R, AD5695R, AD5696R,
+*
+*   @author Istvan Csomortani (istvan.csomortani@analog.com)
+********************************************************************************
+* Copyright 2013, 2020(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification,
+* are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS
+* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*******************************************************************************/
+
+/*****************************************************************************/
+/***************************** Include Files *********************************/
+/*****************************************************************************/
+#include <stdint.h>
+#include "platform_drivers.h"
+
+/* Control Bits */
+#define AD5686_CTRL_NOP          0
+#define AD5686_CTRL_WRITE        1
+#define AD5686_CTRL_UPDATE       2
+#define AD5686_CTRL_WRITEUPDATE  3
+#define AD5686_CTRL_PWR          4
+#define AD5686_CTRL_LDAC_MASK    5
+#define AD5686_CTRL_SWRESET      6
+#define AD5686_CTRL_IREF_REG     7
+#define AD5686_CTRL_DCEN         8
+#define AD5686_CTRL_RB_REG       9
+
+#define AD5683_CMD_WR_CTRL_REG   4
+#define AD5683_CTRL_RB_REG       5
+
+/* Power-down operation modes masks */
+#define AD5686_PWRM_NORMAL       0
+#define AD5686_PWRM_1K           1
+#define AD5686_PWRM_100K         2
+#define AD5686_PWRM_THREESTATE   3
+
+#define AD5686_PWRM_MASK         3
+
+/* Enable/disable defines */
+#define AD5686_INTREF_EN        1
+#define AD5686_INTREF_DIS       0
+#define AD5686_DC_EN            1
+#define AD5686_DC_DIS           0
+#define AD5686_RB_EN            1
+#define AD5686_RB_DIS           0
+
+#define MAX_RESOLUTION  16     // Maximum resolution of the supported devices
+
+#define PKT_LENGTH               3      // SPI packet length in byte
+
+#define ADDR_MASK                0xFF   // Mask for Address bits
+#define CMD_OFFSET               4      // Offset for Command
+
+#define AD5686_CMD_MASK          0xFF
+#define AD5686_MSB_MASK          0xFF00 // Most significant byte of the data word
+#define AD5686_MSB_OFFSET        8
+#define AD5686_LSB_MASK          0x00FF // Least significant byte of the data word
+#define AD5686_LSB_OFFSET        0
+
+#define AD5683_MIDB_OFFSET       4	   // Offset for middle bits
+#define AD5683_MIDB_MASK         0xFF
+#define AD5683_MSB_OFFSET        12
+#define AD5683_MSB_MASK          0xF
+#define AD5683_CMD_MASK          0xF
+#define AD5683_LSB_MASK          0xF
+#define AD5683_LSB_OFFSET        4
+
+#define AD5683_REG_MAP           0
+#define AD5686_REG_MAP           1
+
+/********************** AD5683 Write Control Register Bits ********************/
+
+#define AD5683_CTRL_DCEN(x)      (((((x) & 0x1) << 0) << 10) & 0xFC00)
+#define AD5683_CTRL_GM(x)        (((((x) & 0x1) << 1) << 10) & 0xFC00)
+#define AD5683_CTRL_INT_REF(x)   (((((x) & 0x1) << 2) << 10) & 0xFC00)
+#define AD5683_CTRL_PWRM(x)      (((((x) & 0x3) << 3) << 10) & 0xFC00)
+#define AD5683_SW_RESET          ((((0x1) << 5) << 10) & 0xFC00)
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/* Supported devices */
+enum ad5686_type {
+	ID_AD5671R,
+	ID_AD5672R,
+	ID_AD5673R,
+	ID_AD5674,
+	ID_AD5674R,
+	ID_AD5675R,
+	ID_AD5676,
+	ID_AD5676R,
+	ID_AD5677R,
+	ID_AD5679,
+	ID_AD5679R,
+	ID_AD5686,
+	ID_AD5684R,
+	ID_AD5685R,
+	ID_AD5686R,
+	ID_AD5687,
+	ID_AD5687R,
+	ID_AD5689,
+	ID_AD5689R,
+	ID_AD5697R,
+	ID_AD5694,
+	ID_AD5694R,
+	ID_AD5695R,
+	ID_AD5696,
+	ID_AD5696R,
+	ID_AD5681R,
+	ID_AD5682R,
+	ID_AD5683R,
+	ID_AD5683,
+	ID_AD5691R,
+	ID_AD5692R,
+	ID_AD5693R,
+	ID_AD5693
+};
+
+enum comm_type {
+	SPI,
+	I2C,
+};
+
+enum ad5686_dac_channels {
+	AD5686_CH_0 = 0,
+	AD5686_CH_1,
+	AD5686_CH_2,
+	AD5686_CH_3,
+	AD5686_CH_4,
+	AD5686_CH_5,
+	AD5686_CH_6,
+	AD5686_CH_7,
+	AD5686_CH_8,
+	AD5686_CH_9,
+	AD5686_CH_10,
+	AD5686_CH_11,
+	AD5686_CH_12,
+	AD5686_CH_13,
+	AD5686_CH_14,
+	AD5686_CH_15,
+};
+
+struct ad5686_chip_info {
+	uint8_t		resolution;
+	uint8_t		register_map;
+	enum comm_type	communication;
+	const uint32_t *channel_addr;
+};
+
+struct ad5686_dev {
+	/* I2C */
+	i2c_desc	*i2c_desc;
+	/* SPI */
+	spi_desc	*spi_desc;
+	/* GPIO */
+	struct gpio_desc	*gpio_reset;
+	struct gpio_desc	*gpio_ldac;
+	struct gpio_desc	*gpio_gain;
+	/* Device Settings */
+	enum ad5686_type	act_device;
+	uint32_t power_down_mask;
+	uint32_t ldac_mask;
+};
+
+struct ad5686_init_param {
+	/* I2C */
+	i2c_init_param	i2c_init;
+	/* SPI */
+	spi_init_param	spi_init;
+	/* GPIO */
+	struct gpio_init_param	gpio_reset;
+	struct gpio_init_param	gpio_ldac;
+	struct gpio_init_param	gpio_gain;
+	/* Device Settings */
+	enum ad5686_type	act_device;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+/* Initialize SPI and Initial Values for AD5686 Board. */
+int32_t ad5686_init(struct ad5686_dev **device,
+		    struct ad5686_init_param init_param);
+
+/* Free the resources allocated by ad5686_init(). */
+int32_t ad5686_remove(struct ad5686_dev *dev);
+
+/* Write to input register */
+uint16_t ad5686_set_shift_reg(struct ad5686_dev *dev,
+			      uint8_t command,
+			      uint8_t address,
+			      uint16_t data);
+
+/* Write to Input Register n (dependent on LDAC) */
+void ad5686_write_register(struct ad5686_dev *dev,
+			   enum ad5686_dac_channels channel,
+			   uint16_t data);
+
+/* Update DAC Register n with contents of Input Register n */
+void ad5686_update_register(struct ad5686_dev *dev,
+			    enum ad5686_dac_channels channel);
+
+/* Write to and update DAC channel n */
+void ad5686_write_update_register(struct ad5686_dev *dev,
+				  enum ad5686_dac_channels channel,
+				  uint16_t data);
+
+/* Read back Input Register n */
+uint16_t ad5686_read_back_register(struct ad5686_dev *dev,
+				   enum ad5686_dac_channels channel);
+
+/* Power down / power up DAC */
+void ad5686_power_mode(struct ad5686_dev *dev,
+		       enum ad5686_dac_channels channel,
+		       uint8_t mode);
+
+/* Set up LDAC mask register */
+void ad5686_ldac_mask(struct ad5686_dev *dev,
+		      enum ad5686_dac_channels channel,
+		      uint8_t enable);
+
+/* Software reset (power-on reset) */
+void ad5686_software_reset(struct ad5686_dev *dev);
+
+/* Write to Internal reference setup register */
+void ad5686_internal_reference(struct ad5686_dev *dev,
+			       uint8_t value);
+
+/* Set up DCEN register (daisy-chain enable) */
+void ad5686_daisy_chain_en(struct ad5686_dev *dev,
+			   uint8_t value);
+
+/* Set up readback register (readback enable) */
+void ad5686_read_back_en(struct ad5686_dev *dev,
+			 uint8_t value);
+
+/* Set Gain mode */
+int32_t ad5686_gain_mode(struct ad5686_dev *dev, uint8_t value);
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,494 @@
+/***************************************************************************//**
+ *   @file   AD5933.c
+ *   @brief  Implementation of AD5933 Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2012(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/*****************************************************************************/
+/***************************** Include Files *********************************/
+/*****************************************************************************/
+#include <stdint.h>
+#include <stdlib.h>
+#include "platform_drivers.h"
+#include "ad5933.h"
+
+
+/******************************************************************************/
+/************************** Constants Definitions *****************************/
+/******************************************************************************/
+const int32_t pow_2_27 = 134217728ul;      // 2 to the power of 27
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/***************************************************************************//**
+ * @brief Initializes the communication peripheral and the initial Values for
+ *        AD5933 Board.
+ *
+ * @param device     - The device structure.
+ * @param init_param - The structure that contains the device initial
+ * 		       parameters.
+ *
+ * @return ret - The result of the initialization procedure.
+ *               Example: -1 - I2C peripheral was not initialized or the
+ *                             device is not present.
+ *                         0 - I2C peripheral was initialized and the
+ *                             device is present.
+*******************************************************************************/
+int32_t ad5933_init(struct ad5933_dev **device,
+		    struct ad5933_init_param init_param)
+{
+	struct ad5933_dev *dev;
+	int32_t status;
+
+	dev = (struct ad5933_dev *)malloc(sizeof(*dev));
+	if (!dev)
+		return -1;
+
+	dev->current_sys_clk = init_param.current_sys_clk;
+	dev->current_clock_source = init_param.current_clock_source;
+	dev->current_gain = init_param.current_gain;
+	dev->current_range = init_param.current_range;
+	dev->current_settling = init_param.current_settling;
+
+	status = i2c_init(&dev->i2c_desc, &init_param.i2c_init);
+
+	*device = dev;
+
+	return status;
+}
+
+/***************************************************************************//**
+ * @brief Free the resources allocated by ad5933_init().
+ *
+ * @param dev - The device structure.
+ *
+ * @return ret - The result of the remove procedure.
+*******************************************************************************/
+int32_t ad5933_remove(struct ad5933_dev *dev)
+{
+	int32_t status;
+
+	status = i2c_remove(dev->i2c_desc);
+
+	free(dev);
+
+	return status;
+}
+
+/***************************************************************************//**
+ * @brief Writes data into a register.
+ *
+ * @param dev              - The device structure.
+ * @param register_address - Address of the register.
+ * @param register_value   - Data value to write.
+ * @param bytes_number     - Number of bytes.
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_set_register_value(struct ad5933_dev *dev,
+			       uint8_t register_address,
+			       uint32_t register_value,
+			       uint8_t bytes_number)
+{
+	uint8_t byte = 0;
+	uint8_t write_data[2] = {0, 0};
+
+	for(byte = 0; byte < bytes_number; byte++) {
+		write_data[0] = register_address + bytes_number - byte - 1;
+		write_data[1] = (uint8_t)((register_value >> (byte * 8)) & 0xFF);
+		i2c_write(dev->i2c_desc, write_data, 2, 1);
+	}
+}
+
+/***************************************************************************//**
+ * @brief Reads the value of a register.
+ *
+ * @param dev              - The device structure.
+ * @param register_address - Address of the register.
+ * @param bytes_number     - Number of bytes.
+ *
+ * @return registerValue  - Value of the register.
+*******************************************************************************/
+uint32_t ad5933_get_register_value(struct ad5933_dev *dev,
+				   uint8_t register_address,
+				   uint8_t bytes_number)
+{
+	uint32_t register_value = 0;
+	uint8_t byte = 0;
+	uint8_t write_data[2]   = {0, 0};
+	uint8_t read_data[2]    = {0, 0};
+
+	for(byte = 0; byte < bytes_number; byte ++) {
+		/* Set the register pointer. */
+		write_data[0] = AD5933_ADDR_POINTER;
+		write_data[1] = register_address + byte;
+		i2c_write(dev->i2c_desc, write_data, 2, 1);
+		/* Read Register Data. */
+		read_data[0] = 0xFF;
+		i2c_read(dev->i2c_desc, read_data, 1, 1);
+		register_value = register_value << 8;
+		register_value += read_data[0];
+	}
+
+	return register_value;
+}
+
+/***************************************************************************//**
+ * @brief Resets the device.
+ *
+ * @param dev             - The device structure.
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_reset(struct ad5933_dev *dev)
+{
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_LB,
+				  AD5933_CONTROL_RESET | dev->current_clock_source,
+				  1);
+}
+
+/***************************************************************************//**
+ * @brief Selects the source of the system clock.
+ *
+ * @param dev          - The device structure.
+ * @param clk_source   - Selects the source of the system clock.
+ *                     Example: AD5933_CONTROL_INT_SYSCLK
+ *                              AD5933_CONTROL_EXT_SYSCLK
+ * @param ext_clk_freq - Frequency value of the external clock, if used.
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_set_system_clk(struct ad5933_dev *dev,
+			   int8_t clk_source,
+			   uint32_t ext_clk_freq)
+{
+	dev->current_clock_source = clk_source;
+	if(clk_source == AD5933_CONTROL_EXT_SYSCLK) {
+		dev->current_sys_clk = ext_clk_freq;                 // External clock frequency
+	} else {
+		dev->current_sys_clk = AD5933_INTERNAL_SYS_CLK;    // 16 MHz
+	}
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_LB,
+				  dev->current_clock_source,
+				  1);
+}
+
+
+/***************************************************************************//**
+ * @brief Selects the range and gain of the device.
+ *
+ * @param dev   - The device structure.
+ * @param range - Range option.
+ *                Example: AD5933_RANGE_2000mVpp
+ *                         AD5933_RANGE_200mVpp
+ *                         AD5933_RANGE_400mVpp
+
+ *                         AD5933_RANGE_1000mVpp
+ * @param gain  - Gain option.
+ *                Example: AD5933_GAIN_X5
+ *                         AD5933_GAIN_X1
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_set_range_and_gain(struct ad5933_dev *dev,
+			       int8_t range,
+			       int8_t gain)
+{
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(AD5933_FUNCTION_NOP) |
+				  AD5933_CONTROL_RANGE(range) |
+				  AD5933_CONTROL_PGA_GAIN(gain),
+				  1);
+	/* Store the last settings made to range and gain. */
+	dev->current_range = range;
+	dev->current_gain = gain;
+}
+
+/***************************************************************************//**
+ * @brief Reads the temperature from the part and returns the data in
+ *        degrees Celsius.
+ *
+ * @param dev             - The device structure.
+ *
+ * @return temperature - Temperature.
+*******************************************************************************/
+float ad5933_get_temperature(struct ad5933_dev *dev)
+{
+	float temperature = 0;
+	uint8_t status = 0;
+
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(AD5933_FUNCTION_MEASURE_TEMP) |
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	while((status & AD5933_STAT_TEMP_VALID) == 0) {
+		status = ad5933_get_register_value(dev,
+						   AD5933_REG_STATUS,
+						   1);
+	}
+
+	temperature = ad5933_get_register_value(dev,
+						AD5933_REG_TEMP_DATA,
+						2);
+	if(temperature < 8192) {
+		temperature /= 32;
+	} else {
+		temperature -= 16384;
+		temperature /= 32;
+	}
+
+	return temperature;
+}
+
+/***************************************************************************//**
+ * @brief Configures the sweep parameters: Start frequency, Frequency increment
+ *        and Number of increments.
+ *
+ * @param dev        - The device structure.
+ * @param start_freq - Start frequency in Hz;
+ * @param inc_freq   - Frequency increment in Hz;
+ * @param inc_num    - Number of increments. Maximum value is 511(0x1FF).
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_config_sweep(struct ad5933_dev *dev,
+			 uint32_t  start_freq,
+			 uint32_t  inc_freq,
+			 uint16_t inc_num)
+{
+	uint32_t start_freq_reg = 0;
+	uint32_t inc_freq_reg = 0;
+	uint16_t inc_num_reg = 0;
+
+	/* Ensure that incNum is a valid data. */
+	if(inc_num > AD5933_MAX_INC_NUM) {
+		inc_num_reg = AD5933_MAX_INC_NUM;
+	} else {
+		inc_num_reg = inc_num;
+	}
+
+	/* Convert users start frequency to binary code. */
+	start_freq_reg = (uint32_t)((double)start_freq * 4 / dev->current_sys_clk *
+				    pow_2_27);
+
+	/* Convert users increment frequency to binary code. */
+	inc_freq_reg = (uint32_t)((double)inc_freq * 4 / dev->current_sys_clk *
+				  pow_2_27);
+
+	/* Configure the device with the sweep parameters. */
+	ad5933_set_register_value(dev,
+				  AD5933_REG_FREQ_START,
+				  start_freq_reg,
+				  3);
+	ad5933_set_register_value(dev,
+				  AD5933_REG_FREQ_INC,
+				  inc_freq_reg,
+				  3);
+	ad5933_set_register_value(dev,
+				  AD5933_REG_INC_NUM,
+				  inc_num_reg,
+				  2);
+}
+
+/***************************************************************************//**
+ * @brief Starts the sweep operation.
+ *
+ * @param dev             - The device structure.
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_start_sweep(struct ad5933_dev *dev)
+{
+	uint8_t status = 0;
+
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(AD5933_FUNCTION_STANDBY) |
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	ad5933_reset(dev);
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(AD5933_FUNCTION_INIT_START_FREQ)|
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(AD5933_FUNCTION_START_SWEEP) |
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	status = 0;
+	while((status & AD5933_STAT_DATA_VALID) == 0) {
+		status = ad5933_get_register_value(dev,
+						   AD5933_REG_STATUS,
+						   1);
+	};
+}
+
+/***************************************************************************//**
+ * @brief Reads the real and the imaginary data and calculates the Gain Factor.
+ *
+ * @param dev                   - The device structure.
+ * @param calibration_impedance - The calibration impedance value.
+ * @param freq_function         - Frequency function.
+ *                               Example: AD5933_FUNCTION_INC_FREQ - Increment
+                                          freq.;
+ *                                        AD5933_FUNCTION_REPEAT_FREQ - Repeat
+                                          freq..
+ *
+ * @return gainFactor          - Calculated gain factor.
+*******************************************************************************/
+double ad5933_calculate_gain_factor(struct ad5933_dev *dev,
+				    uint32_t calibration_impedance,
+				    uint8_t freq_function)
+{
+	double gain_factor = 0;
+	double magnitude = 0;
+	signed short real_data = 0;
+	signed short imag_data = 0;
+	uint8_t status = 0;
+
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(freq_function) |
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	status = 0;
+	while((status & AD5933_STAT_DATA_VALID) == 0) {
+		status = ad5933_get_register_value(dev,
+						   AD5933_REG_STATUS,
+						   1);
+	}
+	real_data = ad5933_get_register_value(dev,
+					      AD5933_REG_REAL_DATA,
+					      2);
+	imag_data = ad5933_get_register_value(dev,
+					      AD5933_REG_IMAG_DATA,
+					      2);
+	magnitude = sqrt((real_data * real_data) + (imag_data * imag_data));
+	gain_factor = 1 / (magnitude * calibration_impedance);
+
+	return gain_factor;
+}
+
+/***************************************************************************//**
+ * @brief Reads the real and the imaginary data and calculates the Impedance.
+ *
+ * @param dev           - The device structure.
+ * @param gain_factor   - The gain factor.
+ * @param freq_function - Frequency function.
+ *                       Example: AD5933_FUNCTION_INC_FREQ - Increment freq.;
+ *                                AD5933_FUNCTION_REPEAT_FREQ - Repeat freq..
+ *
+ * @return ad5933_results - Struct of calculated values.
+*******************************************************************************/
+ad5933_result ad5933_calculate_impedance(struct ad5933_dev *dev,
+				  double gain_factor,
+				  uint8_t freq_function)
+{
+	signed short real_data = 0;
+	signed short imag_data = 0;
+	double magnitude = 0;
+	uint8_t status = 0;
+	ad5933_result result;
+
+	ad5933_set_register_value(dev,
+				  AD5933_REG_CONTROL_HB,
+				  AD5933_CONTROL_FUNCTION(freq_function) |
+				  AD5933_CONTROL_RANGE(dev->current_range) |
+				  AD5933_CONTROL_PGA_GAIN(dev->current_gain),
+				  1);
+	status = 0;
+	while((status & AD5933_STAT_DATA_VALID) == 0) {
+		status = ad5933_get_register_value(dev,
+						   AD5933_REG_STATUS,
+						   1);
+	}
+	real_data = ad5933_get_register_value(dev,
+					      AD5933_REG_REAL_DATA,
+					      2);
+	imag_data = ad5933_get_register_value(dev,
+					      AD5933_REG_IMAG_DATA,
+					      2);
+	magnitude = sqrt((real_data * real_data) + (imag_data * imag_data));
+
+
+	result.magnitude = magnitude;
+	result.phase	 = atan2(imag_data,real_data) * radToDeg180ovPi;
+
+	return result;
+}
+
+/***************************************************************************//**
+ * @brief Selects the number of settling cycles of the device.
+ *
+ * @param dev		 - The device structure.
+ * @param cycles	 - 9-bit number of cycles to wait before triggering ADC
+ *                       
+ * @param multiplier - Multiply number of cycles by X1, X2 or X4
+ *                Example:	AD5933_SETTLING_X1 
+ *							AD5933_SETTLING_X2
+ *							AD5933_SETTLING_X4
+ *
+ * @return None.
+*******************************************************************************/
+void ad5933_set_settling_time(struct ad5933_dev *dev,
+			       uint8_t		multiplier,
+			       uint16_t		number_cycles)
+{
+	
+	
+	if ((multiplier != AD5933_SETTLING_X2) && (multiplier != AD5933_SETTLING_X4))
+		multiplier = AD5933_SETTLING_X1;
+
+	ad5933_set_register_value(dev,
+				  AD5933_REG_SETTLING_CYCLES,
+				  number_cycles | (multiplier << 9),
+				  2);
+	/* Store the last settings made. */
+	dev->current_settling = number_cycles;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/impedance-analyzer/ad5933/ad5933.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,213 @@
+/***************************************************************************//**
+ *   @file   AD5933.h
+ *   @brief  Header file of AD5933 Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2012(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef __AD5933_H__
+#define __AD5933_H__
+
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265359
+#endif
+const double radToDeg180ovPi = 180 / M_PI;
+
+/******************************************************************************/
+/************************** AD5933 Definitions ********************************/
+/******************************************************************************/
+
+/* AD5933 Registers */
+#define AD5933_REG_CONTROL_HB       0x80    // HB of the Control register
+#define AD5933_REG_CONTROL_LB       0x81    // LB of the Control register
+#define AD5933_REG_FREQ_START       0x82    // Start frequency
+#define AD5933_REG_FREQ_INC         0x85    // Frequency increment
+#define AD5933_REG_INC_NUM          0x88    // Number of increments
+#define AD5933_REG_SETTLING_CYCLES  0x8A    // Number of settling time cycles
+#define AD5933_REG_STATUS           0x8F    // Status
+#define AD5933_REG_TEMP_DATA        0x92    // Temperature data
+#define AD5933_REG_REAL_DATA        0x94    // Real data
+#define AD5933_REG_IMAG_DATA        0x96    // Imaginary data
+
+/* AD5933_REG_CONTROL_HB Bits */
+#define AD5933_CONTROL_FUNCTION(x)  ((x) << 4)
+#define AD5933_CONTROL_RANGE(x)     ((x) << 1)
+#define AD5933_CONTROL_PGA_GAIN(x)  ((x) << 0)
+
+/* AD5933_REG_CONTROL_LB Bits */
+#define AD5933_CONTROL_RESET        (0x1 << 4)
+#define AD5933_CONTROL_INT_SYSCLK   (0x0 << 3)
+#define AD5933_CONTROL_EXT_SYSCLK   (0x1 << 3)
+
+/* AD5933_CONTROL_FUNCTION(x) options */
+#define AD5933_FUNCTION_NOP                 0x0
+#define AD5933_FUNCTION_INIT_START_FREQ     0x1
+#define AD5933_FUNCTION_START_SWEEP         0x2
+#define AD5933_FUNCTION_INC_FREQ            0x3
+#define AD5933_FUNCTION_REPEAT_FREQ         0x4
+#define AD5933_FUNCTION_MEASURE_TEMP        0x9
+#define AD5933_FUNCTION_POWER_DOWN          0xA
+#define AD5933_FUNCTION_STANDBY             0xB
+
+/* AD5933_CONTROL_RANGE(x) options */
+#define AD5933_RANGE_2000mVpp       0x0
+#define AD5933_RANGE_200mVpp        0x1
+#define AD5933_RANGE_400mVpp        0x2
+#define AD5933_RANGE_1000mVpp       0x3
+
+/* AD5933_CONTROL_PGA_GAIN(x) options */
+#define AD5933_GAIN_X5              0
+#define AD5933_GAIN_X1              1
+
+/* AD5933 Default number of settling cycles */
+#define AD5933_15_CYCLES			15
+
+/* AD5933 settling cycles mulitiplier */
+#define AD5933_SETTLING_X1			0
+#define AD5933_SETTLING_X2			1
+#define AD5933_SETTLING_X4			3
+
+/* AD5933_REG_STATUS Bits */
+#define AD5933_STAT_TEMP_VALID      (0x1 << 0)
+#define AD5933_STAT_DATA_VALID      (0x1 << 1)
+#define AD5933_STAT_SWEEP_DONE      (0x1 << 2)
+
+/* AD5933 Address */
+#define AD5933_ADDRESS              0x0D
+
+/* AD5933 Block Commands */
+#define AD5933_BLOCK_WRITE          0xA0
+#define AD5933_BLOCK_READ           0xA1
+#define AD5933_ADDR_POINTER         0xB0
+
+/* AD5933 Specifications */
+#define AD5933_INTERNAL_SYS_CLK     16000000ul      // 16MHz
+#define AD5933_MAX_INC_NUM          511             // Maximum increment number
+#define AD5933_MAX_SETTLING_CYCLES  511             
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+struct ad5933_dev {
+	/* I2C */
+	i2c_desc	*i2c_desc;
+	/* Device Settings */
+	uint32_t current_sys_clk;
+	uint8_t current_clock_source;
+	uint8_t current_gain;
+	uint8_t current_range;
+	uint16_t current_settling;
+};
+
+struct ad5933_init_param {
+	/* I2C */
+	i2c_init_param	i2c_init;
+	/* Device Settings */
+	uint32_t current_sys_clk;
+	uint8_t current_clock_source;
+	uint8_t current_gain;
+	uint8_t current_range;
+	uint16_t current_settling;
+};
+
+typedef struct ad5933_result {
+	double  		magnitude;
+	double 			phase;
+}ad5933_result;
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/*! Initializes the communication peripheral. */
+int32_t ad5933_init(struct ad5933_dev **device,
+		    struct ad5933_init_param init_param);
+
+/*! Free the resources allocated by ad5686_init(). */
+int32_t ad5933_remove(struct ad5933_dev *dev);
+
+/*! Writes data into a register. */
+void ad5933_set_register_value(struct ad5933_dev *dev,
+			       uint8_t register_address,
+			       uint32_t register_value,
+			       uint8_t bytes_number);
+
+/*! Reads the value of a register. */
+uint32_t ad5933_get_register_value(struct ad5933_dev *dev,
+				   uint8_t register_address,
+				   uint8_t bytes_number);
+
+/*! Resets the device. */
+void ad5933_reset(struct ad5933_dev *dev);
+
+/*! Selects the source of the system clock. */
+void ad5933_set_system_clk(struct ad5933_dev *dev,
+			   int8_t clk_source,
+			   uint32_t ext_clk_freq);
+
+/*! Selects the range and gain of the device. */
+void ad5933_set_range_and_gain(struct ad5933_dev *dev,
+			       int8_t range,
+			       int8_t gain);
+
+/*! Reads the temp. from the part and returns the data in degrees Celsius. */
+float ad5933_get_temperature(struct ad5933_dev *dev);
+
+/*! Configures the sweep parameters. */
+void ad5933_config_sweep(struct ad5933_dev *dev,
+			 uint32_t  start_freq,
+			 uint32_t  inc_freq,
+			 uint16_t inc_num);
+
+/*! Starts the sweep operation. */
+void ad5933_start_sweep(struct ad5933_dev *dev);
+
+/*! Reads the real and the imaginary data and calculates the Gain Factor. */
+double ad5933_calculate_gain_factor(struct ad5933_dev *dev,
+				    uint32_t calibration_impedance,
+				    uint8_t freq_function);
+
+/*! Reads the real and the imaginary data and calculates the Impedance. */
+ad5933_result ad5933_calculate_impedance(struct ad5933_dev *dev,
+				  double gain_factor,
+				  uint8_t freq_function);
+
+void ad5933_set_settling_time(struct ad5933_dev *dev,
+				uint8_t		mulitplier,
+				uint16_t	number_cycles);
+
+#endif /* __AD5933_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/License.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/License.txt	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,14 @@
+Copyright (c) 2019 Analog Devices, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+  - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  
+  - Modified versions of the software must be conspicuously marked as such.
+  - This software is licensed solely and exclusively for use with processors/products manufactured by or for Analog Devices, Inc.
+  - This software may not be combined or merged with other code in any manner that would cause the software to become subject to terms and conditions which differ from those listed here.
+  - Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+  - The use of this software may or may not infringe the patent rights of one or more patent holders.  This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
+
+THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+2019-01-10-7CBSD SLA
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/inc/platform_drivers.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/inc/platform_drivers.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,67 @@
+/***************************************************************************//**
+ *   @file   platform_drivers.h
+ *   @brief  Header file of Generic Platform Drivers.
+********************************************************************************
+ * Copyright 2017, 2019-20(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef PLATFORM_DRIVERS_H_
+#define PLATFORM_DRIVERS_H_
+
+
+// Platform drivers needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif //  _cplusplus
+
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+// spi_init(), i2c_init(), i2c_write() and i2c_read() function are already defined
+// in mbed-os libraries. To avoid this naming conflict, the functions are wrapped
+// with suffix _noos using macros.
+
+#define  spi_init(desc, init_param)         spi_init_noos(desc, init_param)
+
+#define  i2c_init(desc, init_param)                      i2c_init_noos(desc, init_param)
+#define  i2c_write(desc, data, bytes_number, stop_bits)  i2c_write_noos(desc, data, bytes_number, stop_bits)
+#define  i2c_read(desc, data, bytes_number, stop_bits)   i2c_read_noos(desc, data, bytes_number, stop_bits)
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+/*
+#include "include/irq.h"
+#include "include/util.h"
+#include "include/delay.h"
+#include "include/error.h"
+#include "include/gpio.h"
+#include "include/i2c.h"
+#include "include/spi.h"
+#include "include/uart.h" */
+
+#include "irq.h"
+#include "util.h"
+#include "delay.h"
+#include "error.h"
+#include "gpio.h"
+#include "i2c.h"
+#include "spi.h"
+#include "uart.h"
+
+
+#ifdef __cplusplus  // Closing extern c
+}
+#endif //  _cplusplus
+
+#endif // PLATFORM_DRIVERS_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/inc/platform_support.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/inc/platform_support.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,51 @@
+/***************************************************************************//**
+ *   @file     platform_support.h
+ *   @brief:   support functions and declarations for selected platform
+ *   @details: This is a platform specific file that supports functionality
+ *             required from application generic file. This file should be
+ *             modified according to platform that you are working with.
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef PLATFORM_SUPPORT_H_
+#define PLATFORM_SUPPORT_H_
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+char getchar_noblock(void);
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* PLATFORM_SUPPORT_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/delay.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/delay.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,49 @@
+/***************************************************************************//**
+ *   @file   delay.cpp
+ *   @brief  Implementation of delay functionality
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <mbed.h>
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Generate microseconds delay.
+ * @param usecs - Delay in microseconds.
+ * @return None.
+ */
+void udelay(uint32_t usecs)
+{
+	wait_us(usecs);
+}
+
+/**
+ * @brief Generate miliseconds delay.
+ * @param msecs - Delay in miliseconds.
+ * @return None.
+ */
+void mdelay(uint32_t msecs)
+{
+	if (msecs) {
+		HAL_Delay(msecs);
+	}
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/gpio.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/gpio.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,261 @@
+/***************************************************************************//**
+ *   @file   gpio.cpp
+ *   @brief  Implementation of GPIO No-OS platform driver interfaces
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/************************ Includes Files *******************************/
+/******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <mbed.h>
+
+#include "platform_drivers.h"
+#include "gpio_extra.h"
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Obtain the GPIO decriptor.
+ * @param desc - The GPIO descriptor.
+ * @param gpio_number - The number of the GPIO.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_get(struct gpio_desc **desc, const struct gpio_init_param *param)
+{
+	if (desc && param) {
+		// Create the gpio description object for the device
+		gpio_desc *new_gpio = (gpio_desc *)calloc(1, sizeof(gpio_desc)) ;
+		if (new_gpio == NULL) {
+			return FAILURE;
+		}
+
+		// Create the gpio extra descriptor object to store extra mbed gpio info
+		mbed_gpio_desc *gpio_desc_extra = (mbed_gpio_desc *)calloc(1,
+						  sizeof(mbed_gpio_desc)) ;
+		if (gpio_desc_extra == NULL) {
+			return FAILURE;
+		}
+
+		new_gpio->number = param->number;
+		new_gpio->extra = gpio_desc_extra;
+
+		gpio_desc_extra->direction = GPIO_IN;
+		gpio_desc_extra->gpio_pin = NULL;
+		gpio_desc_extra->pin_mode = ((mbed_gpio_init_param *)(*desc)->extra)->pin_mode;
+
+		*desc = new_gpio;
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Get the value of an optional GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param param - GPIO Initialization parameters.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_get_optional(struct gpio_desc **desc,
+			  const struct gpio_init_param *param)
+{
+	if (param) {
+		return gpio_get(desc, param);
+	} else {
+		*desc = NULL;
+		return SUCCESS;
+	}
+}
+
+
+/**
+ * @brief Free the resources allocated by gpio_get().
+ * @param desc - The GPIO descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_remove(struct gpio_desc *desc)
+{
+	if (desc) {
+		// Free the gpio object
+		if(((mbed_gpio_desc *)(desc->extra))->gpio_pin) {
+			free(((mbed_gpio_desc *)(desc->extra))->gpio_pin);
+		}
+
+		// Free the gpio extra descriptor object
+		if((mbed_gpio_desc *)(desc->extra)) {
+			free((mbed_gpio_desc *)(desc->extra));
+		}
+
+		// Free the gpio descriptor object
+		free(desc);
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Enable the input direction of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ * @note does not support reconfiguration of already set pin direction
+ */
+int32_t gpio_direction_input(struct gpio_desc *desc)
+{
+	DigitalIn *gpio_input;   	// pointer to gpio input object
+	mbed_gpio_desc *gpio_desc_extra;   // pointer to gpio desc extra parameters
+
+	if (desc && desc->extra) {
+		gpio_desc_extra = (mbed_gpio_desc *)(desc->extra);
+		if (gpio_desc_extra->gpio_pin == NULL) {
+			// Configure and instantiate GPIO pin as input
+			gpio_input = new DigitalIn((PinName)desc->number);
+			if (gpio_input == NULL) {
+				return FAILURE;
+			}
+
+			gpio_desc_extra->gpio_pin = (mbed_gpio_desc *)gpio_input;
+			gpio_desc_extra->direction = GPIO_IN;
+
+			// Set the gpio pin mode
+			gpio_input->mode((PinMode)((mbed_gpio_desc *)desc->extra)->pin_mode);
+
+			return SUCCESS;
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Enable the output direction of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param value - The value.
+ *                Example: GPIO_HIGH
+ *                         GPIO_LOW
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ * @note does not support reconfiguration of already set pin direction
+ */
+int32_t gpio_direction_output(struct gpio_desc *desc, uint8_t value)
+{
+	DigitalOut *gpio_output;    	// pointer to gpio output object
+	mbed_gpio_desc *gpio_desc_extra;   // pointer to gpio desc extra parameters
+
+	if(desc && desc->extra) {
+		gpio_desc_extra = (mbed_gpio_desc *)(desc->extra);
+		if (gpio_desc_extra->gpio_pin == NULL) {
+
+			// Configure and instantiate GPIO pin as output
+			gpio_output = new DigitalOut((PinName)desc->number);
+
+			if (gpio_output == NULL) {
+				return FAILURE;
+			}
+
+			gpio_desc_extra->gpio_pin = (mbed_gpio_desc *)gpio_output;
+			gpio_desc_extra->direction = GPIO_OUT;
+
+			// Set the GPIO value
+			if(gpio_set_value(desc, value) == SUCCESS) {
+				return SUCCESS;
+			}
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Get the direction of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param direction - The direction.
+ *                    Example: GPIO_OUT
+ *                             GPIO_IN
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_get_direction(struct gpio_desc *desc, uint8_t *direction)
+{
+	mbed_gpio_desc *gpio_desc_extra;     // pointer to gpio desc extra parameters
+
+	if(desc && desc->extra) {
+		gpio_desc_extra = (mbed_gpio_desc *)(desc->extra);
+
+		if (gpio_desc_extra->gpio_pin) {
+			*direction = gpio_desc_extra->direction;
+		}
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Set the value of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param value - The value.
+ *                Example: GPIO_HIGH
+ *                         GPIO_LOW
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_set_value(struct gpio_desc *desc, uint8_t value)
+{
+	DigitalOut *gpio_output; 		// pointer to gpio output object
+	mbed_gpio_desc *gpio_desc_extra;    // pointer to gpio desc extra parameters
+
+	if(desc && desc->extra) {
+		gpio_desc_extra = (mbed_gpio_desc *)(desc->extra);
+
+		if (gpio_desc_extra->gpio_pin) {
+			gpio_output = (DigitalOut *)((mbed_gpio_desc *)desc->extra)->gpio_pin;
+			gpio_output->write(value);
+		}
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Get the value of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param value - The value.
+ *                Example: GPIO_HIGH
+ *                         GPIO_LOW
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t gpio_get_value(struct gpio_desc *desc, uint8_t *value)
+{
+	DigitalIn *gpio_input;    	// pointer to gpio input object
+	uint8_t returnVal = FAILURE;
+
+	if (desc && desc->extra) {
+		gpio_input = (DigitalIn *)((mbed_gpio_desc *)desc->extra)->gpio_pin;
+		*value = (uint8_t)gpio_input->read();
+		returnVal = gpio_input->is_connected() ? SUCCESS : FAILURE;
+
+		return returnVal;
+	}
+
+	return FAILURE;
+}
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/gpio_extra.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/gpio_extra.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,73 @@
+/***************************************************************************//**
+ *   @file     gpio_extra.h
+ *   @brief:   Header containing extra types required for GPIO interface
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef GPIO_EXTRA_H
+#define GPIO_EXTRA_H
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/*
+ * Note: The structure members are not strongly typed, as this file is included
+ *       in application specific '.c' files. The mbed code structure does not
+ *       allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
+ *       All the members are hence typecasted to mbed specific type during
+ *       gpio init and read/write operations.
+ **/
+
+/**
+* @struct mbed_gpio_init_param
+* @brief Structure holding the GPIO init parameters for mbed platform.
+*/
+typedef struct mbed_gpio_init_param {
+	uint8_t pin_mode; 		// GPIO pin mode (PinMode)
+} mbed_gpio_init_param;
+
+/**
+* @struct mbed_gpio_desc
+* @brief GPIO specific descriptor for the mbed platform.
+*/
+typedef struct mbed_gpio_desc {
+	uint8_t direction;
+	void *gpio_pin;     	// GPIO pin instance (DigitalIn/DigitalOut)
+	uint8_t pin_mode;
+} mbed_gpio_desc;
+
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* GPIO_EXTRA_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/i2c.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/i2c.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,177 @@
+/***************************************************************************//**
+ *   @file   i2c.cpp
+ *   @brief  Implementation of I2C No-OS platform driver interfaces
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdio.h>
+#include <mbed.h>
+
+#include "platform_drivers.h"
+#include "i2c_extra.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Initialize the I2C communication peripheral.
+ * @param desc - The I2C descriptor.
+ * @param param - The structure that contains the I2C parameters.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t i2c_init_noos(struct i2c_desc **desc,
+		      const struct i2c_init_param *param)
+{
+	mbed::I2C *i2c;		// pointer to new I2C instance
+	mbed_i2c_desc *mbed_desc;	// pointer to mbed i2c desc
+
+	if (desc) {
+		// Create an i2c descriptor object for the device
+		i2c_desc *new_desc = (i2c_desc *)malloc(sizeof(i2c_desc));
+		if (new_desc == NULL) {
+			return FAILURE;
+		}
+
+		// Address passed in parameter shifted left by 1 to form
+		// 7-bit i2c slave address (7 MSBs) and the LSB acts as
+		// r/w bit during i2c read/write operations
+		new_desc->slave_address = ((param->slave_address) << 1);
+
+		// Configure and instantiate I2C protocol
+		i2c = new I2C(
+			(PinName)(((mbed_i2c_init_param *)param->extra)->i2c_sda_pin),
+			(PinName)(((mbed_i2c_init_param *)param->extra)->i2c_scl_pin));
+
+		if (i2c == NULL) {
+			return FAILURE;
+		}
+
+		// Create the i2c mbed descriptor object to store new i2c instance
+		mbed_desc = (mbed_i2c_desc *)malloc(sizeof(mbed_i2c_desc));
+		if (mbed_desc == NULL) {
+			return FAILURE;
+		}
+
+		mbed_desc->i2c_port = (I2C *)i2c;
+		new_desc->extra = (mbed_i2c_desc *)mbed_desc;
+
+		*desc = new_desc;
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by i2c_init_noos().
+ * @param desc - The I2C descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t i2c_remove(struct i2c_desc *desc)
+{
+	if (desc) {
+		// Free the I2C port object
+		if ((I2C *)(((mbed_i2c_desc *)(desc->extra))->i2c_port)) {
+			delete((I2C *)(((mbed_i2c_desc *)(desc->extra))->i2c_port));
+		}
+
+		// Free the I2C extra descriptor object
+		if ((mbed_i2c_desc *)(desc->extra)) {
+			free((mbed_i2c_desc *)(desc->extra));
+		}
+
+		// Free the I2C descriptor object
+		free(desc);
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Write data to a slave device.
+ * @param desc - The I2C descriptor.
+ * @param data - Buffer that stores the transmission data.
+ * @param bytes_number - Number of bytes to write.
+ * @param stop_bit - Stop condition control.
+ *                   Example: 0 - A stop condition will not be generated;
+ *                            1 - A stop condition will be generated.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+
+int32_t i2c_write_noos(struct i2c_desc *desc,
+		       uint8_t *data,
+		       uint8_t bytes_number,
+		       uint8_t stop_bit)
+{
+	mbed::I2C *i2c;
+	i2c = (I2C *)(((mbed_i2c_desc *)(desc->extra))->i2c_port);
+
+	/**
+	    The MBED I2C API is reversed for parameter 4
+	    Instead of stop_bit - it has
+	    @param repeated   - Repeated start, true - don't send stop at end default value is false.
+	    Inverting here to keep the no-OS/platform_drivers API
+	 */
+	if (!(i2c->write(desc->slave_address, (char *)data, bytes_number, !stop_bit))) {
+		return SUCCESS;
+	} else {
+		return FAILURE;
+	}
+}
+
+
+/**
+ * @brief Read data from a slave device.
+ * @param desc - The I2C descriptor.
+ * @param data - Buffer that will store the received data.
+ * @param bytes_number - Number of bytes to read.
+ * @param stop_bit - Stop condition control.
+ *                   Example: 0 - A stop condition will not be generated;
+ *                            1 - A stop condition will be generated.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t i2c_read_noos(struct i2c_desc *desc,
+		      uint8_t *data,
+		      uint8_t bytes_number,
+		      uint8_t stop_bit)
+{
+	mbed::I2C *i2c;
+	i2c = (I2C *)(((mbed_i2c_desc *)(desc->extra))->i2c_port);
+
+	/**
+	    The MBED I2C API is reversed for parameter 4
+	    Instead of stop_bit - it has
+	    @param repeated   - Repeated start, true - don't send stop at end default value is false.
+	    Inverting here to keep the no-OS/platform_drivers API
+	 */
+	if (!(i2c->read(desc->slave_address, (char *)data, bytes_number, !stop_bit))) {
+		return SUCCESS;
+	} else {
+		return FAILURE;
+	}
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/i2c_extra.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/i2c_extra.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,72 @@
+/***************************************************************************//**
+ *   @file     i2c_extra.h
+ *   @brief:   Header containing extra types required for I2C interface
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef I2C_EXTRA_H
+#define I2C_EXTRA_H
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/*
+ * Note: The structure members are not strongly typed, as this file is included
+ *       in application specific '.c' files. The mbed code structure does not
+ *       allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
+ *       All the members are hence typecasted to mbed specific type during
+ *       i2c init and read/write operations.
+ **/
+
+/**
+* @struct mbed_i2c_init_param
+* @brief Structure holding the I2C init parameters for mbed platform.
+*/
+typedef struct mbed_i2c_init_param {
+	uint8_t i2c_sda_pin;  	// I2C SDA pin (PinName)
+	uint8_t i2c_scl_pin;  	// I2C SCL pin (PinName)
+} mbed_i2c_init_param;
+
+/**
+* @struct mbed_i2c_desc
+* @brief I2C specific descriptor for the mbed platform.
+*/
+typedef struct mbed_i2c_desc {
+	void *i2c_port;  		// I2C port instance (mbed::I2C)
+} mbed_i2c_desc;
+
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* I2C_EXTRA_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/irq.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/irq.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,168 @@
+/***************************************************************************//**
+ * @file  irq.cpp
+ * @brief Implementation of Interrupt No-OS platform driver interfaces
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdio.h>
+#include <mbed.h>
+
+#include "platform_drivers.h"
+#include "irq_extra.h"
+#include "uart_extra.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief	Initialized the controller for the peripheral interrupts
+ * @param	desc[in, out] - Pointer where the configured instance is stored
+ * @param	param[in] - Configuration information for the instance
+ * @return	SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t irq_ctrl_init(struct irq_ctrl_desc **desc,
+	const struct irq_init_param *param)
+{
+	if (!desc || !param) {
+		return FAILURE;
+	}
+
+	irq_ctrl_desc *new_desc = (irq_ctrl_desc *)malloc(sizeof(irq_ctrl_desc));
+	if (!new_desc) {
+		return FAILURE;
+	}
+
+	mbed_irq_desc *new_mbed_desc = (mbed_irq_desc *)malloc(sizeof(mbed_irq_desc));
+	if (!new_mbed_desc) {
+		free(new_desc);
+		return FAILURE;
+	}
+
+	new_desc->irq_ctrl_id = param->irq_ctrl_id;
+
+	new_mbed_desc->int_mode = ((mbed_irq_init_param *)param->extra)->int_mode;
+	new_mbed_desc->int_obj_type = ((mbed_irq_init_param *)
+				       param->extra)->int_obj_type;
+
+	new_desc->extra = (irq_ctrl_desc *)new_mbed_desc;
+
+	*desc = new_desc;
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief	Free the resources allocated by irq_ctrl_init()
+ * @param	desc[in, out] - Interrupt controller descriptor.
+ * @return	SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t irq_ctrl_remove(struct irq_ctrl_desc *desc)
+{
+	if (!desc) {
+		return FAILURE;
+	}
+
+	if (((mbed_irq_desc *)desc->extra)->int_obj) {
+		free(((mbed_irq_desc *)desc->extra)->int_obj);
+	}
+
+	if ((irq_ctrl_desc *)desc->extra) {
+		free((irq_ctrl_desc *)desc->extra);
+	}
+
+	free(desc);
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief	Registers a IRQ callback function to irq controller.
+ * @param	desc[in] - The IRQ controller descriptor.
+ * @param	irq_id[in] - Interrupt identifier.
+ * @param	callback_desc - Descriptor of the callback. If it is NULL, the
+ *			callback will be unregistered
+ * @return	SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t irq_register_callback(struct irq_ctrl_desc *desc,
+	uint32_t irq_id,
+	struct callback_desc *callback_desc)
+{
+	InterruptIn *ext_interrupt;
+	mbed::UnbufferedSerial *uart_rx_port;
+	PinName *ext_int_pin;
+
+	if (!desc || !callback_desc) {
+		return FAILURE;
+	}
+
+	switch (irq_id) {
+	case EXTERNAL_INT_ID:
+		/* Attach external interrupt to input pin */
+		ext_int_pin = (PinName *)((mbed_irq_desc *)(desc->extra))->int_obj_type;
+		if (!ext_int_pin) {
+			return FAILURE;
+		}
+
+		ext_interrupt = new InterruptIn(*ext_int_pin);
+		if (!ext_interrupt) {
+			return FAILURE;
+		}
+
+		/* Register a callback function to get external interrupt input */
+		if (((mbed_irq_desc *)(desc->extra))->int_mode == EXT_IRQ_FALL) {
+			ext_interrupt->fall(callback_desc->callback);
+		}
+		else if (((mbed_irq_desc *)(desc->extra))->int_mode == EXT_IRQ_RISE) {
+			ext_interrupt->rise(callback_desc->callback);
+		}
+		else {
+			return FAILURE;
+		}
+
+		/* Store the external interrupt object to be freed from irq_ctrl_remove() */
+		((mbed_irq_desc *)(desc->extra))->int_obj = ext_interrupt;
+
+		ext_interrupt->enable_irq();
+
+		break;
+
+	case UART_RX_INT_ID:
+		uart_rx_port = (mbed::UnbufferedSerial *)(((mbed_irq_desc *)(
+					desc->extra))->int_obj_type);
+		if (!uart_rx_port) {
+			return FAILURE;
+		}
+
+		/* Register a callback function to receive UnbufferedSerial port event */
+		uart_rx_port->attach(callback_desc->callback, UnbufferedSerial::RxIrq);
+
+		break;
+
+	default:
+		return FAILURE;
+	}
+
+	return SUCCESS;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/irq_extra.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/irq_extra.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,84 @@
+/***************************************************************************//**
+ *   @file     irq_extra.h
+ *   @brief:   Header containing extra types required for IRQ drivers
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef IRQ_EXTRA_H
+#define IRQ_EXTRA_H
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdbool.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @enum irq_id
+ * @brief Interrupts IDs supported by the irq driver
+ */
+enum irq_id {
+	/** External interrupt ID */
+	EXTERNAL_INT_ID,
+	/** UART Rx interrupt ID */
+	UART_RX_INT_ID,
+	/* Number of available interrupts */
+	NB_INTERRUPTS
+};
+
+/*
+ * External IRQ events
+ * */
+typedef enum {
+	EXT_IRQ_NONE,
+	EXT_IRQ_RISE,
+	EXT_IRQ_FALL
+} ext_irq_event;
+
+/**
+ * @struct mbed_irq_init_param
+ * @brief Structure holding the extra parameters for Interrupt Request.
+ */
+typedef struct {
+	uint32_t int_mode;			// Interrupt mode (falling/rising etc)
+	void *int_obj_type;  		// Interrupt handling object
+} mbed_irq_init_param;
+
+/**
+ * @struct aducm410_irq_desc
+ * @brief Structure holding the platform descriptor for Interrupt Request.
+ */
+typedef struct {
+	uint32_t int_mode;			// Interrupt mode (falling/rising etc)
+	void *int_obj_type;  		// Interrupt handling object
+	void *int_obj;				// Interrupt object (e.g. InterruptIn)
+} mbed_irq_desc;
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif // IRQ_EXTRA_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/platform_support.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/platform_support.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,56 @@
+/***************************************************************************//**
+ *   @file     platform_support.cpp
+ *   @brief:   support functions and declarations for particular platform
+ *   @details: This is a platform specific file that supports functionality
+ *             required from application generic file. This file should be
+ *             modified according to platform that you are working with.
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/************************ Includes Files **************************************/
+/******************************************************************************/
+#include <mbed.h>
+#include "platform_support.h"
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Variable Declarations *******************************/
+/******************************************************************************/
+
+// Configure and instantiate UnbufferedSerial object to access the stdin.
+// The default mbed baud rate is 9600, unless is it overriden in the
+// mbed_app.json file, or by creating another UnbufferedSerial object using
+// the same pins.
+static UnbufferedSerial port(USBTX, USBRX);
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+  * @brief  getchar, but does not block if nothing waiting to be read
+  * @param  None
+  * @return character if available, NULL otherwise
+  */
+char getchar_noblock(void)
+{
+	char rx_char = '\0';
+
+	// Return the character read from the serial port
+	if (port.readable() > 0) {
+		port.read(&rx_char, 1);
+	}
+
+	return rx_char;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/spi.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/spi.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,222 @@
+/***************************************************************************//**
+ *   @file   spi.cpp
+ *   @brief  Implementation of SPI No-OS platform driver interfaces
+********************************************************************************
+ * Copyright (c) 2019, 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdio.h>
+#include <mbed.h>
+
+#include "platform_drivers.h"
+#include "spi_extra.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+#define		SPI_16_BIT_FRAME		16		// SPI 16-bit frame size
+#define		SPI_8_BIT_FRAME			8		// SPI 8-bit frame size
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+static uint8_t spi_format_bytes = SPI_16_BIT_FRAME;   	// SPI format
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Initialize the SPI communication peripheral.
+ * @param desc - The SPI descriptor.
+ * @param init_param - The structure that contains the SPI parameters.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t spi_init_noos(struct spi_desc **desc,
+		      const struct spi_init_param *param)
+{
+	mbed::SPI *spi;		// pointer to new spi instance
+	DigitalOut *ss; 	// pointer to new SS instance
+	mbed_spi_desc *mbed_desc;	// Pointer to mbed spi descriptor
+
+	if (desc) {
+		// Create the spi description object for the device
+		spi_desc * new_desc = (spi_desc *)malloc(sizeof(spi_desc));
+		if (new_desc == NULL) {
+			return FAILURE;
+		}
+
+		new_desc->chip_select = param->chip_select;
+		new_desc->mode = param->mode;
+		new_desc->max_speed_hz = param->max_speed_hz;
+
+		// Configure and instantiate SPI protocol
+		spi = new SPI(
+			(PinName)(((mbed_spi_init_param *)param->extra)->spi_mosi_pin),
+			(PinName)(((mbed_spi_init_param *)param->extra)->spi_miso_pin),
+			(PinName)(((mbed_spi_init_param *)param->extra)->spi_clk_pin));
+
+		if (spi == NULL) {
+			return FAILURE;
+		}
+
+		// Configure and instantiate slave select pin
+		ss = new DigitalOut((PinName)(new_desc->chip_select));
+		if (ss == NULL) {
+			return FAILURE;
+		}
+
+		// Create the SPI extra descriptor object to store new SPI instances
+		mbed_desc = (mbed_spi_desc *)malloc(sizeof(mbed_spi_desc));
+		if (mbed_desc == NULL) {
+			return FAILURE;
+		}
+
+		mbed_desc->spi_port = (SPI *)spi;
+		mbed_desc->slave_select = (DigitalOut *)ss;
+		new_desc->extra = (mbed_spi_desc *)mbed_desc;
+
+		*desc = new_desc;
+
+		/**
+		    NOTE: Actual frequency of SPI clk will be somewhat device
+		    dependent, relating to clock-settings, prescalars etc. If absolute
+		    SPI frequency is required, consult your device documentation.
+		  **/
+		spi->frequency(param->max_speed_hz);
+		spi->format(SPI_16_BIT_FRAME, param->mode);  // data write/read format
+		spi_format_bytes = SPI_16_BIT_FRAME;
+		spi->set_default_write_value(0x00);          // code to write when reading back
+		ss->write(GPIO_HIGH);                        // set SS high
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by spi_init().
+ * @param desc - The SPI descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t spi_remove(struct spi_desc *desc)
+{
+	if (desc) {
+		// Free the SPI port object
+		if ((SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port)) {
+			delete((SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port));
+		}
+
+		// Free the SS port object
+		if ((DigitalOut *)(((mbed_spi_desc *)(desc->extra))->slave_select)) {
+			delete((DigitalOut *)(((mbed_spi_desc *)(desc->extra))->slave_select));
+		}
+
+		// Free the SPI extra descriptor object
+		if ((mbed_spi_desc *)(desc->extra)) {
+			free((mbed_spi_desc *)(desc->extra));
+		}
+
+		// Free the SPI descriptor object
+		free(desc);
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Write and read data to/from SPI.
+ * @param desc - The SPI descriptor.
+ * @param data - The buffer with the transmitted/received data.
+ * @param bytes_number - Number of bytes to write/read.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t spi_write_and_read(struct spi_desc *desc,
+			   uint8_t *data,
+			   uint16_t bytes_number)
+{
+	mbed::SPI *spi; 			// pointer to new spi instance
+	mbed::DigitalOut *ss;  		// pointer to new SS instance
+	uint16_t num_of_words;		// Number of words in SPI frame
+	uint16_t rw_data;			// SPI read data (16-bit)
+	uint16_t data_index = 0;	// Data index
+	size_t byte;				// Byte read/write index
+
+	if (desc) {
+		spi = (SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port);
+		ss = (DigitalOut *)(((mbed_spi_desc *)(desc->extra))->slave_select);
+
+		/* Get the total number of words (16-bit) */
+		num_of_words = bytes_number / 2;
+
+		/* Determine the data transmit/receive format based on parity of data */
+		if (!(bytes_number % 2)) {
+			if (spi_format_bytes != SPI_16_BIT_FRAME) {
+				spi->format(SPI_16_BIT_FRAME, desc->mode);
+				spi_format_bytes = SPI_16_BIT_FRAME;
+			}
+		} else {
+			if (spi_format_bytes != SPI_8_BIT_FRAME) {
+				spi->format(SPI_8_BIT_FRAME, desc->mode);
+				spi_format_bytes = SPI_8_BIT_FRAME;
+			}
+		}
+
+		ss->write(GPIO_LOW);
+
+		/* **Note: It is not possible to change the format of data transfer when SPI
+		 * communication is in progress. If format is attempted to change (from 8-bit
+		 * to 16-bit or vice a versa), the SPI communication is reset and master generates
+		 * a single Clock signal during format change. This triggers false transfer on slave
+		 * which results into incorrect data transfer. For this reason, the bytes with even parity
+		 * are transferred in 16-bit format and odd parity bytes are transferred in 8-bit format.
+		 * Application layer doesn't have any control to stop SPI reset during format change. */
+
+		if (!(bytes_number % 2)) {
+			while (num_of_words) {
+				/* Form a 16-bit data to be written (LE format) */
+				rw_data = ((uint16_t)data[data_index + 1] | ((uint16_t)data[data_index] << 8));
+
+				/* Transmit a 16-bit data over SPI */
+				rw_data =  (uint16_t)spi->write(rw_data);
+
+				/* Extract the MSB and LSB from 16-bit read data (LE format) */
+				data[data_index++] = (uint8_t)(rw_data >> 8);
+				data[data_index++] = (uint8_t)rw_data;
+
+				num_of_words--;
+			}
+		} else {
+			for (byte = 0; byte < bytes_number; byte++) {
+				data[byte] =  spi->write(data[byte]);
+			}
+		}
+
+		ss->write(GPIO_HIGH);
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/spi_extra.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/spi_extra.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,74 @@
+/***************************************************************************//**
+ *   @file     spi_extra.h
+ *   @brief:   Header containing extra types required for SPI interface
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef SPI_EXTRA_H
+#define SPI_EXTRA_H
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/*
+ * Note: The structure members are not strongly typed, as this file is included
+ *       in application specific '.c' files. The mbed code structure does not
+ *       allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
+ *       All the members are hence typecasted to mbed specific type during
+ *       spi init and read/write operations.
+ **/
+
+/**
+ * @struct mbed_spi_init_param
+ * @brief Structure holding the SPI init parameters for mbed platform.
+ */
+typedef struct mbed_spi_init_param {
+	uint8_t spi_miso_pin;		// SPI MISO pin (PinName)
+	uint8_t spi_mosi_pin;  		// SPI MOSI pin (PinName)
+	uint8_t spi_clk_pin;  		// SPI CLK pin (PinName)
+} mbed_spi_init_param;
+
+/**
+ * @struct mbed_spi_desc
+ * @brief SPI specific descriptor for the mbed platform.
+ */
+typedef struct mbed_spi_desc {
+	void *spi_port; 			// SPI port instance (mbed::SPI)
+	void *slave_select; 		// SPI slave select gpio instance (DigitalOut)
+} mbed_spi_desc;
+
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* SPI_EXTRA_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/uart.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/uart.cpp	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,234 @@
+/***************************************************************************//**
+ * @file  uart.cpp
+ * @brief Implementation of UART No-OS platform driver interfaces
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+#include <mbed.h>
+
+#include "platform_drivers.h"
+#include "uart_extra.h"
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Read data from UART device.
+ * @param desc - Instance of UART.
+ * @param data - Pointer to buffer containing data.
+ * @param bytes_number - Number of bytes to read.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t uart_read(struct uart_desc *desc, uint8_t *data, uint32_t bytes_number)
+{
+	mbed::BufferedSerial *uart;		// pointer to BufferedSerial/UART instance
+
+	if (desc) {
+		if (((mbed_uart_desc *)(desc->extra))->uart_port) {
+			uart = (BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port);
+
+			if (data) {
+				return uart->read(data, bytes_number);
+			}
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Write data to UART device.
+ * @param desc - Instance of UART.
+ * @param data - Pointer to buffer containing data.
+ * @param bytes_number - Number of bytes to read.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t uart_write(struct uart_desc *desc, const uint8_t *data,
+		   uint32_t bytes_number)
+{
+	mbed::BufferedSerial *uart;		// pointer to BufferedSerial/UART instance
+
+	if (desc) {
+		if (((mbed_uart_desc *)(desc->extra))->uart_port) {
+			uart = (BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port);
+
+			if (data) {
+				return uart->write(data, bytes_number);
+			}
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Submit reading buffer to the UART driver.
+ *
+ * Buffer is used until bytes_number bytes are read.
+ * @param desc:	Descriptor of the UART device
+ * @param data:	Buffer where data will be read
+ * @param bytes_number:	Number of bytes to be read.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t uart_read_nonblocking(struct uart_desc *desc,
+			      uint8_t *data,
+			      uint32_t bytes_number)
+{
+	mbed::BufferedSerial *uart;		// pointer to BufferedSerial/UART instance
+
+	if (desc) {
+		if (((mbed_uart_desc *)(desc->extra))->uart_port) {
+			uart = (BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port);
+
+			if (data) {
+				for (size_t i = 0; i < bytes_number; i++) {
+					if (uart->readable() > 0) {
+						uart->read(&data[i], 1);
+					}
+				}
+
+				return bytes_number;
+			}
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Submit writting buffer to the UART driver.
+ *
+ * Data from the buffer is sent over the UART, the function returns imediatly.
+ * @param desc:	Descriptor of the UART device
+ * @param data:	Buffer where data will be written
+ * @param bytes_number:	Number of bytes to be written.
+ * @return \ref SUCCESS in case of success, \ref FAILURE otherwise.
+ */
+int32_t uart_write_nonblocking(struct uart_desc *desc,
+			       const uint8_t *data,
+			       uint32_t bytes_number)
+{
+	mbed::BufferedSerial *uart;		// pointer to BufferedSerial/UART instance
+
+	if (desc) {
+		if (((mbed_uart_desc *)(desc->extra))->uart_port) {
+			uart = (BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port);
+
+			if (data) {
+				for (size_t i = 0; i < bytes_number; i++) {
+					uart->write(&data[i], 1);
+				}
+
+				return bytes_number;
+			}
+		}
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Initialize the UART communication peripheral.
+ * @param desc - The UART descriptor.
+ * @param param - The structure that contains the UART parameters.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t uart_init(struct uart_desc **desc, struct uart_init_param *param)
+{
+	mbed::BufferedSerial *uart;	// pointer to new BufferedSerial/UART instance
+	mbed_uart_desc *mbed_desc; 	// Pointer to mbed uart descriptor
+
+	if (desc && param) {
+		// Create the UART description object for the device
+		uart_desc *new_desc = (uart_desc *)malloc(sizeof(uart_desc));
+		if (new_desc == NULL) {
+			return FAILURE;
+		}
+
+		new_desc->baud_rate = param->baud_rate;
+
+		// Create and configure a new instance of BufferedSerial/UART port
+		uart = new BufferedSerial(
+			(PinName)(((mbed_uart_init_param *)param->extra)->uart_tx_pin),
+			(PinName)(((mbed_uart_init_param *)param->extra)->uart_rx_pin),
+			(int)param->baud_rate);
+
+		if (uart == NULL) {
+			return FAILURE;
+		}
+
+		// Create a new mbed descriptor to store new UART instances
+		mbed_desc = (mbed_uart_desc *)malloc(sizeof(mbed_uart_desc));
+		if (mbed_desc == NULL) {
+			return FAILURE;
+		}
+
+		mbed_desc->uart_port = (BufferedSerial *)uart;
+		new_desc->extra = (mbed_uart_desc *)mbed_desc;
+
+		*desc = new_desc;
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by uart_init().
+ * @param desc - The UART descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t uart_remove(struct uart_desc *desc)
+{
+	if (desc) {
+		// Free the UART port object
+		if ((BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port)) {
+			delete((BufferedSerial *)(((mbed_uart_desc *)(desc->extra))->uart_port));
+		}
+
+		// Free the UART extra descriptor object
+		if ((mbed_uart_desc *)(desc->extra)) {
+			free((mbed_uart_desc *)(desc->extra));
+		}
+
+		// Free the UART descriptor object
+		free(desc);
+
+		return SUCCESS;
+	}
+
+	return FAILURE;
+}
+
+
+/**
+ * @brief Get number of UART errors.
+ * @param desc - The UART descriptor.
+ * @return number of errors.
+ */
+uint32_t uart_get_errors(struct uart_desc *desc)
+{
+	if (desc) {
+		// Unused variable - fix compiler warning
+	}
+
+	return SUCCESS;
+}
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/platform/mbed/src/uart_extra.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/platform/mbed/src/uart_extra.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,71 @@
+/***************************************************************************//**
+ *   @file     uart_extra.h
+ *   @brief:   Header containing extra types required for UART interface
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef UART_EXTRA_H
+#define UART_EXTRA_H
+
+
+// Platform support needs to be C-compatible to work with other drivers
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/*
+ * Note: The structure members are not strongly typed, as this file is included
+ *       in application specific '.c' files. The mbed code structure does not
+ *       allow inclusion of mbed driver files (e.g. mbed.h) into '.c' files.
+ *       All the members are hence typecasted to mbed specific type during
+ *       uart init and read/write operations.
+ **/
+
+/**
+ * @struct mbed_uart_init_param
+ * @brief Structure holding the UART init parameters for mbed platform.
+ */
+typedef struct {
+	uint8_t uart_tx_pin;		// UART Transmit Pin
+	uint8_t uart_rx_pin;  		// UART Receive Pin
+} mbed_uart_init_param;
+
+/**
+ * @struct mbed_uart_desc
+ * @brief UART specific descriptor for the mbed platform.
+ */
+typedef struct {
+	void *uart_port; 			// UART port instance
+} mbed_uart_desc;
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* UART_EXTRA_H */
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/temperature/adt7420/adt7420.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/temperature/adt7420/adt7420.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,252 @@
+/***************************************************************************//**
+ *   @file   adt7420.c
+ *   @brief  Implementation of ADT7420 Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2012(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdlib.h>
+#include "adt7420.h"
+
+/***************************************************************************//**
+ * @brief Reads the value of a register.
+ *
+ * @param dev              - The device structure.
+ * @param register_address - Address of the register.
+ *
+ * @return register_value  - Value of the register.
+*******************************************************************************/
+uint8_t adt7420_get_register_value(struct adt7420_dev *dev,
+				   uint8_t register_address)
+{
+	uint8_t register_value = 0;
+
+	i2c_write(dev->i2c_desc,
+		  &register_address,
+		  1,
+		  0);
+	i2c_read(dev->i2c_desc,
+		 &register_value,
+		 1,
+		 1);
+
+	return register_value;
+}
+
+/***************************************************************************//**
+ * @brief Sets the value of a register.
+ *
+ * @param dev              - The device structure.
+ * @param register_address - Address of the register.
+ * @param register_value   - Value of the register.
+ *
+ * @return None.
+*******************************************************************************/
+void adt7420_set_register_value(struct adt7420_dev *dev,
+				uint8_t register_address,
+				uint8_t register_value)
+{
+	uint8_t data_buffer[2] = {0, 0};
+
+	data_buffer[0] = register_address;
+	data_buffer[1] = register_value;
+	i2c_write(dev->i2c_desc,
+		  data_buffer,
+		  2,
+		  1);
+}
+
+/***************************************************************************//**
+ * @brief Initializes the communication peripheral and checks if the device is
+ *        present.
+ *
+ * @param device     - The device structure.
+ * @param init_param - The structure that contains the device initial
+ * 		       parameters.
+ *
+ * @return status - The result of the initialization procedure.
+ *                  Example: -1 - I2C peripheral was not initialized or the
+ *                                device is not present.
+ *                            0 - I2C peripheral was initialized and the
+ *                                device is present.
+*******************************************************************************/
+int32_t adt7420_init(struct adt7420_dev **device,
+		     struct adt7420_init_param init_param)
+{
+	struct adt7420_dev *dev;
+	int32_t status;
+	uint8_t test = 0;
+
+	dev = (struct adt7420_dev *)malloc(sizeof(*dev));
+	if (!dev)
+		return -1;
+
+	/* I2C */
+	status = i2c_init(&dev->i2c_desc, &init_param.i2c_init);
+
+	/* Device Settings */
+	dev->resolution_setting = init_param.resolution_setting;
+
+	test   = adt7420_get_register_value(dev, ADT7420_REG_ID);
+	if(test != ADT7420_DEFAULT_ID)
+		status = -1;
+
+	*device = dev;
+
+	return status;
+}
+
+/***************************************************************************//**
+ * @brief Free the resources allocated by adt7420_init().
+ *
+ * @param dev - The device structure.
+ *
+ * @return ret - The result of the remove procedure.
+*******************************************************************************/
+int32_t adt7420_remove(struct adt7420_dev *dev)
+{
+	int32_t ret;
+
+	ret = i2c_remove(dev->i2c_desc);
+
+	free(dev);
+
+	return ret;
+}
+
+/***************************************************************************//**
+ * @brief Resets the ADT7420.
+ *        The ADT7420 does not respond to I2C bus commands while the default
+ *        values upload (approximately 200 us).
+ *
+ * @param dev - The device structure.
+ *
+ * @return None.
+*******************************************************************************/
+void adt7420_reset(struct adt7420_dev *dev)
+{
+	uint8_t register_address = ADT7420_REG_RESET;
+
+	i2c_write(dev->i2c_desc,
+		  &register_address,
+		  1,
+		  1);
+	dev->resolution_setting = 0;
+}
+
+/***************************************************************************//**
+ * @brief Sets the operational mode for ADT7420.
+ *
+ * @param dev  - The device structure.
+ * @param mode - Operation mode.
+ *               Example: ADT7420_OP_MODE_CONT_CONV - continuous conversion;
+ *                        ADT7420_OP_MODE_ONE_SHOT  - one shot;
+ *                        ADT7420_OP_MODE_1_SPS     - 1 SPS mode;
+ *                        ADT7420_OP_MODE_SHUTDOWN  - shutdown.
+ *
+ * @return None.
+*******************************************************************************/
+void adt7420_set_operation_mode(struct adt7420_dev *dev,
+				uint8_t mode)
+{
+	uint8_t register_value = 0;
+
+	register_value  = adt7420_get_register_value(dev, ADT7420_REG_CONFIG);
+	register_value &= ~ADT7420_CONFIG_OP_MODE(ADT7420_OP_MODE_SHUTDOWN);
+	register_value |= ADT7420_CONFIG_OP_MODE(mode);
+	adt7420_set_register_value(dev, ADT7420_REG_CONFIG, register_value);
+}
+
+/***************************************************************************//**
+ * @brief Sets the resolution for ADT7420.
+ *
+ * @param dev        - The device structure.
+ * @param resolution - Resolution.
+ *                     Example: 0 - 13-bit resolution;
+ *                              1 - 16-bit resolution.
+ *
+ * @return None.
+*******************************************************************************/
+void adt7420_set_resolution(struct adt7420_dev *dev,
+			    uint8_t resolution)
+{
+	uint8_t register_value = 0;
+
+	register_value  = adt7420_get_register_value(dev, ADT7420_REG_CONFIG);
+	register_value &= ~ADT7420_CONFIG_RESOLUTION;
+	register_value |= (resolution * ADT7420_CONFIG_RESOLUTION);
+	adt7420_set_register_value(dev, ADT7420_REG_CONFIG, register_value);
+	dev->resolution_setting = resolution;
+}
+
+/***************************************************************************//**
+ * @brief Reads the temperature data and converts it to Celsius degrees.
+ *
+ * @param dev - The device structure.
+ *
+ * @return temperature - Temperature in degrees Celsius.
+*******************************************************************************/
+float adt7420_get_temperature(struct adt7420_dev *dev)
+{
+	uint8_t msb_temp = 0;
+	uint8_t lsb_temp = 0;
+	uint16_t temp = 0;
+	float temp_c = 0;
+
+	msb_temp = adt7420_get_register_value(dev, ADT7420_REG_TEMP_MSB);
+	lsb_temp = adt7420_get_register_value(dev, ADT7420_REG_TEMP_LSB);
+	temp    = ((uint16_t)msb_temp << 8) + lsb_temp;
+	if(dev->resolution_setting) {
+		if(temp & 0x8000)
+			/*! Negative temperature */
+			temp_c = (float)((int32_t)temp - 65536) / 128;
+		else
+			/*! Positive temperature */
+			temp_c = (float)temp / 128;
+	} else {
+		temp >>= 3;
+		if(temp & 0x1000)
+			/*! Negative temperature */
+			temp_c = (float)((int32_t)temp - 8192) / 16;
+		else
+			/*! Positive temperature */
+			temp_c = (float)temp / 16;
+	}
+
+	return temp_c;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/drivers/temperature/adt7420/adt7420.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/drivers/temperature/adt7420/adt7420.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,153 @@
+/***************************************************************************//**
+ *   @file   adt7420.h
+ *   @brief  Header file of ADT7420 Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2012(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef __ADT7420_H__
+#define __ADT7420_H__
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/************************** ADT7420 Definitions *******************************/
+/******************************************************************************/
+
+/* ADT7420 address */
+#define ADT7420_A0_PIN(x)	(((x) & 0x1) << 0) // I2C Serial Bus Address Selection Pin
+#define ADT7420_A1_PIN(x)	(((x) & 0x1) << 1) // I2C Serial Bus Address Selection Pin
+#define ADT7420_ADDRESS(x,y)	(0x48 + ADT7420_A1_PIN(x) + ADT7420_A0_PIN(y))
+
+/* ADT7420 registers */
+#define ADT7420_REG_TEMP_MSB		0x00 // Temperature value MSB
+#define ADT7420_REG_TEMP_LSB		0x01 // Temperature value LSB
+#define ADT7420_REG_STATUS		0x02 // Status
+#define ADT7420_REG_CONFIG		0x03 // Configuration
+#define ADT7420_REG_T_HIGH_MSB		0x04 // Temperature HIGH setpoint MSB
+#define ADT7420_REG_T_HIGH_LSB		0x05 // Temperature HIGH setpoint LSB
+#define ADT7420_REG_T_LOW_MSB		0x06 // Temperature LOW setpoint MSB
+#define ADT7420_REG_T_LOW_LSB		0x07 // Temperature LOW setpoint LSB
+#define ADT7420_REG_T_CRIT_MSB		0x08 // Temperature CRIT setpoint MSB
+#define ADT7420_REG_T_CRIT_LSB		0x09 // Temperature CRIT setpoint LSB
+#define ADT7420_REG_HIST		0x0A // Temperature HYST setpoint
+#define ADT7420_REG_ID			0x0B // ID
+#define ADT7420_REG_RESET		0x2F // Software reset
+
+/* ADT7420_REG_STATUS definition */
+#define ADT7420_STATUS_T_LOW		(1 << 4)
+#define ADT7420_STATUS_T_HIGH		(1 << 5)
+#define ADT7420_STATUS_T_CRIT		(1 << 6)
+#define ADT7420_STATUS_RDY		(1 << 7)
+
+/* ADT7420_REG_CONFIG definition */
+#define ADT7420_CONFIG_FAULT_QUEUE(x)	(x & 0x3)
+#define ADT7420_CONFIG_CT_POL		(1 << 2)
+#define ADT7420_CONFIG_INT_POL		(1 << 3)
+#define ADT7420_CONFIG_INT_CT_MODE	(1 << 4)
+#define ADT7420_CONFIG_OP_MODE(x)	((x & 0x3) << 5)
+#define ADT7420_CONFIG_RESOLUTION	(1 << 7)
+
+/* ADT7420_CONFIG_FAULT_QUEUE(x) options */
+#define ADT7420_FAULT_QUEUE_1_FAULT	0
+#define ADT7420_FAULT_QUEUE_2_FAULTS	1
+#define ADT7420_FAULT_QUEUE_3_FAULTS	2
+#define ADT7420_FAULT_QUEUE_4_FAULTS	3
+
+/* ADT7420_CONFIG_OP_MODE(x) options */
+#define ADT7420_OP_MODE_CONT_CONV	0
+#define ADT7420_OP_MODE_ONE_SHOT	1
+#define ADT7420_OP_MODE_1_SPS		2
+#define ADT7420_OP_MODE_SHUTDOWN	3
+
+/* ADT7420 default ID */
+#define ADT7420_DEFAULT_ID		0xCB
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+struct adt7420_dev {
+	/* I2C */
+	i2c_desc	*i2c_desc;
+	/* Device Settings */
+	uint8_t		resolution_setting;
+};
+
+struct adt7420_init_param {
+	/* I2C */
+	i2c_init_param	i2c_init;
+	/* Device Settings */
+	uint8_t		resolution_setting;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/*! Reads the value of a register. */
+uint8_t adt7420_get_register_value(struct adt7420_dev *dev,
+				   uint8_t register_address);
+
+/*! Sets the value of a register. */
+void adt7420_set_register_value(struct adt7420_dev *dev,
+				uint8_t register_address,
+				uint8_t register_value);
+
+/*! Initializes the comm. peripheral and checks if the device is present. */
+int32_t adt7420_init(struct adt7420_dev **device,
+		     struct adt7420_init_param init_param);
+
+/* Free the resources allocated by adt7420_init(). */
+int32_t adt7420_remove(struct adt7420_dev *dev);
+
+/*! Resets the ADT7420. */
+void adt7420_reset(struct adt7420_dev *dev);
+
+/*! Sets the operational mode for ADT7420. */
+void adt7420_set_operation_mode(struct adt7420_dev *dev,
+				uint8_t mode);
+
+/*! Sets the resolution for ADT7420. */
+void adt7420_set_resolution(struct adt7420_dev *dev,
+			    uint8_t resolution);
+
+/*! Reads the temperature data and converts it to Celsius degrees. */
+float adt7420_get_temperature(struct adt7420_dev *dev);
+
+#endif	/* __ADT7420_H__ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/axi_io.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/axi_io.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,59 @@
+/***************************************************************************//**
+ *   @file   axi_io.h
+ *   @brief  Header file of AXI IO.
+ *   @author Antoniu Miclaus (antoniu.miclaus@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef AXI_IO_H_
+#define AXI_IO_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* AXI IO Read data */
+int32_t axi_io_read(uint32_t base, uint32_t offset, uint32_t *data);
+
+/* AXI IO Write data */
+int32_t axi_io_write(uint32_t base, uint32_t offset, uint32_t data);
+
+#endif // AXI_IO_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/circular_buffer.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/circular_buffer.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,85 @@
+/***************************************************************************//**
+ *   @file   circular_buffer.h
+ *   @brief  Circular buffer library header
+ *   @author Mihail Chindris (mihail.chindris@analog.com)
+********************************************************************************
+ *   @copyright
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef CIRCULAR_BUFFER_H
+#define CIRCULAR_BUFFER_H
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Reference type for circular buffer
+ *
+ * Abstract type of the circular buffer, used as reference for the functions.
+ */
+struct circular_buffer;
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+int32_t cb_init(struct circular_buffer **desc, uint32_t size);
+int32_t cb_remove(struct circular_buffer *desc);
+int32_t cb_size(struct circular_buffer *desc, uint32_t *size);
+
+int32_t cb_write(struct circular_buffer *desc, const void *data,
+		 uint32_t nb_elements);
+int32_t cb_read(struct circular_buffer *desc, void *data, uint32_t nb_elements);
+
+int32_t cb_prepare_async_write(struct circular_buffer *desc,
+			       uint32_t raw_size_to_write,
+			       void **write_buff,
+			       uint32_t *raw_size_avilable);
+int32_t cb_end_async_write(struct circular_buffer *desc);
+
+int32_t cb_prepare_async_read(struct circular_buffer *desc,
+			      uint32_t raw_size_to_read,
+			      void **read_buff,
+			      uint32_t *raw_size_avilable);
+int32_t cb_end_async_read(struct circular_buffer *desc);
+
+#endif
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/clk.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/clk.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,88 @@
+/***************************************************************************//**
+ *   @file   clk.h
+ *   @brief  Header file of Clock Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef CLK_H_
+#define CLK_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+
+/******************************************************************************/
+/************************* Structure Declarations *****************************/
+/******************************************************************************/
+struct clk_hw {
+	void	*dev;
+	int32_t (*dev_clk_enable)();
+	int32_t (*dev_clk_disable)();
+	int32_t (*dev_clk_recalc_rate)();
+	int32_t (*dev_clk_set_rate)();
+	int32_t (*dev_clk_round_rate)();
+};
+
+struct clk {
+	struct clk_hw	*hw;
+	uint32_t	hw_ch_num;
+	const char	*name;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Start the clock. */
+int32_t clk_enable(struct clk * clk);
+
+/* Stop the clock. */
+int32_t clk_disable(struct clk * clk);
+
+/* Get the current frequency of the clock. */
+int32_t clk_recalc_rate(struct clk *clk,
+			uint64_t *rate);
+
+/* Round the desired frequency to a rate that the clock can actually output. */
+int32_t clk_round_rate(struct clk *clk,
+		       uint64_t rate,
+		       uint64_t *rounded_rate);
+
+/* Change the frequency of the clock. */
+int32_t clk_set_rate(struct clk *clk,
+		     uint64_t rate);
+
+#endif // CLK_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/crc.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/crc.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,45 @@
+/***************************************************************************//**
+ *   @file   crc.h
+ *   @brief  Generic header file for all CRC computation algorithms.
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef __CRC_H
+#define __CRC_H
+
+#include "crc8.h"
+#include "crc16.h"
+
+#endif // __CRC_H
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/crc16.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/crc16.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,54 @@
+/***************************************************************************//**
+ *   @file   crc16.h
+ *   @brief  Header file of CRC-16 computation.
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef __CRC16_H
+#define __CRC16_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define CRC16_TABLE_SIZE 256
+
+#define DECLARE_CRC16_TABLE(_table) \
+	static uint16_t _table[CRC16_TABLE_SIZE]
+
+void crc16_populate_msb(uint16_t * table, const uint16_t polynomial);
+uint16_t crc16(const uint16_t * table, const uint8_t *pdata, size_t nbytes,
+	       uint16_t crc);
+
+#endif // __CRC16_H
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/crc8.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/crc8.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,54 @@
+/***************************************************************************//**
+ *   @file   crc8.h
+ *   @brief  Header file of CRC-8 computation.
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef __CRC8_H
+#define __CRC8_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define CRC8_TABLE_SIZE 256
+
+#define DECLARE_CRC8_TABLE(_table) \
+	static uint8_t _table[CRC8_TABLE_SIZE]
+
+void crc8_populate_msb(uint8_t * table, const uint8_t polynomial);
+uint8_t crc8(const uint8_t * table, const uint8_t *pdata, size_t nbytes,
+	     uint8_t crc);
+
+#endif // __CRC8_H
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/delay.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/delay.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,59 @@
+/***************************************************************************//**
+ *   @file   delay.h
+ *   @brief  Header file of Delay functions
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef DELAY_H_
+#define DELAY_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Generate microseconds delay. */
+void udelay(uint32_t usecs);
+
+/* Generate miliseconds delay. */
+void mdelay(uint32_t msecs);
+
+#endif // DELAY_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/error.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/error.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,64 @@
+/***************************************************************************//**
+ *   @file   error.h
+ *   @brief  Error codes definition
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef ERROR_H_
+#define ERROR_H_
+
+#include <errno.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+#ifndef SUCCESS
+#define SUCCESS		0
+#endif
+#ifndef FAILURE
+#define FAILURE		-1
+#endif
+
+/*
+ * Last error from errno.h is __ELASTERROR 2000 . After it, can be declared
+ * user errors
+ */
+#define EOVERRUN	(__ELASTERROR + 1) /* Circular buffer overrun */
+
+#define IS_ERR_VALUE(x)	((x) < 0)
+
+#endif // ERROR_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/fifo.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/fifo.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,75 @@
+/***************************************************************************//**
+ *   @file   fifo.h
+ *   @brief  Implementation of fifo
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef FIFO_H_
+#define FIFO_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct fifo_element
+ * @brief Structure holding the fifo element parameters.
+ */
+struct fifo_element {
+	/** next FIFO element */
+	struct fifo_element *next;
+	/** FIFO data pointer */
+	char *data;
+	/** FIFO length */
+	uint32_t len;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Insert element to fifo tail. */
+int32_t fifo_insert(struct fifo_element **p_fifo, char *buff, uint32_t len);
+
+/* Remove fifo head. */
+struct fifo_element *fifo_remove(struct fifo_element *p_fifo);
+
+#endif /* FIFO_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/gpio.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/gpio.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,165 @@
+/***************************************************************************//**
+ *   @file   gpio.h
+ *   @brief  Header file of GPIO Interface
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef GPIO_H_
+#define GPIO_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+#define GPIO_OUT	0x01
+#define GPIO_IN		0x00
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct gpio_platform_ops
+ * @brief Structure holding gpio function pointers that point to the platform
+ * specific function
+ */
+struct gpio_platform_ops ;
+
+/**
+ * @struct gpio_init_param
+ * @brief Structure holding the parameters for GPIO initialization.
+ */
+typedef struct gpio_init_param {
+	/** GPIO number */
+	uint32_t	number;
+	/** GPIO platform specific functions */
+	const struct gpio_platform_ops *platform_ops;
+	/** GPIO extra parameters (device specific) */
+	void		*extra;
+} gpio_init_param;
+
+/**
+ * @struct gpio_desc
+ * @brief Structure holding the GPIO descriptor.
+ */
+typedef struct gpio_desc {
+	/** GPIO number */
+	uint32_t	number;
+	/** GPIO platform specific functions */
+	const struct gpio_platform_ops *platform_ops;
+	/** GPIO extra parameters (device specific) */
+	void		*extra;
+} gpio_desc;
+
+/**
+ * @enum gpio_values
+ * @brief Enum that holds the possible output states of a GPIO.
+ */
+enum gpio_values {
+	/** GPIO logic low */
+	GPIO_LOW,
+	/** GPIO logic high */
+	GPIO_HIGH,
+	/** GPIO high impedance */
+	GPIO_HIGH_Z
+};
+
+/**
+ * @struct gpio_platform_ops
+ * @brief Structure holding gpio function pointers that point to the platform
+ * specific function
+ */
+struct gpio_platform_ops {
+	/** gpio initialization function pointer */
+	int32_t (*gpio_ops_get)(struct gpio_desc **, const struct gpio_init_param *);
+	/** gpio optional descriptor function pointer */
+	int32_t (*gpio_ops_get_optional)(struct gpio_desc **,
+					 const struct gpio_init_param *);
+	/** gpio remove function pointer */
+	int32_t (*gpio_ops_remove)(struct gpio_desc *);
+	/** gpio direction input function pointer */
+	int32_t (*gpio_ops_direction_input)(struct gpio_desc *);
+	/** gpio direction output function pointer */
+	int32_t (*gpio_ops_direction_output)(struct gpio_desc *, uint8_t);
+	/** gpio get direction function pointer */
+	int32_t (*gpio_ops_get_direction)(struct gpio_desc *, uint8_t *);
+	/** gpio set value function pointer */
+	int32_t (*gpio_ops_set_value)(struct gpio_desc *, uint8_t);
+	/** gpio get value function pointer */
+	int32_t (*gpio_ops_get_value)(struct gpio_desc *, uint8_t *);
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Obtain the GPIO decriptor. */
+int32_t gpio_get(struct gpio_desc **desc,
+		 const struct gpio_init_param *param);
+
+/* Obtain optional GPIO descriptor. */
+int32_t gpio_get_optional(struct gpio_desc **desc,
+			  const struct gpio_init_param *param);
+
+/* Free the resources allocated by gpio_get() */
+int32_t gpio_remove(struct gpio_desc *desc);
+
+/* Enable the input direction of the specified GPIO. */
+int32_t gpio_direction_input(struct gpio_desc *desc);
+
+/* Enable the output direction of the specified GPIO. */
+int32_t gpio_direction_output(struct gpio_desc *desc,
+			      uint8_t value);
+
+/* Get the direction of the specified GPIO. */
+int32_t gpio_get_direction(struct gpio_desc *desc,
+			   uint8_t *direction);
+
+/* Set the value of the specified GPIO. */
+int32_t gpio_set_value(struct gpio_desc *desc,
+		       uint8_t value);
+
+/* Get the value of the specified GPIO. */
+int32_t gpio_get_value(struct gpio_desc *desc,
+		       uint8_t *value);
+
+#endif // GPIO_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/i2c.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/i2c.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,129 @@
+/***************************************************************************//**
+ *   @file   i2c.h
+ *   @brief  Header file of I2C Interface
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef I2C_H_
+#define I2C_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct i2c_platform_ops
+ * @brief Structure holding I2C function pointers that point to the platform
+ * specific function
+ */
+struct i2c_platform_ops ;
+
+/**
+ * @struct i2c_init_param
+ * @brief Structure holding the parameters for I2C initialization.
+ */
+typedef struct i2c_init_param {
+	/** I2C maximum transfer speed supported */
+	uint32_t	max_speed_hz;
+	/** Slave address */
+	uint8_t		slave_address;
+	/** I2C platform specific functions */
+	const struct i2c_platform_ops *platform_ops;
+	/** I2C extra parameters (device specific parameters) */
+	void		*extra;
+} i2c_init_param;
+
+/**
+ * @struct i2c_desc
+ * @brief Structure holding I2C descriptor
+ */
+typedef struct i2c_desc {
+	/** I2C maximum transfer speed supported */
+	uint32_t	max_speed_hz;
+	/** Slave address */
+	uint8_t		slave_address;
+	/** I2C platform specific functions */
+	const struct i2c_platform_ops *platform_ops;
+	/** I2C extra parameters (device specific parameters) */
+	void		*extra;
+} i2c_desc;
+
+/**
+ * @struct i2c_platform_ops
+ * @brief Structure holding i2c function pointers that point to the platform
+ * specific function
+ */
+struct i2c_platform_ops {
+	/** i2c initialization function pointer */
+	int32_t (*i2c_ops_init)(struct i2c_desc **, const struct i2c_init_param *);
+	/** i2c write function pointer */
+	int32_t (*i2c_ops_write)(struct i2c_desc *, uint8_t *, uint8_t, uint8_t);
+	/** i2c write function pointer */
+	int32_t (*i2c_ops_read)(struct i2c_desc *, uint8_t *, uint8_t, uint8_t);
+	/** i2c remove function pointer */
+	int32_t (*i2c_ops_remove)(struct i2c_desc *);
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Initialize the I2C communication peripheral. */
+int32_t i2c_init(struct i2c_desc **desc,
+		 const struct i2c_init_param *param);
+
+/* Free the resources allocated by i2c_init(). */
+int32_t i2c_remove(struct i2c_desc *desc);
+
+/* Write data to a slave device. */
+int32_t i2c_write(struct i2c_desc *desc,
+		  uint8_t *data,
+		  uint8_t bytes_number,
+		  uint8_t stop_bit);
+
+/* Read data from a slave device. */
+int32_t i2c_read(struct i2c_desc *desc,
+		 uint8_t *data,
+		 uint8_t bytes_number,
+		 uint8_t stop_bit);
+
+#endif // I2C_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/irq.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/irq.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,134 @@
+/***************************************************************************//**
+ *   @file   irq.h
+ *   @brief  Header file of IRQ interface.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef IRQ_H_
+#define IRQ_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @enum irq_uart_event_e
+ * @brief Possible events for uart interrupt
+ */
+enum irq_uart_event_e {
+	/** Write operation finalized */
+	WRITE_DONE,
+	/** Read operation finalized */
+	READ_DONE,
+	/** An error occurred */
+	ERROR_RW
+};
+
+/**
+ * @struct irq_init_param
+ * @brief Structure holding the initial parameters for Interrupt Request.
+ */
+struct irq_init_param {
+	/** Interrupt request controller ID. */
+	uint32_t	irq_ctrl_id;
+	/** IRQ extra parameters (device specific) */
+	void		*extra;
+};
+
+/**
+ * @struct irq_desc
+ * @brief Structure for Interrupt Request descriptor.
+ */
+struct irq_ctrl_desc {
+	/** Interrupt request controller ID. */
+	uint32_t	irq_ctrl_id;
+	/** IRQ extra parameters (device specific) */
+	void		*extra;
+};
+
+/**
+ * @struct callback_desc
+ * @brief Structure describing a callback to be registered
+ */
+struct callback_desc {
+	/**
+	 * Callback to be called when the event an event occurs
+	 */
+	void(*callback)(void);
+	/** Parameter to be passed when the callback is called */
+	void *ctx;
+	/** Platform specific configuration for a callback */
+	void *config;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Initialize a interrupt controller peripheral. */
+int32_t irq_ctrl_init(struct irq_ctrl_desc **desc,
+	const struct irq_init_param *param);
+
+/* Free the resources allocated by irq_ctrl_init(). */
+int32_t irq_ctrl_remove(struct irq_ctrl_desc *desc);
+
+/* Register a callback to handle the irq events */
+int32_t irq_register_callback(struct irq_ctrl_desc *desc,
+	uint32_t irq_id,
+	struct callback_desc *callback_desc);
+
+/* Unregisters a generic IRQ handling function */
+int32_t irq_unregister(struct irq_ctrl_desc *desc, uint32_t irq_id);
+
+/* Global interrupt enable */
+int32_t irq_global_enable(struct irq_ctrl_desc *desc);
+
+/* Global interrupt disable */
+int32_t irq_global_disable(struct irq_ctrl_desc *desc);
+
+/* Enable specific interrupt */
+int32_t irq_enable(struct irq_ctrl_desc *desc, uint32_t irq_id);
+
+/* Disable specific interrupt */
+int32_t irq_disable(struct irq_ctrl_desc *desc, uint32_t irq_id);
+
+#endif // IRQ_H_
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/list.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/list.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,317 @@
+/***************************************************************************//**
+ *   @file   list.h
+ *   @brief  List library header
+ *   @author Mihail Chindris (mihail.chindris@analog.com)
+********************************************************************************
+ *   @copyright
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+********************************************************************************
+ *
+ *  @section list_details Library description
+ *   This library handles double linked lists and it expose inseart,
+ *   read, get and delete functions. \n
+ *   It also can be accesed using it member functions which wrapp function for
+ *   usual list types.\n
+ *  @subsection example Sample code
+ *   @code{.c}
+ *	// -- Use a generic list
+ *	struct list_desc *list1;
+ *	struct iterator  *it;
+ *	uint32_t	 a;
+ *	// Create list list1
+ *	list_init(&list1, LIST_DEFAULT, NULL);
+ *	// Add items to the list
+ *	list_add_last(list1, 1);
+ *	list_add_last(list1, 2);
+ *	list_add_last(list1, 3);
+ *	// Here the list will be: 1 -> 2 - > 3
+ *
+ *	list_read_last(list1, &a);
+ *	printf("Last: %d\n", a);
+ *	// 3 will be printed
+ *	// Create an iterator on the end of the list
+ *	iterator_init(&it, list1, 0);
+ *	// Move the iterator backword with one position
+ *	iterator_move(it, -1);
+ *	// Read the data at the current position
+ *	iterator_read(it, &a);
+ *	printf("Current: %d\n", a);
+ *	// 2 will be printed
+ *	iterator_remove(it);
+ *	list_remove(list1);
+ *
+ *	// -- Use a popular list
+ *	struct list_desc *stack;
+ *	// Create a FIFO list
+ *	list_init(&stack, LIST_STACK, NULL);
+ *	// Put elements in the list
+ *	stack->push(stack, 1);
+ *	stack->push(stack, 2);
+ *	stack->push(stack, 3);
+ *	// Read from the stack
+ *	stack->pop(stack, &a);
+ *	printf("Last: %d\n", a);
+ *	// 3 will be printed
+ *	list_remove(stack);
+ *    @endcode
+*******************************************************************************/
+
+#ifndef LIST_H
+#define LIST_H
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+#include <stdbool.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct list_desc
+ * @brief Structure storing the list and function wrapper for usual list types
+ *
+ * With this structure the funtionalities of usual list types
+ * ( \ref adapter_type ) can be accesed with the functions referenced in this
+ * structure.
+ * For example:
+ * @code{.c}
+ * my_queue->push(my_queue, my_data);
+ * @endcode
+ */
+struct list_desc;
+
+/**
+ * @struct list_iterator
+ * @brief Structure used to iterate through the list using Iterator functions.
+ */
+struct iterator;
+
+/**
+ * @brief Prototype of the compare function.
+ *
+ * The function used to compare the elements of the liste when doing
+ * operations on an ordered list.
+ * @param data1 - First element to be compared
+ * @param data2 - Second element to be compared
+ * @return
+ *  - -1 - If data1 < data2
+ *  - 0 - If data1 == data2
+ *  - 1 - If data1 > data2
+ */
+typedef int32_t (*f_cmp)(void *data1, void *data2);
+
+/**
+ * @name Generic functions
+ * Each function interacting with the list have one of the following formats.\n
+ * Aditionaly they may have one more parametere for specific functionalities.\n
+ * In the Iterator functions, the list reference is replaced by the iterator's
+ * one.
+ * @{
+ */
+
+/**
+ * @brief Add an element in the list.
+ *
+ * The element of the list is created and the data field is stored in it.
+ * @param list_desc - Reference to the list. Created by \ref list_init
+ * @param data - Data to store in a list element
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+typedef int32_t (*f_add)(struct list_desc *list_desc, void *data);
+
+/**
+ * @brief Edit an element in the list. The content is replaced by new_data.
+ * @param list_desc - Reference to the list. Created by \ref list_init .
+ * @param new_data - New data to replace the old one
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+typedef int32_t (*f_edit)(struct list_desc *list_desc, void *new_data);
+
+/**
+ * @brief Read an element from the list.
+ * @param list_desc - Reference to the list. Created by \ref list_init
+ * @param result - If not null, result is filled with:
+ * @param data - Content of the list element, NULL if some error occur.
+ * @return \n
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ * @note If the content of an element can be 0 then the result must be checked
+ * to see if the functions has succeded
+ */
+typedef int32_t (*f_read)(struct list_desc *list_desc, void **data);
+
+/**
+ * @brief Read and remove an element from the list.
+ * @param list_desc - Reference to the list. Created by \ref list_init
+ * @param result - If not null, result is filled with:
+ * @param data - Content of the list element, NULL if some error occur.
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+typedef int32_t (*f_get)(struct list_desc *list_desc, void **data);
+
+/** @} */
+
+/**
+ * @enum adapter_type
+ * @brief Selects functionalities for functions in \ref list_desc
+ */
+enum adapter_type {
+	/** Default type is LIST_STACK */
+	LIST_DEFAULT,
+	/**
+	 * Functions for a FIFO list (First-in first-out). Elements are inserted
+	 * in one end and extracted from the other end.
+	 *  - \e Push: Insert element
+	 *  - \e Pop: Get next element (Read and remove)
+	 *  - \e Top_next: Read next element
+	 *  - \e Back: Read first element
+	 *  - \e Swap: Edit the content of the next element
+	 */
+	LIST_QUEUE,
+	/**
+	 * Functions for a LIFO list (Last-in first-out). Elements are inserted
+	 * and extracted only from the same end.
+	 *  - \e Push: Insert element
+	 *  - \e Pop: Get top element (Read and remove)
+	 *  - \e Top_next: Read top element
+	 *  - \e Back: Read bottom element
+	 *  - \e Swap: Edit the content of the top element
+	 */
+	LIST_STACK,
+	/**
+	 * Functions for ordered list. The order of element is determinated
+	 * usinge the \ref f_cmp.
+	 *  - \e Push: Insert element
+	 *  - \e Pop: Get lowest element (Read and remove)
+	 *  - \e Top_next: Read lowest element
+	 *  - \e Back: Read the biggest element
+	 *  - \e Swap: Edit the lowest element
+	 */
+	LIST_PRIORITY_LIST
+};
+
+struct list_desc {
+	/** Refer to \ref adapter_type */
+	f_add	push;
+	/** Refer to \ref adapter_type */
+	f_get	pop;
+	/** Refer to \ref adapter_type */
+	f_read	top_next;
+	/** Refer to \ref adapter_type */
+	f_read	back;
+	/** Refer to \ref adapter_type */
+	f_edit	swap;
+	/** Structure storing the list internal parameters */
+	void	*priv_desc;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+int32_t list_init(struct list_desc **list_desc, enum adapter_type type,
+		  f_cmp comparator);
+int32_t list_remove(struct list_desc *list_desc);
+int32_t list_get_size(struct list_desc *list_desc, uint32_t *out_size);
+
+/**
+ * @name Iterator functions
+ * An iterator is used to iterate through the list. For a list, any number of
+ * iterators can be created. All must be removed before removing a list.
+ * @{
+ */
+int32_t iterator_init(struct iterator **iter, struct list_desc *list_desc,
+		      bool start);
+int32_t iterator_remove(struct iterator *iter);
+int32_t iterator_move(struct iterator *iter, int32_t idx);
+int32_t iterator_find(struct iterator *iter, void *cmp_data);
+int32_t iterator_insert(struct iterator *iter, void *data, bool after);
+int32_t iterator_edit(struct iterator *iter, void *new_data);
+int32_t iterator_read(struct iterator *iter, void **data);
+int32_t iterator_get(struct iterator *iter, void **data);
+/** @}*/
+
+/**
+ * @name Operations on the ends of the list
+ * These functions will operate on the first or last element of the list
+ * @{
+ */
+int32_t list_add_first(struct list_desc *list_desc, void *data);
+int32_t list_edit_first(struct list_desc *list_desc, void *new_data);
+int32_t list_read_first(struct list_desc *list_desc, void **data);
+int32_t list_get_first(struct list_desc *list_desc, void **data);
+
+int32_t list_add_last(struct list_desc *list_desc, void *data);
+int32_t list_edit_last(struct list_desc *list_desc, void *new_data);
+int32_t list_read_last(struct list_desc *list_desc, void **data);
+int32_t list_get_last(struct list_desc *list_desc, void **data);
+/** @}*/
+
+/**
+ * @name Operations by index
+ * These functions use an index to identify the element in the list.
+ * @{
+ */
+int32_t list_add_idx(struct list_desc *list_desc, void *data, uint32_t idx);
+int32_t list_edit_idx(struct list_desc *list_desc, void *new_data,
+		      uint32_t idx);
+int32_t list_read_idx(struct list_desc *list_desc, void **data, uint32_t idx);
+int32_t list_get_idx(struct list_desc *list_desc, void **data, uint32_t idx);
+/** @}*/
+
+/**
+ * @name Operations by comparation
+ * These functions use the specified \ref f_cmp at \ref list_init to identify
+ * the element this will operate on.
+ * @{
+ */
+int32_t list_add_find(struct list_desc *list_desc, void *data);
+int32_t list_edit_find(struct list_desc *list_desc, void *new_data,
+		       void *cmp_data);
+int32_t list_read_find(struct list_desc *list_desc, void **data,
+		       void *cmp_data);
+int32_t list_get_find(struct list_desc *list_desc, void **data, void *cmp_data);
+/** @}*/
+
+#endif //LIST_H
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/pwm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/pwm.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,134 @@
+/***************************************************************************//**
+ *   @file   pwm.h
+ *   @brief  Header file of PWM Interface
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef PWM_H_
+#define PWM_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include <stdbool.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+/**
+ * @enum pwm_polarity
+ * @brief Possible polarities of the PWM signal
+ */
+enum pwm_polarity {
+	/** PWM duty cycle is high, idle low */
+	PWM_POLARITY_HIGH,
+	/** PWM duty cycle is low, idle high */
+	PWM_POLARITY_LOW,
+};
+
+/**
+ * @struct pwm_init_param
+ * @brief  Structure containing the init parameters needed by the PWM generator
+ */
+struct pwm_init_param {
+	/** PWM generator period */
+	uint32_t period_ns;
+	/** PWM generator duty cycle */
+	uint32_t duty_cycle_ns;
+	/** PWM generator polarity */
+	enum pwm_polarity polarity;
+	/** PWM extra parameters (device specific) */
+	void *extra;
+};
+
+/**
+ * @struct pwm_desc
+ * @brief  Structure representing an PWM generator device
+ */
+struct pwm_desc {
+	/** PWM generator period */
+	uint32_t period_ns;
+	/** PWM generator duty cycle */
+	uint32_t duty_cycle_ns;
+	/** PWM generator polarity */
+	enum pwm_polarity polarity;
+	/** PWM generator enabled */
+	bool enabled;
+	/** PWM extra parameters (device specific) */
+	void *extra;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+/* Initialize the PWM generator device */
+int32_t pwm_init(struct pwm_desc **desc,
+		 const struct pwm_init_param *param);
+
+/* Free the resources used by the PWM generator device */
+int32_t pwm_remove(struct pwm_desc *desc);
+
+/* Enable PWM generator device */
+int32_t pwm_enable(struct pwm_desc *desc);
+
+/* Disable PWM generator device */
+int32_t pwm_disable(struct pwm_desc *desc);
+
+/* Set period of PWM generator device */
+int32_t pwm_set_period(struct pwm_desc *desc,
+		       uint32_t period_ns);
+
+/* Get period of PWM generator device */
+int32_t pwm_get_period(struct pwm_desc *desc,
+			uint32_t *period_ns);
+
+/* Set duty cycle of PWM generator device */
+int32_t pwm_set_duty_cycle(struct pwm_desc *desc,
+			   uint32_t duty_cycle_ns);
+
+/* Get period of PWM generator device */
+int32_t pwm_get_duty_cycle(struct pwm_desc *desc,
+			   uint32_t *duty_cycle_ns);
+
+/* Set polarity of PWM generator device */
+int32_t pwm_set_polarity(struct pwm_desc *desc,
+			 enum pwm_polarity polarity);
+
+/* Set polarity of PWM generator device */
+int32_t pwm_get_polarity(struct pwm_desc *desc,
+			 enum pwm_polarity *polarity);
+
+#endif
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/rtc.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/rtc.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,105 @@
+/***************************************************************************//**
+ *   @file   rtc.h
+ *   @brief  Header of the RTC interface
+ *   @author Andrei Drimbarean (andrei.drimbarean@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef RTC_H_
+#define RTC_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct rtc_desc
+ * @brief Structure holding RTC descriptor.
+ */
+struct rtc_desc {
+	/** ID of the real time clock core. */
+	uint8_t id;
+	/** Frequency of the RTC */
+	uint32_t freq;
+	/** Load value of the RTC */
+	uint32_t load;
+	/** Device specific RTC parameters. */
+	void *extra;
+};
+
+/**
+ * @struct rtc_init_param
+ * @brief Structure holding RTC initialization parameters.
+ */
+struct rtc_init_param {
+	/** ID of the real time clock core. */
+	uint8_t id;
+	/** Frequency of the RTC */
+	uint32_t freq;
+	/** Load value of the RTC */
+	uint32_t load;
+	/** Device specific RTC parameters. */
+	void *extra;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/** Initialize the RTC peripheral. */
+int32_t rtc_init(struct rtc_desc **device, struct rtc_init_param *init_param);
+
+/** Free the resources allocated by rtc_init(). */
+int32_t rtc_remove(struct rtc_desc *dev);
+
+/** Start the real time clock. */
+int32_t rtc_start(struct rtc_desc *dev);
+
+/** Stop the real time clock. */
+int32_t rtc_stop(struct rtc_desc *dev);
+
+/** Get the current count for the real time clock. */
+int32_t rtc_get_cnt(struct rtc_desc *dev, uint32_t *tmr_cnt);
+
+/** Set the current count for the real time clock. */
+int32_t rtc_set_cnt(struct rtc_desc *dev, uint32_t tmr_cnt);
+
+#endif /* RTC_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/spi.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/spi.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,144 @@
+/***************************************************************************//**
+ *   @file   spi.h
+ *   @brief  Header file of SPI Interface
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef SPI_H_
+#define SPI_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+#define	SPI_CPHA	0x01
+#define	SPI_CPOL	0x02
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @enum spi_mode
+ * @brief SPI configuration for clock phase and polarity.
+ */
+typedef enum spi_mode {
+	/** Data on rising, shift out on falling */
+	SPI_MODE_0 = (0 | 0),
+	/** Data on falling, shift out on rising */
+	SPI_MODE_1 = (0 | SPI_CPHA),
+	/** Data on falling, shift out on rising */
+	SPI_MODE_2 = (SPI_CPOL | 0),
+	/** Data on rising, shift out on falling */
+	SPI_MODE_3 = (SPI_CPOL | SPI_CPHA)
+} spi_mode;
+
+/**
+ * @struct spi_platform_ops
+ * @brief Structure holding SPI function pointers that point to the platform
+ * specific function
+ */
+struct spi_platform_ops ;
+
+/**
+ * @struct spi_init_param
+ * @brief Structure holding the parameters for SPI initialization
+ */
+typedef struct spi_init_param {
+	/** maximum transfer speed */
+	uint32_t	max_speed_hz;
+	/** SPI chip select */
+	uint8_t		chip_select;
+	/** SPI mode */
+	enum spi_mode	mode;
+	const struct spi_platform_ops *platform_ops;
+	/**  SPI extra parameters (device specific) */
+	void		*extra;
+} spi_init_param;
+
+/**
+ * @struct spi_desc
+ * @brief Structure holding SPI descriptor.
+ */
+typedef struct spi_desc {
+	/** maximum transfer speed */
+	uint32_t	max_speed_hz;
+	/** SPI chip select */
+	uint8_t		chip_select;
+	/** SPI mode */
+	enum spi_mode	mode;
+	const struct spi_platform_ops *platform_ops;
+	/**  SPI extra parameters (device specific) */
+	void		*extra;
+} spi_desc;
+
+/**
+ * @struct spi_platform_ops
+ * @brief Structure holding SPI function pointers that point to the platform
+ * specific function
+ */
+struct spi_platform_ops {
+	/** SPI initialization function pointer */
+	int32_t (*spi_ops_init)(struct spi_desc **, const struct spi_init_param *);
+	/** SPI write/read function pointer */
+	int32_t (*spi_ops_write_and_read)(struct spi_desc *, uint8_t *, uint16_t);
+	/** SPI remove function pointer */
+	int32_t (*spi_ops_remove)(struct spi_desc *);
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Initialize the SPI communication peripheral. */
+int32_t spi_init(struct spi_desc **desc,
+		 const struct spi_init_param *param);
+
+/* Free the resources allocated by spi_init(). */
+int32_t spi_remove(struct spi_desc *desc);
+
+/* Write and read data to/from SPI. */
+int32_t spi_write_and_read(struct spi_desc *desc,
+			   uint8_t *data,
+			   uint16_t bytes_number);
+
+#endif // SPI_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/timer.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/timer.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,113 @@
+/***************************************************************************//**
+*   @file   timer.h
+*   @brief  Timer control module header.
+*   @author Andrei Drimbarean (andrei.drimbarean@analog.com)
+********************************************************************************
+* Copyright 2019(c) Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*  - Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+*  - Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in
+*    the documentation and/or other materials provided with the
+*    distribution.
+*  - Neither the name of Analog Devices, Inc. nor the names of its
+*    contributors may be used to endorse or promote products derived
+*    from this software without specific prior written permission.
+*  - The use of this software may or may not infringe the patent rights
+*    of one or more patent holders.  This license does not release you
+*    from the requirement that you obtain separate licenses from these
+*    patent holders to use this software.
+*  - Use of the software either in source or binary form, must be run
+*    on or directly connected to an Analog Devices Inc. component.
+*
+* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY
+* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef SRC_TIMER_H_
+#define SRC_TIMER_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct timer_desc
+ * @brief Structure holding timer descriptor
+ */
+struct timer_desc {
+	/** timer ID */
+	uint16_t id;
+	/** timer count frequency (Hz) */
+	uint32_t freq_hz;
+	/** counter start value */
+	uint32_t load_value;
+	/** timer extra parameters (device specific) */
+	void *extra;
+};
+
+/**
+ * @struct timer_init_param
+ * @brief  Structure holding the parameters for timer initialization
+ */
+struct timer_init_param {
+	/** timer ID */
+	uint16_t id;
+	/** timer count frequency (Hz) */
+	uint32_t freq_hz;
+	/** counter start value */
+	uint32_t load_value;
+	/** timer extra parameters (device specific) */
+	void *extra;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Initialize hardware timer and the handler structure associated with it. */
+int32_t timer_init(struct timer_desc **desc,
+		   struct timer_init_param *param);
+
+/* Free the memory allocated by timer_setup(). */
+int32_t timer_remove(struct timer_desc *desc);
+
+/* Start a timer. */
+int32_t timer_start(struct timer_desc *desc);
+
+/* Stop a timer from counting. */
+int32_t timer_stop(struct timer_desc *desc);
+
+/* Get the value of the counter register for the timer. */
+int32_t timer_counter_get(struct timer_desc *desc, uint32_t *counter);
+
+/* Set the timer counter register value. */
+int32_t timer_counter_set(struct timer_desc *desc, uint32_t new_val);
+
+/* Get the timer clock frequency. */
+int32_t timer_count_clk_get(struct timer_desc *desc, uint32_t *freq_hz);
+
+/* Set the timer clock frequency. */
+int32_t timer_count_clk_set(struct timer_desc *desc, uint32_t freq_hz);
+
+#endif /* SRC_TIMER_H_ */
+
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/trng.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/trng.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,84 @@
+/***************************************************************************//**
+ *   @file   trng.h
+ *   @brief  Header file of true random number generator
+ *   @author Mihail Chindris (mihail.chindris@analog.com)
+********************************************************************************
+ *   @copyright
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef TRNG_H
+#define TRNG_H
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct trng_desc
+ * @brief TRNG Descriptor
+ */
+struct trng_desc;
+
+/**
+ * @struct trng_init_param
+ * @brief Init parameter for TRNG
+ */
+struct trng_init_param {
+	/** Device id */
+	uint32_t	dev_id;
+	/** Platform specific parameter */
+	void		*extra;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Initialize descriptor */
+int32_t trng_init(struct trng_desc **desc, struct trng_init_param *param);
+
+/* Free resources allocated in descriptor */
+void trng_remove(struct trng_desc *desc);
+
+/* Fill buffer with random numbers */
+int32_t trng_fill_buffer(struct trng_desc *desc, uint8_t *buff, uint32_t len);
+
+#endif
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/uart.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/uart.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,111 @@
+/***************************************************************************//**
+ *   @file   uart.h
+ *   @brief  Header file of UART interface.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef UART_H_
+#define UART_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct uart_init_param
+ * @brief Structure holding the parameters for UART initialization
+ */
+struct uart_init_param {
+	/** UART Device ID */
+	uint8_t	device_id;
+	/** UART Baud Rate */
+	uint32_t 	baud_rate;
+	/** UART extra parameters (device specific) */
+	void 		*extra;
+};
+
+/**
+ * @struct uart_desc
+ * @brief Stucture holding the UART descriptor.
+ */
+struct uart_desc {
+	/** UART Device ID */
+	uint8_t 	device_id;
+	/** UART Baud Rate */
+	uint32_t 	baud_rate;
+	/** Callback to be called when an operation is done (optional) */
+	void		(*callback)(void *callback_ctx, uint32_t event,
+				    void *extra);
+	/** Parameter to be passed to the callback as app_param */
+	void		*callback_ctx;
+	/** UART extra parameters (device specific) */
+	void 		*extra;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Read data from UART. Blocking function */
+int32_t uart_read(struct uart_desc *desc, uint8_t *data, uint32_t bytes_number);
+
+/* Write data to UART. Blocking function */
+int32_t uart_write(struct uart_desc *desc, const uint8_t *data,
+		   uint32_t bytes_number);
+
+/* Read data from UART. Non blocking function */
+int32_t uart_read_nonblocking(struct uart_desc *desc, uint8_t *data,
+			      uint32_t bytes_number);
+
+/* Write data to UART. Non blocking function*/
+int32_t uart_write_nonblocking(struct uart_desc *desc, const uint8_t *data,
+			       uint32_t bytes_number);
+
+/* Initialize the UART communication peripheral. */
+int32_t uart_init(struct uart_desc **desc, struct uart_init_param *param);
+
+/* Free the resources allocated by uart_init(). */
+int32_t uart_remove(struct uart_desc *desc);
+
+/* Check if UART errors occurred. */
+uint32_t uart_get_errors(struct uart_desc *desc);
+
+#endif /* UART_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/util.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/util.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,150 @@
+/***************************************************************************//**
+ *   @file   util.h
+ *   @brief  Implementation of utility functions.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2018(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef UTIL_H_
+#define UTIL_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdint.h>
+#include <stdbool.h>
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+#define BIT(x)	(1 << (x))
+
+#define ARRAY_SIZE(x) \
+	(sizeof(x) / sizeof((x)[0]))
+
+#define DIV_ROUND_UP(x,y) \
+	(((x) + (y) - 1) / (y))
+#define DIV_ROUND_CLOSEST(x, y) \
+	(((x) + (y) / 2) / (y))
+#define DIV_ROUND_CLOSEST_ULL(x, y) \
+	DIV_ROUND_CLOSEST(x, y)
+
+#define min(x, y) \
+	(((x) < (y)) ? (x) : (y))
+#define min_t(type, x, y) \
+	(type)min((type)(x), (type)(y))
+
+#define max(x, y) \
+	(((x) > (y)) ? (x) : (y))
+#define max_t(type, x, y) \
+	(type)max((type)(x), (type)(y))
+
+#define clamp(val, min_val, max_val) \
+	(max(min((val), (max_val)), (min_val)))
+#define clamp_t(type, val, min_val, max_val) \
+	(type)clamp((type)(val), (type)(min_val), (type)(max_val))
+
+#define abs(x) \
+	((x) < 0 ? (-(x)) : (x))
+
+#define swap(x, y) \
+	{typeof(x) _tmp_ = (x); (x) = (y); (y) = _tmp_;}
+
+#define round_up(x,y) \
+		(((x)+(y)-1)/(y))
+
+#define BITS_PER_LONG 32
+
+#define GENMASK(h, l) ({ 					\
+		uint32_t t = (uint32_t)(~0UL);			\
+		t = t << (BITS_PER_LONG - (h - l + 1));		\
+		t = t >> (BITS_PER_LONG - (h + 1));		\
+		t;						\
+})
+
+#define bswap_constant_32(x) \
+	((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) | \
+	 (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
+
+#define U16_MAX		((uint16_t)~0U)
+#define S16_MAX		((int16_t)(U16_MAX>>1))
+
+#define DIV_U64(x, y) (x / y)
+
+#define UNUSED_PARAM(x) ((void)x)
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+/* Find first set bit in word. */
+uint32_t find_first_set_bit(uint32_t word);
+/* Find last set bit in word. */
+uint32_t find_last_set_bit(uint32_t word);
+/* Locate the closest element in an array. */
+uint32_t find_closest(int32_t val,
+		      const int32_t *array,
+		      uint32_t size);
+/* Shift the value and apply the specified mask. */
+uint32_t field_prep(uint32_t mask, uint32_t val);
+/* Get a field specified by a mask from a word. */
+uint32_t field_get(uint32_t mask, uint32_t word);
+/* Log base 2 of the given number. */
+int32_t log_base_2(uint32_t x);
+/* Find greatest common divisor of the given two numbers. */
+uint32_t greatest_common_divisor(uint32_t a,
+				 uint32_t b);
+/* Calculate best rational approximation for a given fraction. */
+void rational_best_approximation(uint32_t given_numerator,
+				 uint32_t given_denominator,
+				 uint32_t max_numerator,
+				 uint32_t max_denominator,
+				 uint32_t *best_numerator,
+				 uint32_t *best_denominator);
+/* Calculate the number of set bits. */
+uint32_t hweight8(uint32_t word);
+/* Calculate the quotient and the remainder of an integer division. */
+uint64_t do_div(uint64_t* n,
+		uint64_t base);
+/* Unsigned 64bit divide with 64bit divisor and remainder */
+uint64_t div64_u64_rem(uint64_t dividend, uint64_t divisor,
+		       uint64_t *remainder);
+/* Unsigned 64bit divide with 32bit divisor with remainder */
+uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder);
+/* Unsigned 64bit divide with 32bit divisor */
+uint64_t div_u64(uint64_t dividend, uint32_t divisor);
+/* Converts from string to int32_t */
+int32_t str_to_int32(const char *str);
+/* Converts from string to uint32_t */
+uint32_t srt_to_uint32(const char *str);
+#endif // UTIL_H_
+
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/include/xml.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/include/xml.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,123 @@
+/***************************************************************************//**
+ *   @file   xml.h
+ *   @brief  Header file of xml
+ *   @author CPop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2013(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef ___XML_H__
+#define ___XML_H__
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "stdio.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct xml_attribute
+ * @brief Structure holding the parameters for XML attribute
+ */
+struct xml_attribute {
+	/** XML attribute name */
+	char *name;
+	/** XML attribute value */
+	char *value;
+};
+
+/**
+ * @struct xml_node
+ * @brief Structure holding the parameters for XML node
+ */
+struct xml_node {
+	/** XML node name */
+	char *name;
+	/** Node's attributes */
+	struct xml_attribute **attributes;
+	/** Number of attributes */
+	uint16_t attr_cnt;
+	/** XML children nodes */
+	struct xml_node **children;
+	/** Number of children */
+	uint16_t children_cnt;
+};
+
+/**
+ * @struct xml_document
+ * @brief Structure holding the parameters for XML document
+ */
+struct xml_document {
+	/** XML Document buffer */
+	char *buff;
+	/** Buffer length */
+	uint32_t index;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Create xml attribute. */
+ssize_t xml_create_attribute(struct xml_attribute **attribute, char *name,
+			     const char *value);
+
+/* Delete xml attribute. */
+ssize_t xml_delete_attribute(struct xml_attribute *attribute);
+
+/* Add xml attribute to node. */
+ssize_t xml_add_attribute(struct xml_node *node,
+			  struct xml_attribute *attribute);
+
+/* Create xml node. */
+ssize_t xml_create_node(struct xml_node **node, char *name);
+
+/* Delete xml node. */
+ssize_t xml_delete_node(struct xml_node *node);
+
+/* Add xml node to a parent node. */
+ssize_t xml_add_node(struct xml_node *node_parent, struct xml_node *node_child);
+
+/* Create xml document. */
+ssize_t xml_create_document(struct xml_document **document,
+			    struct xml_node *node);
+
+/* Delete xml document. */
+ssize_t xml_delete_document(struct xml_document *document);
+
+#endif // ___XML_H__
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/adi_console_menu/License.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/adi_console_menu/License.txt	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,14 @@
+Copyright (c) 2019 Analog Devices, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+  - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  
+  - Modified versions of the software must be conspicuously marked as such.
+  - This software is licensed solely and exclusively for use with processors/products manufactured by or for Analog Devices, Inc.
+  - This software may not be combined or merged with other code in any manner that would cause the software to become subject to terms and conditions which differ from those listed here.
+  - Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+  - The use of this software may or may not infringe the patent rights of one or more patent holders.  This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
+
+THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+2019-01-10-7CBSD SLA
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/adi_console_menu/adi_console_menu.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/adi_console_menu/adi_console_menu.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,300 @@
+/*!
+ *****************************************************************************
+  @file:  adi_console_menu.c
+
+  @brief: A simple console menu manager handler
+
+  @details: A way to define using arrays of structs a set of menus that can
+            be displayed to a user, easily, with all user interaction handled
+            by the library, leaving only the implementation of the menu actions
+            to be done by the library user.
+ -----------------------------------------------------------------------------
+ Copyright (c) 2019, 2020 Analog Devices, Inc.
+ All rights reserved.
+
+ This software is proprietary to Analog Devices, Inc. and its licensors.
+ By using this software you agree to the terms of the associated
+ Analog Devices Software License Agreement.
+
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <stdbool.h>
+#include <assert.h>
+
+#include "adi_console_menu.h"
+
+
+#define DIV_STRING "\t=================================================="
+
+/*!
+ * @brief      displays the text of a console menu
+ *
+ * @details
+ */
+static void adi_display_console_menu(const console_menu * menu)
+{
+	adi_clear_console();
+
+	// call headerItem to allow display of other content
+	if (menu->headerItem != NULL) {
+		menu->headerItem();
+		printf(DIV_STRING EOL);
+	}
+
+	/*
+	 * Display the menu title and  menuItems
+	 * The shortcutKey is used to display '[A]' before the dispayText
+	 */
+	printf("\t%s" EOL "\t", menu->title);
+	// show an underline to distinguish title from item
+	for (uint8_t i = 0; i < strlen(menu->title); i++) {
+		putchar('-');
+	}
+	// Extend underline past end of string, and then new line
+	printf("--" EOL);
+
+	// If the shortcutKey is not unique, first found is used
+	for (uint8_t i = 0; i < menu->itemCount; i ++) {
+		if (menu->items[i].shortcutKey == '\00') {
+			// No shortcut key defined, but display item text if available
+			printf("\t%s" EOL, menu->items[i].text);
+		} else {
+			printf("\t[%c] %s" EOL, toupper(menu->items[i].shortcutKey),
+			       menu->items[i].text);
+		}
+	}
+	if (menu->enableEscapeKey) {
+		printf(EOL "\t[ESC] Exit Menu" EOL);
+	}
+
+	printf(EOL "\tPlease make a selection." EOL);
+
+	// call footerItem to allow display of other content
+	if (menu->footerItem != NULL) {
+		printf(DIV_STRING EOL);
+		menu->footerItem();
+	}
+}
+
+
+/*!
+ * @brief      Display a consoleMenu and handle User interaction
+ *
+ * @details    This displays the menuItems defined by the console menu, and
+ *              handles all user interaction for the menu.
+ */
+int32_t adi_do_console_menu(const console_menu * menu)
+{
+	int32_t itemSelected = MENU_ESCAPED;
+	bool enableKeyScan = true;
+
+	adi_display_console_menu(menu);
+
+	/*
+	 *  Loop waiting for valid user input. menuItem index is returned if
+	 *  user presses a valid menu option.
+	 */
+	do {
+		char keyPressed = toupper(getchar());
+
+		if (menu->enableEscapeKey) {
+			if (keyPressed == ESCAPE_KEY_CODE) {
+				itemSelected = MENU_ESCAPED;
+				enableKeyScan = false;
+				break;
+			}
+		}
+
+		for (uint8_t i = 0; i < menu->itemCount; i ++) {
+			if (toupper(menu->items[i].shortcutKey) == keyPressed) {
+				itemSelected = i;
+
+				// If the menuAction function pointer is not NULL, call the action
+				if (menu->items[i].action != NULL) {
+					switch (menu->items[i].action(menu->items[i].id)) {
+					case MENU_DONE: {
+						enableKeyScan = false;
+						break;
+					}
+					case MENU_CONTINUE:
+					default: {
+						enableKeyScan = true;
+						adi_display_console_menu(menu);
+						break;
+					}
+					}
+				}
+				break;
+			}
+		}
+	} while (enableKeyScan);
+
+	return (itemSelected);
+}
+
+/*!
+ * @brief      Reads a decimal string from the user
+ *
+ * @param      input_len max number of character to accept from the user
+ *
+ * @return      The integer value entered
+ *
+ * @details    Allows a user to type in number, echoing back to the user,
+ *             up to input_len chars
+ *
+ *  @note      Only positive integer numbers are supported currently
+ */
+int32_t adi_get_decimal_int(uint8_t input_len)
+{
+	char buf[20] = {0};
+	uint8_t buf_index = 0;
+	char ch;
+	bool loop = true;
+
+	assert(input_len < 19);
+
+	do  {
+		ch = getchar();
+		if (isdigit(ch) && buf_index < (input_len)) {
+			//  echo and store it as buf not full
+			buf[buf_index++] = ch;
+			putchar(ch);
+		}
+		if ((ch == '\x7F') && (buf_index > 0)) {
+			//backspace and at least 1 char in buffer
+			buf[buf_index--] = '\x00';
+			putchar(ch);
+		}
+		if ((ch == '\x0D') || (ch == '\x0A')) {
+			// return key pressed, all done, null terminate string
+			buf[buf_index] = '\x00';
+			loop = false;
+		}
+	} while(loop);
+
+	return atoi(buf);
+}
+
+/*!
+ * @brief      Reads a hexadecimal number from the user
+ *
+ * @param      input_len max number of character to accept from the user
+ *
+ * @return     The integer value entered
+ *
+* @details     Allows a user to type in a hexnumber, echoing back to the user,
+ *             up to input_len chars
+ */
+uint32_t adi_get_hex_integer(uint8_t input_len)
+{
+	char buf[9] = {0};
+	uint8_t buf_index = 0;
+	char ch;
+	bool loop = true;
+
+	assert(input_len < 8);
+
+	do  {
+		ch = getchar();
+		if (isxdigit(ch) && buf_index < (input_len)) {
+			//  echo and store it as buf not full
+			buf[buf_index++] = ch;
+			putchar(ch);
+		}
+		if ((ch == '\x7F') && (buf_index > 0)) {
+			//backspace and at least 1 char in buffer
+			buf[buf_index--] = '\x00';
+			putchar(ch);
+		}
+		if ((ch == '\x0D') || (ch == '\x0A')) {
+			// return key pressed, all done, null terminate string
+			buf[buf_index] = '\x00';
+			loop = false;
+		}
+	} while(loop);
+
+	return strtol(buf, NULL, 16);
+}
+
+
+/*!
+ * @brief      Reads a floating string from the user
+ *
+ * @param      input_len max number of character to accept from the user
+ *
+ * @return      The float value entered
+ *
+ * @details    Allows a user to type in number, echoing back to the user,
+ *             up to input_len chars
+ *
+ *  @note      Only positive floating point numbers are supported currently
+ */
+float adi_get_decimal_float(uint8_t input_len)
+{
+	char buf[20] = { 0 };
+	uint8_t buf_index = 0;
+	char ch;
+	bool loop = true;
+
+	assert(input_len < 19);
+
+	do {
+		ch = getchar();
+		if ((isdigit(ch) || (ch == '.')) && buf_index < (input_len)) {
+			//  echo and store it as buf not full
+			buf[buf_index++] = ch;
+			putchar(ch);
+		}
+		if ((ch == '\x7F') && (buf_index > 0)) {
+			//backspace and at least 1 char in buffer
+			buf[buf_index--] = '\x00';
+			putchar(ch);
+		}
+		if ((ch == '\x0D') || (ch == '\x0A')) {
+			// return key pressed, all done, null terminate string
+			buf[buf_index] = '\x00';
+			loop = false;
+		}
+	} while (loop);
+
+	return atof(buf);
+}
+
+
+/*!
+ * @brief      Clears the console terminal
+ *
+ * @details    Clears the console terminal using VT100 escape code, or can be changed to
+ *             output blank lines if serial link doesn't support VT100.
+ */
+void adi_clear_console(void)
+{
+	/*
+	 * clear console and move cursor to home location, followed by move to home location.
+	 *  Dedicated call to move home is because sometimes first move home doesn't work
+	 *  \r\n required to flush the uart buffer.
+	 */
+	printf("\x1B[2J\x1B[H\r\n");
+
+	/*
+	 * if VT100 is not supported, this can be enabled instead, but menu display may not work well
+	 */
+//    for (uint8_t = 0; i < 100; i++)
+//      printf("\r\n\r");
+}
+
+
+/*!
+ * @brief      waits for any key to be pressed, and displays a prompt to the user
+ *
+ * @details
+ */
+void adi_press_any_key_to_continue(void)
+{
+	printf("\r\nPress any key to continue...\r\n");
+	getchar();
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/adi_console_menu/adi_console_menu.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/adi_console_menu/adi_console_menu.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,74 @@
+/*!
+ *****************************************************************************
+  @file:  adi_console_menu.h
+
+  @brief:   A simple console menu manager handler
+
+  @details:
+ -----------------------------------------------------------------------------
+ Copyright (c) 2019, 2020 Analog Devices, Inc.
+ All rights reserved.
+
+ This software is proprietary to Analog Devices, Inc. and its licensors.
+ By using this software you agree to the terms of the associated
+ Analog Devices Software License Agreement.
+
+*****************************************************************************/
+
+#ifndef ADI_CONSOLE_MENU_H_
+#define ADI_CONSOLE_MENU_H_
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#define MENU_ESCAPED            -1
+#define MENU_CONTINUE           0
+#define MENU_DONE               1
+
+#define ESCAPE_KEY_CODE         (char)0x1B
+
+#define EOL "\r\n"
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) ((sizeof (x)) / (sizeof ((x)[0])))
+#endif
+
+/* Type Definitions */
+// Each menu item is defined by this struct
+typedef struct {
+	// String displayed for menu item
+	char * text;
+	// character that can be pressed to select menu item
+	char  shortcutKey;
+	// Function to be called when menu item is selected, if NULL, no function is called
+	int32_t (*action)(uint32_t option);
+	// id value passed as the option value when calling menuAction
+	uint32_t id;
+} console_menu_item;
+
+// This defines a complete menu with items
+typedef struct {
+	// String to be displayed as the menu title
+	char * title;
+	// Array of all the menu items
+	console_menu_item * items;
+	// Number of menuItems
+	uint8_t itemCount;
+	// Function alled before Menu title is displayed if defined
+	void (*headerItem)(void);
+	// Function called after menu items are displayed if defined
+	void (*footerItem)(void);
+	// Should the escape key to exit the menu be enabled?
+	bool enableEscapeKey;
+} console_menu;
+
+/* Function Declarations */
+/* Display a console menu, and handle user interactions */
+int32_t adi_do_console_menu(const console_menu * menu);
+int32_t adi_get_decimal_int(uint8_t input_len);
+uint32_t adi_get_hex_integer(uint8_t input_len);
+float adi_get_decimal_float(uint8_t input_len);
+void adi_clear_console(void);
+void adi_press_any_key_to_continue(void);
+
+#endif /* ADI_CONSOLE_MENU_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/iio.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/iio.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,844 @@
+/***************************************************************************//**
+ *   @file   iio.c
+ *   @brief  Implementation of iio.
+ *   This module implements read/write ops, required by libtinyiiod and further
+ *   calls show/store functions, corresponding to device/channel/attribute.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "iio.h"
+#include "ctype.h"
+#include "tinyiiod.h"
+#include "util.h"
+#include "error.h"
+#include "errno.h"
+#include "compat.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct iio_interfaces
+ * @brief Structure containing all interfaces.
+ */
+struct iio_interfaces {
+	/** List containing all interfaces */
+	struct iio_interface **interfaces;
+	/** Number of Interfaces */
+	uint8_t num_interfaces;
+};
+
+/**
+ * @struct element_info
+ * @brief Structure informations about a specific parameter.
+ */
+struct element_info {
+	/** Device name */
+	const char *device_name;
+	/** Channel name */
+	const char *channel_name;
+	/** Attribute name */
+	const char *attribute_name;
+	/** If set, is an output channel */
+	bool ch_out;
+};
+
+/**
+ * iio_read_attr(), iio_write_attr() functions, they need to know about iio_interfaces
+ */
+static struct iio_interfaces *iio_interfaces = NULL;
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Get channel number.
+ * @param ch - String containing channel name + channel number.
+ * @return - Channel number. Ex: for "altvoltage0" return 0, for "voltage2"
+ * return 2.
+ */
+static int32_t iio_get_channel_number(const char *ch)
+{
+	char *p = (char*)ch;
+	int32_t ch_num = FAILURE;
+
+	while (*p) {
+		if (isdigit(*p))
+			ch_num = strtol(p, &p, 10);
+		else
+			p++;
+	}
+
+	return ch_num;
+}
+
+/**
+ * @brief Get channel ID from a list of channels.
+ * @param channel - Channel name.
+ * @param channels - List of channels.
+ * @param ch_out - If "true" is output channel, if "false" is input channel.
+ * @return Channel ID, or negative value if attribute is not found.
+ */
+static int16_t iio_get_channel_id(const char *channel,
+				  struct iio_channel **channels, bool ch_out)
+{
+	int16_t i = 0;
+
+	if (!(*channels))
+		return -EINVAL;
+
+	while (channels[i]) {
+		if (!strcmp(channel, channels[i]->name) && (channels[i]->ch_out == ch_out))
+			return i;
+		i++;
+	}
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Get attribute ID from a list of attributes.
+ * @param attr - Attribute name.
+ * @param attributes - List of attributes.
+ * @return - Attribute ID, or negative value if attribute is not found.
+ */
+static int16_t iio_get_attribute_id(const char *attr,
+				    struct iio_attribute **attributes)
+{
+	int16_t i = 0;
+
+	if (!(*attributes))
+		return -EINVAL;
+
+	while (attributes[i]) {
+		if (!strcmp(attr, attributes[i]->name))
+			return i;
+		i++;
+	}
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Find interface with "device_name".
+ * @param device_name - Device name.
+ * @param iio_interfaces - List of interfaces.
+ * @return Interface pointer if interface is found, NULL otherwise.
+ */
+static struct iio_interface *iio_get_interface(const char *device_name,
+		struct iio_interfaces *iio_interfaces)
+{
+	int16_t i;
+
+	if (!iio_interfaces)
+		return NULL;
+
+	for (i = 0; i < iio_interfaces->num_interfaces; i++) {
+		if (!strcmp(device_name, iio_interfaces->interfaces[i]->name))
+			return iio_interfaces->interfaces[i];
+	}
+
+	return NULL;
+}
+
+/**
+ * @brief Read all attributes from an attribute list.
+ * @param device - Physical instance of a device.
+ * @param buf - Buffer where values are read.
+ * @param len - Maximum length of value to be stored in buf.
+ * @param channel - Channel properties.
+ * @param attributes - List of attributes to be read.
+ * @return Number of bytes read or negative value in case of error.
+ */
+static ssize_t iio_read_all_attr(void *device, char *buf, size_t len,
+				 const struct iio_ch_info *channel, struct iio_attribute **attributes)
+{
+	int16_t i = 0, j = 0;
+	char local_buf[256];
+	ssize_t attr_length;
+	uint32_t *pattr_length;
+
+	if (!attributes)
+		return FAILURE;
+
+	if (!buf)
+		return FAILURE;
+
+	while (attributes[i]) {
+		attr_length = attributes[i]->show(device, local_buf, len, channel);
+		pattr_length = (uint32_t *)(buf + j);
+		*pattr_length = bswap_constant_32(attr_length);
+		j += 4;
+		if (attr_length >= 0) {
+			sprintf(buf + j, "%s", local_buf);
+			if (attr_length & 0x3) /* multiple of 4 */
+				attr_length = ((attr_length >> 2) + 1) << 2;
+			j += attr_length;
+		}
+		i++;
+	}
+
+	return j;
+}
+
+/**
+ * @brief Write all attributes from an attribute list.
+ * @param device - Physical instance of a device.
+ * @param buf - Values to be written.
+ * @param len - Length of buf.
+ * @param channel - Channel properties.
+ * @param attributes - List of attributes to be written.
+ * @return Number of written bytes or negative value in case of error.
+ */
+static ssize_t iio_write_all_attr(void *device, char *buf, size_t len,
+				  const struct iio_ch_info *channel, struct iio_attribute **attributes)
+{
+	int16_t i = 0, j = 0;
+	int16_t attr_length;
+
+	if (!attributes)
+		return FAILURE;
+
+	if (!buf)
+		return FAILURE;
+
+	while (attributes[i]) {
+		attr_length = bswap_constant_32((uint32_t)(buf + j));
+		j += 4;
+		attributes[i]->store(device, (buf + j), attr_length, channel);
+		j += attr_length;
+		if (j & 0x3)
+			j = ((j >> 2) + 1) << 2;
+		i++;
+	}
+
+	return len;
+}
+
+/**
+ * @brief Read/write channel attribute.
+ * @param el_info - Structure describing element to be written.
+ * @param buf - Read/write value.
+ * @param len - Length of data in "buf" parameter.
+ * @param channel - Structure describing channel attributes.
+ * @param is_write -If it has value "1", writes attribute, otherwise reads
+ * 		attribute.
+ * @return Length of chars written/read or negative value in case of error.
+ */
+static ssize_t iio_rd_wr_channel_attribute(struct element_info *el_info,
+		char *buf, size_t len,
+		struct iio_channel *channel, bool is_write)
+{
+	int16_t attribute_id;
+	struct iio_interface *iface = iio_get_interface(el_info->device_name,
+				      iio_interfaces);
+	const struct iio_ch_info channel_info = {
+		iio_get_channel_number(el_info->channel_name),
+		el_info->ch_out
+	};
+
+	if (!strcmp(el_info->attribute_name, "")) {
+		/* read / write all channel attributes */
+		if (is_write)
+			return iio_write_all_attr(iface->dev_instance, buf, len, &channel_info,
+						  channel->attributes);
+		else
+			return iio_read_all_attr(iface->dev_instance, buf, len, &channel_info,
+						 channel->attributes);
+	} else {
+		/* read / write single channel attribute, if attribute found */
+		attribute_id = iio_get_attribute_id(el_info->attribute_name,
+						    channel->attributes);
+		if (attribute_id >= 0) {
+			if (is_write)
+				return channel->attributes[attribute_id]->store(iface->dev_instance,
+						(char*)buf, len, &channel_info);
+			else
+				return channel->attributes[attribute_id]->show(iface->dev_instance, (char*)buf,
+						len, &channel_info);
+		}
+	}
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Read/write attribute.
+ * @param el_info - Structure describing element to be written.
+ * @param buf - Read/write value.
+ * @param len - Length of data in "buf" parameter.
+ * @param iio_device - Physical instance of a device.
+ * @param is_write -If it has value "1", writes attribute, otherwise reads
+ * 		attribute.
+ * @return Length of chars written/read or negative value in case of error.
+ */
+static ssize_t iio_rd_wr_attribute(struct element_info *el_info, char *buf,
+				   size_t len,
+				   struct iio_device *iio_device, bool is_write)
+{
+	int16_t channel_id;
+	int16_t attribute_id;
+	struct iio_interface *iface;
+
+	if (!iio_device)
+		return -ENOENT;
+
+	if (!strcmp(el_info->channel_name, "")) {
+		/* it is attribute of a device */
+		iface = iio_get_interface(el_info->device_name, iio_interfaces);
+
+		if (!strcmp(el_info->attribute_name, "")) {
+			/* read / write all device attributes */
+			if (is_write)
+				return iio_write_all_attr(iface->dev_instance, buf, len, NULL,
+							  iio_device->attributes);
+			else
+				return iio_read_all_attr(iface->dev_instance, buf, len, NULL,
+							 iio_device->attributes);
+		} else {
+			/* read / write single device attribute, if attribute found */
+			attribute_id = iio_get_attribute_id(el_info->attribute_name,
+							    iio_device->attributes);
+			if (attribute_id < 0)
+				return -ENOENT;
+			if (is_write)
+				return iio_device->attributes[attribute_id]->store(iface->dev_instance,
+						(char*)buf, len, NULL);
+			else
+				return iio_device->attributes[attribute_id]->show(iface->dev_instance,
+						(char*)buf, len, NULL);
+		}
+	} else {
+		/* it is attribute of a channel */
+		channel_id = iio_get_channel_id(el_info->channel_name, iio_device->channels,
+						el_info->ch_out);
+		return iio_rd_wr_channel_attribute(el_info, buf, len,
+						   iio_device->channels[channel_id], is_write);
+	}
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Check if device is supported.
+ * @param device - Device name.
+ * @return TRUE if device is supported, FALSE otherwise.
+ */
+static bool iio_supported_dev(const char *device)
+{
+	return (NULL != iio_get_interface(device, iio_interfaces));
+}
+
+/**
+ * @brief Read global attribute of a device.
+ * @param device - String containing device name.
+ * @param attr - String containing attribute name.
+ * @param buf - Buffer where value is read.
+ * @param len - Maximum length of value to be stored in buf.
+ * @param debug - Read raw value if set.
+ * @return Number of bytes read.
+ */
+static ssize_t iio_read_attr(const char *device, const char *attr, char *buf,
+			     size_t len, bool debug)
+{
+	struct iio_interface *iio_device;
+	struct element_info el_info;
+
+	if (!iio_supported_dev(device))
+		return FAILURE;
+
+	el_info.device_name = device;
+	el_info.channel_name = "";	/* there is no channel here */
+	el_info.attribute_name = attr;
+
+	iio_device = iio_get_interface(device, iio_interfaces);
+	if (!iio_device)
+		return FAILURE;
+
+	return iio_rd_wr_attribute(&el_info, buf, len, iio_device->iio, 0);
+}
+
+/**
+ * @brief Write global attribute of a device.
+ * @param device - String containing device name.
+ * @param attr - String containing attribute name.
+ * @param buf - Value to be written.
+ * @param len - Length of data.
+ * @param debug - Write raw value if set.
+ * @return Number of written bytes.
+ */
+static ssize_t iio_write_attr(const char *device, const char *attr,
+			      const char *buf,
+			      size_t len, bool debug)
+{
+	struct element_info el_info;
+	struct iio_interface *iio_interface;
+
+	if (!iio_supported_dev(device))
+		return -ENODEV;
+
+	el_info.device_name = device;
+	el_info.channel_name = "";	/* there is no channel here */
+	el_info.attribute_name = attr;
+
+	iio_interface = iio_get_interface(device, iio_interfaces);
+	if (!iio_interface)
+		return FAILURE;
+
+	return iio_rd_wr_attribute(&el_info, (char*)buf, len, iio_interface->iio, 1);
+}
+
+/**
+ * @brief Read channel attribute.
+ * @param device - String containing device name.
+ * @param channel - String containing channel name.
+ * @param ch_out -Channel type input/output.
+ * @param attr - String containing attribute name.
+ * @param buf - Buffer where value is stored.
+ * @param len - Maximum length of value to be stored in buf.
+ * @return - Number of bytes read.
+ */
+static ssize_t iio_ch_read_attr(const char *device, const char *channel,
+				bool ch_out, const char *attr, char *buf, size_t len)
+{
+	struct element_info el_info;
+	struct iio_interface *iio_interface;
+
+	if (!iio_supported_dev(device))
+		return FAILURE;
+
+	el_info.device_name = device;
+	el_info.channel_name = channel;
+	el_info.attribute_name = attr;
+	el_info.ch_out = ch_out;
+
+	iio_interface = iio_get_interface(device, iio_interfaces);
+	if (!device)
+		return FAILURE;
+
+	return iio_rd_wr_attribute(&el_info, buf, len, iio_interface->iio, 0);
+}
+
+/**
+ * @brief Write channel attribute.
+ * @param device - String containing device name.
+ * @param channel - String containing channel name.
+ * @param ch_out - Channel type input/output.
+ * @param attr - String containing attribute name.
+ * @param buf - Value to be written.
+ * @param len - Length of data in "buf" parameter.
+ * @return Number of written bytes.
+ */
+static ssize_t iio_ch_write_attr(const char *device, const char *channel,
+				 bool ch_out, const char *attr, const char *buf, size_t len)
+{
+	struct element_info el_info;
+	struct iio_interface *iio_interface;
+
+	if (!iio_supported_dev(device))
+		return -ENODEV;
+
+	el_info.device_name = device;
+	el_info.channel_name = channel;
+	el_info.attribute_name = attr;
+	el_info.ch_out = ch_out;
+	iio_interface = iio_get_interface(device, iio_interfaces);
+
+	if (!iio_interface)
+		return -ENOENT;
+
+	return iio_rd_wr_attribute(&el_info, (char*)buf, len, iio_interface->iio, 1);
+}
+
+/**
+ * @brief  Open device.
+ * @param device - String containing device name.
+ * @param sample_size - Sample size.
+ * @param mask - Channels to be opened.
+ * @return SUCCESS, negative value in case of failure.
+ */
+static int32_t iio_open_dev(const char *device, size_t sample_size,
+			    uint32_t mask)
+{
+	struct iio_interface *iface;
+	uint32_t ch_mask;
+
+	if (!iio_supported_dev(device))
+		return -ENODEV;
+
+	iface = iio_get_interface(device, iio_interfaces);
+	ch_mask = 0xFFFFFFFF >> (32 - iface->iio->num_ch);
+
+	if (mask & ~ch_mask)
+		return -ENOENT;
+
+	iface->ch_mask = mask;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Close device.
+ * @param device - String containing device name.
+ * @return SUCCESS, negative value in case of failure.
+ */
+static int32_t iio_close_dev(const char *device)
+{
+	struct iio_interface *iface;
+
+	if (!iio_supported_dev(device))
+		return FAILURE;
+	iface = iio_get_interface(device, iio_interfaces);
+	iface->ch_mask = 0;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Get device mask, this specifies the channels that are used.
+ * @param device - String containing device name.
+ * @param mask - Channels that are opened.
+ * @return SUCCESS, negative value in case of failure.
+ */
+static int32_t iio_get_mask(const char *device, uint32_t *mask)
+{
+	struct iio_interface *iface;
+
+	if (!iio_supported_dev(device))
+		return -ENODEV;
+
+	iface = iio_get_interface(device, iio_interfaces);
+	*mask = iface->ch_mask;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Transfer data from device into RAM.
+ * @param device - String containing device name.
+ * @param bytes_count - Number of bytes.
+ * @return Bytes_count or negative value in case of error.
+ */
+static ssize_t iio_transfer_dev_to_mem(const char *device, size_t bytes_count)
+{
+	struct iio_interface *iio_interface = iio_get_interface(device, iio_interfaces);
+
+	if (iio_interface->transfer_dev_to_mem)
+		return iio_interface->transfer_dev_to_mem(iio_interface->dev_instance,
+				bytes_count, iio_interface->ch_mask);
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Read chunk of data from RAM to pbuf. Call
+ * "iio_transfer_dev_to_mem()" first.
+ * This function is probably called multiple times by libtinyiiod after a
+ * "iio_transfer_dev_to_mem" call, since we can only read "bytes_count" bytes.
+ * @param device - String containing device name.
+ * @param pbuf - Buffer where value is stored.
+ * @param offset - Offset to the remaining data after reading n chunks.
+ * @param bytes_count - Number of bytes to read.
+ * @return: Bytes_count or negative value in case of error.
+ */
+static ssize_t iio_read_dev(const char *device, char *pbuf, size_t offset,
+			    size_t bytes_count)
+{
+	struct iio_interface *iio_interface = iio_get_interface(device, iio_interfaces);
+
+	if (iio_interface->read_data)
+		return iio_interface->read_data(iio_interface->dev_instance, pbuf, offset,
+						bytes_count, iio_interface->ch_mask);
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Transfer memory to device.
+ * @param device - String containing device name.
+ * @param bytes_count - Number of bytes to transfer.
+ * @return Bytes_count or negative value in case of error.
+ */
+static ssize_t iio_transfer_mem_to_dev(const char *device, size_t bytes_count)
+{
+	struct iio_interface *iio_interface = iio_get_interface(device, iio_interfaces);
+
+	if (iio_interface->transfer_mem_to_dev)
+		return iio_interface->transfer_mem_to_dev(iio_interface->dev_instance,
+				bytes_count, iio_interface->ch_mask);
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Write chunk of data into RAM.
+ * This function is probably called multiple times by libtinyiiod before a
+ * "iio_transfer_mem_to_dev" call, since we can only write "bytes_count" bytes
+ * at a time.
+ * @param device - String containing device name.
+ * @param buf - Values to write.
+ * @param offset - Offset in memory after the nth chunk of data.
+ * @param bytes_count - Number of bytes to write.
+ * @return Bytes_count or negative value in case of error.
+ */
+static ssize_t iio_write_dev(const char *device, const char *buf,
+			     size_t offset, size_t bytes_count)
+{
+	struct iio_interface *iio_interface = iio_get_interface(device, iio_interfaces);
+	if(iio_interface->write_data)
+		return iio_interface->write_data(iio_interface->dev_instance, (char*)buf,
+						 offset, bytes_count, iio_interface->ch_mask);
+
+	return -ENOENT;
+}
+
+/**
+ * @brief Get a merged xml containing all devices.
+ * @param outxml - Generated xml.
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+static ssize_t iio_get_xml(char **outxml)
+{
+	char *xml, *tmp_xml, *tmp_xml2;
+	uint32_t length;
+	uint16_t i;
+	ssize_t ret;
+
+	char header[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+			"<!DOCTYPE context ["
+			"<!ELEMENT context (device | context-attribute)*>"
+			"<!ELEMENT context-attribute EMPTY>"
+			"<!ELEMENT device (channel | attribute | debug-attribute | buffer-attribute)*>"
+			"<!ELEMENT channel (scan-element?, attribute*)>"
+			"<!ELEMENT attribute EMPTY>"
+			"<!ELEMENT scan-element EMPTY>"
+			"<!ELEMENT debug-attribute EMPTY>"
+			"<!ELEMENT buffer-attribute EMPTY>"
+			"<!ATTLIST context name CDATA #REQUIRED description CDATA #IMPLIED>"
+			"<!ATTLIST context-attribute name CDATA #REQUIRED value CDATA #REQUIRED>"
+			"<!ATTLIST device id CDATA #REQUIRED name CDATA #IMPLIED>"
+			"<!ATTLIST channel id CDATA #REQUIRED type (input|output) #REQUIRED name CDATA #IMPLIED>"
+			"<!ATTLIST scan-element index CDATA #REQUIRED format CDATA #REQUIRED scale CDATA #IMPLIED>"
+			"<!ATTLIST attribute name CDATA #REQUIRED filename CDATA #IMPLIED>"
+			"<!ATTLIST debug-attribute name CDATA #REQUIRED>"
+			"<!ATTLIST buffer-attribute name CDATA #REQUIRED>"
+			"]>"
+			"<context name=\"xml\" description=\"no-OS analog 1.1.0-g0000000 #1 Tue Nov 26 09:52:32 IST 2019 armv7l\" >"
+			"<context-attribute name=\"no-OS\" value=\"1.1.0-g0000000\" />";
+	char header_end[] = "</context>";
+
+	if (!outxml)
+		return FAILURE;
+
+	xml = (char *)calloc(1, strlen(header) + 1);
+	if (!xml)
+		return FAILURE;
+
+	strcpy(xml, header);
+	for (i = 0; i < iio_interfaces->num_interfaces; i++) {
+		ret = iio_interfaces->interfaces[i]->get_xml(&tmp_xml,
+				iio_interfaces->interfaces[i]->iio);
+		if (ret < 0)
+			goto error;
+
+		length = strlen(xml);
+		tmp_xml2 = (char *)realloc(xml, strlen(xml) + strlen(tmp_xml) + 1);
+		if (!tmp_xml2)
+			goto error;
+
+		xml = tmp_xml2;
+		strcpy((xml + length), tmp_xml);
+	}
+
+	length = strlen(xml);
+	tmp_xml = (char *)realloc(xml, strlen(xml) + strlen(header_end) + 1);
+	if (!tmp_xml)
+		goto error;
+
+	xml = tmp_xml;
+	strcpy((xml + length), header_end);
+
+	*outxml = xml;
+
+	return SUCCESS;
+error:
+	free(xml);
+
+	return FAILURE;
+}
+
+/**
+ * @brief Register interface.
+ * @param iio_interface - Structure containing physical device instance and
+ * device descriptor.
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+ssize_t iio_register(struct iio_interface *iio_interface)
+{
+
+	struct iio_interface **temp_interfaces;
+
+	if (!(iio_interfaces)) {
+		iio_interfaces = (struct iio_interfaces *)calloc(1,
+				 sizeof(struct iio_interfaces));
+		if (!iio_interfaces)
+			return -ENOMEM;
+
+		iio_interfaces->num_interfaces = 1;
+		iio_interfaces->interfaces = (struct iio_interface **)calloc(1,
+					     sizeof(struct iio_interface*));
+		if (!iio_interfaces->interfaces)
+			return -ENOMEM;
+	} else {
+		iio_interfaces->num_interfaces++;
+		temp_interfaces = (struct iio_interface **)realloc(iio_interfaces->interfaces,
+				  iio_interfaces->num_interfaces * sizeof(struct iio_interface*));
+		if (!temp_interfaces) {
+			free(iio_interfaces->interfaces);
+			return -ENOMEM;
+		}
+		iio_interfaces->interfaces = temp_interfaces;
+	}
+
+	iio_interfaces->interfaces[iio_interfaces->num_interfaces - 1] = iio_interface;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Unregister interface.
+ * @param iio_interface - Structure containing physical device instance and
+ * device descriptor.
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+ssize_t iio_unregister(struct iio_interface *iio_interface)
+{
+	struct iio_interfaces *interfaces;
+	int16_t i, deleted = 0;
+
+	interfaces = (struct iio_interfaces *)calloc(1, sizeof(struct iio_interfaces));
+	if (!interfaces)
+		return FAILURE;
+
+	interfaces->interfaces = (struct iio_interface **)calloc(
+					 iio_interfaces->num_interfaces - 1,
+					 sizeof(struct iio_interface*));
+	if (!interfaces->interfaces) {
+		free(interfaces);
+		return FAILURE;
+	}
+
+	for(i = 0; i < iio_interfaces->num_interfaces; i++) {
+		if (!strcmp(iio_interface->name, iio_interfaces->interfaces[i]->name)) {
+			iio_interface = iio_interfaces->interfaces[i];
+			deleted = 1;
+			continue;
+		}
+		interfaces->interfaces[i - deleted] = iio_interfaces->interfaces[i];
+	}
+
+	interfaces->num_interfaces = iio_interfaces->num_interfaces - 1;
+	free(iio_interfaces);
+
+	return deleted ? SUCCESS : FAILURE;
+}
+
+/**
+ * @brief Set communication ops and read/write ops that will be called
+ * from "libtinyiiod".
+ * @param iiod - Structure containing new tinyiiod instance.
+ * @param iio_server_ops - Structure containing read/write ops (Ex: read/write to
+ * 			UART).
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+ssize_t iio_init(struct tinyiiod **iiod, struct iio_server_ops *iio_server_ops)
+{
+	struct tinyiiod_ops *ops = (struct tinyiiod_ops *)calloc(1,
+				   sizeof(struct tinyiiod_ops));
+
+	if (!ops)
+		return FAILURE;
+
+	/* device operations */
+	ops->read_attr = iio_read_attr;
+	ops->write_attr = iio_write_attr;
+	ops->ch_read_attr = iio_ch_read_attr;
+	ops->ch_write_attr = iio_ch_write_attr;
+	ops->transfer_dev_to_mem = iio_transfer_dev_to_mem;
+	ops->read_data = iio_read_dev;
+	ops->transfer_mem_to_dev = iio_transfer_mem_to_dev;
+	ops->write_data = iio_write_dev;
+
+	ops->open = iio_open_dev;
+	ops->close = iio_close_dev;
+	ops->get_mask = iio_get_mask;
+
+	ops->read = iio_server_ops->read;
+	ops->write = iio_server_ops->write;
+	ops->get_xml = iio_get_xml;
+
+	*iiod = tinyiiod_create(ops);
+	if (!(*iiod)) {
+		free(ops);
+		return FAILURE;
+	} else {
+		return SUCCESS;
+	}
+}
+
+/**
+ * @brief Free the resources allocated by "iio_init()".
+ * @param iiod: Structure containing tinyiiod instance.
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+ssize_t iio_remove(struct tinyiiod *iiod)
+{
+	uint8_t i;
+
+	for (i = 0; i < iio_interfaces->num_interfaces; i++)
+		free(iio_interfaces->interfaces[i]);
+
+	free(iio_interfaces);
+	tinyiiod_destroy(iiod);
+
+	return SUCCESS;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/iio.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/iio.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,98 @@
+/***************************************************************************//**
+ *   @file   iio.h
+ *   @brief  Header file of iio
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2013(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef IIO_H_
+#define IIO_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "tinyiiod.h"
+#include "iio_types.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct iio_interface
+ * @brief Links a physical device instance "void *dev_instance"
+ * with a "iio_device *iio" that describes capabilities of the device.
+ */
+struct iio_interface {
+	/** Device name */
+	const char *name;
+	/** Opened channels */
+	uint32_t ch_mask;
+	/** Physical instance of a device */
+	void *dev_instance;
+	/** Device descriptor(describes channels and attributes) */
+	struct iio_device *iio;
+	/** Generate device xml */
+	ssize_t (*get_xml)(char **xml, struct iio_device *iio);
+	/** Transfer data from device into RAM */
+	ssize_t (*transfer_dev_to_mem)(void *dev_instance, size_t bytes_count,
+				       uint32_t ch_mask);
+	/** Read data from RAM to pbuf. It should be called after "transfer_dev_to_mem" */
+	ssize_t (*read_data)(void *dev_instance, char *pbuf, size_t offset,
+			     size_t bytes_count, uint32_t ch_mask);
+	/** Transfer data from RAM to device */
+	ssize_t (*transfer_mem_to_dev)(void *dev_instance, size_t bytes_count,
+				       uint32_t ch_mask);
+	/** Write data to RAM. It should be called before "transfer_mem_to_dev" */
+	ssize_t (*write_data)(void *dev_instance, char *pbuf, size_t offset,
+			      size_t bytes_count, uint32_t ch_mask);
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Set communication ops and read/write ops that will be called from
+ * "libtinyiiod". */
+ssize_t iio_init(struct tinyiiod **iiod, struct iio_server_ops *comm_ops);
+/* Free the resources allocated by iio_init(). */
+ssize_t iio_remove(struct tinyiiod *iiod);
+/* Register interface. */
+ssize_t iio_register(struct iio_interface *iio_interface);
+/* Unregister interface. */
+ssize_t iio_unregister(struct iio_interface *iio_interface);
+
+#endif /* IIO_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/iio_app.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/iio_app.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,111 @@
+/***************************************************************************//**
+ *   @file   iio_app.c
+ *   @brief  Implementation of iio_app.
+ *   This application instantiates iio_axi_adc and iio_axi_dac devices, for
+ *   reading/writing and parameterization.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "error.h"
+#include "iio.h"
+#include "iio_app.h"
+
+/**
+ * @brief Application parameterization.
+ * @param desc - Application descriptor.
+ * @param param - Application initial configuration structure.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t iio_app_init(struct iio_app_desc **desc,
+		     struct iio_app_init_param *param)
+{
+	struct tinyiiod *iiod;
+	int32_t status;
+
+	if (!param)
+		return FAILURE;
+
+	status = iio_init(&iiod, param->iio_server_ops);
+	if(status < 0)
+		return status;
+
+	*desc = calloc(1, sizeof(struct iio_app_desc));
+	if (!(*desc))
+		return FAILURE;
+
+	(*desc)->iiod = iiod;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Release resources.
+ * @param desc - Application descriptor.
+ * @return SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t iio_app_remove(struct iio_app_desc *desc)
+{
+	int32_t status;
+
+	if (!desc)
+		return FAILURE;
+
+	status = iio_remove(desc->iiod);
+	if(status < 0)
+		return status;
+
+	free(desc);
+
+	return SUCCESS;
+}
+
+/**
+ * @brief iio application, reads commands and executes them.
+ * @param desc - Application descriptor.
+ * @return: SUCCESS in case of success, FAILURE otherwise.
+ */
+int32_t iio_app(struct iio_app_desc *desc)
+{
+	int32_t status;
+
+	status = tinyiiod_read_command(desc->iiod);
+	if(status < 0)
+		return status;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/iio_app.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/iio_app.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,85 @@
+/***************************************************************************//**
+ *   @file   iio_app.h
+ *   @brief  Header file of iio_app.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+#ifndef IIO_APP_H_
+#define IIO_APP_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "iio_types.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct iio_app_desc
+ * @brief Application desciptor.
+ */
+struct iio_app_desc {
+	/** read./write function callbacks */
+	struct iio_server_ops *iio_server_ops;
+	/** iiod handle */
+	struct tinyiiod *iiod;
+};
+
+/**
+ * @struct iio_app_init_param
+ * @brief Application initial configuration.
+ */
+struct iio_app_init_param {
+	/** read./write function callbacks */
+	struct iio_server_ops *iio_server_ops;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Init application. */
+int32_t iio_app_init(struct iio_app_desc **desc,
+		     struct iio_app_init_param *param);
+/* Free the resources allocated by iio_app_init(). */
+int32_t iio_app_remove(struct iio_app_desc *desc);
+/* Basic iio application loop. */
+int32_t iio_app(struct iio_app_desc *desc);
+
+#endif // IIO_APP_H_
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/iio_types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/iio_types.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,118 @@
+/***************************************************************************//**
+ *   @file   iio_types.h
+ *   @brief  Header file for iio_types
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2013, 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#ifndef IIO_TYPES_H_
+#define IIO_TYPES_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct iio_ch_info
+ * @brief Structure holding channel attributess.
+ */
+struct iio_ch_info {
+	/** Channel number */
+	int16_t ch_num;
+	/** Channel type: input/output */
+	bool ch_out;
+};
+
+/**
+ * @struct iio_attribute
+ * @brief Structure holding pointers to show and store functions.
+ */
+struct iio_attribute {
+	/** Attribute name */
+	const char *name;
+	/** Show function pointer */
+	ssize_t (*show)(void *device, char *buf, size_t len,
+			const struct iio_ch_info *channel);
+	/** Store function pointer */
+	ssize_t (*store)(void *device, char *buf, size_t len,
+			 const struct iio_ch_info *channel);
+};
+
+/**
+ * @struct iio_channel
+ * @brief Structure holding attributes of a channel.
+ */
+struct iio_channel {
+	/** channel name */
+	char *name;
+	/** list of attributes */
+	struct iio_attribute **attributes;
+	/** if true, the channel is an output channel */
+	bool ch_out;
+};
+
+/**
+ * @struct iio_device
+ * @brief Structure holding channels and attributes of a device.
+ */
+struct iio_device {
+	/** Device name */
+	const char *name;
+	/** Device number of channels */
+	uint16_t num_ch;
+	/** List of channels */
+	struct iio_channel **channels;
+	/** List of attributes */
+	struct iio_attribute **attributes;
+};
+
+/**
+ * @struct iio_server_ops
+ * @brief iio interface for server read/write operations
+ */
+struct iio_server_ops {
+	/** Read from from a peripheral device (UART, USB, NETWORK) */
+	ssize_t (*read)(char *buf, size_t len);
+	/** Write to a peripheral device (UART, USB, NETWORK) */
+	ssize_t (*write)(const char *buf, size_t len);
+};
+
+#endif /* IIO_TYPES_H_ */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/LICENSE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/LICENSE	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,504 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+(This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.)
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    {description}
+    Copyright (C) {year} {fullname}
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+    USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random
+  Hacker.
+
+  {signature of Ty Coon}, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/LICENSE_ADIBSD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/LICENSE_ADIBSD	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,33 @@
+
+Copyright 2011(c) Analog Devices, Inc.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+    - Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    - Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+    - Neither the name of Analog Devices, Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+    - The use of this software may or may not infringe the patent rights
+      of one or more patent holders.  This license does not release you
+      from the requirement that you obtain separate licenses from these
+      patent holders to use this software.
+    - Use of the software either in source or binary form, must be run
+      on or directly connected to an Analog Devices Inc. component.
+   
+THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED.
+
+IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
+RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
+THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/README.md
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/README.md	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,14 @@
+# libtinyiiod
+
+Tiny IIO Daemon Library
+
+## License
+
+This work is dual-licensed under the ADI-BSD License and GNU Lesser General Public License v2.1 (or later).
+You can choose between one of them if you use this work.
+
+`SPDX-License-Identifier: LGPL-2.1-or-later`
+
+ * [LICENSE_ADIBSD](./LICENSE_ADIBSD)
+
+ * [LICENSE_LGPL](./LICENSE)
\ No newline at end of file
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/compat.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/compat.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,58 @@
+/*
+ * libtinyiiod - Tiny IIO Daemon Library
+ *
+ * Copyright (C) 2019 Analog Devices, Inc.
+ * Author: Cristian Pop <cristian.pop@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#ifndef COMPAT_H
+#define COMPAT_H
+
+#ifdef _USE_STD_INT_TYPES
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <string.h>
+#else // _USE_STD_INT_TYPES
+#if !defined(__ssize_t_defined) && !defined(_SSIZE_T_DEFINED)
+typedef long int ssize_t;
+typedef unsigned long int size_t;
+#define __ssize_t_defined
+#define _SSIZE_T_DEFINED
+#endif
+
+typedef long int32_t;
+typedef unsigned long uint32_t;
+typedef int bool;
+
+#define true 1
+#define false 0
+
+#define NULL (void*)0
+
+#define ENOENT		2	/* No such file or directory */
+#define EIO		5	/* I/O error */
+#define ENODEV		19	/* No such device */
+#define EINVAL		22	/* Invalid argument */
+#define ENOSYS		38	/* Function not implemented */
+
+#define PRIi32		"li"
+# define PRIx32		"x"
+# define PRIu16		"u"
+#endif //_USE_STD_INT_TYPES
+
+#endif /* COMPAT_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/parser.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/parser.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,217 @@
+/*
+ * libtinyiiod - Tiny IIO Daemon Library
+ *
+ * Copyright (C) 2016 Analog Devices, Inc.
+ * Author: Paul Cercueil <paul.cercueil@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#include "tinyiiod-private.h"
+
+#include "compat.h"
+
+static int32_t parse_rw_string(struct tinyiiod *iiod, char *str, bool write)
+{
+	char *device, *channel, *attr, *ptr;
+	bool is_channel = false, output = false;
+	enum iio_attr_type type = IIO_ATTR_TYPE_DEVICE;
+	long bytes;
+
+	ptr = strchr(str, ' ');
+	if (!ptr)
+		return -EINVAL;
+
+	*ptr = '\0';
+	device = str;
+	str = ptr + 1;
+
+	if (!strncmp(str, "INPUT ", sizeof("INPUT ") - 1)) {
+		is_channel = true;
+		str += sizeof("INPUT ") - 1;
+	} else if (!strncmp(str, "OUTPUT ", sizeof("OUTPUT ") - 1)) {
+		is_channel = true;
+		output = true;
+		str += sizeof("OUTPUT ") - 1;
+	} else if (!strncmp(str, "DEBUG ", sizeof("DEBUG ") - 1)) {
+		type = IIO_ATTR_TYPE_DEBUG;
+		str += sizeof("DEBUG ") - 1;
+	} else if (!strncmp(str, "BUFFER ", sizeof("BUFFER ") - 1)) {
+		type = IIO_ATTR_TYPE_BUFFER;
+		str += sizeof("BUFFER ") - 1;
+	}
+
+	if (is_channel) {
+		ptr = strchr(str, ' ');
+		if (!ptr)
+			return -EINVAL;
+
+		*ptr = '\0';
+		channel = str;
+		str = ptr + 1;
+	} else {
+		channel = NULL;
+	}
+
+	ptr = strchr(str, ' ');
+	if ((!!ptr) ^ write)
+		return -EINVAL;
+
+	attr = str;
+
+	if (write) {
+		*ptr = '\0';
+		str = ptr + 1;
+	} else {
+		tinyiiod_do_read_attr(iiod, device, channel,
+				      output, attr, type);
+		return 0;
+	}
+
+	bytes = strtol(str, &ptr, 10);
+	if (str == ptr || bytes < 0)
+		return -EINVAL;
+
+	tinyiiod_do_write_attr(iiod, device, channel,
+			       output, attr, (size_t) bytes, type);
+
+	return 0;
+}
+
+static int32_t parse_open_string(struct tinyiiod *iiod, char *str)
+{
+	char *device, *ptr;
+	long samples_count;
+	uint32_t mask = 0;
+
+	ptr = strchr(str, ' ');
+	if (!ptr)
+		return -EINVAL;
+
+	*ptr = '\0';
+	device = str;
+	str = ptr + 1;
+
+	samples_count = strtol(str, &ptr, 10);
+	if (str == ptr || *ptr != ' ' || samples_count < 0)
+		return -EINVAL;
+
+	str = ptr + 1;
+
+	mask = strtoul(str, NULL, 16);
+
+	tinyiiod_do_open(iiod, device, (size_t) samples_count, mask);
+
+	return 0;
+}
+
+static int32_t parse_timeout_string(struct tinyiiod *iiod, char *str)
+{
+	uint32_t timeout = strtoul(str, NULL, 10);
+
+	return tinyiiod_set_timeout(iiod, timeout);
+}
+
+static int32_t parse_writebuf_string(struct tinyiiod *iiod, char *str)
+{
+	char *device, *ptr;
+	long bytes_count;
+
+	ptr = strchr(str, ' ');
+	if (!ptr)
+		return -EINVAL;
+
+	*ptr = '\0';
+	device = str;
+	str = ptr + 1;
+
+	bytes_count = strtol(str, &ptr, 10);
+	if (str == ptr || *ptr != '\0' || bytes_count < 0)
+		return -EINVAL;
+
+	return tinyiiod_do_writebuf(iiod, device, (size_t) bytes_count);
+}
+
+static int32_t parse_readbuf_string(struct tinyiiod *iiod, char *str)
+{
+	char *device, *ptr;
+	long bytes_count;
+
+	ptr = strchr(str, ' ');
+	if (!ptr)
+		return -EINVAL;
+
+	*ptr = '\0';
+	device = str;
+	str = ptr + 1;
+
+	bytes_count = strtol(str, &ptr, 10);
+	if (str == ptr || *ptr != '\0' || bytes_count < 0)
+		return -EINVAL;
+
+	return tinyiiod_do_readbuf(iiod, device, (size_t) bytes_count);
+}
+
+int32_t tinyiiod_parse_string(struct tinyiiod *iiod, char *str)
+{
+	while (*str == '\n' || *str == '\r')
+		str++;
+
+	if (str[0] == '\0')
+		return 0;
+
+	if (!strncmp(str, "VERSION", sizeof("VERSION"))) {
+		char buf[32];
+
+		snprintf(buf, sizeof(buf), "%"PRIu16".%"PRIu16".%07x\n",
+			 TINYIIOD_VERSION_MAJOR,
+			 TINYIIOD_VERSION_MINOR,
+			 TINYIIOD_VERSION_GIT);
+		tinyiiod_write_string(iiod, buf);
+		return 0;
+	}
+
+	if (!strncmp(str, "PRINT", sizeof("PRINT"))) {
+		tinyiiod_write_xml(iiod);
+		return 0;
+	}
+
+	if (!strncmp(str, "READ ", sizeof("READ ") - 1))
+		return parse_rw_string(iiod, str + sizeof("READ ") - 1, false);
+
+	if (!strncmp(str, "WRITE ", sizeof("WRITE ") -1))
+		return parse_rw_string(iiod, str + sizeof("WRITE ") - 1, true);
+
+	if (!strncmp(str, "OPEN ", sizeof("OPEN ") -1))
+		return parse_open_string(iiod, str + sizeof("OPEN ") - 1);
+
+	if (!strncmp(str, "CLOSE ", sizeof("CLOSE ") -1)) {
+		tinyiiod_do_close(iiod, str + sizeof("CLOSE ") - 1);
+		return 0;
+	}
+
+	if (!strncmp(str, "READBUF ", sizeof("READBUF ") -1))
+		return parse_readbuf_string(iiod, str + sizeof("READBUF ") - 1);
+
+	if (!strncmp(str, "TIMEOUT ", sizeof("TIMEOUT ") - 1))
+		return parse_timeout_string(iiod, str + sizeof("TIMEOUT ") - 1);
+
+	if (!strncmp(str, "WRITEBUF ", sizeof("WRITEBUF ") -1))
+		return parse_writebuf_string(iiod, str + sizeof("WRITEBUF ") - 1);
+
+	if (!strncmp(str, "EXIT", sizeof("EXIT") - 1))
+		return tinyiiod_do_close_instance(iiod);
+
+	if (!strncmp(str, "GETTRIG", sizeof("GETTRIG") - 1))
+		return tinyiiod_write_value(iiod, -ENODEV);
+
+	return -EINVAL;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod-private.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod-private.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,59 @@
+/*
+ * libtinyiiod - Tiny IIO Daemon Library
+ *
+ * Copyright (C) 2016 Analog Devices, Inc.
+ * Author: Paul Cercueil <paul.cercueil@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#ifndef TINYIIOD_PRIVATE_H
+#define TINYIIOD_PRIVATE_H
+
+#include "tinyiiod.h"
+
+char tinyiiod_read_char(struct tinyiiod *iiod);
+ssize_t tinyiiod_read(struct tinyiiod *iiod, char *buf, size_t len);
+ssize_t tinyiiod_read_line(struct tinyiiod *iiod, char *buf, size_t len);
+
+ssize_t tinyiiod_write_char(struct tinyiiod *iiod, char c);
+ssize_t tinyiiod_write(struct tinyiiod *iiod, const char *data, size_t len);
+ssize_t tinyiiod_write_string(struct tinyiiod *iiod, const char *str);
+ssize_t tinyiiod_write_value(struct tinyiiod *iiod, int32_t value);
+
+void tinyiiod_write_xml(struct tinyiiod *iiod);
+
+void tinyiiod_do_read_attr(struct tinyiiod *iiod, const char *device,
+			   const char *channel, bool ch_out, const char *attr, enum iio_attr_type type);
+
+void tinyiiod_do_write_attr(struct tinyiiod *iiod, const char *device,
+			    const char *channel, bool ch_out, const char *attr,
+			    size_t bytes, enum iio_attr_type type);
+
+void tinyiiod_do_open(struct tinyiiod *iiod, const char *device,
+		      size_t sample_size, uint32_t mask);
+void tinyiiod_do_close(struct tinyiiod *iiod, const char *device);
+
+int32_t tinyiiod_do_open_instance(struct tinyiiod *iiod);
+
+int32_t tinyiiod_do_close_instance(struct tinyiiod *iiod);
+
+int32_t tinyiiod_do_readbuf(struct tinyiiod *iiod,
+			    const char *device, size_t bytes_count);
+
+int32_t tinyiiod_do_writebuf(struct tinyiiod *iiod, const char *device,
+			     size_t bytes_count);
+
+int32_t tinyiiod_parse_string(struct tinyiiod *iiod, char *str);
+
+int32_t tinyiiod_set_timeout(struct tinyiiod *iiod, uint32_t timeout);
+
+#endif /* TINYIIOD_PRIVATE_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,286 @@
+/*
+ * libtinyiiod - Tiny IIO Daemon Library
+ *
+ * Copyright (C) 2016 Analog Devices, Inc.
+ * Author: Paul Cercueil <paul.cercueil@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#include "tinyiiod-private.h"
+
+#include "compat.h"
+
+struct tinyiiod {
+	struct tinyiiod_ops *ops;
+	char *buf;
+};
+
+struct tinyiiod * tinyiiod_create(struct tinyiiod_ops *ops)
+{
+	struct tinyiiod *iiod = malloc(sizeof(*iiod));
+
+	if (!iiod)
+		return NULL;
+
+	iiod->buf = malloc(IIOD_BUFFER_SIZE);
+	if (!iiod->buf) {
+		free(iiod);
+		return NULL;
+	}
+	iiod->ops = ops;
+
+	return iiod;
+}
+
+void tinyiiod_destroy(struct tinyiiod *iiod)
+{
+	free(iiod->buf);
+	free(iiod);
+}
+
+int32_t tinyiiod_read_command(struct tinyiiod *iiod)
+{
+	char buf[128];
+	int32_t ret;
+
+	ret = tinyiiod_read_line(iiod, buf, sizeof(buf));
+	if (ret < 0)
+		return ret;
+
+	ret = tinyiiod_parse_string(iiod, buf);
+	if (ret < 0)
+		tinyiiod_write_value(iiod, ret);
+
+	return ret;
+}
+
+ssize_t tinyiiod_read(struct tinyiiod *iiod, char *buf, size_t len)
+{
+	return iiod->ops->read(buf, len);
+}
+
+ssize_t tinyiiod_read_line(struct tinyiiod *iiod, char *buf, size_t len)
+{
+	char ch;
+	uint32_t i;
+	bool found = false;
+	int32_t ret;
+
+	if (iiod->ops->read_line)
+		return iiod->ops->read_line(buf, len);
+
+	for (i = 0; i < len - 1; i++) {
+		ret = iiod->ops->read(&ch, 1);
+		if (ret <= 0)
+			return -EIO;
+		buf[i] = ch;
+		if (buf[i] != '\n')
+			found = true;
+		else if (found)
+			break;
+	}
+
+	if (!found || i == len - 1) {
+		/* No \n found -> garbage data */
+		return -EIO;
+	}
+
+	buf[i - 1] = '\0';
+
+	return i;
+}
+
+ssize_t tinyiiod_write_char(struct tinyiiod *iiod, char c)
+{
+	return iiod->ops->write(&c, 1);
+}
+
+ssize_t tinyiiod_write(struct tinyiiod *iiod, const char *data, size_t len)
+{
+	return iiod->ops->write(data, len);
+}
+
+ssize_t tinyiiod_write_string(struct tinyiiod *iiod, const char *str)
+{
+	return tinyiiod_write(iiod, str, strlen(str));
+}
+
+ssize_t tinyiiod_write_value(struct tinyiiod *iiod, int32_t value)
+{
+	char buf[16];
+
+	snprintf(buf, sizeof(buf), "%"PRIi32"\n", value);
+	return tinyiiod_write_string(iiod, buf);
+}
+
+void tinyiiod_write_xml(struct tinyiiod *iiod)
+{
+	char *xml;
+	iiod->ops->get_xml(&xml);
+	size_t len = strlen(xml);
+
+	tinyiiod_write_value(iiod, len);
+	tinyiiod_write(iiod, xml, len);
+	tinyiiod_write_char(iiod, '\n');
+}
+
+void tinyiiod_do_read_attr(struct tinyiiod *iiod, const char *device,
+			   const char *channel, bool ch_out, const char *attr, enum iio_attr_type type)
+{
+	ssize_t ret;
+
+	if (channel)
+		ret = iiod->ops->ch_read_attr(device, channel,
+					      ch_out, attr, iiod->buf, IIOD_BUFFER_SIZE);
+	else
+		ret = iiod->ops->read_attr(device, attr,
+					   iiod->buf, IIOD_BUFFER_SIZE, type);
+
+	tinyiiod_write_value(iiod, (int32_t) ret);
+	if (ret > 0) {
+		iiod->buf[ret] = '\n';
+		tinyiiod_write(iiod, iiod->buf, (size_t) ret + 1);
+	}
+}
+
+void tinyiiod_do_write_attr(struct tinyiiod *iiod, const char *device,
+			    const char *channel, bool ch_out, const char *attr,
+			    size_t bytes, enum iio_attr_type type)
+{
+	ssize_t ret;
+
+	if (bytes > IIOD_BUFFER_SIZE - 1)
+		bytes = IIOD_BUFFER_SIZE - 1;
+
+	tinyiiod_read(iiod, iiod->buf, bytes);
+	iiod->buf[bytes] = '\0';
+
+	if (channel)
+		ret = iiod->ops->ch_write_attr(device, channel, ch_out,
+					       attr, iiod->buf, bytes);
+	else
+		ret = iiod->ops->write_attr(device, attr, iiod->buf, bytes, type);
+
+	tinyiiod_write_value(iiod, (int32_t) ret);
+}
+
+void tinyiiod_do_open(struct tinyiiod *iiod, const char *device,
+		      size_t sample_size, uint32_t mask)
+{
+	int32_t ret = iiod->ops->open(device, sample_size, mask);
+	tinyiiod_write_value(iiod, ret);
+}
+
+void tinyiiod_do_close(struct tinyiiod *iiod, const char *device)
+{
+	int32_t ret = iiod->ops->close(device);
+	tinyiiod_write_value(iiod, ret);
+}
+
+int32_t tinyiiod_do_open_instance(struct tinyiiod *iiod)
+{
+	if (iiod->ops->open_instance)
+		return iiod->ops->open_instance();
+
+	return 0;
+}
+
+int32_t tinyiiod_do_close_instance(struct tinyiiod *iiod)
+{
+	if (iiod->ops->close_instance)
+		return iiod->ops->close_instance();
+
+	return 0;
+}
+
+int32_t tinyiiod_do_writebuf(struct tinyiiod *iiod,
+			     const char *device, size_t bytes_count)
+{
+	size_t bytes, offset = 0, total_bytes = bytes_count;
+	char buf[256];
+	int32_t ret = 0;
+
+	tinyiiod_write_value(iiod, bytes_count);
+	while (bytes_count) {
+		bytes = bytes_count > sizeof(buf) ? sizeof(buf) : bytes_count;
+		ret = tinyiiod_read(iiod, buf, bytes);
+		if (ret > 0) {
+			ret = iiod->ops->write_data(device, buf, offset, ret);
+			offset += ret;
+			if (ret < 0)
+				return ret;
+			bytes_count -= ret;
+		} else
+			return ret;
+	}
+	if (iiod->ops->transfer_mem_to_dev) {
+		ret = iiod->ops->transfer_mem_to_dev(device, total_bytes);
+		if (ret < 0)
+			return ret;
+	}
+	tinyiiod_write_value(iiod, (int) total_bytes);
+
+	return ret;
+}
+
+int32_t tinyiiod_do_readbuf(struct tinyiiod *iiod,
+			    const char *device, size_t bytes_count)
+{
+	int32_t ret;
+	char buf[256];
+	uint32_t mask;
+	bool print_mask = true;
+	size_t offset = 0;
+
+	ret = iiod->ops->get_mask(device, &mask);
+	if (ret < 0) {
+		return ret;
+	}
+	if (iiod->ops->transfer_dev_to_mem) {
+		ret = iiod->ops->transfer_dev_to_mem(device, bytes_count);
+		if (ret < 0)
+			return ret;
+	}
+	while (bytes_count) {
+		size_t bytes = bytes_count > sizeof(buf) ? sizeof(buf) : bytes_count;
+
+		ret = (int) iiod->ops->read_data(device, buf, offset, bytes);
+		offset += bytes;
+		tinyiiod_write_value(iiod, ret);
+		if (ret < 0)
+			return ret;
+
+		if (print_mask) {
+			char buf_mask[10];
+
+			snprintf(buf_mask, sizeof(buf_mask), "%08"PRIx32"\n", mask);
+			tinyiiod_write_string(iiod, buf_mask);
+			print_mask = false;
+		}
+
+		tinyiiod_write(iiod, buf, (size_t) ret);
+		bytes_count -= (size_t) ret;
+	}
+
+	return ret;
+}
+
+int32_t tinyiiod_set_timeout(struct tinyiiod *iiod, uint32_t timeout)
+{
+	int32_t ret = 0;
+
+	if (iiod->ops->set_timeout)
+		ret = iiod->ops->set_timeout(timeout);
+	tinyiiod_write_value(iiod, ret);
+
+	return ret;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/libraries/iio/libtinyiiod/tinyiiod.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,76 @@
+/*
+ * libtinyiiod - Tiny IIO Daemon Library
+ *
+ * Copyright (C) 2016 Analog Devices, Inc.
+ * Author: Paul Cercueil <paul.cercueil@analog.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#ifndef TINYIIOD_H
+#define TINYIIOD_H
+
+#include "compat.h"
+
+struct tinyiiod;
+
+enum iio_attr_type {
+	IIO_ATTR_TYPE_DEVICE = 0,
+	IIO_ATTR_TYPE_DEBUG = 1,
+	IIO_ATTR_TYPE_BUFFER = 2,
+};
+
+struct tinyiiod_ops {
+	/* Read from the input stream */
+	ssize_t (*read)(char *buf, size_t len);
+
+	/* Write to the output stream */
+	ssize_t (*write)(const char *buf, size_t len);
+	ssize_t (*read_line)(char *buf, size_t len);
+
+	ssize_t (*open_instance)();
+
+	ssize_t (*close_instance)();
+
+	ssize_t (*read_attr)(const char *device, const char *attr,
+			     char *buf, size_t len, enum iio_attr_type type);
+	ssize_t (*write_attr)(const char *device, const char *attr,
+			      const char *buf, size_t len, enum iio_attr_type type);
+
+	ssize_t (*ch_read_attr)(const char *device, const char *channel,
+				bool ch_out, const char *attr, char *buf, size_t len);
+	ssize_t (*ch_write_attr)(const char *device, const char *channel,
+				 bool ch_out, const char *attr,
+				 const char *buf, size_t len);
+
+	int32_t (*open)(const char *device, size_t sample_size, uint32_t mask);
+	int32_t (*close)(const char *device);
+
+	ssize_t (*transfer_dev_to_mem)(const char *device, size_t bytes_count);
+	ssize_t (*read_data)(const char *device, char *buf, size_t offset,
+			     size_t bytes_count);
+
+	ssize_t (*transfer_mem_to_dev)(const char *device, size_t bytes_count);
+	ssize_t (*write_data)(const char *device, const char *buf, size_t offset,
+			      size_t bytes_count);
+
+	int32_t (*get_mask)(const char *device, uint32_t *mask);
+
+	int32_t (*set_timeout)(uint32_t timeout);
+
+	ssize_t (*get_xml)(char **outxml);
+};
+
+struct tinyiiod * tinyiiod_create(struct tinyiiod_ops *ops);
+void tinyiiod_destroy(struct tinyiiod *iiod);
+int32_t tinyiiod_read_command(struct tinyiiod *iiod);
+
+#endif /* TINYIIOD_H */
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/circular_buffer.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/circular_buffer.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,412 @@
+/***************************************************************************//**
+ *   @file   circular_buffer.c
+ *   @brief  Circular buffer implementation
+ *   @author Mihail Chindris (mihail.chindris@analog.com)
+********************************************************************************
+ *   @copyright
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include "circular_buffer.h"
+#include "error.h"
+#include "util.h"
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct cb_ptr
+ * @brief Circular buffer pointer
+ */
+struct cb_ptr {
+	/** Index of data in the buffer */
+	uint32_t	idx;
+	/** Counts the number of times idx exceeds the liniar buffer */
+	uint32_t	spin_count;
+	/** Set if async transaction is active */
+	bool		async_started;
+	/** Number of bytes to update after an async transaction is finished */
+	uint32_t	async_size;
+};
+
+/**
+ * @struct circular_buffer
+ * @brief Circular buffer descriptor
+ */
+struct circular_buffer {
+	/** Size of the buffer in bytes */
+	uint32_t	size;
+	/** Address of the buffer */
+	int8_t		*buff;
+	/** Write pointer */
+	struct cb_ptr	write;
+	/** Read pointer */
+	struct cb_ptr	read;
+};
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Create circular buffer structure
+ *
+ * @note Circular buffer implementation is thread safe for one write
+ * and one reader.
+ * If multiple writer or multiple readers access the circular buffer then
+ * function that updates the structure should be called inside a critical
+ * critical section.
+ *
+ * @param desc - Where to store the circular buffer reference
+ * @param buff_size - Buffer size
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t cb_init(struct circular_buffer **desc, uint32_t buff_size)
+{
+	struct circular_buffer	*ldesc;
+
+	if (!desc || !buff_size)
+		return -EINVAL;
+
+	ldesc = (struct circular_buffer*)calloc(1, sizeof(*ldesc));
+	if (!ldesc)
+		return -ENOMEM;
+
+	*desc = ldesc;
+
+	ldesc->size = buff_size;
+	ldesc->buff = calloc(1, buff_size);
+	if (!ldesc->buff) {
+		free(ldesc);
+		return -ENOMEM;
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Free the resources allocated for the circular buffer structure
+ * @param desc - Circular buffer reference
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t cb_remove(struct circular_buffer *desc)
+{
+	if (!desc)
+		return FAILURE;
+
+	if (desc->buff)
+		free(desc->buff);
+	free(desc);
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Get the number of elements in the buffer
+ * @param desc - Circular buffer reference
+ * @param size - Where to store size of data available to read
+ * @return
+ *  - \ref SUCCESS   - No errors
+ *  - -EINVAL   - Wrong parameters used
+ *  - -EOVERRUN - A buffer overrun occurred
+ */
+int32_t cb_size(struct circular_buffer *desc, uint32_t *size)
+{
+	uint32_t nb_spins;
+
+	if (!desc || !size)
+		return -EINVAL;
+
+	if (desc->write.spin_count > desc->read.spin_count)
+		nb_spins = desc->write.spin_count - desc->read.spin_count;
+	else
+		/* Integer overflow on desc->write.spin_count */
+		nb_spins = UINT32_MAX - desc->read.spin_count +
+			   desc->write.spin_count + 1;
+
+	if (nb_spins > 0)
+		*size = desc->size + desc->write.idx - desc->read.idx;
+	else
+		*size = desc->write.idx - desc->read.idx;
+
+	if (*size > desc->size) {
+		*size = desc->size;
+		return -EOVERRUN;
+	}
+
+	return SUCCESS;
+}
+
+/*
+ * Functionality described at cb_prepare_async_write/read having the is_read
+ * parameter to specifiy if it is a read or write operation
+ */
+static int32_t cb_prepare_async_operation(struct circular_buffer *desc,
+		uint32_t requested_size,
+		void **buff,
+		uint32_t *raw_size_available,
+		bool is_read)
+{
+	struct cb_ptr	*ptr;
+	uint32_t	available_size;
+	uint32_t	ret;
+
+	if (!desc || !buff || !raw_size_available)
+		return -EINVAL;
+
+	ret = SUCCESS;
+	/* Select if read or write index will be updated */
+	ptr = is_read ? &desc->read : &desc->write;
+
+	/* Only one transaction type possible at a single time */
+	if (ptr->async_started)
+		return -EBUSY;
+
+	if (is_read) {
+		ret = cb_size(desc, &available_size);
+		if (ret == -EOVERRUN) {
+			/* Update read index */
+			desc->read.spin_count = desc->write.spin_count - 1;
+			desc->read.idx = desc->write.idx;
+		}
+
+		/* We can only read available data */
+		requested_size = min(requested_size, available_size);
+		if (!requested_size)
+			return -EAGAIN;
+	}
+
+	/* Size to end of buffer */
+	ptr->async_size = min(requested_size, desc->size - ptr->idx);
+
+	*raw_size_available = ptr->async_size;
+
+	/* Convert index to address in the buffer */
+	*buff = (void *)(desc->buff + ptr->idx);
+
+	ptr->async_started = true;
+
+	return ret;
+}
+
+/*
+ * Functionality described at cb_end_async_write/read having the is_read
+ * parameter to specifiy if it is a read or write operation
+ */
+static int32_t cb_end_async_operation(struct circular_buffer *desc,
+				      bool is_read)
+{
+	struct cb_ptr	*ptr;
+	uint32_t	new_val;
+
+
+	if (!desc)
+		return -EINVAL;
+
+	/* Select if read or write index will be updated */
+	ptr = is_read ? &desc->read : &desc->write;
+
+	/* Transaction not started */
+	if (!ptr->async_started)
+		return FAILURE;
+
+	/* Update pointer value */
+	new_val = ptr->idx + ptr->async_size;
+	if (new_val >= desc->size) {
+		ptr->spin_count++;
+		new_val %= desc->size;
+	}
+	ptr->idx = new_val;
+	ptr->async_size = 0;
+	ptr->async_started = false;
+
+	return SUCCESS;
+}
+
+/*
+ * Functionality described at cb_write/read having the is_read
+ * parameter to specifiy if it is a read or write operation
+ */
+static int32_t cb_operation(struct circular_buffer *desc,
+			    void *data, uint32_t size,
+			    bool is_read)
+{
+	uint8_t		*buff;
+	uint32_t	available_size;
+	int32_t		ret;
+	uint32_t	i;
+	bool		sticky_overrun;
+
+	if (!desc || !data || !size)
+		return -EINVAL;
+
+	sticky_overrun = 0;
+	i = 0;
+	while (i < size) {
+		do {
+			ret = cb_prepare_async_operation(desc, size - i,
+							 (void **)&buff,
+							 &available_size,
+							 is_read);
+		} while (ret == -EBUSY || ret == -EAGAIN);
+		if (ret == -EOVERRUN)
+			sticky_overrun = true;
+
+		if (is_read)
+			memcpy((uint8_t *)data + i, buff, available_size);
+		else
+			memcpy(buff, (uint8_t *)data + i, available_size);
+
+		cb_end_async_operation(desc, is_read);
+
+		i += available_size;
+	}
+
+	if (sticky_overrun)
+		return -EOVERRUN;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Prepare asynchronous write
+ *
+ * Get the inside raw buffer to be used in DMA transactions.
+ *
+ * @param desc - Circular buffer reference
+ * @param size_to_write - Number of bytes needed to write to the buffer.
+ * @param write_buff - Address where to store the buffer where to write to.
+ * @param size_avilable - min(size_to_write, size until end of allocated buffer)
+ * @return
+ *  - \ref SUCCESS   - No errors
+ *  - -EINVAL   - Wrong parameters used
+ *  - -EBUSY    - Asynchronous transaction already started
+ */
+int32_t cb_prepare_async_write(struct circular_buffer *desc,
+			       uint32_t size_to_write,
+			       void **write_buff,
+			       uint32_t *size_avilable)
+{
+	return cb_prepare_async_operation(desc, size_to_write, write_buff,
+					  size_avilable, 0);
+}
+
+/**
+ * @brief Prepare asynchronous read
+ *
+ * Get the inside raw buffer to be used in DMA transactions.
+ *
+ * @param desc - Circular buffer reference
+ * @param size_to_read - Number of bytes needed to write to the buffer.
+ * @param read_buff - Address where to store the buffer where data will be read.
+ * @param size_avilable - min(size_to_read, size until end of allocated buffer)
+ * @return
+ *  - \ref SUCCESS   - No errors
+ *  - -EAGAIN   - No data available at this moment
+ *  - -EINVAL   - Wrong parameters used
+ *  - -EBUSY    - Asynchronous transaction already started
+ *  - -EOVERRUN - An overrun occurred and some data have been overwritten
+ */
+int32_t cb_prepare_async_read(struct circular_buffer *desc,
+			      uint32_t size_to_read,
+			      void **read_buff,
+			      uint32_t *size_avilable)
+{
+	return cb_prepare_async_operation(desc, size_to_read, read_buff,
+					  size_avilable, 1);
+}
+
+/**
+ * \defgroup end_async_group End Ashyncronous functions
+ * @brief End asynchronous transaction
+ *
+ * @param desc - Circular buffer reference
+ * @return
+ *  - \ref SUCCESS   - No errors
+ *  - \ref FAILURE   - Asynchronous transaction not started
+ *  - -EINVAL        - Wrong parameters used
+ * @{
+ */
+int32_t cb_end_async_write(struct circular_buffer *desc)
+{
+	return cb_end_async_operation(desc, 0);
+}
+
+int32_t cb_end_async_read(struct circular_buffer *desc)
+{
+
+	return cb_end_async_operation(desc, 1);
+}
+/** @} */
+
+/**
+ * @brief Write data to the buffer (Blocking)
+ * @param desc - Circular buffer reference
+ * @param data - Buffer from where data is copied to the circular buffer
+ * @param size - Size to write
+ * @return
+ *  - \ref SUCCESS - No errors
+ *  - -EINVAL      - Wrong parameters used
+ */
+int32_t cb_write(struct circular_buffer *desc, const void *data, uint32_t size)
+{
+	return cb_operation(desc, (void *)data, size, 0);
+}
+
+/**
+ * @brief Read data from the buffer (Blocking)
+ * @param desc - Circular buffer reference
+ * @param data - Buffer where to data is copied from the circular buffer
+ * @param size - Size to read
+ * @return
+ *  - \ref SUCCESS   - No errors
+ *  - -EINVAL   - Wrong parameters used
+ *  - -EOVERRUN - An overrun occurred and some data have been overwritten
+ */
+int32_t cb_read(struct circular_buffer *desc, void *data, uint32_t size)
+{
+	return cb_operation(desc, data, size, 1);
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/clk.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/clk.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,128 @@
+/***************************************************************************//**
+ *   @file   clk.c
+ *   @brief  Implementation of Clock Driver.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include "error.h"
+#include "clk.h"
+
+/******************************************************************************/
+/************************** Functions Implementation **************************/
+/******************************************************************************/
+
+/**
+ * Start the clock.
+ * @param clk - The clock structure.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t clk_enable(struct clk * clk)
+{
+	if (clk->hw->dev_clk_enable)
+		return clk->hw->dev_clk_enable(clk->hw->dev);
+	else
+		return FAILURE;
+}
+
+/**
+ * Stop the clock.
+ * @param clk - The clock structure.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t clk_disable(struct clk * clk)
+{
+	if (clk->hw->dev_clk_disable)
+		return clk->hw->dev_clk_disable(clk->hw->dev);
+	else
+		return FAILURE;
+}
+
+/**
+ * Get the current frequency of the clock.
+ * @param clk - The clock structure.
+ * @param rate - The current frequency.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t clk_recalc_rate(struct clk *clk,
+			uint64_t *rate)
+{
+	if (clk->hw->dev_clk_recalc_rate)
+		return clk->hw->dev_clk_recalc_rate(clk->hw->dev,
+						    clk->hw_ch_num,
+						    rate);
+	else
+		return FAILURE;
+}
+
+/**
+ * Round the desired frequency to a rate that the clock can actually output.
+ * @param clk - The clock structure.
+ * @param rate - The desired frequency.
+ * @param rounded_rate - The rounded frequency.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t clk_round_rate(struct clk *clk,
+		       uint64_t rate,
+		       uint64_t *rounded_rate)
+{
+	if (clk->hw->dev_clk_round_rate)
+		return clk->hw->dev_clk_round_rate(clk->hw->dev,
+						   clk->hw_ch_num,
+						   rate,
+						   rounded_rate);
+	else
+		return FAILURE;
+}
+
+/**
+ * Change the frequency of the clock.
+ * @param clk - The clock structure.
+ * @param rate - The desired frequency.
+ * @return SUCCESS in case of success, negative error code otherwise.
+ */
+int32_t clk_set_rate(struct clk *clk,
+		     uint64_t rate)
+{
+	if (clk->hw->dev_clk_set_rate)
+		return clk->hw->dev_clk_set_rate(clk->hw->dev,
+						 clk->hw_ch_num,
+						 rate);
+	else
+		return FAILURE;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/crc16.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/crc16.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,102 @@
+/***************************************************************************//**
+ *   @file   crc16.c
+ *   @brief  Source file of CRC-16 computation.
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#include "crc16.h"
+
+/***************************************************************************//**
+ * @brief Creates the CRC-16 lookup table for a given polynomial.
+ *
+ * @param table      - Pointer to a CRC-16 lookup table to write to.
+ * @param polynomial - msb-first representation of desired polynomial.
+ *
+ * Polynomials in CRC algorithms are typically represented as shown below.
+ *
+ *    poly = x^16 + x^14 + x^13 + x^12 + x^10 + x^8 + x^6 + x^4 + x^3 +
+ *           x^1 + 1
+ *
+ * Using msb-first direction, x^15 maps to the msb.
+ *
+ *    msb first: poly = (1)0111010101011011 = 0x755B
+ *                         ^
+ *
+ * @return None.
+*******************************************************************************/
+void crc16_populate_msb(uint16_t * table, const uint16_t polynomial)
+{
+	if (!table)
+		return;
+
+	for (int16_t n = 0; n < CRC16_TABLE_SIZE; n++) {
+		uint16_t currByte = (uint16_t)(n << 8);
+		for (uint8_t bit = 0; bit < 8; bit++) {
+			if ((currByte & 0x8000) != 0) {
+				currByte <<= 1;
+				currByte ^= polynomial;
+			} else {
+				currByte <<= 1;
+			}
+		}
+		table[n] = currByte;
+	}
+}
+
+/***************************************************************************//**
+ * @brief Computes the CRC-16 over a buffer of data.
+ *
+ * @param table     - Pointer to a CRC-16 lookup table for the desired polynomial.
+ * @param pdata     - Pointer to data buffer.
+ * @param nbytes    - Number of bytes to compute the CRC-16 over.
+ * @param crc       - Initial value for the CRC-16 computation. Can be used to
+ *                    cascade calls to this function by providing a previous
+ *                    output of this function as the crc parameter.
+ *
+ * @return crc      - Computed CRC-16 value.
+*******************************************************************************/
+uint16_t crc16(const uint16_t * table, const uint8_t *pdata, size_t nbytes,
+	       uint16_t crc)
+{
+	unsigned int idx;
+
+	while (nbytes--) {
+		idx = ((crc >> 8) ^ *pdata) & 0xff;
+		crc = (table[idx] ^ (crc << 8)) & 0xffff;
+		pdata++;
+	}
+
+	return crc;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/crc8.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/crc8.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,100 @@
+/***************************************************************************//**
+ *   @file   crc8.c
+ *   @brief  Source file of CRC-8 computation.
+ *   @author Darius Berghe (darius.berghe@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+#include "crc8.h"
+
+/***************************************************************************//**
+ * @brief Creates the CRC-8 lookup table for a given polynomial.
+ *
+ * @param table      - Pointer to a CRC-8 lookup table to write to.
+ * @param polynomial - msb-first representation of desired polynomial.
+ *
+ * Polynomials in CRC algorithms are typically represented as shown below.
+ *
+ *	poly = x^8 + x^2 + x^1 + 1
+ *
+ * Using msb-first direction, x^7 maps to the msb.
+ *
+ * 	msb first: poly = (1)00000111 = 0x07
+ *
+ * @return None.
+*******************************************************************************/
+void crc8_populate_msb(uint8_t * table, const uint8_t polynomial)
+{
+	if (!table)
+		return;
+
+	for (int16_t n = 0; n < CRC8_TABLE_SIZE; n++) {
+		uint8_t currByte = (uint8_t)n;
+		for (uint8_t bit = 0; bit < 8; bit++) {
+			if ((currByte & 0x80) != 0) {
+				currByte <<= 1;
+				currByte ^= polynomial;
+			} else {
+				currByte <<= 1;
+			}
+		}
+		table[n] = currByte;
+	}
+}
+
+/***************************************************************************//**
+ * @brief Computes the CRC-8 over a buffer of data.
+ *
+ * @param table     - Pointer to a CRC-8 lookup table for the desired polynomial.
+ * @param pdata     - Pointer to 8-bit data buffer.
+ * @param nbytes    - Number of bytes to compute the CRC-8 over.
+ * @param crc       - Initial value for the CRC-8 computation. Can be used to
+ *                    cascade calls to this function by providing a previous
+ *                    output of this function as the crc parameter.
+ *
+ * @return crc      - Computed CRC-8 value.
+*******************************************************************************/
+uint8_t crc8(const uint8_t * table, const uint8_t *pdata, size_t nbytes,
+	     uint8_t crc)
+{
+	unsigned int idx;
+
+	while (nbytes--) {
+		idx = (crc ^ *pdata);
+		crc = (table[idx]) & 0xff;
+		pdata++;
+	}
+
+	return crc;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/fifo.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/fifo.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,136 @@
+/***************************************************************************//**
+ *   @file   fifo.c
+ *   @brief  Implementation of fifo.
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <string.h>
+#include <stdlib.h>
+#include "fifo.h"
+#include "error.h"
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief Create new fifo element
+ * @param buff - Data to be saved in fifo.
+ * @param len - Length of the data.
+ * @return fifo element in case of success, NULL otherwise
+ */
+static struct fifo_element * fifo_new_element(char *buff, uint32_t len)
+{
+	struct fifo_element *q = calloc(1, sizeof(struct fifo_element));
+	if (!q)
+		return NULL;
+
+	q->len = len;
+	q->data = calloc(1, len);
+	if (!(q->data)) {
+		free(q);
+		return NULL;
+	}
+	memcpy(q->data, buff, len);
+
+	return q;
+}
+
+/**
+ * @brief Get last element in fifo
+ * @param p_fifo - pointer to fifo
+ * @return fifo last element if exists, NULL otherwise
+ */
+static struct fifo_element *fifo_get_last(struct fifo_element *p_fifo)
+{
+	if(p_fifo == NULL)
+		return NULL;
+	while (p_fifo->next) {
+		p_fifo = p_fifo->next;
+	}
+
+	return p_fifo;
+}
+
+/**
+ * @brief Insert element to fifo, in the last position.
+ * @param p_fifo - Pointer to fifo.
+ * @param buff - Data to be saved in fifo.
+ * @param len - Length of the data.
+ * @return SUCCESS in case of success, FAILURE otherwise
+ */
+int32_t fifo_insert(struct fifo_element **p_fifo, char *buff, uint32_t len)
+{
+	struct fifo_element *p, *q;
+
+	if (len <= 0)
+		return FAILURE;
+
+	q = fifo_new_element(buff, len);
+	if (!q)
+		return FAILURE;
+
+	if (!(*p_fifo)) {
+		*p_fifo = q;
+	} else {
+		p = fifo_get_last(*p_fifo);
+		p->next = q;
+	}
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Remove fifo head
+ * @param p_fifo - Pointer to fifo.
+ * @return next element in fifo if exists, NULL otherwise.
+ */
+struct fifo_element * fifo_remove(struct fifo_element *p_fifo)
+{
+	struct fifo_element *p = p_fifo;
+
+	if (p_fifo != NULL) {
+		p_fifo = p_fifo->next;
+		free(p->data);
+		free(p);
+	}
+
+	return p_fifo;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/list.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/list.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,842 @@
+/***************************************************************************//**
+ *   @file   list.c
+ *   @brief  List library implementation
+ *   @author Mihail Chindris (mihail.chindris@analog.com)
+********************************************************************************
+ * Copyright 2020(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "list.h"
+#include "error.h"
+#include <stdlib.h>
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct list_elem
+ * @brief Format of each element of the list
+ */
+struct list_elem {
+	/** User data */
+	void			*data;
+	/** Reference to previous element */
+	struct list_elem	*prev;
+	/** Reference to next element */
+	struct list_elem	*next;
+};
+
+/**
+ * @struct list_iterator
+ * @brief Structure used to iterate through the list
+ */
+struct iterator {
+	/** List reference */
+	struct _list_desc	*list;
+	/** Current element reference */
+	struct list_elem	*elem;
+};
+
+/**
+ * @struct _list_desc
+ * @brief List descriptor
+ */
+struct _list_desc {
+	/** Reference to first element in the list */
+	struct list_elem	*first;
+	/** Reference to last element in the list*/
+	struct list_elem	*last;
+	/** Number of elements in the list */
+	uint32_t		nb_elements;
+	/** Function used to compare elements */
+	f_cmp			comparator;
+	/** Number of current active iterators */
+	uint32_t		nb_iterators;
+	/** Internal list iterator */
+	struct iterator		l_it;
+};
+
+/** @brief Default function used to compare element in the list ( \ref f_cmp) */
+static int32_t default_comparator(void *data1, void *data2)
+{
+	return (int32_t)(data1 - data2);
+}
+
+/**
+ * @brief Creates a new list elements an configure its value
+ * @param data - To set list_elem.data
+ * @param prev - To set list_elem.prev
+ * @param next - To set list_elem.next
+ * @return Address of the new element or NULL if allocation fails.
+ */
+static inline struct list_elem *create_element(void *data,
+		struct list_elem *prev,
+		struct list_elem *next)
+{
+	struct list_elem *elem;
+
+	elem = (struct list_elem *)calloc(1, sizeof(*elem));
+	if (!elem)
+		return NULL;
+	elem->data = data;
+	elem->prev = prev;
+	elem->next = next;
+
+	return (elem);
+}
+
+/**
+ * @brief Updates the necesary link on the list elements to add or remove one
+ * @param prev - Low element
+ * @param elem - Middle element
+ * @param next - High element
+ */
+static inline void update_links(struct list_elem *prev, struct list_elem *elem,
+				struct list_elem *next)
+{
+	if (prev)
+		prev->next = elem ? elem : next;
+	if (elem) {
+		elem->prev = prev;
+		elem->next = next;
+	}
+	if (next)
+		next->prev = elem ? elem : prev;
+}
+
+/**
+ * @brief Update according to modification the list descriptor
+ * @param list - List reference
+ * @param new_first - New first element
+ * @param new_last - New last element
+ */
+static inline void update_desc(struct _list_desc *list,
+			       struct list_elem *new_first,
+			       struct list_elem *new_last)
+{
+	if (new_first == list->first) {
+		list->last = new_last;
+		if (new_first == NULL || new_last == NULL)
+			list->first = new_last;
+	} else {	/* if (new_last == list->last) */
+		list->first = new_first;
+		if (new_last == NULL || new_first == NULL)
+			list->last = new_first;
+	}
+}
+
+/**
+ * @brief Set the adapter functions acording to the adapter type
+ * @param ad - Reference of the adapter
+ * @param type - Type of the adapter
+ */
+static inline void set_adapter(struct list_desc *ad, enum adapter_type type)
+{
+	switch (type) {
+	case LIST_PRIORITY_LIST:
+		ad->push = list_add_find;
+		ad->pop = list_get_first;
+		ad->top_next = list_read_first;
+		ad->back = list_read_last;
+		ad->swap = list_edit_first;
+		break;
+	case LIST_QUEUE:
+		ad->push = list_add_last;
+		ad->pop = list_get_first;
+		ad->top_next = list_read_first;
+		ad->back = list_read_last;
+		ad->swap = list_edit_first;
+		break;
+	case LIST_DEFAULT:
+	case LIST_STACK:
+	default:
+		ad->push = list_add_last;
+		ad->pop = list_get_last;
+		ad->top_next = list_read_last;
+		ad->back = list_read_first;
+		ad->swap = list_edit_last;
+		break;
+	}
+}
+
+/**
+ * @brief Create a new empty list
+ * @param list_desc - Where to store the reference of the new created list
+ * @param type - Type of adapter to use.
+ * @param comparator - Used to compare item when using an ordered list or when
+ * using the \em find functions.
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t list_init(struct list_desc **list_desc, enum adapter_type type,
+		  f_cmp comparator)
+{
+	struct list_desc	*l_desc;
+	struct _list_desc	*list;
+
+
+	if (!list_desc)
+		return FAILURE;
+	l_desc = (struct list_desc *)calloc(1, sizeof(*l_desc));
+	if (!l_desc)
+		return FAILURE;
+	list = (struct _list_desc *)calloc(1, sizeof(*list));
+	if (!list) {
+		free(l_desc);
+		return FAILURE;
+	}
+
+	*list_desc = l_desc;
+	l_desc->priv_desc = list;
+	list->comparator = comparator ? comparator : default_comparator;
+
+	/* Configure wrapper */
+	set_adapter(l_desc, type);
+	list->l_it.list = list;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Remove the created list.
+ *
+ * All its elements will be cleared and the data inside each will be lost. If
+ * not all iterators have been removed, the list will not be removed.
+ * @param list_desc - Reference to the list
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t list_remove(struct list_desc *list_desc)
+{
+	void			*data;
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+	if (list->nb_iterators != 0)
+		return FAILURE;
+
+	/* Remove all the elements */
+	while (SUCCESS == list_get_first(list_desc, &data))
+		;
+	free(list_desc->priv_desc);
+	free(list_desc);
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Get the number of elements inside the list
+ * @param list_desc - List reference
+ * @param out_size - Where to store the number of elements
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t list_get_size(struct list_desc *list_desc, uint32_t *out_size)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !out_size)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+	*out_size = list->nb_elements;
+
+	return SUCCESS;
+}
+
+/** @brief Add element at the begining of the list. Refer to \ref f_add */
+int32_t list_add_first(struct list_desc *list_desc, void *data)
+{
+	struct list_elem	*prev;
+	struct list_elem	*next;
+	struct list_elem	*elem;
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+
+	prev = NULL;
+	next = list->first;
+	elem = create_element(data, prev, next);
+	if (!elem)
+		return FAILURE;
+
+	update_links(prev, elem, next);
+
+	update_desc(list, elem, list->last);
+
+	list->nb_elements++;
+
+	return SUCCESS;
+}
+
+/** @brief Add element at the end of the list. Refer to \ref f_add */
+int32_t list_add_last(struct list_desc *list_desc, void *data)
+{
+	struct list_elem	*prev;
+	struct list_elem	*next;
+	struct list_elem	*elem;
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+	list = list_desc->priv_desc;
+
+	prev = list->last;
+	next = NULL;
+	elem = create_element(data, prev, next);
+	if (!elem)
+		return FAILURE;
+
+	update_links(prev, elem, next);
+
+	update_desc(list, list->first, elem);
+
+	list->nb_elements++;
+
+	return SUCCESS;
+}
+
+/** @brief Add element at the specified idx. Refer to \ref f_add */
+int32_t list_add_idx(struct list_desc *list_desc, void *data, uint32_t idx)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+	list = list_desc->priv_desc;
+
+	/* If there are no elements the creation of an iterator will fail */
+	if (list->nb_elements == 0 || idx == 0)
+		return list_add_first(list_desc, data);
+	if (list->nb_elements == idx)
+		return list_add_last(list_desc, data);
+
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_move(&(list->l_it), idx))
+		return FAILURE;
+
+	return iterator_insert(&(list->l_it), data, 0);
+}
+
+/** @brief Add element in ascending order. Refer to \ref f_add */
+int32_t list_add_find(struct list_desc *list_desc, void *data)
+{
+	struct list_elem	*elem;
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+	list = list_desc->priv_desc;
+
+
+	/* Based on place iterator */
+	elem = list->first;
+	while (elem) {
+		if (0 < list->comparator(elem->data, data))
+			break;
+		elem = elem->next;
+	}
+	if (elem == NULL) {
+		list->l_it.elem = list->last;
+		return iterator_insert(&(list->l_it), data, 1);
+	} else {
+		list->l_it.elem = elem;
+		return iterator_insert(&(list->l_it), data, 0);
+	}
+
+}
+
+/** @brief Edit the first element of the list. Refer to \ref f_edit */
+int32_t list_edit_first(struct list_desc *list_desc, void *new_data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+	list->first->data = new_data;
+
+	return SUCCESS;
+}
+
+/** @brief Edit the last element of the list. Refer to \ref f_edit */
+int32_t list_edit_last(struct list_desc *list_desc, void *new_data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+	list->last->data = new_data;
+
+	return SUCCESS;
+}
+
+/** @brief Edit the element at the specified idx. Refer to \ref f_edit */
+int32_t list_edit_idx(struct list_desc *list_desc, void *new_data, uint32_t idx)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+	list = list_desc->priv_desc;
+
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_move(&(list->l_it), idx))
+		return FAILURE;
+
+	return iterator_edit(&(list->l_it), new_data);
+}
+
+/** @brief Edit the element which match with cmp_data. Refer to \ref f_edit */
+int32_t list_edit_find(struct list_desc *list_desc, void *new_data,
+		       void *cmp_data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc)
+		return FAILURE;
+	list = list_desc->priv_desc;
+
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_find(&(list->l_it), cmp_data))
+		return FAILURE;
+
+	return iterator_edit(&(list->l_it), new_data);
+}
+
+/** @brief Read the first element of the list. Refer to \ref f_read */
+int32_t list_read_first(struct list_desc *list_desc, void **data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list->first)
+		return FAILURE;
+
+	*data = list->first->data;
+
+	return SUCCESS;
+}
+
+/** @brief Read the last element of the list. Refer to \ref f_read */
+int32_t list_read_last(struct list_desc *list_desc, void **data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list->last)
+		return FAILURE;
+
+	*data = list->last->data;
+
+	return SUCCESS;
+}
+
+/** @brief Read the element at the specified idx. Refer to \ref f_read */
+int32_t list_read_idx(struct list_desc *list_desc, void **data, uint32_t idx)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list)
+		return FAILURE;
+
+	if (idx >= list->nb_elements)
+		return FAILURE;
+
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_move(&(list->l_it), idx))
+		return FAILURE;
+
+	return iterator_read(&(list->l_it), data);
+}
+
+/** @brief Read the element which match with cmp_data. Refer to \ref f_read */
+int32_t list_read_find(struct list_desc *list_desc, void **data,
+		       void *cmp_data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list)
+		return FAILURE;
+
+	list = list_desc->priv_desc;
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_find(&(list->l_it), cmp_data))
+		return FAILURE;
+
+	return iterator_read(&(list->l_it), data);
+}
+
+/** @brief Read and delete the first element of the list. Refer to \ref f_get */
+int32_t list_get_first(struct list_desc *list_desc, void **data)
+{
+	struct list_elem 	*prev;
+	struct list_elem 	*next;
+	struct list_elem 	*elem;
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list->nb_elements)
+		return FAILURE;
+
+	elem = list->first;
+	prev = elem->prev;
+	next = elem->next;
+
+	update_links(prev, NULL, next);
+	update_desc(list, next, list->last);
+	list->nb_elements--;
+
+	*data = elem->data;
+	free(elem);
+
+	return SUCCESS;
+}
+
+/** @brief Read and delete the last element of the list. Refer to \ref f_get */
+int32_t list_get_last(struct list_desc *list_desc, void **data)
+{
+	struct list_elem 	*prev;
+	struct list_elem	 *next;
+	struct list_elem 	*elem;
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	if (!list->nb_elements)
+		return FAILURE;
+
+	elem = list->last;
+	prev = elem->prev;
+	next = elem->next;
+
+	update_links(prev, NULL, next);
+	update_desc(list, list->first, prev);
+	list->nb_elements--;
+
+	*data = elem->data;
+	free(elem);
+
+	return SUCCESS;
+}
+
+/** @brief Read and delete the element at idx. Refer to \ref f_get */
+int32_t list_get_idx(struct list_desc *list_desc, void **data, uint32_t idx)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_move(&(list->l_it), idx))
+		return FAILURE;
+
+	return iterator_get(&(list->l_it), data);
+}
+
+/**
+ * @brief Read and delete the element which match with cmp_data.
+ * Refer to \ref f_get
+ */
+int32_t list_get_find(struct list_desc *list_desc, void **data, void *cmp_data)
+{
+	struct _list_desc	*list;
+
+	if (!list_desc || !data)
+		return FAILURE;
+
+	*data = NULL;
+	list = list_desc->priv_desc;
+	list->l_it.elem = list->first;
+	if (SUCCESS != iterator_find(&(list->l_it), cmp_data))
+		return FAILURE;
+
+	return iterator_get(&(list->l_it), data);
+}
+
+/**
+ * @brief Create a new iterator
+ * @param iter - Where to store the reference for the new iterator
+ * @param list_desc - Reference of the list the iterator will be used for
+ * @param start - If it is true the iterator will be positioned at the first
+ * element of the list, else it will be positioned at the last.
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t iterator_init(struct iterator **iter, struct list_desc *list_desc,
+		      bool start)
+{
+	struct iterator	*it;
+
+	if (!list_desc)
+		return FAILURE;
+
+	it = (struct iterator *)calloc(1, sizeof(*it));
+	if (!it)
+		return FAILURE;
+	it->list = list_desc->priv_desc;
+	it->list->nb_iterators++;
+	it->elem = start ? it->list->first : it->list->last;
+	*iter = it;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Remove the created iterator
+ * @param iter - Reference of the iterator
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t iterator_remove(struct iterator *iter)
+{
+	struct iterator *it = iter;
+
+	if (!it)
+		return FAILURE;
+
+	it->list->nb_iterators--;
+	free(it);
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Move the position of the iteration through the list.
+ *
+ * If the required position is outside the list, the call will fail and the
+ * iterator will keep its position.
+ * @param iter - Reference of the iterator
+ * @param idx - Number of positions to be move. If positive, it will be moved
+ * forward, otherwise backwords.
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t iterator_move(struct iterator *iter, int32_t idx)
+{
+	struct iterator		*it = iter;
+	struct list_elem	*elem;
+	int32_t			dir = (idx < 0) ? -1 : 1;
+
+	if (!it)
+		return FAILURE;
+
+	idx = abs(idx);
+	elem = it->elem;
+	while (idx > 0 && elem) {
+		elem = dir > 0 ? elem->next : elem->prev;
+		idx--;
+	}
+	if (!elem)
+		return FAILURE;
+
+	it->elem = elem;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Place the iterator where cmp_data if found.
+ * @param iter - Reference to the iterator
+ * @param cmp_data - Data to be found
+ * @return
+ *  - \ref SUCCESS : On success
+ *  - \ref FAILURE : Otherwise
+ */
+int32_t iterator_find(struct iterator *iter, void *cmp_data)
+{
+	struct iterator		*it = iter;
+	struct list_elem	*elem;
+
+	if (!it)
+		return FAILURE;
+
+	elem = it->list->first;
+	while (elem) {
+		if (0 == it->list->comparator(elem->data, cmp_data)) {
+			it->elem = elem;
+			return SUCCESS;
+		}
+		elem = elem->next;
+	}
+
+	return FAILURE;
+}
+
+/**
+ * @brief Replace the data at the current position. Refer to \ref f_edit
+ */
+int32_t iterator_edit(struct iterator *iter, void *new_data)
+{
+	struct iterator *it = iter;
+
+	if (!it)
+		return FAILURE;
+
+	it->elem->data = new_data;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Read and remove the data at the current position. Refer to \ref f_get.
+ *
+ * If the current item is the last one, the iterator will be moved to the
+ * previous one.
+ */
+int32_t iterator_get(struct iterator *iter, void **data)
+{
+	struct iterator		*it = iter;
+	struct list_elem	*next;
+
+
+	if (!it || !it->elem || !data)
+		return FAILURE;
+
+	update_links(it->elem->prev, NULL, it->elem->next);
+	if (it->elem == it->list->first)
+		update_desc(it->list, it->elem->next, it->list->last);
+	else if (it->elem == it->list->last)
+		update_desc(it->list, it->list->first, it->elem->prev);
+	it->list->nb_elements--;
+
+	*data = it->elem->data;
+	if (it->elem == it->list->last)
+		next = it->elem->prev;
+	else
+		next = it->elem->next;
+	free(it->elem);
+	it->elem = next;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Read the data at the current position. Refer to \ref f_read
+ */
+int32_t iterator_read(struct iterator *iter, void **data)
+{
+	struct iterator *it = iter;
+
+	if (!it || !it->elem || !data)
+		return FAILURE;
+
+	*data = it->elem->data;
+
+	return SUCCESS;
+}
+
+/**
+ * @brief Insert an item in the list. Refer to \ref f_add
+ * @param iter
+ * @param data
+ * @param after - If true, the item will be inserted after the current position.
+ * Otherwise it will be inserted before.
+ */
+int32_t iterator_insert(struct iterator *iter, void *data, bool after)
+{
+	struct iterator		*it = iter;
+	struct list_elem	*elem;
+	struct list_desc	list_desc;
+
+	if (!it)
+		return FAILURE;
+
+	list_desc.priv_desc = iter->list;
+	if (after && it->elem == it->list->last)
+		return list_add_last(&list_desc, data);
+	if (!after && it->elem == it->list->first)
+		return list_add_first(&list_desc, data);
+
+	if (after)
+		elem = create_element(data, it->elem, it->elem->next);
+	else
+		elem = create_element(data, it->elem->prev, it->elem);
+	if (!elem)
+		return FAILURE;
+
+	update_links(elem->prev, elem, elem->next);
+
+	it->list->nb_elements++;
+
+	return SUCCESS;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/util.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/util.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,264 @@
+/***************************************************************************//**
+ *   @file   util.c
+ *   @brief  Implementation of utility functions.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2018(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <string.h>
+#include <stdlib.h>
+#include "util.h"
+#include "errno.h"
+/******************************************************************************/
+/************************** Functions Implementation **************************/
+/******************************************************************************/
+
+/**
+ * Find first set bit in word.
+ */
+uint32_t find_first_set_bit(uint32_t word)
+{
+	uint32_t first_set_bit = 0;
+
+	while (word) {
+		if (word & 0x1)
+			return first_set_bit;
+		word >>= 1;
+		first_set_bit ++;
+	}
+
+	return 32;
+}
+
+/**
+ * Find last set bit in word.
+ */
+uint32_t find_last_set_bit(uint32_t word)
+{
+	uint32_t bit = 0;
+	uint32_t last_set_bit = 32;
+
+	while (word) {
+		if (word & 0x1)
+			last_set_bit = bit;
+		word >>= 1;
+		bit ++;
+	}
+
+	return last_set_bit;
+}
+
+/**
+ * Locate the closest element in an array.
+ */
+uint32_t find_closest(int32_t val,
+		      const int32_t *array,
+		      uint32_t size)
+{
+	int32_t diff = abs(array[0] - val);
+	uint32_t ret = 0;
+	uint32_t i;
+
+	for (i = 1; i < size; i++) {
+		if (abs(array[i] - val) < diff) {
+			diff = abs(array[i] - val);
+			ret = i;
+		}
+	}
+
+	return ret;
+}
+
+/**
+ * Shift the value and apply the specified mask.
+ */
+uint32_t field_prep(uint32_t mask, uint32_t val)
+{
+	return (val << find_first_set_bit(mask)) & mask;
+}
+
+/**
+ * Get a field specified by a mask from a word.
+ */
+uint32_t field_get(uint32_t mask, uint32_t word)
+{
+	return (word & mask) >> find_first_set_bit(mask);
+}
+
+/**
+ * Log base 2 of the given number.
+ */
+int32_t log_base_2(uint32_t x)
+{
+	return find_last_set_bit(x);
+}
+
+/**
+ * Find greatest common divisor of the given two numbers.
+ */
+uint32_t greatest_common_divisor(uint32_t a,
+				 uint32_t b)
+{
+	uint32_t div;
+	uint32_t common_div = 1;
+
+	if ((a == 0) || (b == 0))
+		return max(a, b);
+
+	for (div = 1; (div <= a) && (div <= b); div++)
+		if (!(a % div) && !(b % div))
+			common_div = div;
+
+	return common_div;
+}
+
+/**
+ * Calculate best rational approximation for a given fraction.
+ */
+void rational_best_approximation(uint32_t given_numerator,
+				 uint32_t given_denominator,
+				 uint32_t max_numerator,
+				 uint32_t max_denominator,
+				 uint32_t *best_numerator,
+				 uint32_t *best_denominator)
+{
+	uint32_t gcd;
+
+	gcd = greatest_common_divisor(given_numerator, given_denominator);
+
+	*best_numerator = given_numerator / gcd;
+	*best_denominator = given_denominator / gcd;
+
+	if ((*best_numerator > max_numerator) ||
+	    (*best_denominator > max_denominator)) {
+		*best_numerator = 0;
+		*best_denominator = 0;
+	}
+}
+
+/**
+ * Calculate the number of set bits.
+ */
+uint32_t hweight8(uint32_t word)
+{
+	uint32_t count = 0;
+
+	while (word) {
+		if (word & 0x1)
+			count++;
+		word >>= 1;
+	}
+
+	return count;
+}
+
+/**
+ * Calculate the quotient and the remainder of an integer division.
+ */
+uint64_t do_div(uint64_t* n,
+		uint64_t base)
+{
+	uint64_t mod = 0;
+
+	mod = *n % base;
+	*n = *n / base;
+
+	return mod;
+}
+
+/**
+ * Unsigned 64bit divide with 64bit divisor and remainder
+ */
+uint64_t div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder)
+{
+	*remainder = dividend % divisor;
+
+	return dividend / divisor;
+}
+
+/**
+ * Unsigned 64bit divide with 32bit divisor with remainder
+ */
+uint64_t div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder)
+{
+	*remainder = do_div(&dividend, divisor);
+
+	return dividend;
+}
+
+/**
+ * Unsigned 64bit divide with 32bit divisor
+ */
+uint64_t div_u64(uint64_t dividend, uint32_t divisor)
+{
+	uint32_t remainder;
+
+	return div_u64_rem(dividend, divisor, &remainder);
+}
+
+/**
+ * Converts from string to int32_t
+ * @param *str
+ * @return int32_t
+ */
+int32_t str_to_int32(const char *str)
+{
+	char *end;
+	int32_t value = strtol(str, &end, 0);
+
+	if (end == str)
+		return -EINVAL;
+	else
+		return value;
+}
+
+/**
+ * Converts from string to uint32_t
+ * @param *str
+ * @return uint32_t
+ */
+uint32_t srt_to_uint32(const char *str)
+{
+	char *end;
+	uint32_t value = strtoul(str, &end, 0);
+
+	if (end == str)
+		return -EINVAL;
+	else
+		return value;
+}
diff -r 000000000000 -r 3afcd581558d app/noos_mbed/util/xml.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/noos_mbed/util/xml.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,336 @@
+/***************************************************************************//**
+ *   @file   xml.c
+ *   @brief  Implementation of xml
+ *   @author Cristian Pop (cristian.pop@analog.com)
+********************************************************************************
+ * Copyright 2019(c) Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *  - Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  - Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  - Neither the name of Analog Devices, Inc. nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *  - The use of this software may or may not infringe the patent rights
+ *    of one or more patent holders.  This license does not release you
+ *    from the requirement that you obtain separate licenses from these
+ *    patent holders to use this software.
+ *  - Use of the software either in source or binary form, must be run
+ *    on or directly connected to an Analog Devices Inc. component.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <string.h>
+#include <stdlib.h>
+#include "xml.h"
+#include "error.h"
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * create attribute
+ * @param **attribute pointer to new attribute
+ * @param *name attribute name
+ * @param *value attribute value
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_create_attribute(struct xml_attribute **attribute, char *name,
+			     const char *value)
+{
+	if(!attribute)
+		return FAILURE;
+	if(!name)
+		return FAILURE;
+	if(!value)
+		return FAILURE;
+
+	*attribute = calloc(1, sizeof(struct xml_attribute));
+	if (!(*attribute))
+		return FAILURE;
+
+	(*attribute)->name = calloc(1, strlen(name) + 1);
+	if (!(*attribute)->name) {
+		free(*attribute);
+		return FAILURE;
+	}
+	strcpy((*attribute)->name, name);
+
+	(*attribute)->value = calloc(1, strlen(value) + 1);
+	if (!(*attribute)->value) {
+		free((*attribute)->name);
+		free(*attribute);
+		return FAILURE;
+	}
+	strcpy((*attribute)->value, value);
+
+	return SUCCESS;
+}
+
+/**
+ * add attribute to a xml node
+ * @param *node pointer to the node, where the attribute is inserted
+ * @param *attribute attribute
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_add_attribute(struct xml_node *node,
+			  struct xml_attribute *attribute)
+{
+	if(!node)
+		return FAILURE;
+	if(!attribute)
+		return FAILURE;
+
+	if (!node->attributes) {
+		node->attributes = calloc(1, sizeof(struct xml_attribute*));
+		if (!node->attributes)
+			return FAILURE;
+	} else {
+		struct xml_attribute **buff = realloc(node->attributes,
+						      (node->attr_cnt + 1) * sizeof(struct xml_attribute*));
+		if (!buff)
+			return FAILURE;
+		node->attributes = buff;
+	}
+	node->attributes[node->attr_cnt] = attribute;
+	node->attr_cnt++;
+
+	return SUCCESS;
+}
+
+/**
+ * create new xml node
+ * @param **node pointer to the new node
+ * @param *name
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_create_node(struct xml_node **node, char *name)
+{
+	if(!node)
+		return FAILURE;
+	if(!name)
+		return FAILURE;
+
+	*node = calloc(1, sizeof(struct xml_node));
+	if (!(*node))
+		return FAILURE;
+	(*node)->name = calloc(1, strlen(name) + 1);
+	if (!(*node)->name) {
+		free(*node);
+		return FAILURE;
+	}
+	strcpy((*node)->name, name);
+
+	return SUCCESS;
+}
+
+/**
+ * add child node to a parent node
+ * @param *node_parent
+ * @param *node_child
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_add_node(struct xml_node *node_parent, struct xml_node *node_child)
+{
+	if(!node_parent)
+		return FAILURE;
+	if(!node_child)
+		return FAILURE;
+
+	if (!node_parent->children) {
+		node_parent->children = calloc(1, sizeof(struct xml_node*));
+		if (!node_parent->children)
+			return FAILURE;
+	} else {
+		struct xml_node **buff = realloc(node_parent->children,
+						 (node_parent->children_cnt + 1) * sizeof(struct xml_node*));
+		if (!buff)
+			return FAILURE;
+		node_parent->children = buff;
+	}
+	node_parent->children[node_parent->children_cnt] = node_child;
+	node_parent->children_cnt++;
+
+	return SUCCESS;
+}
+
+/**
+ * delete attribute
+ * @param *attribute
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_delete_attribute(struct xml_attribute *attribute)
+{
+	free(attribute->name);
+	free(attribute->value);
+	free(attribute);
+
+	return SUCCESS;
+}
+
+/**
+ * delete xml node
+ * @param *node
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_delete_node(struct xml_node *node)
+{
+	uint16_t i;
+	for (i = 0; i < node->attr_cnt; i++) {
+		xml_delete_attribute(node->attributes[i]);
+	}
+	for (i = 0; i < node->children_cnt; i++) {
+		xml_delete_node(node->children[i]);
+	}
+	free(node->name);
+	free(node->attributes);
+	free(node->children);
+	free(node);
+
+	return SUCCESS;
+}
+
+/**
+ * print string to xml_document.
+ * @param *doc
+ * @param *data to be written.
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+static ssize_t xml_print_to_doc(struct xml_document *doc, char *data)
+{
+	uint32_t calc_len, print_len;
+
+	calc_len = strlen(data) + 1;
+	char *buff = realloc(doc->buff, doc->index + calc_len);
+	if (!buff)
+		return FAILURE;
+	doc->buff = buff;
+	print_len = sprintf(&(doc->buff[doc->index]), "%s", data);
+	if(print_len != calc_len - 1)
+		return FAILURE;
+	doc->index +=print_len;
+
+	return SUCCESS;
+}
+
+/**
+ * print xml tree into a xml document
+ * @param **document
+ * @param *node pointer to parent node, that contains the xml tree
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_create_document(struct xml_document **document,
+			    struct xml_node *node)
+{
+	uint16_t i;
+	ssize_t ret;
+	struct xml_document *doc;
+
+	if(!document)
+		return FAILURE;
+	if(!node)
+		return FAILURE;
+
+	if (!(*document)) {
+		*document = calloc(1, sizeof(struct xml_document));
+		if (!(*document))
+			return FAILURE;
+	}
+	doc = *document;
+
+	ret = xml_print_to_doc(doc, "<");
+	if (ret < 0)
+		goto error;
+	ret = xml_print_to_doc(doc, node->name);
+	if (ret < 0)
+		goto error;
+	ret = xml_print_to_doc(doc, " ");
+	if (ret < 0)
+		goto error;
+
+	for (i = 0; i < node->attr_cnt; i++) {
+		ret = xml_print_to_doc(doc, node->attributes[i]->name);
+		if (ret < 0)
+			goto error;
+		ret = xml_print_to_doc(doc, "=\"");
+		if (ret < 0)
+			goto error;
+		ret = xml_print_to_doc(doc, node->attributes[i]->value);
+		if (ret < 0)
+			goto error;
+		ret = xml_print_to_doc(doc, "\" ");
+		if (ret < 0)
+			goto error;
+	}
+
+	if (node->children_cnt == 0) {
+		ret = xml_print_to_doc(doc, "/>\n");
+		if (ret < 0)
+			goto error;
+
+		return SUCCESS;
+	} else {
+		ret = xml_print_to_doc(doc, ">\n");
+		if (ret < 0)
+			goto error;
+	}
+
+	for (i = 0; i < node->children_cnt; i++) {
+		ret = xml_create_document(document, node->children[i]);
+		if (ret < 0)
+			return ret;
+	}
+
+	ret = xml_print_to_doc(doc, "</");
+	if (ret < 0)
+		goto error;
+	ret = xml_print_to_doc(doc, node->name);
+	if (ret < 0)
+		goto error;
+	ret = xml_print_to_doc(doc, ">\n");
+	if (ret < 0)
+		goto error;
+
+	return SUCCESS;
+
+error:
+	free(doc->buff);
+	free(doc);
+
+	return FAILURE;
+}
+
+/**
+ * delete xml document
+ * @param **document pointer to document
+ * @return SUCCESS in case of success or negative value otherwise
+ */
+ssize_t xml_delete_document(struct xml_document *document)
+{
+	free(document->buff);
+	free(document);
+
+	return SUCCESS;
+}
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_data_capture.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_data_capture.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,311 @@
+/***************************************************************************//**
+ *   @file    ad7606_data_capture.c
+ *   @brief   Data capture interface for AD7606 IIO application
+ *   @details This module handles the AD7606 data capturing
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "app_config.h"
+#include "ad7606_data_capture.h"
+#include "ad7606_support.h"
+#include "gpio_extra.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+/* Device instance for background adc conversion callback */
+static volatile struct ad7606_dev *dev = NULL;
+
+/*
+ *@enum		acq_buffer_state_e
+ *@details	Enum holding the data acquisition buffer states
+ **/
+typedef enum {
+	BUF_AVAILABLE,
+	BUF_FULL
+} acq_buffer_state_e;
+
+/*
+ *@struct	acq_buf_t
+ *@details	Structure holding the data acquisition buffer parameters
+ **/
+typedef struct {
+	acq_buffer_state_e state;
+#if (ADC_RESOLUTION > 16)
+	uint32_t data[NO_OF_SAMPLES];
+#else
+	uint16_t data[NO_OF_SAMPLES];
+#endif
+} acq_buf_t;
+
+/* ADC data acquisition buffers */
+static volatile acq_buf_t acq_buffer[2];
+
+/* Flag to indicate background data conversion status */
+static volatile bool start_background_conversion = false;
+
+/* Active channels to be captured */
+static volatile uint32_t active_channels = 0;
+
+/* Minimum number of bytes to be read from device */
+static volatile uint8_t min_bytes_to_read = 0;
+
+/* Minimum number of samples to be stored into acquisition buffer */
+static volatile uint8_t min_samples_to_store = 0;
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/*!
+ * @brief	Function to init the data capture for AD7606 device
+ * @param	device[in]- Device instance
+ * @return	none
+ */
+int32_t iio_data_capture_init(struct ad7606_dev *device)
+{
+	/* Save the device structure for background conversion */
+	dev = malloc(sizeof(struct ad7606_dev *));
+	if (!dev) {
+		return FAILURE;
+	}
+
+	memcpy(&dev, &device, sizeof(dev));
+
+	return SUCCESS;
+}
+
+
+/*!
+ * @brief	Function to read the ADC raw data for single channel
+ * @param	device[in]- Device instance
+ * @param	chn[in] - Input channel
+ * @return	adc raw data/sample
+ */
+int32_t single_data_read(void *device, uint8_t chn, polarity_e polarity)
+{
+	int32_t adc_data = 0;
+	uint32_t adc_raw[ADC_RESOLUTION] = { 0 };
+
+	if (ad7606_read(device, adc_raw) != SUCCESS) {
+		adc_raw[chn] = 0;
+	}
+
+	if (polarity == BIPOLAR) {
+		/* Check for negative adc value for bipolar inputs */
+		if (adc_raw[chn] >= ADC_MAX_COUNT_BIPOLAR) {
+			/* Take the 2s complement for the negative counts (>full scale value) */
+			adc_data = ADC_MAX_COUNT_UNIPOLAR - adc_raw[chn];
+			adc_data = 0 - adc_data;
+		} else {
+			adc_data = adc_raw[chn];
+		}
+	} else {
+		adc_data = adc_raw[chn];
+	}
+
+	return adc_data;
+}
+
+
+/*!
+ * @brief	Function to read the ADC buffered raw data
+ * @param	device[in]- Device instance
+ * @param	pbuf[out] - Buffer to load ADC raw data
+ * @param	bytes[in] - Number of bytes to be read
+ * @param	chn_mask[in] - Active channels mask
+ * @return	none
+ * @details	This function reads the data from any available acquisition
+ *			buffer (the buffer which is full). The intention here is to
+ *			have most recent data fetched from the device.
+ */
+void buffered_data_read(char *pbuf, size_t bytes, size_t offset,
+			uint32_t chn_mask)
+{
+	uint8_t mask = 0x1;
+
+	if (acq_buffer[0].state == BUF_FULL) {
+		/* Copy the acquisition buffer 0 into output data buffer */
+		memcpy(pbuf, acq_buffer[0].data, bytes);
+	} else if(acq_buffer[1].state == BUF_FULL) {
+		/* Copy the acquisition buffer 1 into output data buffer */
+		memcpy(pbuf, acq_buffer[1].data, bytes);
+	} else {
+		/* This case should never reach. At any instance, at least one
+		 * of the buffer should be full */
+	}
+
+	/* Find the minimum number of bytes to be read from device during
+	 * background conversion (Reading all channels adds extra overhead,
+	 * so restrict the minimum reads to whatever is possible) */
+	if (offset == 0) {
+		active_channels = chn_mask;
+		for (uint8_t chn = 1; chn <= NO_OF_CHANNELS; chn++) {
+			if (active_channels & mask) {
+#if (ADC_RESOLUTION == 18)
+				/* 1 sample = 3 bytes (max 18 bytes) */
+				min_bytes_to_read = chn * 3;
+				if (min_bytes_to_read > ADC_RESOLUTION) {
+					min_bytes_to_read = ADC_RESOLUTION;
+				}
+#else
+				/* 1 sample = 2 bytes */
+				min_bytes_to_read = chn * 2;
+#endif
+				min_samples_to_store = chn;
+			}
+
+			mask <<= 1;
+		}
+	}
+}
+
+
+/*!
+ * @brief	Function to perform background ADC conversion
+ * @return	none
+ * @details	This is an External Interrupt callback function/ISR, which is tied up to
+ *			falling edge trigger of BUSY pin. It is trigered when previous data
+ *			conversion is over and BUSY line goes low. Upon trigger, conversion
+ *			results are read into acquisition buffer and next conversion is triggered.
+ *			This continues until background conversion is stopped.
+ */
+void do_conversion_callback(void)
+{
+	static uint16_t sample_cnt = 0;
+#if (ADC_RESOLUTION == 18)
+	uint8_t arr_indx = 0;
+	uint8_t offset_end = 2;
+	uint8_t mask = 0xff;
+#else
+	uint8_t mask = 0x01;
+#endif
+
+	if (start_background_conversion == true) {
+
+		/* Read the conversion result for required number of bytes */
+		(void)ad7606_read_conversion_data(dev, min_bytes_to_read);
+
+		/* Extract the channels data based on the active channels
+		 * Note: The extraction of data based on active channel needs
+		 * to be done since its not possible to capture individual
+		 * channel in AD7606 devices */
+		for (uint8_t cnt = 0; cnt < min_samples_to_store; cnt++) {
+			if (active_channels & mask) {
+				/* Fill the buffer based on the availability */
+				if (acq_buffer[0].state == BUF_AVAILABLE) {
+#if (ADC_RESOLUTION == 18)
+					acq_buffer[0].data[sample_cnt] =
+						(((uint32_t)(dev->data[arr_indx] & mask) << 16) | 			// MSB
+						 ((uint32_t)dev->data[arr_indx+1] << 8) |
+						 ((uint32_t)(dev->data[arr_indx+2] >> (8-offset_end))));	// LSB
+#else
+					acq_buffer[0].data[sample_cnt] =
+						(uint16_t)(((uint16_t)dev->data[cnt << 1] << 8) |	// MSB
+							   dev->data[(cnt << 1) + 1]);					// LSB
+#endif
+				} else if (acq_buffer[1].state == BUF_AVAILABLE) {
+#if (ADC_RESOLUTION == 18)
+					acq_buffer[1].data[sample_cnt] =
+						(((uint32_t)(dev->data[arr_indx] & mask) << 16) | 			// MSB
+						 ((uint32_t)dev->data[arr_indx + 1] << 8) |
+						 ((uint32_t)(dev->data[arr_indx + 2] >> (8 - offset_end))));// LSB
+#else
+					acq_buffer[1].data[sample_cnt] =
+						(uint16_t)(((uint16_t)dev->data[cnt << 1] << 8) |	// MSB
+							   dev->data[(cnt << 1) + 1]);					// LSB
+#endif
+				} else {
+					/* This case should never reach */
+				}
+
+				sample_cnt++;
+			}
+
+#if (ADC_RESOLUTION == 18)
+			arr_indx += 2;
+
+			/* Track array to reach at the middle (9 bytes apart) to change the offsets */
+			if (arr_indx == ((ADC_RESOLUTION / 2) -1)) {
+				arr_indx++;
+				offset_end = 2;
+				mask = 0xff;
+			} else {
+				mask = (0xff >> offset_end);
+				offset_end += 2;
+			}
+#endif
+
+			if (sample_cnt >= NO_OF_SAMPLES) {
+				break;
+			}
+
+			mask <<= 1;
+		}
+
+		/* Monitor buffer full status based on active buffer state */
+		if (sample_cnt >= NO_OF_SAMPLES) {
+			if (acq_buffer[0].state == BUF_AVAILABLE) {
+				/* Buffer 0 is set FULL */
+				acq_buffer[0].state =  BUF_FULL;
+
+				/* Buffer 1 is set available to store next data samples */
+				acq_buffer[1].state =  BUF_AVAILABLE;
+			} else if (acq_buffer[1].state == BUF_AVAILABLE) {
+				/* Buffer 1 is set FULL */
+				acq_buffer[1].state =  BUF_FULL;
+
+				/* Buffer 0 is set available to store next data samples */
+				acq_buffer[0].state =  BUF_AVAILABLE;
+			} else {
+				/* This case should never reach */
+			}
+
+			sample_cnt = 0;
+		}
+
+		/* Trigger next conversion */
+		(void)ad7606_convst(dev);
+	}
+}
+
+
+/*!
+ * @brief	Function to start bakground ADC conversion
+ * @return	none
+ */
+void start_background_data_conversion(void)
+{
+	/* Start conversion */
+	(void)ad7606_convst(dev);
+	start_background_conversion = true;
+}
+
+
+/*!
+ * @brief	Function to stop bakground ADC conversion
+ * @return	none
+ */
+void stop_background_data_conversion(void)
+{
+	start_background_conversion = false;
+}
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_data_capture.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_data_capture.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,51 @@
+/***************************************************************************//**
+ *   @file   ad7606_data_capture.h
+ *   @brief  Header for AD7606 data capture interfaces
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef AD7606_DATA_CAPTURE_H_
+#define AD7606_DATA_CAPTURE_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stddef.h>
+
+#include "ad7606.h"
+#include "ad7606_support.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/* This is a number of bytes read in single query of read IIO buffer */
+#define	IIO_DATA_BUFFER_RD_SIZE	(256)
+
+/* Total number of samples to be read in one go are equal to buffer read size */
+#define NO_OF_SAMPLES			(IIO_DATA_BUFFER_RD_SIZE)
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Public Declarations *********************************/
+/******************************************************************************/
+
+int32_t iio_data_capture_init(struct ad7606_dev *device);
+int32_t single_data_read(void *device, uint8_t chn, polarity_e polarity);
+void buffered_data_read(char *pbuf, size_t bytes, size_t offset,
+			uint32_t chn_mask);
+void do_conversion_callback(void);
+void start_background_data_conversion(void);
+void stop_background_data_conversion(void);
+
+#endif /* AD7606_DATA_CAPTURE_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_support.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_support.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,85 @@
+/*************************************************************************//**
+ *   @file   ad7606_support.c
+ *   @brief  AD7606 device No-OS driver supports
+******************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*****************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+#include "app_config.h"
+#include "ad7606_support.h"
+#include "ad7606_data_capture.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/*!
+ * @brief	Function to convert adc raw data into equivalent voltage
+ * @param	adc_raw[in] - ADC raw data
+ * @param	scale[in] - ADC raw to voltage conversion scale
+ * @return	equivalent voltage
+ */
+float convert_adc_raw_to_voltage(int32_t adc_raw, float scale)
+{
+	float voltage;
+
+	/* Convert adc data into equivalent voltage.
+	 * scale = (chn_range / MAX_ADC_CNT * 1000) as defined in iio_ad7606.c
+	 * */
+	voltage = (adc_raw  * (scale / 1000));
+
+	return voltage;
+}
+
+
+/*!
+ * @brief	Function to get the polarity of analog input
+ * @param	chn_range_bits[in] - Bits from the channel range register
+ * @return	UNIPOLAR or BIPOLAR
+ */
+polarity_e ad7606_get_input_polarity(uint8_t chn_range_bits)
+{
+	polarity_e polarity;
+
+	if (chn_range_bits >= AD7606C_UNIPOLAR_RANGE_MIN
+	    && chn_range_bits <= AD7606C_UNIPOLAR_RANGE_MAX) {
+		polarity = UNIPOLAR;
+	} else {
+		polarity = BIPOLAR;
+	}
+
+	return polarity;
+}
+
+
+/*!
+ * @brief	Read the num_of_bytes from previous conversion
+ * @param	dev[in]- Device instance
+ * @param	num_of_bytes[in] - Number of bytes to read from previous conversion
+ * @return	SUCCESS in case of success, FAILURE otherwise
+ */
+int32_t ad7606_read_conversion_data(struct ad7606_dev *dev,
+				    uint8_t num_of_bytes)
+{
+	memset(dev->data, 0, sizeof(dev->data));
+	return spi_write_and_read(dev->spi_desc, dev->data, num_of_bytes);
+}
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_support.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_support.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,76 @@
+/***************************************************************************//**
+ *   @file   ad7606_support.h
+ *   @brief  Header for AD7606 No-OS driver supports
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef AD7606_SUPPORT_H_
+#define AD7606_SUPPORT_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "ad7606.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/* Offset b/w two channel selections in CHx_RANGE register */
+#define CHANNEL_RANGE_MSK_OFFSET	4
+
+/* AD7606_REG_OVERSAMPLING */
+#define AD7606_OVERSAMPLING_MSK		GENMASK(3,0)
+
+/* Default channel range for AD7606 devices */
+#define DEFAULT_CHN_RANGE	(10.0)
+
+/* Diagnostic channels Mux configurations */
+#define AD7606_DIAGN_MUX_CH_MSK(ch)			(GENMASK(2, 0) << (3 * ((ch) % 2)))
+#define AD7606_DIAGN_MUX_CH_VAL(ch, val)	(val << (3 * ((ch) % 2)))
+
+/* Diagnostic channels Mux select bits */
+#define ANALOG_INPUT_MUX	0X00
+#define TEMPERATURE_MUX		0x01
+#define VREF_MUX			0X02
+#define ALDO_MUX			0X03
+#define DLDO_MUX			0X04
+#define	VDRIVE_MUX			0x05
+
+/* Diagnostic Mux multiplers */
+#define VREF_MUX_MULTIPLIER		4.0
+
+/* Unipolar inputs range bits for AD7606C */
+#define AD7606C_UNIPOLAR_RANGE_MIN	5
+#define AD7606C_UNIPOLAR_RANGE_MAX	7
+
+/* Number of AD7606 registers */
+#define NUM_OF_REGISTERS	0x2F
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+/* Analog input polarity */
+typedef enum {
+	UNIPOLAR,
+	BIPOLAR
+} polarity_e;
+
+/******************************************************************************/
+/************************ Public Declarations *********************************/
+/******************************************************************************/
+
+float convert_adc_raw_to_voltage(int32_t adc_raw, float scale);
+int32_t ad7606_read_conversion_data(struct ad7606_dev *dev, uint8_t bytes);
+polarity_e ad7606_get_input_polarity(uint8_t chn_range_bits);
+
+#endif /* AD7606_SUPPORT_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_user_config.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_user_config.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,161 @@
+/*************************************************************************//**
+ *   @file   ad7606_user_config.c
+ *   @brief  User configuration file for AD7606 device
+******************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*****************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+
+#include "app_config.h"
+#include "ad7606_user_config.h"
+#include "ad7606_support.h"
+#include "spi_extra.h"
+#include "gpio_extra.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+#define		USER_CONFIG_RANGE	(DEFAULT_CHN_RANGE * 1000)
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+struct gpio_init_param gpio_init_reset = {
+	.number = RESET_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_convst = {
+	.number = CONVST_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_busy = {
+	.number = BUSY_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_osr0 = {
+	.number = OSR0_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_osr1 = {
+	.number = OSR1_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_osr2 = {
+	.number = OSR2_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_range= {
+	.number = RANGE_PIN,
+	.extra = NULL
+};
+
+struct gpio_init_param gpio_init_stdby = {
+	.number = STDBY_PIN,
+	.extra = NULL
+};
+
+
+/* Define SPI extra init parameters structure */
+mbed_spi_init_param spi_init_extra_params = {
+	.spi_clk_pin = SPI_SCK,
+	.spi_miso_pin = SPI_MISO,
+	.spi_mosi_pin = SPI_MOSI
+};
+
+/* Initialize the AD7606 device structure */
+struct ad7606_init_param ad7606_init_str = {
+	// Define SPI init parameters structure
+	{
+		.max_speed_hz = 22500000,   	// Max SPI Speed
+		.chip_select = SPI_SS,   		// Chip Select
+		.mode = SPI_MODE_2,   			// CPOL = 1, CPHA = 1
+		.extra = &spi_init_extra_params	// SPI extra configurations
+	},
+
+	.gpio_reset = &gpio_init_reset,
+	.gpio_convst = &gpio_init_convst,
+	.gpio_busy = &gpio_init_busy,
+	.gpio_stby_n = &gpio_init_stdby,
+	.gpio_range = &gpio_init_range,
+	.gpio_os0 = &gpio_init_osr0,
+	.gpio_os1 = &gpio_init_osr1,
+	.gpio_os2 = &gpio_init_osr2,
+	.gpio_par_ser = NULL,
+
+	.device_id = ACTIVE_DEVICE,
+	.oversampling = { 0, AD7606_OSR_1 },
+	.sw_mode = true,
+
+	// Below settings (except range) applies only to AD7606B and AD7606C devices
+
+	/* Device Configs */
+	{
+		.op_mode = AD7606_NORMAL,
+		.dout_format = AD7606_1_DOUT,
+		.ext_os_clock = false,
+		.status_header = false
+	},
+
+	/* Diagnostic flags setting */
+	{
+		.rom_crc_err_en = false,
+		.mm_crc_err_en = false,
+		.int_crc_err_en = false,
+		.spi_write_err_en = false,
+		.spi_read_err_en = false,
+		.busy_stuck_high_err_en = false,
+		.clk_fs_os_counter_en = false,
+		.interface_check_en = false
+	},
+
+	/* Default offset for all channels */
+	.offset_ch = { 0, 0, 0, 0, 0, 0, 0, 0 },
+
+	/* Default phase (0x00) for all channels */
+	.phase_ch = { 0, 0, 0, 0, 0, 0, 0, 0 },
+
+	/* Default gain (0x00) for all channels */
+	.gain_ch = { 0, 0, 0, 0, 0, 0, 0, 0 },
+
+	/* Default range for all channels */
+	.range_ch = {
+#if defined(DEV_AD7609)
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, true},
+#else
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false},
+		{-USER_CONFIG_RANGE, USER_CONFIG_RANGE, false}
+#endif
+	}
+};
diff -r 000000000000 -r 3afcd581558d app/src/ad7606_user_config.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/ad7606_user_config.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,34 @@
+/*************************************************************************//**
+ *   @file   ad7606_user_config.h
+ *   @brief  Header for AD7606 user configuration file
+******************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*****************************************************************************/
+
+#ifndef _AD7606_USER_CONFIG_H_
+#define _AD7606_USER_CONFIG_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdint.h>
+#include "ad7606.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/********************** Variables and User Defined Data Types *****************/
+/******************************************************************************/
+
+extern struct ad7606_init_param ad7606_init_str;
+
+#endif /* end of _AD7606_USER_CONFIG_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/app_config.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/app_config.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,125 @@
+/*************************************************************************//**
+ *   @file   app_config.h
+ *   @brief  Configuration file for AD7606 device applications
+******************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+*
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*****************************************************************************/
+
+#ifndef _APP_CONFIG_H_
+#define _APP_CONFIG_H_
+
+#include <stdint.h>
+#include <PinNames.h>
+
+// **** Note for User: ACTIVE_DEVICE selection ****//
+/* Define the device type here from the list of below device type defines
+ * (one at a time. Defining more than one device can result into compile error).
+ * e.g. #define DEV_AD7606B -> This will make AD7606B as an ACTIVE_DEVICE.
+ * The ACTIVE_DEVICE is default set to AD7606B if device type is not defined.
+ * */
+
+#define DEV_AD7606B
+
+
+#if defined(DEV_AD7605_4)
+#define ACTIVE_DEVICE		ID_AD7605_4
+#define ACTIVE_DEVICE_NAME	"AD7605-4-phy"
+#elif defined(DEV_AD7606_4)
+#define ACTIVE_DEVICE		ID_AD7606_4
+#define ACTIVE_DEVICE_NAME	"AD7606-4-phy"
+#elif defined(DEV_AD7606_6)
+#define ACTIVE_DEVICE		ID_AD7606_6
+#define ACTIVE_DEVICE_NAME	"AD7606-6-phy"
+#elif defined(DEV_AD7606_8)
+#define ACTIVE_DEVICE		ID_AD7606_8
+#define ACTIVE_DEVICE_NAME	"AD7606-8-phy"
+#elif defined(DEV_AD7606B)
+#define ACTIVE_DEVICE		ID_AD7606B
+#define ACTIVE_DEVICE_NAME	"AD7606B-phy"
+#elif defined(DEV_AD7606C_16)
+#define ACTIVE_DEVICE		ID_AD7606C_16
+#define ACTIVE_DEVICE_NAME	"AD7606C-16-phy"
+#elif defined(DEV_AD7606C_18)
+#define ACTIVE_DEVICE		ID_AD7606C_18
+#define ACTIVE_DEVICE_NAME	"AD7606C-18-phy"
+#elif defined(DEV_AD7608)
+#define ACTIVE_DEVICE		ID_AD7608
+#define ACTIVE_DEVICE_NAME	"AD7608-phy"
+#elif defined(DEV_AD7609)
+#define ACTIVE_DEVICE		ID_AD7609
+#define ACTIVE_DEVICE_NAME	"AD7609-phy"
+#else
+#warning No/Unsupported ADxxxxy symbol defined. AD7606B defined
+#define DEV_AD7606B
+#define ACTIVE_DEVICE		ID_AD7606B
+#define ACTIVE_DEVICE_NAME	"AD7606B-phy"
+#endif
+
+
+#if defined(DEV_AD7605_4)
+#define	NO_OF_CHANNELS		4
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606_4)
+#define	NO_OF_CHANNELS		4
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606_6)
+#define	NO_OF_CHANNELS		6
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606_8)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606B)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606C_16)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		16
+#elif defined(DEV_AD7606C_18)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		18
+#elif defined(DEV_AD7608)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		18
+#elif defined(DEV_AD7609)
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		18
+#else
+/* Default config for AD7606B */
+#define	NO_OF_CHANNELS		8
+#define ADC_RESOLUTION		16
+#endif
+
+/* ADC max count (full scale value) for unipolar inputs */
+#define ADC_MAX_COUNT_UNIPOLAR	(uint32_t)((1 << ADC_RESOLUTION) - 1)
+
+/* ADC max count (full scale value) for bipolar inputs */
+#define ADC_MAX_COUNT_BIPOLAR	(uint32_t)(1 << (ADC_RESOLUTION-1))
+
+// Pin mapping of AD7606 w.r.t Arduino (reference: PinNames.h)
+#define SPI_SS		D10
+#define SPI_MOSI	D11
+#define SPI_MISO	D12
+#define SPI_SCK		D13
+
+#define UART_TX		USBTX
+#define	UART_RX		USBRX
+
+#define	OSR0_PIN	D2
+#define	OSR1_PIN	D3
+#define	OSR2_PIN	D4
+#define RESET_PIN	D5
+#define CONVST_PIN	D6
+#define BUSY_PIN	D7
+#define RANGE_PIN	D8
+#define STDBY_PIN	D9
+
+#define LED_GREEN	LED3
+
+
+#endif //_APP_CONFIG_H_
diff -r 000000000000 -r 3afcd581558d app/src/iio_ad7606.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/iio_ad7606.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,1702 @@
+/***************************************************************************//**
+ *   @file    iio_ad7606.c
+ *   @brief   Implementation of AD7606 IIO application interfaces
+ *   @details This module acts as an interface for AD7606 IIO application
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <inttypes.h>
+#include <string.h>
+#include <errno.h>
+
+#include "app_config.h"
+
+#include "tinyiiod.h"
+#include "iio_ad7606.h"
+#include "iio_ad7606_attr.h"
+#include "iio_app.h"
+#include "iio_transport.h"
+
+#include "platform_support.h"
+#include "spi_extra.h"
+#include "gpio_extra.h"
+#include "uart_extra.h"
+#include "irq_extra.h"
+
+#include "ad7606.h"
+#include "ad7606_data_capture.h"
+#include "ad7606_support.h"
+#include "ad7606_user_config.h"
+
+/******************************************************************************/
+/************************ Macros/Constants ************************************/
+/******************************************************************************/
+
+/* ADC data to Voltage conversion scale factor for IIO client */
+#define DEFAULT_SCALE		((DEFAULT_CHN_RANGE / ADC_MAX_COUNT_BIPOLAR) * 1000)
+
+/* Select open wire detection mode (disable to select auto mode) */
+#define MANUAL_OPEN_DETECT
+
+/* Open detect threshold @50K Rpd as per datasheet */
+#define OPEN_DETECT_THRESHOLD_RPD50K	15
+
+/* Number of conversions to be performed before detecting open wire */
+#define OPEN_DETECT_AUTO_MODE_CNTS		10
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+* IIO application instance descriptor.
+*/
+static struct iio_app_desc *iio_app_desc;
+
+/**
+ * Device name.
+ */
+static const char dev_name[] = ACTIVE_DEVICE_NAME;
+
+/**
+ * Pointer to the struct representing the AD7606 IIO device
+ */
+static struct ad7606_dev *p_ad7606_dev = NULL;
+
+
+/* Device attributes with default values */
+
+/* Power down mode values string representation (possible values specified in datasheet) */
+static char *operating_mode_str[] = {
+	"0  (Normal Mode)",
+	"1  (Standby Mode)",
+	"2  (Auto Standby Mode)",
+	"3  (Shutdown Mode)"
+};
+
+/* Bandwidth values string */
+static char *bandwidth_str[] = {
+	"0  (Low)",
+	"1  (High)"
+};
+
+/* Channel range values string representation (possible values specified in datasheet) */
+static char *chn_range_str[] = {
+#if defined(DEV_AD7606B)
+	"0  (+/-2.5V SE)", "1  (+/-5.0V SE)", "2  (+/-10.0V SE)", "3  (+/-10.0V SE)",
+	"4  (+/-10.0V SE)", "5  (+/-10.0V SE)", "6  (+/-10.0V SE)", "7  (+/-10.0V SE)",
+	"8  (+/-10.0V SE)", "9  (+/-10.0V SE)", "10  (+/-10.0V SE)", "11  (+/-10.0V SE)",
+#elif defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"0  (+/-2.5V SE)", "1  (+/-5.0V SE)", "2  (+/-6.25V SE)", "3  (+/-10.0V SE)",
+	"4  (+/-12.5V SE)", "5  (+5.0V SE)", "6  (+10.0V SE)", "7  (+12.5V SE)",
+	"8  (+/-5.0V DE)", "9  (+/-10.0V DE)", "10  (+/-12.5V DE)", "11  (+/-20.0V DE)"
+#elif defined(DEV_AD7609)
+	"0  (+/-10.0V SE)", "1  (+/-20.0V SE)"
+#else
+	"0  (+/-5.0V SE)", "1  (+/-10.0V SE)"
+#endif
+};
+
+/* Oversampling values string representation (possible values specified in datasheet) */
+static char *oversampling_val_str[] = {
+	"0 (no oversampling)", "1 (oversampling by 2)", "2 (oversampling by 4)",
+	"3 (oversampling by 8)", "4 (oversampling by 16)", "5 (oversampling by 32)",
+	"6 (oversampling by 64)", "7 (oversampling by 128)", "8 (oversampling by 256)"
+};
+
+
+/* Channel range values string representation (possible values specified in datasheet) */
+static float chn_range_val[] = {
+#if defined(DEV_AD7606B)
+	2.5, 5.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0
+#elif defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	2.5, 5.0, 6.25, 10.0, 12.5, 5.0, 10.0, 12.5, 5.0, 10.0, 12.5, 20.0
+#elif defined(DEV_AD7609)
+	10.0, 20.0
+#else
+	5.0, 10.0
+#endif
+};
+
+/* Range value per channel */
+static float attr_chn_range[NO_OF_CHANNELS] = {
+	DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE,
+	DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE, DEFAULT_CHN_RANGE
+};
+
+/* Scale value per channel */
+static float attr_scale_val[NO_OF_CHANNELS] = {
+	DEFAULT_SCALE, DEFAULT_SCALE, DEFAULT_SCALE, DEFAULT_SCALE,
+	DEFAULT_SCALE, DEFAULT_SCALE, DEFAULT_SCALE, DEFAULT_SCALE
+};
+
+/* Scale value per channel */
+static polarity_e attr_polarity_val[NO_OF_CHANNELS] = {
+	BIPOLAR, BIPOLAR, BIPOLAR, BIPOLAR,
+	BIPOLAR, BIPOLAR, BIPOLAR, BIPOLAR
+};
+
+/* Channel range */
+typedef enum {
+	LOW,
+	HIGH
+} range_e;
+
+/* Device register value */
+static uint8_t device_reg_val;
+
+/* GPIO LED descriptor and init structure */
+static struct gpio_desc *gpio_led;
+
+/******************************************************************************/
+/************************ Functions Prototypes ********************************/
+/******************************************************************************/
+
+static float get_vltg_conv_scale_factor(float chn_range, polarity_e polarity);
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/*!
+ * @brief	Getter/Setter for the scale attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ */
+ssize_t get_chn_scale(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	return (ssize_t) sprintf(buf, "%f", attr_scale_val[channel->ch_num - 1]);
+}
+
+ssize_t set_chn_scale(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	float scale;
+
+	(void)sscanf(buf, "%f", &scale);
+
+	if (scale > 0.0) {
+		attr_scale_val[channel->ch_num - 1] = scale;
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the raw attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ */
+ssize_t get_chn_raw(void *device,
+		    char *buf,
+		    size_t len,
+		    const struct iio_ch_info *channel)
+{
+	int32_t adc_data_raw;
+
+	/* Capture the raw adc data */
+	adc_data_raw = single_data_read(device, channel->ch_num - 1,
+					attr_polarity_val[channel->ch_num - 1]);
+
+	return (ssize_t) sprintf(buf, "%d", adc_data_raw);
+}
+
+ssize_t set_chn_raw(void *device,
+		    char *buf,
+		    size_t len,
+		    const struct iio_ch_info *channel)
+{
+	/* NA- Can't set raw value */
+	return len;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the operating mode attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_operating_mode(void *device,
+			   char *buf,
+			   size_t len,
+			   const struct iio_ch_info *channel)
+{
+	uint8_t read_val;
+	uint8_t operating_mode_value;
+
+	if (ad7606_spi_reg_read(device, AD7606_REG_CONFIG, &read_val) == SUCCESS) {
+		operating_mode_value = (read_val & AD7606_CONFIG_OPERATION_MODE_MSK);
+
+		if (operating_mode_value < sizeof(operating_mode_str) / sizeof(
+			    operating_mode_str[0])) {
+			return (ssize_t)sprintf(buf, "%s", operating_mode_str[operating_mode_value]);
+		}
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_operating_mode(void *device,
+			   char *buf,
+			   size_t len,
+			   const struct iio_ch_info *channel)
+{
+	uint8_t operating_mode_value;
+
+	(void)sscanf(buf, "%d", &operating_mode_value);
+
+	if (operating_mode_value < sizeof(operating_mode_str) / sizeof(
+		    operating_mode_str[0])) {
+		if (ad7606_spi_write_mask(device,
+					  AD7606_REG_CONFIG,
+					  AD7606_CONFIG_OPERATION_MODE_MSK,
+					  operating_mode_value) == SUCCESS) {
+			return len;
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the power down mode attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available for all devices except AD7606B and AD7606C
+ */
+ssize_t get_power_down_mode(void *device,
+			    char *buf,
+			    size_t len,
+			    const struct iio_ch_info *channel)
+{
+	uint8_t gpio_stby_val;
+	uint8_t gpio_range_val;
+
+	if (gpio_get_value(((struct ad7606_dev *)device)->gpio_stby_n,
+			   &gpio_stby_val) == SUCCESS) {
+		if (gpio_get_value(((struct ad7606_dev *)device)->gpio_range,
+				   &gpio_range_val) == SUCCESS) {
+
+			if (gpio_stby_val) {
+				return sprintf(buf, "%s", operating_mode_str[AD7606_NORMAL]);
+			} else {
+				if (gpio_range_val) {
+					return sprintf(buf, "%s", operating_mode_str[AD7606_STANDBY]);
+				} else {
+					return sprintf(buf, "%s", operating_mode_str[AD7606_SHUTDOWN]);
+				}
+			}
+		}
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_power_down_mode(void *device,
+			    char *buf,
+			    size_t len,
+			    const struct iio_ch_info *channel)
+{
+	uint8_t power_down_mode_value;
+	static enum ad7606_op_mode prev_power_down_mode = AD7606_NORMAL;
+	struct ad7606_config dev_config;
+
+	sscanf(buf, "%d", &power_down_mode_value);
+
+	if (power_down_mode_value < (sizeof(operating_mode_str) / sizeof(
+					     operating_mode_str[0]))) {
+
+		dev_config.op_mode = power_down_mode_value;
+
+		switch (power_down_mode_value) {
+		case AD7606_NORMAL:
+			if (ad7606_set_config(device, dev_config) == SUCCESS) {
+				/* Reset the device if previous power down mode was either standby
+				 * or shutdown */
+				if (prev_power_down_mode != AD7606_NORMAL) {
+
+					/* Power-up wait time */
+					mdelay(1);
+
+					/* Toggle reset pin */
+					if (gpio_set_value(((struct ad7606_dev *)device)->gpio_reset,
+							   GPIO_HIGH) == SUCCESS) {
+						mdelay(1);
+
+						if (gpio_set_value(((struct ad7606_dev *)device)->gpio_reset,
+								   GPIO_LOW) == SUCCESS) {
+							prev_power_down_mode = AD7606_NORMAL;
+							return len;
+						}
+					}
+				}
+			}
+			break;
+
+		case AD7606_STANDBY:
+			if (ad7606_set_config(device, dev_config) == SUCCESS) {
+				prev_power_down_mode = AD7606_STANDBY;
+				return len;
+			}
+			break;
+
+		case AD7606_SHUTDOWN:
+			if (ad7606_set_config(device, dev_config) == SUCCESS) {
+				prev_power_down_mode = AD7606_SHUTDOWN;
+				return len;
+			}
+			break;
+
+		default:
+			break;
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the range attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available for all devices except AD7606B and AD7606C
+ */
+ssize_t get_range(void *device,
+		  char *buf,
+		  size_t len,
+		  const struct iio_ch_info *channel)
+{
+	uint8_t gpio_range_val;
+	struct ad7606_dev *dev = device;
+
+	if (gpio_get_value(dev->gpio_range, &gpio_range_val) == SUCCESS) {
+		if (gpio_range_val) {
+			return sprintf(buf, "%s", chn_range_str[HIGH]);
+		} else {
+			return sprintf(buf, "%s", chn_range_str[LOW]);
+		}
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_range(void *device,
+		  char *buf,
+		  size_t len,
+		  const struct iio_ch_info *channel)
+{
+	uint8_t range_value;
+	struct ad7606_dev *dev = device;
+
+	(void)sscanf(buf, "%d", &range_value);
+
+	if (range_value < (sizeof(chn_range_str) / sizeof(chn_range_str[0]))) {
+		if (range_value == LOW) {
+			if (gpio_set_value(dev->gpio_range, GPIO_LOW) == SUCCESS) {
+				return len;
+			}
+		} else {
+			if (gpio_set_value(dev->gpio_range, GPIO_HIGH) == SUCCESS) {
+				return len;
+			}
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the oversampling attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available for all devices except AD7606B and AD7606C
+ */
+ssize_t get_oversampling(void *device,
+			 char *buf,
+			 size_t len,
+			 const struct iio_ch_info *channel)
+{
+	uint8_t oversampling_value;
+	uint8_t read_val;
+	uint8_t gpio_osr0_val;
+	uint8_t gpio_osr1_val;
+	uint8_t gpio_osr2_val;
+	struct ad7606_dev *dev = device;
+
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	if (ad7606_spi_reg_read(device,
+				AD7606_REG_OVERSAMPLING,
+				&read_val) == SUCCESS) {
+		oversampling_value = (read_val & AD7606_OVERSAMPLING_MSK);
+
+		if (oversampling_value < sizeof(oversampling_val_str) / sizeof(
+			    oversampling_val_str[0])) {
+			return (ssize_t)sprintf(buf, "%s", oversampling_val_str[oversampling_value]);
+		}
+	}
+#else
+	if (gpio_get_value(dev->gpio_os0, &gpio_osr0_val) == SUCCESS) {
+		if (gpio_get_value(dev->gpio_os1, &gpio_osr1_val) == SUCCESS) {
+			if (gpio_get_value(dev->gpio_os2, &gpio_osr2_val) == SUCCESS) {
+				oversampling_value = (gpio_osr2_val << 2) | (gpio_osr1_val << 1) |
+						     gpio_osr0_val;
+
+				if (oversampling_value < (sizeof(oversampling_val_str) / sizeof(
+								  oversampling_val_str[0]))) {
+					return sprintf(buf, "%s", oversampling_val_str[oversampling_value]);
+				}
+			}
+		}
+	}
+#endif
+
+	return -EINVAL;
+}
+
+ssize_t set_oversampling(void *device,
+			 char *buf,
+			 size_t len,
+			 const struct iio_ch_info *channel)
+{
+	uint8_t oversampling_value;
+	struct ad7606_oversampling oversampling_cfg;
+
+	(void)sscanf(buf, "%d", &oversampling_value);
+
+	if (oversampling_value < (sizeof(oversampling_val_str) / sizeof(
+					  oversampling_val_str[0]))) {
+
+		oversampling_cfg.os_pad = 0;
+		oversampling_cfg.os_ratio = oversampling_value;
+
+		ad7606_set_oversampling(device, oversampling_cfg);
+
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the bandwidth attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available for only AD7606C
+ */
+ssize_t get_bandwidth(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	uint8_t bw_value;
+	uint8_t read_val;
+
+	if (ad7606_spi_reg_read(device,
+				AD7606_REG_BANDWIDTH,
+				&read_val) == SUCCESS) {
+		bw_value = (read_val >> (channel->ch_num - 1)) & 0x1;
+
+		if (bw_value < sizeof(bandwidth_str) / sizeof(
+			    bandwidth_str[0])) {
+			return (ssize_t)sprintf(buf, "%s", bandwidth_str[bw_value]);
+		}
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_bandwidth(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	uint8_t bw_value;
+	uint8_t read_val;
+
+	(void)sscanf(buf, "%d", &bw_value);
+
+	if (bw_value < sizeof(bandwidth_str) / sizeof(
+		    bandwidth_str[0])) {
+		if (ad7606_spi_reg_read(device,
+					AD7606_REG_BANDWIDTH,
+					&read_val) == SUCCESS) {
+			if (bw_value) {
+				read_val |= (1 << (channel->ch_num - 1));
+			} else {
+				read_val &= (~(1 << (channel->ch_num - 1)));
+			}
+
+			if (ad7606_spi_reg_write(device,
+						 AD7606_REG_BANDWIDTH,
+						 read_val) == SUCCESS) {
+				return len;
+			}
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel range attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_range(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	uint8_t read_val;
+	uint8_t chn_range;
+
+	if (ad7606_spi_reg_read(device, AD7606_REG_RANGE_CH_ADDR(channel->ch_num-1),
+				&read_val) == SUCCESS) {
+		if (((channel->ch_num - 1) % 2) != 0) {
+			read_val >>= CHANNEL_RANGE_MSK_OFFSET;
+			chn_range = read_val;
+		} else {
+			chn_range = (read_val & AD7606_RANGE_CH_MSK(channel->ch_num - 1));
+		}
+
+		if (chn_range < sizeof(chn_range_str) / sizeof(chn_range_str[0])) {
+			return (ssize_t)sprintf(buf, "%s", chn_range_str[chn_range]);
+		}
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_range(void *device,
+		      char *buf,
+		      size_t len,
+		      const struct iio_ch_info *channel)
+{
+	uint8_t chn_range;
+
+	(void)sscanf(buf, "%d", &chn_range);
+
+	if (chn_range < sizeof(chn_range_val) / sizeof(chn_range_val[0])) {
+
+		/* Get the polarity of channel */
+		attr_polarity_val[channel->ch_num - 1] = ad7606_get_input_polarity(chn_range);
+
+		attr_chn_range[channel->ch_num - 1] = chn_range_val[chn_range];
+		attr_scale_val[channel->ch_num - 1] = get_vltg_conv_scale_factor(
+				chn_range_val[chn_range],
+				attr_polarity_val[channel->ch_num - 1]);
+
+		if (((channel->ch_num - 1) % 2) != 0) {
+			chn_range <<= CHANNEL_RANGE_MSK_OFFSET;
+		}
+
+		if (ad7606_spi_write_mask(device,
+					  AD7606_REG_RANGE_CH_ADDR(channel->ch_num-1),
+					  AD7606_RANGE_CH_MSK(channel->ch_num-1),
+					  chn_range) == SUCCESS) {
+			return len;
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel gain attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_gain(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	uint8_t read_val;
+	uint8_t chn_gain_value;
+
+	if (ad7606_spi_reg_read(device,
+				AD7606_REG_GAIN_CH(channel->ch_num - 1),
+				&read_val) == SUCCESS) {
+		chn_gain_value = (read_val & AD7606_GAIN_MSK);
+		return (ssize_t)sprintf(buf, "%d", chn_gain_value);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_gain(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	uint8_t chn_gain_value;
+
+	(void)sscanf(buf, "%d", &chn_gain_value);
+
+	if (ad7606_set_ch_gain(device, channel->ch_num - 1,
+			       chn_gain_value) == SUCCESS) {
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel offset attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_offset(void *device,
+		       char *buf,
+		       size_t len,
+		       const struct iio_ch_info *channel)
+{
+	uint8_t chn_offset_value;
+
+	if (ad7606_spi_reg_read(device, AD7606_REG_OFFSET_CH(channel->ch_num-1),
+				&chn_offset_value) == SUCCESS) {
+		return (ssize_t)sprintf(buf, "%d", chn_offset_value);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_offset(void *device,
+		       char *buf,
+		       size_t len,
+		       const struct iio_ch_info *channel)
+{
+	uint8_t chn_offset_value = 0;
+
+	(void)sscanf(buf, "%d", &chn_offset_value);
+
+	if (ad7606_set_ch_offset(device, channel->ch_num - 1,
+				 chn_offset_value) == SUCCESS) {
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel pahse offset attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_phase_offset(void *device,
+			     char *buf,
+			     size_t len,
+			     const struct iio_ch_info *channel)
+{
+	uint8_t chn_phase_offset_value;
+
+	if (ad7606_spi_reg_read(device,
+				AD7606_REG_PHASE_CH(channel->ch_num - 1),
+				&chn_phase_offset_value) == SUCCESS) {
+		return (ssize_t)sprintf(buf, "%d", chn_phase_offset_value);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_phase_offset(void *device,
+			     char *buf,
+			     size_t len,
+			     const struct iio_ch_info *channel)
+{
+	uint8_t chn_phase_offset_value = 0;
+
+	(void)sscanf(buf, "%d", &chn_phase_offset_value);
+
+	if (ad7606_set_ch_phase(device, channel->ch_num - 1,
+				chn_phase_offset_value) == SUCCESS) {
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel temperature attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_temperature(void *device,
+			    char *buf,
+			    size_t len,
+			    const struct iio_ch_info *channel)
+{
+	int32_t adc_chn_data = 0;
+	float temperature;
+	float voltage;
+
+	/* Configure the channel multiplexer to select temperature read */
+	if (ad7606_spi_write_mask(device,
+				  AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+						  TEMPERATURE_MUX)) == SUCCESS) {
+
+		/* Allow to settle Mux channel */
+		udelay(100);
+
+		/* Sample the channel and read conversion result */
+		adc_chn_data = single_data_read(device, channel->ch_num - 1,
+						attr_polarity_val[channel->ch_num - 1]);
+
+		/* Convert ADC data into equivalent voltage */
+		voltage = convert_adc_raw_to_voltage(adc_chn_data,
+						     attr_scale_val[channel->ch_num - 1]);
+
+		/* Obtain the temperature using equation specified in device datasheet */
+		temperature = ((voltage - 0.69068) / 0.019328) + 25.0;
+
+		/* Change channel mux back to analog input */
+		(void)ad7606_spi_write_mask(device,
+					    AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+							    ANALOG_INPUT_MUX));
+
+		return (ssize_t)sprintf(buf, "%f", temperature);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_temperature(void *device,
+			    char *buf,
+			    size_t len,
+			    const struct iio_ch_info *channel)
+{
+	// NA- Can't set temperature
+	return -EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel Vref attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_vref(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	float vref_voltge;
+	int32_t adc_chn_data;
+
+	/* Configure the channel multiplexer to select Vref read */
+	if (ad7606_spi_write_mask(device,
+				  AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+						  VREF_MUX)) == SUCCESS) {
+
+		/* Allow to settle Mux channel */
+		udelay(100);
+
+		/* Sample the channel and read conversion result */
+		adc_chn_data = single_data_read(device, channel->ch_num - 1,
+						attr_polarity_val[channel->ch_num - 1]);
+
+		/* Convert ADC data into equivalent voltage */
+		vref_voltge = convert_adc_raw_to_voltage(adc_chn_data,
+				attr_scale_val[channel->ch_num - 1]);
+
+		/* Divide by 4 since Vref Mux has 4x multiplier on it */
+		vref_voltge /= VREF_MUX_MULTIPLIER;
+
+		/* Change channel mux back to analog input */
+		(void)ad7606_spi_write_mask(device,
+					    AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+							    ANALOG_INPUT_MUX));
+
+		return (ssize_t)sprintf(buf, "%f", vref_voltge);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_vref(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	// NA- Can't set Vref
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel Vdrive attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_vdrive(void *device,
+		       char *buf,
+		       size_t len,
+		       const struct iio_ch_info *channel)
+{
+	float vdrive_voltge;
+	int32_t adc_chn_data;
+
+	/* Configure the channel multiplexer to select Vdrive read */
+	if (ad7606_spi_write_mask(device,
+				  AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+						  VDRIVE_MUX)) == SUCCESS) {
+
+		/* Allow to settle Mux channel */
+		udelay(100);
+
+		/* Sample the channel and read conversion result */
+		adc_chn_data = single_data_read(device, channel->ch_num - 1,
+						attr_polarity_val[channel->ch_num - 1]);
+
+		/* Convert ADC data into equivalent voltage */
+		vdrive_voltge = convert_adc_raw_to_voltage(adc_chn_data,
+				attr_scale_val[channel->ch_num - 1]);
+
+		/* Change channel mux back to analog input */
+		(void)ad7606_spi_write_mask(device,
+					    AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+							    ANALOG_INPUT_MUX));
+
+		return (ssize_t)sprintf(buf, "%f", vdrive_voltge);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_vdrive(void *device,
+		       char *buf,
+		       size_t len,
+		       const struct iio_ch_info *channel)
+{
+	// NA- Can't set Vdrive
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel ALDO attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_aldo(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	float aldo_voltge;
+	int32_t adc_chn_data;
+
+	/* Configure the channel multiplexer to select ALDO read */
+	if (ad7606_spi_write_mask(device,
+				  AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+						  ALDO_MUX)) == SUCCESS) {
+
+		/* Allow to settle Mux channel */
+		udelay(100);
+
+		/* Sample the channel and read conversion result */
+		adc_chn_data = single_data_read(device, channel->ch_num - 1,
+						attr_polarity_val[channel->ch_num - 1]);
+
+		/* Convert ADC data into equivalent voltage */
+		aldo_voltge = convert_adc_raw_to_voltage(adc_chn_data,
+				attr_scale_val[channel->ch_num - 1]);
+
+		/* Divide by 4 since ALDO Mux has 4x multiplier on it */
+		aldo_voltge /= VREF_MUX_MULTIPLIER;
+
+		/* Change channel mux back to analog input */
+		(void)ad7606_spi_write_mask(device,
+					    AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+							    ANALOG_INPUT_MUX));
+
+		return (ssize_t)sprintf(buf, "%f", aldo_voltge);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_aldo(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	// NA- Can't set ALDO
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel DLDO attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ * @note	Available only for AD7606B and AD7606C
+ */
+ssize_t get_chn_dldo(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	float dldo_voltge;
+	int32_t adc_chn_data;
+
+	/* Configure the channel multiplexer to select DLDO read */
+	if (ad7606_spi_write_mask(device,
+				  AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+				  AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+						  DLDO_MUX)) == SUCCESS) {
+
+		/* Allow to settle Mux channel */
+		udelay(100);
+
+		/* Sample the channel and read conversion result */
+		adc_chn_data = single_data_read(device,
+						channel->ch_num - 1,
+						attr_polarity_val[channel->ch_num - 1]);
+
+		/* Convert ADC data into equivalent voltage */
+		dldo_voltge = convert_adc_raw_to_voltage(adc_chn_data,
+				attr_scale_val[channel->ch_num - 1]);
+
+		/* Divide by 4 since ALDO Mux has 4x multiplier on it */
+		dldo_voltge /= VREF_MUX_MULTIPLIER;
+
+		/* Change channel mux back to analog input */
+		(void)ad7606_spi_write_mask(device,
+					    AD7606_REG_DIAGNOSTIC_MUX_CH(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_MSK(channel->ch_num - 1),
+					    AD7606_DIAGN_MUX_CH_VAL((channel->ch_num - 1),
+							    ANALOG_INPUT_MUX));
+
+		return (ssize_t)sprintf(buf, "%f", dldo_voltge);
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_dldo(void *device,
+		     char *buf,
+		     size_t len,
+		     const struct iio_ch_info *channel)
+{
+	// NA- Can't set DLDO
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the channel open wire detect attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ */
+ssize_t get_chn_open_wire_detect(void *device,
+				 char *buf,
+				 size_t len,
+				 const struct iio_ch_info *channel)
+{
+	int32_t data[2];
+	uint8_t open_detect_flag = false;
+	int32_t rw_status = FAILURE;
+
+#if defined MANUAL_OPEN_DETECT
+	/* Read the ADC output voltage on channel */
+	data[0] = single_data_read(device, channel->ch_num - 1,
+				   attr_polarity_val[channel->ch_num - 1]);
+
+	/* Enter into manual open detect mode */
+	if (ad7606_spi_reg_write(device, AD7606_REG_OPEN_DETECT_QUEUE, 1) == SUCCESS) {
+		/* Enable open wire detection on selected channel */
+		if (ad7606_spi_reg_write(device, AD7606_REG_OPEN_DETECT_ENABLE,
+					 (1 << ((channel->ch_num) - 1))) == SUCCESS) {
+			/* Read the ADC output after open wire detection */
+			data[1] = single_data_read(device, channel->ch_num - 1,
+						   attr_polarity_val[channel->ch_num - 1]);
+
+			/* Check for shift in common mode output voltage */
+			if ((data[1] - data[0]) > OPEN_DETECT_THRESHOLD_RPD50K) {
+				open_detect_flag = true;
+			}
+
+			rw_status = SUCCESS;
+		}
+	}
+#else
+	/* Enter into auto open detect mode */
+	if (ad7606_spi_reg_write(device, AD7606_REG_OPEN_DETECT_QUEUE,
+				 OPEN_DETECT_AUTO_MODE_CNTS) == SUCCESS) {
+		/* Enable open wire detection on selected channel */
+		if (ad7606_spi_reg_write(device, AD7606_REG_OPEN_DETECT_ENABLE,
+					 (1 << ((channel->ch_num) - 1))) == SUCCESS) {
+			mdelay(1);
+
+			if (ad7606_spi_reg_read(device, AD7606_REG_OPEN_DETECTED,
+						&open_detect_flag) == SUCCESS) {
+				rw_status = SUCCESS;
+
+				open_detect_flag >>= (channel->ch_num -1);
+				open_detect_flag &= 0x1;
+			}
+		}
+	}
+#endif
+
+	/* Disable open detect mode */
+	(void)ad7606_spi_reg_write(device, AD7606_REG_OPEN_DETECT_QUEUE, 0);
+
+	if (rw_status == SUCCESS) {
+		if (open_detect_flag) {
+			strcpy(buf, "Open Wire Detected");
+		} else {
+			strcpy(buf, "Open Wire Not Detected");
+		}
+
+		return len;
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_open_wire_detect(void *device,
+				 char *buf,
+				 size_t len,
+				 const struct iio_ch_info *channel)
+{
+	// NA- Can't set open wire detect
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the adc calibration
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ */
+ssize_t get_chn_calibrate_adc(void *device,
+			      char *buf,
+			      size_t len,
+			      const struct iio_ch_info *channel)
+{
+	float lsb_voltage;
+	float adc_voltage;
+	polarity_e polarity = attr_polarity_val[channel->ch_num - 1];
+	int32_t adc_data;
+	int8_t chn_offset;
+
+	/* Perform the system offset calibration */
+
+	if (polarity == UNIPOLAR) {
+		lsb_voltage = attr_chn_range[channel->ch_num - 1] / ADC_MAX_COUNT_UNIPOLAR;
+	} else {
+		lsb_voltage = attr_chn_range[channel->ch_num - 1] / ADC_MAX_COUNT_BIPOLAR;
+	}
+
+	/* Sample and read the ADC channel */
+	adc_data = single_data_read(device, channel->ch_num - 1,
+				    polarity);
+
+	/* Get an equivalent ADC voltage */
+	adc_voltage = convert_adc_raw_to_voltage(adc_data,
+			attr_scale_val[channel->ch_num - 1]);
+
+	/* Calculate the channel offset and write it to offset register (0x80-chn_offset) */
+	chn_offset = (adc_voltage / lsb_voltage);
+
+	if (ad7606_set_ch_offset(device, channel->ch_num - 1,
+				 chn_offset) == SUCCESS) {
+		return sprintf(buf, "%s", "ADC Calibration Done");
+	}
+
+	return -EINVAL;
+}
+
+ssize_t set_chn_calibrate_adc(void *device,
+			      char *buf,
+			      size_t len,
+			      const struct iio_ch_info *channel)
+{
+	// NA- Can't set open wire detect
+	return - EINVAL;
+}
+
+
+/*!
+ * @brief	Getter/Setter for the direct register access attribute value
+ * @param	device- pointer to IIO device structure
+ * @param	buf- pointer to buffer holding attribute value
+ * @param	len- length of buffer string data
+ * @param	channel- pointer to IIO channel structure
+ * @return	Number of characters read/written
+ */
+ssize_t get_direct_reg_access(void *device,
+			      char *buf,
+			      size_t len,
+			      const struct iio_ch_info *channel)
+{
+	return (ssize_t)sprintf(buf, "%d", device_reg_val);
+}
+
+ssize_t set_direct_reg_access(void *device,
+			      char *buf,
+			      size_t len,
+			      const struct iio_ch_info *channel)
+{
+	uint8_t reg_address;
+	char *token;
+	uint8_t offset = strlen("0x");
+	char str[10] = "";
+	uint8_t i=0;
+	uint8_t reg_data;
+
+	if (buf[1] == 'x') {
+		/* Write a data to device */
+
+		/* Extract the register address from received string */
+		strcpy(str, buf);
+		token = strtok(str, " ");
+		(void)sscanf(token + offset, "%x", &reg_address);
+
+		/* Extract the register data from received string */
+		i = (strlen(str) + 1) + offset;
+		(void)sscanf(str + i, "%x", &reg_data);
+
+		if (reg_address <= NUM_OF_REGISTERS) {
+			if ((ad7606_spi_reg_write(device, reg_address, reg_data) == SUCCESS)) {
+				return len;
+			}
+		}
+	} else {
+		/* Read the data from device */
+		(void)sscanf(buf, "%d", &reg_address);
+		if ((ad7606_spi_reg_read(device, reg_address, &device_reg_val) == SUCCESS)) {
+			return len;
+		}
+	}
+
+	return -EINVAL;
+}
+
+
+/**
+ * @brief Get xml corresponding to an AD7606 device.
+ * @param xml - Xml containing description of a device.
+ * @param iio_dev - Structure describing a device, channels and attributes.
+ * @return SUCCESS in case of success or negative value otherwise.
+ */
+static ssize_t iio_ad7606_get_xml(char **xml, struct iio_device *iio_dev)
+{
+	*xml = (char*)calloc(1, strlen(ad7606_phy_xml) + 1);
+	if (!(*xml)) {
+		return -ENOMEM;
+	}
+
+	memcpy(*xml, ad7606_phy_xml, strlen(ad7606_phy_xml));
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief	Read buffer data corresponding to AD7606 IIO device
+ * @param	dev_instance[in] - IIO device instance
+ * @param	pbuf[out] - Pointer to output data buffer
+ * @return	SUCCESS in case of success or negative value otherwise
+ */
+static ssize_t iio_ad7606_read_data(void *dev_instance,
+				    char *pbuf,
+				    size_t offset,
+				    size_t bytes_count,
+				    uint32_t ch_mask)
+{
+	/* Read the buffered data */
+	buffered_data_read(pbuf, bytes_count, offset, ch_mask);
+
+	return bytes_count;
+}
+
+
+/**
+ * @brief	Create structure describing a device, channels and attributes
+ * @param	device_name[in] - Device name
+ * @return	iio_device or NULL, in case of failure
+ */
+static struct iio_device *iio_ad7606_create_device(const char *device_name)
+{
+	struct iio_device *iio_ad7606_device;
+
+	iio_ad7606_device = calloc(1, sizeof(struct iio_device));
+	if (!iio_ad7606_device) {
+		return NULL;
+	}
+
+	iio_ad7606_device->name = device_name;
+	iio_ad7606_device->num_ch = sizeof(iio_ad7606_channels) / sizeof(
+					    iio_ad7606_channels[0]);
+	iio_ad7606_device->channels = iio_ad7606_channels;
+	iio_ad7606_device->attributes = global_attributes;
+
+	return iio_ad7606_device;
+}
+
+
+/**
+ * @brief	Delete IIO device.
+ * @param	iio_device - Structure describing a device, channels and attributes
+ * @return	SUCCESS in case of success or negative value otherwise
+ */
+static ssize_t iio_ad7606_delete_device(struct iio_device *iio_device)
+{
+	if (!iio_device) {
+		return FAILURE;
+	}
+
+	free(iio_device);
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief	Init for reading/writing and parameterization of a
+ * 			ad7606 IIO device
+ * @param 	desc[in,out] - IIO device descriptor
+ * @param	init[in] - Configuration structure
+ * @return	SUCCESS in case of success, FAILURE otherwise
+ */
+int32_t iio_ad7606_init(struct iio_ad7606_desc **desc,
+			struct iio_ad7606_init_param *init)
+{
+	int32_t status;
+	struct iio_interface *iio_interface;
+
+	iio_interface = (struct iio_interface *)calloc(1, sizeof(struct iio_interface));
+	if (!iio_interface) {
+		return -ENOMEM;
+	}
+
+	*iio_interface = (struct iio_interface) {
+		.name = dev_name,
+		.dev_instance = init->ad7606_phy,
+		.iio = iio_ad7606_create_device(dev_name),
+		.get_xml = iio_ad7606_get_xml,
+		.transfer_dev_to_mem = NULL,
+		.transfer_mem_to_dev = NULL,
+		.read_data = iio_ad7606_read_data,
+		.write_data = NULL,
+	};
+
+	status = iio_register(iio_interface);
+	if (status < 0) {
+		free(iio_interface);
+		return FAILURE;
+	}
+
+	*desc = calloc(1, sizeof(struct iio_ad7606_desc));
+	if (!(*desc)) {
+		iio_unregister(iio_interface);
+		free(iio_interface);
+		return FAILURE;
+	}
+
+	(*desc)->iio_interface = iio_interface;
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief Release resources allocated for IIO device
+ * @param desc[in] - IIO device descriptor
+ * @return SUCCESS in case of success, FAILURE otherwise
+ */
+int32_t iio_ad7606_remove(struct iio_ad7606_desc *desc)
+{
+	int32_t status;
+
+	if (!desc) {
+		return FAILURE;
+	}
+
+	status = iio_unregister(desc->iio_interface);
+	if (status < 0) {
+		return FAILURE;
+	}
+
+	status = iio_ad7606_delete_device(desc->iio_interface->iio);
+	if (status < 0) {
+		return FAILURE;
+	}
+
+	free(desc->iio_interface);
+	free(desc);
+
+	return SUCCESS;
+}
+
+
+/*!
+ * @brief	Get scale factor for adc data to voltage conversion for IIO client
+ * @param	chn_range[in] - Current channel voltage range
+ * @param	chn_range_bits[in] - Channel range register bits
+ * @return	scale
+ * @details	This function samples and capture the new data when previous data
+ * 			is transmitted to IIO client
+ */
+static float get_vltg_conv_scale_factor(float chn_range, polarity_e polarity)
+{
+	float scale;
+
+	/* Get the scale factor for voltage conversion from range */
+	if (polarity == UNIPOLAR) {
+		scale = (chn_range / ADC_MAX_COUNT_UNIPOLAR) * 1000;
+	} else {
+		scale = (chn_range / ADC_MAX_COUNT_BIPOLAR) * 1000;
+	}
+
+	return scale;
+}
+
+
+/**
+ * @brief 	Initialize the IRQ contoller
+ * @param	uart_desc[in] - UART descriptor for UART Rx IRQ event init
+ * @return	none
+ * @details	This function initialize the interrupt controller
+ */
+static int32_t iio_interrupt_handler_init(mbed_uart_desc *uart_desc)
+{
+	/* Pin to generate external interrupt */
+	PinName ext_int_pin = BUSY_PIN;
+
+	/* External interrupt descriptor */
+	struct irq_ctrl_desc *external_int_desc;
+
+	/* Define external interrupt platform specific parameters structure */
+	mbed_irq_init_param mbed_ext_int_init_param = {
+		.int_mode = EXT_IRQ_FALL,
+		.int_obj_type = &ext_int_pin
+	};
+
+	/* External interrupt init parameters */
+	struct irq_init_param external_int_init_param = {
+		.irq_ctrl_id = EXTERNAL_INT_ID,
+		.extra = &mbed_ext_int_init_param
+	};
+
+	/* External interrupt callback descriptor */
+	struct callback_desc external_int_callback_desc = {
+		&do_conversion_callback,
+		NULL,
+		NULL
+	};
+
+	/* UART Rx interrupt descriptor */
+	struct irq_ctrl_desc *uart_rx_int_desc;
+
+	/* Define external interrupt platform specific parameters structure */
+	mbed_irq_init_param mbed_uart_rx_int_init_param = {
+		.int_mode = 0,
+		.int_obj_type = uart_desc->uart_port
+	};
+
+	/* UART Rx interrupt init parameters */
+	struct irq_init_param uart_rx_int_init_param = {
+		.irq_ctrl_id = UART_RX_INT_ID,
+		.extra = &mbed_uart_rx_int_init_param
+	};
+
+	/* UART Rx interrupt callback descriptor */
+	struct callback_desc uart_rx_int_callback_desc = {
+		&iio_uart_rx_callback,
+		NULL,
+		NULL
+	};
+
+	/* Init interrupt controller for external interrupt */
+	if (irq_ctrl_init(&external_int_desc, &external_int_init_param) == FAILURE) {
+		return FAILURE;
+	}
+
+	/* Init interrupt controller for UART Rx interrupt */
+	if (irq_ctrl_init(&uart_rx_int_desc, &uart_rx_int_init_param) == FAILURE) {
+		return FAILURE;
+	}
+
+	/* Register a callback function for external interrupt */
+	if (irq_register_callback(external_int_desc, EXTERNAL_INT_ID,
+				  &external_int_callback_desc) == FAILURE) {
+		return FAILURE;
+	}
+
+	/* Register a callback function for UART Rx interrupt */
+	if (irq_register_callback(uart_rx_int_desc, UART_RX_INT_ID,
+				  &uart_rx_int_callback_desc) == FAILURE) {
+		return FAILURE;
+	}
+
+	return SUCCESS;
+}
+
+
+/**
+ * @brief	Initialize the IIO interface for AD7606 IIO device
+ * @return	none
+ * @return	SUCCESS in case of success, FAILURE otherwise
+ */
+int32_t ad7606_iio_initialize(void)
+{
+	int32_t init_status;
+
+	/**
+	* AD7606 IIO instance descriptor
+	*/
+	struct iio_ad7606_desc *piio_ad7606_desc;
+
+	/**
+	 * AD7606 IIO init parameters
+	 */
+	struct iio_ad7606_init_param iio_ad7606_init_param;
+
+	/**
+	 * IIO application init parameters
+	 */
+	struct iio_app_init_param iio_app_init_par;
+
+	/**
+	 * UART serial interface read/write callback
+	 */
+	struct iio_server_ops uart_iio_server_ops;
+
+	/*
+	 * UART Mbed init extra parameters structure
+	 */
+	mbed_uart_init_param uart_extra_init_param;
+
+	/*
+	 * UART init parameters structure
+	 */
+	struct uart_init_param uart_init_param;
+
+	/**
+	 * IIO application UART descriptor
+	 */
+	struct uart_desc *uart_desc = NULL;
+
+	/*
+	 * GPIO LED Init parameters structure
+	 */
+	struct gpio_init_param gpio_init_led;
+
+	iio_ad7606_init_param = (struct iio_ad7606_init_param) {
+		.ad7606_phy = NULL,
+	};
+
+	uart_extra_init_param = (mbed_uart_init_param) {
+		.uart_tx_pin = UART_TX,
+		.uart_rx_pin = UART_RX
+	};
+
+	uart_init_param = (struct uart_init_param ) {
+		.device_id = NULL,
+		.baud_rate = IIO_UART_BAUD_RATE,
+		.extra = &uart_extra_init_param
+	};
+
+	uart_iio_server_ops = (struct iio_server_ops) {
+		.read = iio_uart_read,
+		.write = iio_uart_write,
+	};
+
+	gpio_init_led = (struct gpio_init_param) {
+		.number = LED_GREEN,
+		.extra = NULL
+	};
+
+	iio_app_init_par = (struct iio_app_init_param) {
+		.iio_server_ops = &uart_iio_server_ops,
+	};
+
+	/* Initialize AD7606 device and peripheral interface */
+	init_status = ad7606_init(&p_ad7606_dev, &ad7606_init_str);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	/* Initialize the LED GPIO descriptor */
+	init_status = gpio_get_optional(&gpio_led, &gpio_init_led);
+	if (init_status != SUCCESS) {
+		return init_status;
+	} else {
+		init_status = gpio_direction_output(gpio_led, GPIO_HIGH);
+		if (init_status != SUCCESS) {
+			return init_status;
+		}
+	}
+
+	/* Get the AD7606 IIO device instance */
+	iio_ad7606_init_param.ad7606_phy = p_ad7606_dev;
+
+	/* Initialize the UART interface for IIO application */
+	init_status = iio_uart_init(&uart_desc, &uart_init_param);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	/* Initialize the IIO application interface */
+	init_status = iio_app_init(&iio_app_desc, &iio_app_init_par);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	/* Register and initialize the AD7606 device into IIO interface */
+	init_status = iio_ad7606_init(&piio_ad7606_desc, &iio_ad7606_init_param);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	/* Init the data capture for AD7606 IIO app */
+	init_status = iio_data_capture_init(p_ad7606_dev);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	/* Init the interrupt event handler for AD7606 IIO app */
+	init_status = iio_interrupt_handler_init(uart_desc->extra);
+	if (init_status != SUCCESS) {
+		return init_status;
+	}
+
+	return init_status;
+}
+
+
+/**
+ * @brief 	Run the AD7606 IIO event handler
+ * @return	none
+ * @details	This function monitors the new IIO client event
+ */
+void ad7606_iio_event_handler(void)
+{
+	static bool background_conversion_started = false;
+
+	/* Handle new IIO command */
+	if (is_new_iio_command_detected()) {
+		/* Start/Stop the bakground conversion based on buffer read request */
+		if (!check_iio_cmd("READBUF", 7)) {
+			stop_background_data_conversion();
+			background_conversion_started = false;
+		} else {
+			if (background_conversion_started == false) {
+				start_background_data_conversion();
+				background_conversion_started = true;
+			}
+		}
+
+		/* Run the IIO interface when new command is detected */
+		(void)iio_app(iio_app_desc);
+	}
+}
diff -r 000000000000 -r 3afcd581558d app/src/iio_ad7606.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/iio_ad7606.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,70 @@
+/***************************************************************************//**
+*   @file   iio_ad7606.h
+*   @brief  Header file of iio_ad7606
+********************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*******************************************************************************/
+#ifndef IIO_AD7606_H_
+#define IIO_AD7606_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdio.h>
+#include <stdbool.h>
+#include "iio.h"
+#include "iio_types.h"
+
+/******************************************************************************/
+/****************************** Macros ****************************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/**
+ * @struct iio_ad7606_init_param
+ * @brief Device configuration structure.
+ */
+struct iio_ad7606_init_param {
+	/** ad7606 device instance pointer */
+	struct ad7606_dev *ad7606_phy;
+};
+
+/**
+ * @struct iio_ad7606_desc
+ * @brief Structure holding IIO descriptor.
+ */
+struct iio_ad7606_desc {
+	/** iio_interface instance pointer */
+	struct iio_interface *iio_interface;
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Init AD7606 IIO interface */
+int32_t iio_ad7606_init(struct iio_ad7606_desc **desc,
+			struct iio_ad7606_init_param *init);
+
+/* Free the resources allocated for IIO device */
+int32_t iio_ad7606_remove(struct iio_ad7606_desc *desc);
+
+/* Init the IIO interface */
+int32_t ad7606_iio_initialize(void);
+
+/* Run the IIO event handler */
+void ad7606_iio_event_handler(void);
+
+/* Init the IIO application */
+int32_t ad7606_app_initialize(void);
+
+#endif /* IIO_AD7606_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/iio_ad7606_attr.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/iio_ad7606_attr.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,580 @@
+/***************************************************************************//**
+*   @file   iio_ad7606_attr.h
+*   @brief  File for AD7606 IIO Attributes
+********************************************************************************
+* Copyright (c) 2020 Analog Devices, Inc.
+*
+* All rights reserved.
+* This software is proprietary to Analog Devices, Inc. and its licensors.
+* By using this software you agree to the terms of the associated
+* Analog Devices Software License Agreement.
+*******************************************************************************/
+#ifndef IIO_AD7606_ATTR_H_
+#define IIO_AD7606_ATTR_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include <stdio.h>
+#include <stdbool.h>
+
+#include "app_config.h"
+#include "iio.h"
+#include "iio_types.h"
+
+/******************************************************************************/
+/****************************** Macros ****************************************/
+/******************************************************************************/
+
+extern ssize_t get_chn_scale(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+extern ssize_t set_chn_scale(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_range(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+extern ssize_t set_chn_range(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_gain(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+extern ssize_t set_chn_gain(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_offset(void *device, char *buf, size_t len,
+			      const struct iio_ch_info *channel);
+extern ssize_t set_chn_offset(void *device, char *buf, size_t len,
+			      const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_phase_offset(void *device, char *buf, size_t len,
+				    const struct iio_ch_info *channel);
+extern ssize_t set_chn_phase_offset(void *device, char *buf, size_t len,
+				    const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_temperature(void *device, char *buf, size_t len,
+				   const struct iio_ch_info *channel);
+extern ssize_t set_chn_temperature(void *device, char *buf, size_t len,
+				   const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_vref(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+extern ssize_t set_chn_vref(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_vdrive(void *device, char *buf, size_t len,
+			      const struct iio_ch_info *channel);
+extern ssize_t set_chn_vdrive(void *device, char *buf, size_t len,
+			      const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_aldo(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+extern ssize_t set_chn_aldo(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_dldo(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+extern ssize_t set_chn_dldo(void *device, char *buf, size_t len,
+			    const struct iio_ch_info *channel);
+
+extern ssize_t get_bandwidth(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+extern ssize_t set_bandwidth(void *device, char *buf, size_t len,
+			     const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_open_wire_detect(void *device, char *buf, size_t len,
+					const struct iio_ch_info *channel);
+extern ssize_t set_chn_open_wire_detect(void *device, char *buf, size_t len,
+					const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_calibrate_adc(void *device, char *buf, size_t len,
+				     const struct iio_ch_info *channel);
+extern ssize_t set_chn_calibrate_adc(void *device, char *buf, size_t len,
+				     const struct iio_ch_info *channel);
+
+extern ssize_t get_chn_raw(void *device, char *buf, size_t len,
+			   const struct iio_ch_info *channel);
+extern ssize_t set_chn_raw(void *device, char *buf, size_t len,
+			   const struct iio_ch_info *channel);
+
+extern ssize_t get_operating_mode(void *device, char *buf, size_t len,
+				  const struct iio_ch_info *channel);
+extern ssize_t set_operating_mode(void *device, char *buf, size_t len,
+				  const struct iio_ch_info *channel);
+
+extern ssize_t get_power_down_mode(void *device, char *buf, size_t len,
+				   const struct iio_ch_info *channel);
+extern ssize_t set_power_down_mode(void *device, char *buf, size_t len,
+				   const struct iio_ch_info *channel);
+
+extern ssize_t get_range(void *device, char *buf, size_t len,
+			 const struct iio_ch_info *channel);
+extern ssize_t set_range(void *device, char *buf, size_t len,
+			 const struct iio_ch_info *channel);
+
+extern ssize_t get_oversampling(void *device, char *buf, size_t len,
+				const struct iio_ch_info *channel);
+extern ssize_t set_oversampling(void *device, char *buf, size_t len,
+				const struct iio_ch_info *channel);
+
+extern ssize_t get_direct_reg_access(void *device, char *buf, size_t len,
+				     const struct iio_ch_info *channel);
+extern ssize_t set_direct_reg_access(void *device, char *buf, size_t len,
+				     const struct iio_ch_info *channel);
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+// XML describes the IIO context hierarchy for AD7606 family devices
+static const char * const ad7606_phy_xml =
+#if defined(DEV_AD7605_4)
+	"<device id=\"AD7605-4-phy\" name=\"ID_AD7605-4-phy\" >"
+#elif defined(DEV_AD7606_4)
+	"<device id=\"AD7606-4-phy\" name=\"AD7606-4-phy\" >"
+#elif defined(DEV_AD7606_6)
+	"<device id=\"AD7606-6-phy\" name=\"AD7606-6-phy\" >"
+#elif defined(DEV_AD7606_8)
+	"<device id=\"AD7606-8-phy\" name=\"AD7606-8-phy\" >"
+#elif defined(DEV_AD7606B)
+	"<device id=\"AD7606B-phy\" name=\"AD7606B-phy\" >"
+#elif defined(DEV_AD7606C_16)
+	"<device id=\"AD7606C-phy\" name=\"AD7606C-16-phy\" >"
+#elif defined(DEV_AD7606C_18)
+	"<device id=\"AD7606C-phy\" name=\"AD7606C-18-phy\" >"
+#elif defined(DEV_AD7608)
+	"<device id=\"AD7608-phy\" name=\"AD7608-phy\" >"
+#elif defined(DEV_AD7609)
+	"<device id=\"AD7609-phy\" name=\"AD7609-phy\" >"
+#else
+#endif
+	"<channel id=\"voltage1\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"0\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"0\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+	"<channel id=\"voltage2\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"1\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"1\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+	"<channel id=\"voltage3\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"2\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"2\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+	"<channel id=\"voltage4\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"3\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"3\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+#if (NO_OF_CHANNELS > 4)
+	"<channel id=\"voltage5\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"4\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"4\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_oversampling\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+	"<channel id=\"voltage6\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"5\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"5\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+#endif
+#if (NO_OF_CHANNELS > 6)
+	"<channel id=\"voltage7\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"6\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"6\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+	"<channel id=\"voltage8\" type=\"input\" >"
+#if (ADC_RESOLUTION > 16)
+	"<scan-element scale=\"0.1525\" format=\"le:s18/18>>0\" index =\"7\" />"
+#else
+	"<scan-element scale=\"0.1525\" format=\"le:s16/16>>0\" index =\"7\" />"
+#endif
+	"<attribute name=\"raw\" />"
+	"<attribute name=\"scale\" />"
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"chn_range\" />"
+	"<attribute name=\"chn_gain\" />"
+	"<attribute name=\"chn_offset\" />"
+	"<attribute name=\"Temperature\" />"
+	"<attribute name=\"Vref\" />"
+	"<attribute name=\"Vdrive\" />"
+	"<attribute name=\"ALDO\" />"
+	"<attribute name=\"DLDO\" />"
+	"<attribute name=\"perform_open_wire_detect\" />"
+	"<attribute name=\"do_calibration_(Vin_must_be_0)\" />"
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"bandwidth\" />"
+#endif
+#endif
+	"</channel>"
+#endif
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	"<attribute name=\"operating_mode\" />"
+	"<attribute name=\"oversampling\" />"
+	"<debug-attribute name =\"direct_reg_access\" />"
+#else
+	"<attribute name=\"power_down_mode\" />"
+	"<attribute name=\"range\" />"
+#endif
+	"</device>";
+
+
+/* Channels IIO attribute structures */
+
+static struct iio_attribute iio_attr_chn_scale = {
+	.name = "scale",
+	.show = get_chn_scale,
+	.store = set_chn_scale,
+};
+
+static struct iio_attribute iio_attr_chn_raw = {
+	.name = "raw",
+	.show = get_chn_raw,
+	.store = set_chn_raw,
+};
+
+static struct iio_attribute iio_attr_chn_range = {
+	.name = "chn_range",
+	.show = get_chn_range,
+	.store = set_chn_range,
+};
+
+static struct iio_attribute iio_attr_chn_gain = {
+	.name = "chn_gain",
+	.show = get_chn_gain,
+	.store = set_chn_gain,
+};
+
+static struct iio_attribute iio_attr_chn_offset = {
+	.name = "chn_offset",
+	.show = get_chn_offset,
+	.store = set_chn_offset,
+};
+
+static struct iio_attribute iio_attr_chn_phase_offset = {
+	.name = "chn_phase offset",
+	.show = get_chn_phase_offset,
+	.store = set_chn_phase_offset,
+};
+
+static struct iio_attribute iio_attr_chn_temperature = {
+	.name = "Temperature",
+	.show = get_chn_temperature,
+	.store = set_chn_temperature,
+};
+
+static struct iio_attribute iio_attr_chn_vref = {
+	.name = "Vref",
+	.show = get_chn_vref,
+	.store = set_chn_vref,
+};
+
+static struct iio_attribute iio_attr_chn_vdrive = {
+	.name = "Vdrive",
+	.show = get_chn_vdrive,
+	.store = set_chn_vdrive,
+};
+
+static struct iio_attribute iio_attr_chn_aldo = {
+	.name = "ALDO",
+	.show = get_chn_aldo,
+	.store = set_chn_aldo,
+};
+
+static struct iio_attribute iio_attr_chn_dldo = {
+	.name = "DLDO",
+	.show = get_chn_dldo,
+	.store = set_chn_dldo,
+};
+
+static struct iio_attribute iio_attr_bandwidth = {
+	.name = "bandwidth",
+	.show = get_bandwidth,
+	.store = set_bandwidth,
+};
+
+static struct iio_attribute iio_attr_chn_open_wire_detect = {
+	.name = "perform_open_wire_detect",
+	.show = get_chn_open_wire_detect,
+	.store = set_chn_open_wire_detect,
+};
+
+static struct iio_attribute iio_attr_calibrate_adc= {
+	.name = "do_calibration_(Vin_must_be_0)",
+	.show = get_chn_calibrate_adc,
+	.store = set_chn_calibrate_adc,
+};
+
+
+struct iio_attribute *channel_input_attributes[] = {
+	&iio_attr_chn_raw,
+	&iio_attr_chn_scale,
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	&iio_attr_chn_range,
+	&iio_attr_chn_gain,
+	&iio_attr_chn_offset,
+	&iio_attr_chn_phase_offset,
+	&iio_attr_chn_temperature,
+	&iio_attr_chn_vref,
+	&iio_attr_chn_vdrive,
+	&iio_attr_chn_aldo,
+	&iio_attr_chn_dldo,
+	&iio_attr_chn_open_wire_detect,
+	&iio_attr_calibrate_adc,
+#if defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	&iio_attr_bandwidth
+#endif
+#endif
+};
+
+
+/* Device IIO attribute structures */
+
+static struct iio_attribute iio_attr_operating_mode = {
+	.name = "operating_mode",
+	.show = get_operating_mode,
+	.store = set_operating_mode,
+};
+
+static struct iio_attribute iio_attr_power_down_mode = {
+	.name = "power_down_mode",
+	.show = get_power_down_mode,
+	.store = set_power_down_mode,
+};
+
+static struct iio_attribute iio_attr_range = {
+	.name = "range",
+	.show = get_range,
+	.store = set_range,
+};
+
+static struct iio_attribute iio_attr_oversampling = {
+	.name = "oversampling",
+	.show = get_oversampling,
+	.store = set_oversampling,
+};
+
+static struct iio_attribute iio_attr_direct_reg_access = {
+	.name = "direct_reg_access",
+	.show = get_direct_reg_access,
+	.store = set_direct_reg_access,
+};
+
+static struct iio_attribute *global_attributes[] = {
+#if defined(DEV_AD7606B) || defined(DEV_AD7606C_18) || defined(DEV_AD7606C_16)
+	&iio_attr_operating_mode,
+	&iio_attr_oversampling,
+	&iio_attr_direct_reg_access,
+#else
+	&iio_attr_power_down_mode,
+	&iio_attr_range,
+#endif
+};
+
+
+static struct iio_channel iio_channel_ch1_in = {
+	.name = "voltage1",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch2_in = {
+	.name = "voltage2",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch3_in = {
+	.name = "voltage3",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch4_in = {
+	.name = "voltage4",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch5_in = {
+	.name = "voltage5",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch6_in = {
+	.name = "voltage6",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch7_in = {
+	.name = "voltage7",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+static struct iio_channel iio_channel_ch8_in = {
+	.name = "voltage8",
+	.attributes = channel_input_attributes,
+	.ch_out = false,
+};
+
+
+static struct iio_channel *iio_ad7606_channels[] = {
+	&iio_channel_ch1_in,
+	&iio_channel_ch2_in,
+	&iio_channel_ch3_in,
+	&iio_channel_ch4_in,
+#if (NO_OF_CHANNELS > 4)
+	&iio_channel_ch5_in,
+	&iio_channel_ch6_in,
+#endif
+#if (NO_OF_CHANNELS > 6)
+	&iio_channel_ch7_in,
+	&iio_channel_ch8_in,
+#endif
+};
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+#endif /* IIO_AD7606_ATTR_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/iio_transport.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/iio_transport.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,184 @@
+/***************************************************************************//**
+ *   @file   iio_transport.c
+ *   @brief  Implementation of iio transport layer interface for AD7606
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "iio_transport.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/* Max buffer length to hold IIO client data/command */
+#define IIO_CMD_DATA_BUFF_SIZE	(100)
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/* UART descriptor to read/write UART peripheral data */
+static struct uart_desc *uart_desc = NULL;
+
+/* IIO command buffer */
+static volatile char iio_cmd_buffer[IIO_CMD_DATA_BUFF_SIZE];
+
+/* IIO data buffer */
+static volatile char iio_data_buffer[IIO_CMD_DATA_BUFF_SIZE];
+
+/* New IIO command detect flag */
+static volatile bool new_iio_cmd_detected = false;
+
+/* Data buffer index */
+volatile static uint8_t data_buff_indx = 0;
+
+/* Command buffer index */
+volatile static uint8_t cmd_buff_indx = 0;
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief	IIO Wrapper to initialize the UART peripheral
+ * @param	desc- Pointer UART descriptor structure
+ * @param	param- Pointer to UART init param structure
+ * @return	uart init status (SUCCESS/FAILURE)
+ */
+int32_t iio_uart_init(struct uart_desc **desc, struct uart_init_param *param)
+{
+	if (uart_init(desc, param) == SUCCESS) {
+		/* Save the descriptor for data read/write operation */
+		uart_desc = *desc;
+
+		return SUCCESS;
+	} else {
+		return FAILURE;
+	}
+}
+
+
+/**
+ * @brief	IIO Wrapper to wrire data to UART peripheral
+ * @param	buf- Pointer to buffer containing data
+ * @param	len- Number of bytes to write
+ * @return	bytes len in case of success, 0 otherwise
+ */
+ssize_t iio_uart_write(const char *buf, size_t len)
+{
+	if (uart_write(uart_desc, (uint8_t *)buf, len) == SUCCESS) {
+		return len;
+	} else {
+		return 0;
+	}
+}
+
+
+/**
+ * @brief	IIO Wrapper to read iio data/command from UART peripheral
+ * @param	buf- Pointer to buffer containing data
+ * @param	len- Number of bytes to read
+ * @return	bytes len in case of success, 0 otherwise
+ */
+ssize_t iio_uart_read(char *buf, size_t len)
+{
+	size_t i = 0;
+
+	if (len > 1) {
+		do {
+			/* Wait until new data of expected length is received
+			 * from UART Rx interrupt event */
+		} while (data_buff_indx < len);
+
+		/* Get the data into local buffer (entire data) */
+		while (i < len) {
+			buf[i] = iio_data_buffer[i];
+			i++;
+		}
+		data_buff_indx = 0;
+	} else {
+		/* Get the iio command into local buffer (1 character at a time) */
+		buf[i] = iio_cmd_buffer[cmd_buff_indx];
+
+		/* Reset buffer index after reading whole command */
+		if (iio_cmd_buffer[cmd_buff_indx] == '\n') {
+			cmd_buff_indx = 0;
+		} else {
+			cmd_buff_indx++;
+		}
+	}
+
+	return len;
+}
+
+
+/*!
+ * @brief	Callback function to receive IIO command
+ * @return	None
+ * @details	This function is an UART Rx ISR registered by IIO application
+ *			to invoke upon receipt og new character over UART link.
+ */
+void iio_uart_rx_callback(void)
+{
+	uint8_t rx_char;
+
+	if (uart_read(uart_desc, &rx_char, 1) == SUCCESS) {
+
+		iio_data_buffer[data_buff_indx++] = rx_char;
+
+		if (rx_char == '\n') {
+			/* The iio command is identified with new line character */
+			memcpy(iio_cmd_buffer, iio_data_buffer, data_buff_indx);
+			data_buff_indx = 0;
+			new_iio_cmd_detected = true;
+		}
+	}
+}
+
+
+/*!
+ * @brief	Function to check for newer IIO command
+ * @return	IIO command status (true/false)
+ */
+bool is_new_iio_command_detected(void)
+{
+	if (new_iio_cmd_detected) {
+		new_iio_cmd_detected = false;
+		return true;
+	} else {
+		return false;
+	}
+}
+
+
+/*!
+ * @brief	Function to check for expected IIO command
+ * @param	cmd_str[in] - Expected IIO command string
+ * @param	len[in] - Length of IIO command
+ * @return	IIO command status (true/false)
+ */
+bool check_iio_cmd(const char *cmd_str, uint8_t len)
+{
+	int ret;
+
+	ret = strncmp(cmd_str, iio_cmd_buffer, len);
+	if (ret == 0) {
+		/* String matches, return true */
+		return true;
+	}
+
+	return false;
+}
diff -r 000000000000 -r 3afcd581558d app/src/iio_transport.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/iio_transport.h	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,56 @@
+/***************************************************************************//**
+ *   @file   iio_transport.h
+ *   @brief  Header file of iio_transport.
+ *   @author
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+#ifndef IIO_TRANSPORT_H_
+#define IIO_TRANSPORT_H_
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+
+#include "iio.h"
+#include "platform_drivers.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definition ***********************/
+/******************************************************************************/
+
+/* Baud rate for IIO UART interface */
+#define IIO_UART_BAUD_RATE	(230400U)
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* UART peripheral init wrapper */
+int32_t iio_uart_init(struct uart_desc **desc, struct uart_init_param *param);
+
+/* UART data write wrapper */
+ssize_t iio_uart_write(const char *buf, size_t len);
+
+/* UART data read wrapper */
+ssize_t iio_uart_read(char *buf, size_t len);
+
+/* IIO command detect monitor */
+bool is_new_iio_command_detected(void);
+
+/* Check for specific IIO command */
+bool check_iio_cmd(const char *cmd_str, uint8_t len);
+
+/* IIO UART receive interrupt callback function */
+void iio_uart_rx_callback(void);
+
+#endif /* IIO_TRANSPORT_H_ */
diff -r 000000000000 -r 3afcd581558d app/src/main.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/main.c	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,50 @@
+/***************************************************************************//**
+ *   @file    main.c
+ *   @brief   Main module for AD7606 IIO application
+ *   @details This module invokes the AD7606 IIO interfaces
+ *            through forever loop.
+********************************************************************************
+ * Copyright (c) 2020 Analog Devices, Inc.
+ *
+ * All rights reserved.
+ *
+ * This software is proprietary to Analog Devices, Inc. and its licensors.
+ * By using this software you agree to the terms of the associated
+ * Analog Devices Software License Agreement.
+*******************************************************************************/
+
+/******************************************************************************/
+/***************************** Include Files **********************************/
+/******************************************************************************/
+#include <stdio.h>
+#include <stdint.h>
+#include <assert.h>
+
+#include "platform_support.h"
+#include "iio_ad7606.h"
+#include "error.h"
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+ * @brief	Main entry point to application
+ * @return	none
+ */
+int main(void)
+{
+	/* Initialize the AD7606 IIO interface */
+	if (ad7606_iio_initialize() == FAILURE) {
+		assert(false);
+	}
+
+	while (1) {
+		/* Monitor the IIO client events */
+		ad7606_iio_event_handler();
+	}
+}
diff -r 000000000000 -r 3afcd581558d mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#a6207cadad0acd1876f436dc6baeddf46c42af06
diff -r 000000000000 -r 3afcd581558d mbed_app.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Thu Jan 14 18:54:16 2021 +0530
@@ -0,0 +1,17 @@
+{
+	"requires": ["bare-metal"],
+	"macros": [
+		"TINYIIOD_VERSION_MAJOR=0",
+		"TINYIIOD_VERSION_MINOR=1",
+		"TINYIIOD_VERSION_GIT=\"0.1\"",
+		"IIOD_BUFFER_SIZE=0x1000",
+		"_USE_STD_INT_TYPES"
+
+	],
+    "target_overrides": {
+        "*": {
+            "platform.default-serial-baud-rate": 115200,
+			"target.printf_lib": "std"
+        }
+    }
+}
\ No newline at end of file