Analog Devices / ADMX2001

Files at this revision

API Documentation at this revision

Comitter:
nsheth
Date:
Tue Nov 02 10:13:33 2021 +0000
Parent:
9:f286301109fb
Child:
11:071709f5f7d4
Commit message:
Removing platform drivers

Changed in this revision

ADMX2001.cpp Show annotated file Show diff for this revision Revisions of this file
ADMX2001_commands.h Show annotated file Show diff for this revision Revisions of this file
platform_drivers/License.txt Show diff for this revision Revisions of this file
platform_drivers/inc/delay.h Show diff for this revision Revisions of this file
platform_drivers/inc/error.h Show diff for this revision Revisions of this file
platform_drivers/inc/gpio.h Show diff for this revision Revisions of this file
platform_drivers/inc/i2c.h Show diff for this revision Revisions of this file
platform_drivers/inc/platform_drivers.h Show diff for this revision Revisions of this file
platform_drivers/inc/platform_support.h Show diff for this revision Revisions of this file
platform_drivers/inc/spi.h Show diff for this revision Revisions of this file
platform_drivers/src/delay.cpp Show diff for this revision Revisions of this file
platform_drivers/src/gpio.cpp Show diff for this revision Revisions of this file
platform_drivers/src/gpio_extra.h Show diff for this revision Revisions of this file
platform_drivers/src/i2c.cpp Show diff for this revision Revisions of this file
platform_drivers/src/i2c_extra.h Show diff for this revision Revisions of this file
platform_drivers/src/platform_support.cpp Show diff for this revision Revisions of this file
platform_drivers/src/spi.cpp Show diff for this revision Revisions of this file
platform_drivers/src/spi_extra.h Show diff for this revision Revisions of this file
--- a/ADMX2001.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ b/ADMX2001.cpp	Tue Nov 02 10:13:33 2021 +0000
@@ -34,6 +34,7 @@
 
 2021-01-10-7CBSD SLA
 */
+
 /**
  * @file     ADMX2001.cpp
  * @brief    This file contains admx200x APIs for sdpk1 host
--- a/ADMX2001_commands.h	Wed Oct 27 21:17:37 2021 +0000
+++ b/ADMX2001_commands.h	Tue Nov 02 10:13:33 2021 +0000
@@ -34,6 +34,7 @@
 
 2021-01-10-7CBSD SLA
 */
+
 /**
  * @file     ADMX2001_commands.h
  * @brief    This file contains Macros for the SPI Commands
@@ -46,7 +47,7 @@
 /** Bit mask to indicate read or write */
 #define CMD_READ_BITM 0x80
 
-/** Length of a command*/
+/** Length of a command */
 #define ADMX200X_CMD_LENGTH 7
 
 /** Basic commands */
@@ -58,23 +59,23 @@
 #define CMD_CLEAR_ERROR 0x02
 /** Read fifo */
 #define CMD_FIFO_READ 0x03
-/**  Command to calibrate*/
+/**  Command to calibrate */
 #define CMD_CALIBRATE 0x04
-/** Command to read compensation value*/
+/** Command to read compensation value */
 #define CMD_COMPENSATION 0x5
-/** Command to read calibration coefficient*/
+/** Command to read calibration coefficient */
 #define CMD_CAL_READ 0x06
-/** Command to store calibration coefficient*/
+/** Command to store calibration coefficient */
 #define CMD_STORE_CAL 0x08
-/** Command to store calibration coefficient*/
+/** Command to store calibration coefficient */
 #define CMD_RESET_CAL 0x09
 /** Command to swithc on or off error check */
 #define CMD_ERR_CHECK 0xa
 /** Command to swithc on or off error check */
 #define CMD_SELF_TEST 0xb
-/** Command to read calibration coefficient*/
+/** Command to read calibration coefficient */
 #define CMD_COMP_READ 0xc
-/** Command to store calibration coefficient*/
+/** Command to store calibration coefficient */
 #define CMD_STORE_COMP 0xd
 /** Command to read temperature */
 #define CMD_TEMPERATURE 0xe
@@ -90,72 +91,72 @@
 #define CMD_VOLTAGE_GAIN_TABLE 0x14
 /** Version Details */
 #define CMD_VERSION 0x15
