EVAL-AD7124 Mbed Example Program.

Dependencies:   adi_console_menu platform_drivers

Revision:
7:3e1005bd4d41
Parent:
5:ca3854efb1e9
--- a/app/ad7124_console_app.c	Wed Dec 02 11:23:19 2020 +0000
+++ b/app/ad7124_console_app.c	Tue Aug 03 12:05:42 2021 +0100
@@ -8,7 +8,7 @@
             The functions defined in this file performs the action
             based on user selected console menu.
  -----------------------------------------------------------------------------
- Copyright (c) 2019, 2020 Analog Devices, Inc.
+ Copyright (c) 2019-2021 Analog Devices, Inc.
  All rights reserved.
 
  This software is proprietary to Analog Devices, Inc. and its licensors.
@@ -24,7 +24,9 @@
 #include "app_config.h"
 
 #include "platform_support.h"
-#include "platform_drivers.h"
+#include "error.h"
+#include "gpio.h"
+#include "spi.h"
 #include "spi_extra.h"
 
 #include "ad7124.h"
@@ -298,22 +300,23 @@
 		// Not a defined configID
 		return(FAILURE);
 	}
+	
+	// Designated SPI Initialization Structure
+	spi_init_param	ad7124_spi_init = {
+		.max_speed_hz = 2500000, // Max SPI Speed
+		.chip_select =  SPI_SS_A, // Chip Select pin
+		.mode = SPI_MODE_3, // CPOL = 1, CPHA =1
+		.extra = &spi_init_extra_params  // SPI extra configurations		
+	};
 
 	// Used to create the ad7124 device
 	struct  ad7124_init_param sAd7124_init = {
-		// spi_init_param type
-		{
-			2500000,    // Max SPI Speed
-			SPI_SS_A,   // Chip Select pin
-			SPI_MODE_3, // CPOL = 1, CPHA =1
-			&spi_init_extra_params, // SPI extra configurations
-		},
+		&ad7124_spi_init,  // spi_init_param type
 		ad7124_register_map,
-
 		10000               // Retry count for polling
 	};
 
-	return (ad7124_setup(&pAd7124_dev, sAd7124_init));
+	return (ad7124_setup(&pAd7124_dev, &sAd7124_init));
 }
 
 // Private Functions