Example program for EVAL-AD5770R

Dependencies:   adi_console_menu platform_drivers

Files at this revision

API Documentation at this revision

Comitter:
Kjansen
Date:
Tue Aug 03 17:34:58 2021 +0100
Parent:
4:ddef2e8cb4f7
Commit message:
No-OS Adoption Changes:

* Updated the .lib files for adoption of no-OS repository as-is.
* Replaced platform_drivers.h with required header files.
* Updated the copyright year.
* Indentation fixes.

Mbed OS update changes:
1) Added the mbed_app.json file with custom parameters.
2) Updated the mbed-os version to 6.8.0

Updated the readme file.

Changed in this revision

AD5770R.lib Show diff for this revision Revisions of this file
README.txt Show annotated file Show diff for this revision Revisions of this file
adi_console_menu.lib Show diff for this revision Revisions of this file
app/.mbedignore Show annotated file Show diff for this revision Revisions of this file
app/ad5770_user_config.c Show annotated file Show diff for this revision Revisions of this file
app/ad5770r_console_app.c Show annotated file Show diff for this revision Revisions of this file
app/ad5770r_console_app.h Show annotated file Show diff for this revision Revisions of this file
app/ad5770r_reset_config.c Show annotated file Show diff for this revision Revisions of this file
app/ad5770r_reset_config.h Show annotated file Show diff for this revision Revisions of this file
app/ad5770r_user_config.h Show annotated file Show diff for this revision Revisions of this file
app/adi_console_menu.lib Show annotated file Show diff for this revision Revisions of this file
app/app_config.h Show annotated file Show diff for this revision Revisions of this file
app/main.c Show annotated file Show diff for this revision Revisions of this file
app/mbed_platform_drivers.lib Show annotated file Show diff for this revision Revisions of this file
app/no-OS.lib Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
platform_drivers.lib Show diff for this revision Revisions of this file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f AD5770R.lib
--- a/AD5770R.lib	Wed Feb 24 12:18:35 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/teams/AnalogDevices/code/AD5770R/#e2c56c903ec8
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f README.txt
--- a/README.txt	Wed Feb 24 12:18:35 2021 +0000
+++ b/README.txt	Tue Aug 03 17:34:58 2021 +0100
@@ -10,7 +10,7 @@
 
 Product details: https://www.analog.com/en/products/ad5770r.html
 Product Evaluation board details: https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-AD5770R.html
-User Guide for this code: https://wiki.analog.com/resources/tools-software/product-support-software/ad5770r_mbed_support
+User Guide for this code: https://wiki.analog.com/resources/tools-software/product-support-software/ad5770r_mbed_example
 Communication Protocol: SPI
 
 
@@ -26,19 +26,17 @@
 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-AD5770R/
-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.
+Import Code into compiler. Instructions on how to import code are here: https://os.mbed.com/docs/mbed-os/v6.8/quick-start/build-with-the-online-compiler.html
+Compile code to generate binary file and then drag and drop binary into SDP-K1 controller board. Detailed instructions are here: 
+https://os.mbed.com/docs/mbed-os/v6.8/build-tools/getting-your-program-on-your-board.html
 
+Refer project wiki page to find detailed guide on how to use firmware:
+https://wiki.analog.com/resources/tools-software/product-support-software/ad5770r_mbed_example
 
 Notes
 -----
-If using Win 7, install serial drivers for Mbed. https://os.mbed.com/docs/mbed-os/v5.12/tutorials/windows-serial-driver.html
+Refer this page for latest documentation on Mbed-OS: https://os.mbed.com/docs/mbed-os/v6.8/introduction/index.html
 A detailed user guide on SDP-K1 controller board is available here https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/SDP-K1.html.
 
 
