Personal fork of the library

Dependencies:   X_NUCLEO_COMMON

Fork of X_NUCLEO_IHM01A1 by Arkadi Rafalovich

Revision:
1:b38ebb8ea286
Parent:
0:2887415a46cd
Child:
2:de6d31fa3709
Child:
4:83a1eb397a65
--- a/Components/l6474/l6474_class.cpp	Wed Oct 14 15:12:18 2015 +0000
+++ b/Components/l6474/l6474_class.cpp	Fri Oct 16 13:30:06 2015 +0000
@@ -45,7 +45,7 @@
     Repository:       http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev
     Branch/Trunk/Tag: trunk
     Based on:         X-CUBE-SPN1/trunk/Drivers/BSP/Components/l6474/l6474.c
-    Revision:         0
+    Revision:         :0
 */
 
 
@@ -54,8 +54,8 @@
 #include "l6474_class.h"
 #include "l6474.h"
 
-
-/* Private constants ---------------------------------------------------------*/
+    
+/* Private constants ---------------------------------------------------------*/    
 
 /// Error while initialising the SPI
 #define L6474_ERROR_0   (0x8000)   
@@ -78,7 +78,7 @@
 uint8_t L6474::numberOfDevices = 0;
 
 
-/* Private function prototypes -----------------------------------------------*/
+/* Methods -------------------------------------------------------------------*/
 
 /******************************************************//**
  * @brief  Attaches a user callback to the error Handler.
@@ -144,7 +144,7 @@
  **********************************************************/
 DrvStatusTypeDef L6474::L6474_ReadID(uint8_t *id)
 {
-  *id = type;
+  *id = deviceInstance;
 
   return COMPONENT_OK;
 }
@@ -514,6 +514,16 @@
 }
 
 /******************************************************//**
+ * @brief  Locks until the device state becomes Inactive
+ * @retval None
+ **********************************************************/
+void L6474::L6474_WaitWhileActive(void)
+{
+  /* Wait while motor is running */
+  while (L6474_GetDeviceState() != INACTIVE);
+}
+
+/******************************************************//**
  * @brief  Issue the Disable command to the L6474 of the specified device
  * @retval None
  **********************************************************/