Example program for EVAL-ADMX2001

Dependencies:   ADMX2001

Files at this revision

API Documentation at this revision

Comitter:
nsheth
Date:
Tue Nov 02 10:14:25 2021 +0000
Parent:
8:bd0b93e35392
Child:
10:186e097fb1e3
Commit message:
Added platform drivers, documentation updated, short calibration completed

Changed in this revision

ADMX2001.lib Show annotated file Show diff for this revision Revisions of this file
README.txt Show annotated file Show diff for this revision Revisions of this file
calibrate.cpp Show annotated file Show diff for this revision Revisions of this file
calibrate.h Show annotated file Show diff for this revision Revisions of this file
gpio_config.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
measure.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/License.txt Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/delay.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/error.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/gpio.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/i2c.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/platform_drivers.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/platform_support.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/inc/spi.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/delay.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/gpio.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/gpio_extra.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/i2c.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/i2c_extra.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/platform_support.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/spi.cpp Show annotated file Show diff for this revision Revisions of this file
platform_drivers/src/spi_extra.h Show annotated file Show diff for this revision Revisions of this file
--- a/ADMX2001.lib	Wed Oct 27 21:18:12 2021 +0000
+++ b/ADMX2001.lib	Tue Nov 02 10:14:25 2021 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/nsheth/code/ADMX2001/#f286301109fb
+https://os.mbed.com/users/nsheth/code/ADMX2001/#49537b1dbbd7
--- a/README.txt	Wed Oct 27 21:18:12 2021 +0000
+++ b/README.txt	Tue Nov 02 10:14:25 2021 +0000
@@ -1,26 +1,24 @@
 Evaluation Boards/Products Supported
 ------------------------------------ 
-EVAL-AD7124-8SZ
-EVAL-AD7124-4SZ
-Trial addition
+EVAL-ADMX2001
 
 Overview
 --------
 These code files provide the console application and device libraries to 
-interface with AD7124 EVAL board. This code was developed and tested on SDP-K1 
+interface with ADMX2001 board. This code was developed and tested on SDP-K1 
 controller board: https://os.mbed.com/platforms/SDP_K1/
 
-Product details: https://www.analog.com/en/products/ad7124-8.html
-Eval board details: https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-AD7124-8.html
-User Guide for this code: https://wiki.analog.com/resources/tools-software/product-support-software/ad7124_mbed_support
+Product details: 
+Eval board details: 
+User Guide for this code: 
 Communication Protocol: SPI
 
 
 Hardware Setup
 --------------
-Required: SDP-K1 (or alternative MBED enabled controller board), EVAL-AD7124-8SZ, 
+Required: SDP-K1 (or alternative MBED enabled controller board), ADMX2001, 
 USB cable.