-Copyright (c) 2020 Analog Devices, Inc.  All rights reserved.
-
+Copyright (c) 2021 Analog Devices, Inc.  All rights reserved.
\ No newline at end of file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f adi_console_menu.lib
--- a/adi_console_menu.lib	Wed Feb 24 12:18:35 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/teams/AnalogDevices/code/adi_console_menu/#6a97882f6144
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/.mbedignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/.mbedignore	Tue Aug 03 17:34:58 2021 +0100
@@ -0,0 +1,42 @@
+mbed_platform_drivers/adc_data_capture.c
+mbed_platform_drivers/uart.cpp
+no-OS/ci/
+no-OS/doc/
+no-OS/legacy/
+no-OS/accel/
+no-OS/drivers/adc/
+no-OS/drivers/afe/
+no-OS/drivers/amplifiers/
+no-OS/drivers/axi_core/
+no-OS/drivers/cdc/
+no-OS/drivers/dac/ad54*
+no-OS/drivers/dac/ad56*
+no-OS/drivers/dac/ad5755/
+no-OS/drivers/dac/ad576*
+no-OS/drivers/dac/ad5791/
+no-OS/drivers/dac/ad7303/
+no-OS/drivers/dac/ad9*
+no-OS/drivers/dac/dac_demo/
+no-OS/drivers/ecg/
+no-OS/drivers/frequency/
+no-OS/drivers/gpio/
+no-OS/drivers/gyro/
+no-OS/drivers/i2c/
+no-OS/drivers/impedance-analyzer/
+no-OS/drivers/io-expander/
+no-OS/drivers/instr-amplif/
+no-OS/drivers/mux/
+no-OS/drivers/photo-electronic/
+no-OS/drivers/platform/
+no-OS/drivers/potentiometer/
+no-OS/drivers/rf-transceiver/
+no-OS/drivers/sd-card/
+no-OS/drivers/spi/
+no-OS/drivers/tdm/
+no-OS/drivers/temperature/
+no-OS/iio/
+no-OS/legacy/
+no-OS/libraries/
+no-OS/network/
+no-OS/projects/
+no-OS/tools/
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770_user_config.c
--- a/app/ad5770_user_config.c	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770_user_config.c	Tue Aug 03 17:34:58 2021 +0100
@@ -5,7 +5,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
@@ -19,7 +19,7 @@
 
 #include "app_config.h"
 
-#include "platform_drivers.h"
+#include "spi.h"
 #include "spi_extra.h"
 
 #include "ad5770r.h"
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770r_console_app.c
--- a/app/ad5770r_console_app.c	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770r_console_app.c	Tue Aug 03 17:34:58 2021 +0100
@@ -7,7 +7,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
@@ -24,7 +24,10 @@
 
 #include "app_config.h"
 
-#include "platform_drivers.h"
+#include "delay.h"
+#include "error.h"
+#include "gpio.h"
+#include "spi.h"
 #include "platform_support.h"
 #include "ad5770r.h"
 
@@ -162,7 +165,7 @@
 		printf("\n\r *** Error doing device remove ***\n\r");
 	}
 
-	pAd5770r_dev = NULL;	
+	pAd5770r_dev = NULL;
 
 	adi_press_any_key_to_continue();
 	return(MENU_CONTINUE);
@@ -330,9 +333,9 @@
 	printf(EOL "Enter Input register value (hex) for channel %d: " EOL,
 	       channel_id);
 	value = adi_get_hex_integer(4);
-        
-        /* Channels are 14-bits, mask off top 2 bits*/
-        value &= 0x3FFF;
+
+	/* Channels are 14-bits, mask off top 2 bits*/
+	value &= 0x3FFF;
 
 	if ((status =
 		     ad5770r_set_dac_input(pAd5770r_dev, value,
@@ -357,9 +360,9 @@
 	printf(EOL "Enter DAC register value (hex) for channel %d: " EOL, channel_id);
 	value = adi_get_hex_integer(4);
 
-        /* Channels are 14-bits, mask off top 2 bits*/
-        value &= 0x3FFF;
-        
+	/* Channels are 14-bits, mask off top 2 bits*/
+	value &= 0x3FFF;
+
 	if ((status =
 		     ad5770r_set_dac_value(pAd5770r_dev, value,
 					   (enum ad5770r_channels) channel_id)) != SUCCESS) {
@@ -710,21 +713,21 @@
  * DAC Operations Menu
  */
 static  console_menu_item dac_operations_menu_items[] = {
-        {"\tSet Input Channel 0", 'Q', do_input_value, 0},
-        {"\tSet Input Channel 1", 'W', do_input_value, 1},
-        {"\tSet Input Channel 2", 'E', do_input_value, 2},
-        {"\tSet Input Channel 3", 'R', do_input_value, 3},
-        {"\tSet Input Channel 4", 'T', do_input_value, 4},
-        {"\tSet Input Channel 5", 'Y', do_input_value, 5},
-        {""},
-        {"\tToggle Channel 0 SW LDAC Shadow", '0', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 0)},
+	{"\tSet Input Channel 0", 'Q', do_input_value, 0},
+	{"\tSet Input Channel 1", 'W', do_input_value, 1},
+	{"\tSet Input Channel 2", 'E', do_input_value, 2},
+	{"\tSet Input Channel 3", 'R', do_input_value, 3},
+	{"\tSet Input Channel 4", 'T', do_input_value, 4},
+	{"\tSet Input Channel 5", 'Y', do_input_value, 5},
+	{""},
+	{"\tToggle Channel 0 SW LDAC Shadow", '0', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 0)},
 	{"\tToggle Channel 1 SW LDAC Shadow",          '1', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 1)},
 	{"\tToggle Channel 2 SW LDAC Shadow",          '2', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 2)},
 	{"\tToggle Channel 3 SW LDAC Shadow",          '3', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 3)},
 	{"\tToggle Channel 4 SW LDAC Shadow",          '4', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 4)},
 	{"\tToggle Channel 5 SW LDAC Shadow",          '5', do_sw_ldac, AD5770R_HW_LDAC_MASK_CH(1, 5)},
 	{"\tWrite SW LDAC Shadow ",                    'U', do_sw_ldac_write},
