AD7172 library

Revision:
2:8c5d9f069f11
Parent:
1:6d78a35bedd0
Child:
3:ae9ae6b0b8e0
--- a/ad7172.cpp	Tue May 05 17:57:07 2020 +0000
+++ b/ad7172.cpp	Tue May 05 18:19:00 2020 +0000
@@ -77,6 +77,7 @@
 	
 	cs = new DigitalOut(slave_select); // Define cs as digital out variable referred to slave_select pin
 	sync = new DigitalOut(sync_pin); // Define sync as digital out variable referred to sync_pin
+	*sync = 1;
 	Reset(); // Calling the AD7172-2 restart function
 }
 
@@ -122,37 +123,42 @@
     AD7172_PRINTF("Register: IFMODE\tWrite: 0x%04X",data.data);    
     WriteRegister(AD7172_IFMODE_REG,2); // Writing to IFMODE register
     enable(); // *cs = 0
+    *sync = 0;
 }
 
-/******************************************************************************
-* @AD7172 Sync Enable
-*
-*******************************************************************************/
+/*
+////////////////////////////////////////////////////////////////////////////////
+// @AD7172 Sync Enable
+//
+////////////////////////////////////////////////////////////////////////////////
 void AD7172::sync_enable()
 {
 	*sync = 0;
 }
 
-/******************************************************************************
-* @AD7172 Sync Disable
-*
-*******************************************************************************/
+////////////////////////////////////////////////////////////////////////////////
+// @AD7172 Sync Disable
+//
+////////////////////////////////////////////////////////////////////////////////
 void AD7172::sync_disable()
 {
 	*sync = 1;
 }
 
-/******************************************************************************
-* @AD7172 Single Convertion Mode Conversion Driver
-*
-*******************************************************************************/
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+// @AD7172 Single Convertion Mode Conversion Driver
+//
+////////////////////////////////////////////////////////////////////////////////
 void AD7172::start_single_conv()
 {
 	*sync = 0;
-	wait_ms(1);
+	wait_us(1);
 	*sync = 1;
 }
 
+
 /******************************************************************************
 * @AD7172 Read Device ID - Communication Test.
 *