-Plug in the EVAL-AD124 board on SDP-K1 board (or any other Mbed enabled 
+Plug in the ADMX2001 board on SDP-K1 board (or any other Mbed enabled 
 controller board) using the SDP connector and screws.
 Connect SDP-K1 board to the PC using the USB cable.
 
@@ -28,13 +26,22 @@
 How to Get Started
 ------------------
 Open Mbed online compiler. https://ide.mbed.com/compiler
-Import Code into compiler from here: https://os.mbed.com/teams/AnalogDevices/code/EVAL-AD7124/
+Import Code into compiler from here: https://os.mbed.com/teams/AnalogDevices/code/EVAL-ADMX2001/
 instructions on how to import code are here: https://os.mbed.com/docs/mbed-os/v5.12/tools/importing-code.html
-Compile code. Drag and drop binary into SDP-K1 controller board. Find detailed 
-instructions here: https://os.mbed.com/docs/mbed-os/v5.12/tools/getting-your-program-on-your-board.html
-Open Tera Term (or alternative), select 115200 baud rate, and the applicable COM 
-port to see the list of options.
+Compile code. Open Tera Term (or alternative), select serial communication with 115200 baud rate, and the applicable COM 
+port. Drag and drop binary into SDP-K1 controller board. Find detailed 
+instructions here: https://os.mbed.com/docs/mbed-os/v5.12/tools/getting-your-program-on-your-board.html. 
+Tera term will then display the print output of your complied code.  
 
+Details of Operation
+--------------------
+
+The ADMX2001 library, contain the code required to interface with the ADMX2001 module via the SPI interface. 
+The EVAL-ADMX2001 is a program that initialises the spi interface and uses the ADMX2001 library to communicate with the 
+ADMX2001 module. 
+This code performs a measurement and calibration. The set of SPI read/write operations needed for measurement and 
+calibration are present in measure.cpp and calibrate.cpp respectively. 
+The gpio_config file contains code to interface with the on board resistors and allow us to change the test load across the ADMX2001 terminals. 
 
 Notes
 -----
@@ -44,7 +51,7 @@
 
 License
 -------
-Copyright (c) 2019 Analog Devices, Inc.  All rights reserved.
+Copyright (c) 2021 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.
@@ -57,4 +64,4 @@
 
 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
\ No newline at end of file
+2021-01-10-7CBSD SLA
\ No newline at end of file
--- a/calibrate.cpp	Wed Oct 27 21:18:12 2021 +0000
+++ b/calibrate.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -79,6 +79,7 @@
  * @param [in] calType - Type of Calibrate
  * @param [in] stdR - stdR value
  * @param [in] stdX - stdX value
+ * @return Returns 0 for success or negative error code.
  * \ref Calibrate
  */
 int32_t Calibrate(CAL_TYPE calType, float stdR, float stdX)
@@ -155,6 +156,7 @@
 
 /**
  * @brief  Function to read and display calibrated values
+ * @return Returns 0 for success or negative error code.
  */
 int32_t ReadAndDisplayCalibratedValue()
 {
@@ -199,8 +201,11 @@
 }
 
 /**
- * @brief  Dsiplays the output value
- * \ref DisplayCalibratedValue
+ * @brief  Displays the output value
+ * @param [in] displayVal1 - display value 1
+ * @param [in] displayVal2 - display value 2
+ * @param [in] sweepVar - sweep variable
+ * @return Returns 0 for success or negative error code.
  */
 void DisplayCalibratedValue(double displayVal1, double displayVal2,
                             double sweepVar)
--- a/calibrate.h	Wed Oct 27 21:18:12 2021 +0000
+++ b/calibrate.h	Tue Nov 02 10:14:25 2021 +0000
@@ -48,6 +48,7 @@
 #define __CALIBRATE_H__
 
 /*============= I N C L U D E S =============*/
+
 #include <stdint.h>
 
 /*============= D E F I N E S =============*/
@@ -67,7 +68,6 @@
 
 /*============= F U N C T I O N  P R O T O T Y P E S =============*/
 
-
 /**
  * @details perform specified cal type calibration .
  * @param [in] calType - type of calibration
--- a/gpio_config.cpp	Wed Oct 27 21:18:12 2021 +0000
+++ b/gpio_config.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -36,17 +36,19 @@
 */
 
 /**
- * @file    
+ * @file    gpio_config.cpp
  * @brief   This file interfaces configures test loads
  * @{
  */
 
+/*=============  I N C L U D E S   =============*/
 #include <stdlib.h>
 #include "mbed.h"
 #include "gpio_config.h"
 #include "app_config.h"
 #include "platform_drivers.h"
 
+/*=============  D A T A  =============*/
 
 static DigitalOut muxSelA(A2); // Aurdino p4.3
 static DigitalOut muxSelB(A3); // Aurdino p4.4
--- a/main.cpp	Wed Oct 27 21:18:12 2021 +0000
+++ b/main.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -50,6 +50,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+/*=============  D A T A  =============*/
+
 /** This is kept global and non-static as test code requires this*/
 Admx200xDev admx200xDev;
 
@@ -57,6 +59,8 @@
 
 static int32_t ResetModule();
 
+static int32_t SetGain(uint32_t voltageGain, uint32_t currentGain);
+
 /**
  * 
  */
@@ -109,6 +113,39 @@
     return status;
 }
 