-        {""},
+	{""},
 	{"\tToggle HW LDAC digital input",             'J', do_hw_ldac_toggle},
 	{""},
 	{"\tSet DAC Channel 0",                      'A', do_dac_value, 0},
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770r_console_app.h
--- a/app/ad5770r_console_app.h	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770r_console_app.h	Tue Aug 03 17:34:58 2021 +0100
@@ -7,7 +7,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770r_reset_config.c
--- a/app/ad5770r_reset_config.c	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770r_reset_config.c	Tue Aug 03 17:34:58 2021 +0100
@@ -5,7 +5,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
@@ -17,7 +17,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-#include "platform_drivers.h"
+#include "spi.h"
 #include "ad5770r.h"
 
 // #defines
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770r_reset_config.h
--- a/app/ad5770r_reset_config.h	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770r_reset_config.h	Tue Aug 03 17:34:58 2021 +0100
@@ -5,7 +5,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/ad5770r_user_config.h
--- a/app/ad5770r_user_config.h	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/ad5770r_user_config.h	Tue Aug 03 17:34:58 2021 +0100
@@ -5,7 +5,7 @@
   @details:
  -----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/adi_console_menu.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/adi_console_menu.lib	Tue Aug 03 17:34:58 2021 +0100
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AnalogDevices/code/adi_console_menu/#ced4fa6875ed
\ No newline at end of file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/app_config.h
--- a/app/app_config.h	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/app_config.h	Tue Aug 03 17:34:58 2021 +0100
@@ -4,7 +4,7 @@
  *   @brief  Configuration file of AD5770R firmware example program
 ******************************************************************************
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
@@ -33,8 +33,8 @@
 // Pin mapping of AD5770R with SDP-K1/Arduino
 #ifdef ARDUINO
 #define SPI_SS		D10		// SPI_CS
-#define SPI_MISO	D11		// SPI_MOSI
-#define SPI_MOSI	D12		// SPI_MISO
+#define SPI_MISO	D12		// SPI_MOSI
+#define SPI_MOSI	D11		// SPI_MISO
 #define SPI_SCK		D13		// SPI_SCK
 #define HW_LDACB        D2
 #else
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/main.c
--- a/app/main.c	Wed Feb 24 12:18:35 2021 +0000
+++ b/app/main.c	Tue Aug 03 17:34:58 2021 +0100
@@ -4,7 +4,7 @@
  * @brief:
  *-----------------------------------------------------------------------------
  *
-Copyright (c) 2020 Analog Devices, Inc. All Rights Reserved.
+Copyright (c) 2020-2021 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
@@ -14,7 +14,7 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#include "platform_drivers.h"
+#include "error.h"
 
 #include "adi_console_menu.h"
 #include "ad5770r_console_app.h"
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/mbed_platform_drivers.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/mbed_platform_drivers.lib	Tue Aug 03 17:34:58 2021 +0100
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AnalogDevices/code/platform_drivers/#af1f2416dd26
\ No newline at end of file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f app/no-OS.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/no-OS.lib	Tue Aug 03 17:34:58 2021 +0100
@@ -0,0 +1,1 @@
+https://github.com/analogdevicesinc/no-OS/#d14f824a6bee78881a277790310b12d9a3e822bd
\ No newline at end of file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f mbed-os.lib
--- a/mbed-os.lib	Wed Feb 24 12:18:35 2021 +0000
+++ b/mbed-os.lib	Tue Aug 03 17:34:58 2021 +0100
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#64853b354fa188bfe8dbd51e78771213c7ed37f7
+https://github.com/ARMmbed/mbed-os/#26606218ad9d1ee1c8781aa73774fd7ea3a7658e
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f mbed_app.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed_app.json	Tue Aug 03 17:34:58 2021 +0100
@@ -0,0 +1,10 @@
+{
+    "requires": ["bare-metal"],
+    "target_overrides": {
+        "*": {
+            "platform.default-serial-baud-rate": 230400,
+            "target.printf_lib": "std",
+			"target.device_has_remove": ["CAN"]
+        }
+    }
+}
\ No newline at end of file
diff -r ddef2e8cb4f7 -r f3d7cf95cd8f platform_drivers.lib
--- a/platform_drivers.lib	Wed Feb 24 12:18:35 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/teams/AnalogDevices/code/platform_drivers/#70fc373a5f46