-/** Command to read or write spi regsiters*/
+/** Command to read or write spi regsiters */
 #define CMD_IP_REGISTERS 0x16
-/** Initiates the measurement  */
+/** Initiates the measurement */
 #define CMD_INITIATE (0x17)
-/** Triggers the measurement  */
+/** Triggers the measurement */
 #define CMD_TRIGGER (0x18)
-/** Fetch the last measurement  */
+/** Fetch the last measurement */
 #define CMD_FETCH (0x19)
-/** Aborts the measurement  */
+/** Aborts the measurement */
 #define CMD_ABORT (0x1a)
 /** Calibration commit command */
 #define CMD_CAL_COMMIT (0x1b)
-/** Calibration commit password set*/
+/** Calibration commit password set */
 #define CMD_SET_PASSWORD (0x1c)
-/** Calibration commit get password*/
+/** Calibration commit get password */
 #define CMD_GET_PASSWORD (0x1d)
 /** Command to read or write spi regsiters with address more than uint16 */
 #define CMD_IP_REGISTERS_U32 (0x1e)
 
 /**  Base of attribute commands  */
 #define CMD_ATTR_BASE (0x20)
-/**  lcr frequecny   */
+/**  lcr frequecny */
 #define CMD_FREQUENCY (CMD_ATTR_BASE + 3)
-/**  lcr integration time    */
+/**  lcr integration time */
 #define CMD_INTEGRATION (CMD_ATTR_BASE + 4)
-/**  dds magnitude   */
+/**  dds magnitude */
 #define CMD_MAGNITUDE (CMD_ATTR_BASE + 5)
-/**   dds offset   */
+/**   dds offset */
 #define CMD_OFFSET (CMD_ATTR_BASE + 6)
-/**  dds gain   */
+/**  dds gain */
 #define CMD_DDS_GAIN (CMD_ATTR_BASE + 7)
-/**  lcr voltage gain   */
+/**  lcr voltage gain */
 #define CMD_VOLTAGE_GAIN (CMD_ATTR_BASE + 8)
-/**  lcr current gain   */
+/**  lcr current gain */
 #define CMD_CURRENT_GAIN (CMD_ATTR_BASE + 9)
-/**  lcr average   */
+/**  lcr average */
 #define CMD_AVERAGE (CMD_ATTR_BASE + 10)
-/**  lcr measurement delay   */
+/**  lcr measurement delay */
 #define CMD_MDELAY (CMD_ATTR_BASE + 11)
-/**  lcr trigger delay   */
+/**  lcr trigger delay */
 #define CMD_TDELAY (CMD_ATTR_BASE + 12)
-/**  lcr trigger count   */
+/**  lcr trigger count */
 #define CMD_TCOUNT (CMD_ATTR_BASE + 13)
-/** Sweep Start*/
+/** Sweep Start */
 #define CMD_SWEEP_START (CMD_ATTR_BASE + 16)
 /** Sweep End*/
 #define CMD_SWEEP_END (CMD_ATTR_BASE + 17)
-/** Sweep Type*/
+/** Sweep Type */
 #define CMD_SWEEP_TYPE (CMD_ATTR_BASE + 18)
 /** lcr sweep scale log or linear */
 #define CMD_SWEEP_SCALE (CMD_ATTR_BASE + 19)
-/** lcr cycles   */
+/** lcr cycles */
 #define CMD_CYCLES (CMD_ATTR_BASE + 20)
-/** lcr celsius  */
+/** lcr celsius */
 #define CMD_CELSIUS (CMD_ATTR_BASE + 27)
-/** lcr radians  */
+/** lcr radians */
 #define CMD_RADIANS (CMD_ATTR_BASE + 28)
-/** lcr lock  */
+/** lcr lock */
 #define CMD_LOCK (CMD_ATTR_BASE + 29)
-/** lcr display  */
+/** lcr display */
 #define CMD_DISPLAY (CMD_ATTR_BASE + 33)
-/** lcr sample count   */
+/** lcr sample count */
 #define CMD_COUNT (CMD_ATTR_BASE + 34)
-/** lcr correction mode   */
+/** lcr correction mode */
 #define CMD_CORRECTION_MODE (CMD_ATTR_BASE + 35)