+/**
+ * Set the voltage/current gain 
+ */
+int32_t SetGain(uint32_t voltageGain, uint32_t currentGain)
+{
+    int32_t status = ADMX_STATUS_SUCCESS;
+    uint16_t addr = 0;
+    uint8_t cmdId;
+    uint32_t statReg;
+    Admx200xDev *pAdmx200x = &admx200xDev;
+    uint32_t data;
+    
+    data = voltageGain;
+    cmdId = CMD_VOLTAGE_GAIN;
+    status = Admx200xSendCmd(pAdmx200x, &cmdId, &addr, &data, &statReg);
+    if (status == ADMX_STATUS_SUCCESS)
+    {
+        status = (int32_t)(statReg & ADMX200X_STATUS_CODE_BITM);
+    }
+    
+    if (status == ADMX_STATUS_SUCCESS)
+    {
+        cmdId = CMD_CURRENT_GAIN;
+        status = Admx200xSendCmd(pAdmx200x, &cmdId, &addr, &data, &statReg);
+        if (status == ADMX_STATUS_SUCCESS)
+        {
+            status = (int32_t)(statReg & ADMX200X_STATUS_CODE_BITM);
+        }
+    }
+
+    return status;
+}
+
 int main()
 {
     int32_t status = 0;
@@ -147,11 +184,15 @@
             INFO_MSG("------ Measurement completed ------");
             
             INFO_MSG("------ Starting Calibration ------");
-            INFO_MSG("Setting test load to open circuit");
-            // Open the terminals across the lcr meter
-            EnableMuxLine(0);
-            // Running open calibration
-            calType = CAL_TYPE_OPEN;
+            INFO_MSG("Setting test load to short circuit");
+            // Short the terminals across the lcr meter
+            EnableMuxLine(1);
+            // Setting the gain for calibration
+            status = SetGain(0, 0);
+            INFO_MSG("Setting voltage gain to zero");
+            INFO_MSG("Setting current gain to zero");
+            // Running short calibration
+            calType = CAL_TYPE_SHORT;
             status = Calibrate(calType, stdLoad, Xt);
             INFO_MSG("------ Calibration completed ------");
         }
--- a/measure.cpp	Wed Oct 27 21:18:12 2021 +0000
+++ b/measure.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -44,10 +44,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+/*=============  D A T A T Y P E S  =============*/
+
 /**  maximum length for buffer for string operation */
 #define MAX_DISPLAY_LENGTH 256
 /**  maximum length for buffer for storing measurement values */
 #define MAX_MEASUREMENT_BUFFER 512
+
+/*=============  D A T A  =============*/
+
 /**  buffer for string operation */
 char displayString[MAX_DISPLAY_LENGTH];
 /** Array to store measurement values*/
@@ -137,9 +142,6 @@
     addr = 0;
     data = 0;
     
-    // set Ig = 0?
-    // set count to 1?/3?
-    
     cmdId = CMD_Z;
     status =
         Admx200xSendCmd(pAdmx200x, &cmdId, &addr, &data, &statReg);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/License.txt	Tue Nov 02 10:14:25 2021 +0000
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/delay.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,58 @@
+/***************************************************************************//**
+ *   @file   delay.h
+ *   @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_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/error.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,49 @@
+/***************************************************************************//**
+ *   @file   error.h
+ *   @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_
+
+/******************************************************************************/
+/********************** Macros and Constants Definitions **********************/
+/******************************************************************************/
+
+#define ADI_SUCCESS		0
+#define ADI_FAILURE		-1
+
+#endif // ERROR_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/gpio.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,102 @@
+/***************************************************************************//**
+ *   @file   gpio.h
+ *   @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
+
+#define GPIO_HIGH	0x01
+#define GPIO_LOW	0x00
+
+/******************************************************************************/
+/*************************** Types Declarations *******************************/
+/******************************************************************************/
+
+typedef struct gpio_init_param {
+	uint8_t		number;
+	void		*extra;
+} gpio_init_param;
+
+typedef struct gpio_desc {
+	uint8_t		number;
+	void		*extra;
+} gpio_desc;
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+/* Obtain the GPIO decriptor. */
+int32_t gpio_get(struct gpio_desc **desc,
+		 const 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_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/i2c.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,93 @@
+/***************************************************************************//**
+ *   @file   i2c.h
+ *   @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 *******************************/
+/******************************************************************************/
+
+typedef enum i2c_transfer_mode {
+	i2c_general_call =	0x01,
+	i2c_repeated_start =	0x02,
+	i2c_10_bit_transfer =	0x04
+} i2c_transfer_mode;
+
+typedef struct i2c_init_param {
+	uint32_t	max_speed_hz;
+	uint8_t		slave_address;
+	void		*extra;
+} i2c_init_param;
+
+typedef struct i2c_desc {
+	uint32_t	max_speed_hz;
+	uint8_t		slave_address;
+	void		*extra;
+} 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 option);
+
+/* Read data from a slave device. */
+int32_t i2c_read(struct i2c_desc *desc,
+		 uint8_t *data,
+		 uint8_t bytes_number,
+		 uint8_t option);
+
+#endif // I2C_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/platform_drivers.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,80 @@
+/***************************************************************************//**
+ *   @file   platform_drivers.h
+ *   @brief  Header file of Generic Platform Drivers.
+ *   @author DBogdan (dragos.bogdan@analog.com)
+********************************************************************************
+ * Copyright 2017, 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 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 "delay.h"
+#include "error.h"
+#include "gpio.h"
+#include "i2c.h"
+#include "spi.h"
+
+
+#ifdef __cplusplus  // Closing extern c
+}
+#endif //  _cplusplus
+
+#endif // PLATFORM_DRIVERS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/platform_support.h	Tue Nov 02 10:14:25 2021 +0000
@@ -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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/inc/spi.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,96 @@
+/***************************************************************************//**
+ *   @file   spi.h
+ *   @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 *******************************/
+/******************************************************************************/
+
+typedef enum spi_mode {
+	SPI_MODE_0 = (0 | 0),
+	SPI_MODE_1 = (0 | SPI_CPHA),
+	SPI_MODE_2 = (SPI_CPOL | 0),
+	SPI_MODE_3 = (SPI_CPOL | SPI_CPHA)
+} spi_mode;
+
+typedef struct spi_init_param {
+	uint32_t	max_speed_hz;
+	uint8_t		chip_select;
+	enum spi_mode	mode;
+	void		*extra;
+} spi_init_param;
+
+typedef struct spi_desc {
+	uint32_t	max_speed_hz;
+	uint8_t		chip_select;
+	enum spi_mode	mode;
+	void		*extra;
+} 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_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/delay.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,51 @@
+/***************************************************************************//**
+ *   @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)
+{
+	if (usecs) {
+		// Unused variable - fix compiler warning
+	}
+}
+
+/**
+ * @brief Generate miliseconds delay.
+ * @param msecs - Delay in miliseconds.
+ * @return None.
+ */
+void mdelay(uint32_t msecs)
+{
+	if (msecs) {
+		HAL_Delay(msecs);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/gpio.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,227 @@
+/***************************************************************************//**
+ *   @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 <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 ADI_SUCCESS in case of success, ADI_FAILURE otherwise.
+ */
+int32_t gpio_get(struct gpio_desc **desc, const gpio_init_param *param)
+{
+	if (desc) {
+		// Create the gpio description object for the device
+		gpio_desc *new_gpio = (gpio_desc *)malloc(sizeof(gpio_desc));
+		if (new_gpio == NULL) {
+			return ADI_FAILURE;
+		}
+
+		new_gpio->number = param->number;
+		*desc = new_gpio;
+
+		return ADI_SUCCESS;
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by gpio_get().
+ * @param desc - The GPIO descriptor.
+ * @return ADI_SUCCESS in case of success, ADI_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 ADI_SUCCESS;
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Enable the input direction of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @return ADI_SUCCESS in case of success, ADI_FAILURE otherwise.
+ */
+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) {
+		// Configure and instantiate GPIO pin as input
+		gpio_input = new DigitalIn((PinName)desc->number);
+		if (gpio_input == NULL) {
+			return ADI_FAILURE;
+		}
+
+		// Create the gpio extra descriptor object to store new gpio instance
+		gpio_desc_extra = (mbed_gpio_desc *)malloc(sizeof(mbed_gpio_desc));
+		if (gpio_desc_extra == NULL) {
+			return ADI_FAILURE;
+		}
+
+		gpio_desc_extra->gpio_pin = (mbed_gpio_desc *)gpio_input;
+		desc->extra = (mbed_gpio_desc *)gpio_desc_extra;
+
+		// Set the gpio pin mode
+		gpio_input->mode((PinMode)((mbed_gpio_init_param *)desc->extra)->pin_mode);
+
+		return ADI_SUCCESS;
+	}
+
+	return ADI_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 ADI_SUCCESS in case of success, ADI_FAILURE otherwise.
+ */
+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) {
+		// Configure and instantiate GPIO pin as output
+		gpio_output = new DigitalOut((PinName)desc->number);
+		if (gpio_output == NULL) {
+			return ADI_FAILURE;
+		}
+
+		// Create the gpio extra descriptor object to store new gpio instance
+		gpio_desc_extra = (mbed_gpio_desc *)malloc(sizeof(mbed_gpio_desc));
+		if (gpio_desc_extra == NULL) {
+			return ADI_FAILURE;
+		}
+
+		gpio_desc_extra->gpio_pin = (mbed_gpio_desc *)gpio_output;
+		desc->extra = (mbed_gpio_desc *)gpio_desc_extra;
+
+		return ADI_SUCCESS;
+	}
+
+	if (value) {
+		// Unused variable - fix compiler warning
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Get the direction of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param direction - The direction.
+ *                    Example: GPIO_OUT
+ *                             GPIO_IN
+ * @return ADI_SUCCESS in case of success, ADI_FAILURE otherwise.
+ */
+int32_t gpio_get_direction(struct gpio_desc *desc, uint8_t *direction)
+{
+	if (desc) {
+		// Unused variable - fix compiler warning
+	}
+
+	if (direction) {
+		// Unused variable - fix compiler warning
+	}
+
+	return ADI_SUCCESS;
+}
+
+
+/**
+ * @brief Set the value of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param value - The value.
+ *                Example: GPIO_HIGH
+ *                         GPIO_LOW
+ * @return ADI_SUCCESS in case of success, ADI_FAILURE otherwise.
+ */
+int32_t gpio_set_value(struct gpio_desc *desc, uint8_t value)
+{
+	DigitalOut *gpio_output;		// pointer to gpio output object
+
+	if (desc) {
+		gpio_output = (DigitalOut *)((mbed_gpio_desc *)desc->extra)->gpio_pin;
+		gpio_output->write(value);
+
+		return ADI_SUCCESS;
+	}
+
+	if (value) {
+		// Unused variable - fix compiler warning
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Get the value of the specified GPIO.
+ * @param desc - The GPIO descriptor.
+ * @param value - The value.
+ *                Example: GPIO_HIGH
+ *                         GPIO_LOW
+ * @return ADI_SUCCESS in case of success, ADI_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 = ADI_FAILURE;
+
+	if (desc) {
+		gpio_input = (DigitalIn *)((mbed_gpio_desc *)desc->extra)->gpio_pin;
+		*value = (uint8_t)gpio_input->read();
+		returnVal = gpio_input->is_connected() ? ADI_SUCCESS : ADI_FAILURE;
+
+		return returnVal;
+	}
+
+	return ADI_FAILURE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/gpio_extra.h	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,71 @@
+/***************************************************************************//**
+ *   @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 {
+	void *gpio_pin;     	// GPIO pin instance (DigitalIn/DigitalOut)
+} mbed_gpio_desc;
+
+
+/******************************************************************************/
+/************************ Functions Declarations ******************************/
+/******************************************************************************/
+
+
+#ifdef __cplusplus // Closing extern c
+}
+#endif
+
+#endif /* GPIO_EXTRA_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/i2c.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,174 @@
+/***************************************************************************//**
+ *   @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 ADI_SUCCESS in case of ADI_SUCCESS, ADI_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 ADI_FAILURE;
+		}
+
+		new_desc->slave_address = param->slave_address;
+
+		// 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 ADI_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 ADI_FAILURE;
+		}
+
+		mbed_desc->i2c_port = (I2C *)i2c;
+		new_desc->extra = (mbed_i2c_desc *)mbed_desc;
+
+		*desc = new_desc;
+
+		return ADI_SUCCESS;
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by i2c_init_noos().
+ * @param desc - The I2C descriptor.
+ * @return ADI_SUCCESS in case of ADI_SUCCESS, ADI_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 ADI_SUCCESS;
+	}
+
+	return ADI_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 ADI_SUCCESS in case of ADI_SUCCESS, ADI_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 ADI_SUCCESS;
+	} else {
+		return ADI_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 ADI_SUCCESS in case of ADI_SUCCESS, ADI_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 ADI_SUCCESS;
+	} else {
+		return ADI_FAILURE;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/i2c_extra.h	Tue Nov 02 10:14:25 2021 +0000
@@ -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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/platform_support.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,59 @@
+/***************************************************************************//**
+ *   @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 *****************/
+/******************************************************************************/
+
+#define BAUD_RATE        115200  // UART Communication Baud Rate
+
+/******************************************************************************/
+/************************ Variable Declarations *******************************/
+/******************************************************************************/
+
+// Configure and instantiate UART protocol and baud rate
+// *Note: Multiple instances of 'Serial' port can be created with different pins
+//        and baud rate settings. In that case, user must use desired 'Serial'
+//        instance/object to access the serial data, since order of declaration
+//        depends upon the user and compiler.
+static Serial port(USBTX, USBRX, BAUD_RATE);
+
+/******************************************************************************/
+/************************ Functions Definitions *******************************/
+/******************************************************************************/
+
+/**
+  * @brief  getchar, but does not block if nothing waiting to be read
+  * @param  None
+  * @retval 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) {
+		rx_char = port.getc();
+	}
+
+	return rx_char;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/spi.cpp	Tue Nov 02 10:14:25 2021 +0000
@@ -0,0 +1,174 @@
+/***************************************************************************//**
+ *   @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 SEND_BYTE                      8
+
+/******************************************************************************/
+/********************** Variables and User defined data types *****************/
+/******************************************************************************/
+
+/******************************************************************************/
+/************************ 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 ADI_SUCCESS in case of success, ADI_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 ADI_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 ADI_FAILURE;
+		}
+
+		// Configure and instantiate slave select pin
+		ss = new DigitalOut((PinName)(new_desc->chip_select));
+		if (ss == NULL) {
+			return ADI_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 ADI_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(SEND_BYTE, param->mode);       // Stick to byte-multiples
+		spi->set_default_write_value(0x00);        // code to write when reading back
+		ss->write(GPIO_HIGH);                      // set SS high
+
+		return ADI_SUCCESS;
+	}
+
+	return ADI_FAILURE;
+}
+
+
+/**
+ * @brief Free the resources allocated by spi_init().
+ * @param desc - The SPI descriptor.
+ * @return ADI_SUCCESS in case of success, ADI_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 ADI_SUCCESS;
+	}
+
+	return ADI_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 ADI_SUCCESS in case of success, ADI_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
+	DigitalOut *ss;  	// pointer to new SS instance
+
+	if (desc) {
+		spi = (SPI *)(((mbed_spi_desc *)(desc->extra))->spi_port);
+		ss = (DigitalOut *)(((mbed_spi_desc *)(desc->extra))->slave_select);
+
+		ss->write(GPIO_LOW);
+
+		for (size_t byte = 0 ; byte < bytes_number ; byte++) {
+			data[byte] =  spi->write(data[byte]);
+		}
+
+		ss->write(GPIO_HIGH);
+
+		return ADI_SUCCESS;
+	}
+
+	return ADI_FAILURE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/platform_drivers/src/spi_extra.h	Tue Nov 02 10:14:25 2021 +0000
@@ -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 */