-/** Check ADC and FIFO overflow   */
+/** Check ADC and FIFO overflow */
 #define CMD_OVERFLOW_CHECK (CMD_ATTR_BASE + 36)
 /** DC resistance mode */
 #define CMD_RESISTANCE_MODE (CMD_ATTR_BASE + 37)
@@ -169,18 +170,18 @@
 #define CMD_BOARD_REV (CMD_ATTR_BASE + 41)
 /** Trigger mode */
 #define CMD_TRIGGER_MODE (CMD_ATTR_BASE + 42)
-/** State of behaviour model  - only read allowed*/
+/** State of behaviour model  - only read allowed */
 #define CMD_STATE ((CMD_ATTR_BASE + 45) | CMD_READ_BITM)
 /** Actual measurement count value  */
 #define CMD_ACTUAL_COUNT (CMD_ATTR_BASE + 47)
 /** Check if vector display mode is enabled */
 #define CMD_SELF_TEST_STATUS (CMD_ATTR_BASE + 49)
-/** Unique ID -  addr0 - lower 32 , addr 1 upper 32*/
+/** Unique ID -  addr0 - lower 32 , addr 1 upper 32 */
 #define CMD_UNIQUE_ID (CMD_ATTR_BASE + 50)
 /** Warning Message Type */
 #define CMD_WARNING_TYPE (CMD_ATTR_BASE + 51)
 
-/** Not defined or unsupported command*/
+/** Not defined or unsupported command */
 #define CMD_NOT_DEFINED 0xFF
 
 /** Bit mask for measure done bit  */
@@ -198,17 +199,17 @@
 /** Bit mask for command result code field bits */
 #define ADMX200X_STATUS_CODE_BITM 0x0000FFFF
 
-/** Success **/
+/** Success */
 #define ADMX_STATUS_SUCCESS 0
-/** Failed **/
+/** Failed */
 #define ADMX_STATUS_FAILED 1
-/** Timeout **/
+/** Timeout */
 #define ADMX_STATUS_TIMEOUT 2
 /** Invalid attribute */
 #define ADMX_STATUS_INVALID_ATTRIBUTE 3
 /** Attribute value out of range */
 #define ADMX_STATUS_ATTR_OUT_OF_RANGE 4
-/** Invalid address of tcommand*/
+/** Invalid address of tcommand */
 #define ADMX_STATUS_INVALID_ADDRESS 5
 /** Uncommitted calibration coeffs */
 #define ADMX_STATUS_UNCOMMITED_CAL 6
@@ -230,7 +231,7 @@
 #define ADMX_STATUS_INVALID_CAL_TYPE 13
 /** Invalid calibration gains */
 #define ADMX_STATUS_INVALID_GAIN 14
-/** WArning Auto range got disabled in this command*/
+/** WArning Auto range got disabled in this command */
 #define ADMX_STATUS_AUTO_RANGE_DISABLED 15
 /** Calibration faild */
 #define ADMX_STATUS_CAL_FAILED 15
--- a/platform_drivers/License.txt	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-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
--- a/platform_drivers/inc/delay.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/inc/error.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/inc/gpio.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/inc/i2c.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/inc/platform_drivers.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/inc/platform_support.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/***************************************************************************//**
- *   @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_ */
--- a/platform_drivers/inc/spi.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/***************************************************************************//**
- *   @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_
--- a/platform_drivers/src/delay.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/***************************************************************************//**
- *   @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);
-	}
-}
--- a/platform_drivers/src/gpio.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/***************************************************************************//**
- *   @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;
-}
--- a/platform_drivers/src/gpio_extra.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/***************************************************************************//**
- *   @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 */
--- a/platform_drivers/src/i2c.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/***************************************************************************//**
- *   @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;
-	}
-}
--- a/platform_drivers/src/i2c_extra.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/***************************************************************************//**
- *   @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 */
--- a/platform_drivers/src/platform_support.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/***************************************************************************//**
- *   @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;
-}
--- a/platform_drivers/src/spi.cpp	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/***************************************************************************//**
- *   @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;
-}
--- a/platform_drivers/src/spi_extra.h	Wed Oct 27 21:17:37 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/***************************************************************************//**
- *   @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 */