motor board library

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Dependents:   selfbalansingcar

Fork of X_NUCLEO_IHM02A1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Tue Feb 09 16:01:30 2016 +0000
Parent:
13:25a579b9b7c3
Child:
15:31785d1acd4b
Commit message:
+ Updated with the new template's syntax.

Changed in this revision

BSP/x_nucleo_ihm02a1_class.cpp Show annotated file Show diff for this revision Revisions of this file
BSP/x_nucleo_ihm02a1_class.h Show annotated file Show diff for this revision Revisions of this file
BSP/x_nucleo_ihm02a1_config.h Show annotated file Show diff for this revision Revisions of this file
Components/Common/component.h Show annotated file Show diff for this revision Revisions of this file
Components/Common/microstepping_motor.h Show annotated file Show diff for this revision Revisions of this file
Components/Interfaces/Component_class.h Show annotated file Show diff for this revision Revisions of this file
Components/l6470/l6470.h Show annotated file Show diff for this revision Revisions of this file
Components/l6470/l6470_class.cpp Show annotated file Show diff for this revision Revisions of this file
Components/l6470/l6470_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/BSP/x_nucleo_ihm02a1_class.cpp	Tue Jan 19 16:07:00 2016 +0000
+++ b/BSP/x_nucleo_ihm02a1_class.cpp	Tue Feb 09 16:01:30 2016 +0000
@@ -43,12 +43,12 @@
 
 /* ACTION 1 ------------------------------------------------------------------*
  * Include here platform specific header files.                               *
- *----------------------------------------------------------------------------*/        
+ *----------------------------------------------------------------------------*/
 #include "mbed.h"
 #include "DevSPI.h"
 /* ACTION 2 ------------------------------------------------------------------*
  * Include here expansion board specific header files.                        *
- *----------------------------------------------------------------------------*/        
+ *----------------------------------------------------------------------------*/
 #include "x_nucleo_ihm02a1_class.h"
 
 
@@ -70,7 +70,7 @@
  * @param ssel          pin name of the SSEL pin of the SPI device to be used for communication.
  * @param spi           SPI device to be used for communication.
  */
-X_NUCLEO_IHM02A1::X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi) : dev_spi(spi)
+X_NUCLEO_IHM02A1::X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi) : dev_spi(spi)
 {
     /* Checking stackability. */
     if (!(number_of_boards < EXPBRD_MOUNTED_NR_MAX))
@@ -86,8 +86,8 @@
      * Instantiate here the expansion board's components.                     *
      *                                                                        *
      * Example:                                                               *
-     *   component_1 = new COMPONENT_1(COMPONENT_1_SPI_SSEL, *dev_spi);       *
-     *   component_2 = new COMPONENT_2(COMPONENT_2_SPI_SSEL, *dev_spi);       *
+     *   component_1 = new COMPONENT_1(ssel, *dev_spi);                       *
+     *   component_2 = new COMPONENT_2(ssel, *dev_spi);                       *
      *------------------------------------------------------------------------*/
     components[0] = l6470_0 = new L6470(flag_irq, busy_irq, standby_reset, ssel, *dev_spi);
     components[1] = l6470_1 = new L6470(flag_irq, busy_irq, standby_reset, ssel, *dev_spi);
@@ -111,7 +111,7 @@
  * @param miso          pin name of the MISO pin of the SPI device to be used for communication.
  * @param sclk          pin name of the SCLK pin of the SPI device to be used for communication.
  */
-X_NUCLEO_IHM02A1::X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk)
+X_NUCLEO_IHM02A1::X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk)
 {
     /* Checking stackability. */
     if (!(number_of_boards < EXPBRD_MOUNTED_NR_MAX))
@@ -126,8 +126,8 @@
      * Instantiate here the expansion board's components.                     *
      *                                                                        *
      * Example:                                                               *
-     *   component_1 = new COMPONENT_1(COMPONENT_1_SPI_SSEL, *dev_spi);       *
-     *   component_2 = new COMPONENT_2(COMPONENT_2_SPI_SSEL, *dev_spi);       *
+     *   component_1 = new COMPONENT_1(ssel, *dev_spi);                       *
+     *   component_2 = new COMPONENT_2(ssel, *dev_spi);                       *
      *------------------------------------------------------------------------*/
     components[0] = l6470_0 = new L6470(flag_irq, busy_irq, standby_reset, ssel, *dev_spi);
     components[1] = l6470_1 = new L6470(flag_irq, busy_irq, standby_reset, ssel, *dev_spi);
@@ -173,7 +173,7 @@
  *     }                                                                      *
  *                                                                            *
  *     // Configuration.                                                      *
- *     INTERFACE_InitTypeDef InitStructure;                                   *
+ *     COMPONENT_Init_t InitStructure;                                        *
  *     InitStructure.Property_1 = COMPONENT_1_PROPERY_1_INIT;                 *
  *     InitStructure.Property_N = COMPONENT_1_PROPERY_N_INIT;                 *
  *                                                                            *
@@ -204,7 +204,7 @@
 bool X_NUCLEO_IHM02A1::Init_L6470_1(void)
 {
     /* Initialization. */
-    if (l6470_1->Init((void *) init_components[0]) != COMPONENT_OK)
+    if (l6470_1->Init((void *) init_components[1]) != COMPONENT_OK)
         return false;
 
     return true;
--- a/BSP/x_nucleo_ihm02a1_class.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/BSP/x_nucleo_ihm02a1_class.h	Tue Feb 09 16:01:30 2016 +0000
@@ -49,12 +49,12 @@
 
 /* ACTION 1 ------------------------------------------------------------------*
  * Include here platform specific header files.                               *
- *----------------------------------------------------------------------------*/        
+ *----------------------------------------------------------------------------*/
 #include "mbed.h"
 #include "DevSPI.h"
 /* ACTION 2 ------------------------------------------------------------------*
- * Include here expansion board specific header files.                        *
- *----------------------------------------------------------------------------*/        
+ * Include here expansion board configuration's header files.                 *
+ *----------------------------------------------------------------------------*/
 #include "x_nucleo_ihm02a1_config.h"
 /* ACTION 3 ------------------------------------------------------------------*
  * Include here expansion board's components' header files.                   *
@@ -86,7 +86,7 @@
      * @param ssel          pin name of the SSEL pin of the SPI device to be used for communication.
      * @param spi           SPI device to be used for communication.
      */
-    X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
+    X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
 
     /**
      * @brief Constructor.
@@ -100,7 +100,7 @@
      * @param miso          pin name of the MISO pin of the SPI device to be used for communication.
      * @param sclk          pin name of the SCLK pin of the SPI device to be used for communication.
      */
-    X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
+    X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
 
     /**
      * @brief Destructor.
@@ -198,7 +198,7 @@
     L6470 *components[L6470DAISYCHAINSIZE];
     
     /* Components' initialization. */
-    L6470_InitTypeDef *init_components[L6470DAISYCHAINSIZE];
+    L6470_Init_t *init_components[L6470DAISYCHAINSIZE];
 
     /* Results of prepared actions. */
     uint32_t results[L6470DAISYCHAINSIZE];
@@ -218,6 +218,6 @@
     static uint8_t number_of_boards;
 };
 
-#endif // __X_NUCLEO_IHM02A1_CLASS_H
+#endif /* __X_NUCLEO_IHM02A1_CLASS_H */
 
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
--- a/BSP/x_nucleo_ihm02a1_config.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/BSP/x_nucleo_ihm02a1_config.h	Tue Feb 09 16:01:30 2016 +0000
@@ -39,7 +39,7 @@
 /* Generated with Stm32CubeTOO -----------------------------------------------*/
 
 
-/* Define to prevent from recursive inclusion --------------------------------*/
+/* Define to prevent recursive inclusion -------------------------------------*/
 
 #ifndef __X_NUCLEO_IHM02A1_CONFIG_H
 #define __X_NUCLEO_IHM02A1_CONFIG_H
@@ -78,4 +78,4 @@
 /* Maximum number of mounted "X-NUCLEO-IHM02A1" Expansion Boards. */
 #define EXPBRD_MOUNTED_NR_MAX         (4)
 
-#endif // __X_NUCLEO_IHM02A1_CONFIG_H
\ No newline at end of file
+#endif /* __X_NUCLEO_IHM02A1_CONFIG_H */
\ No newline at end of file
--- a/Components/Common/component.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/Common/component.h	Tue Feb 09 16:01:30 2016 +0000
@@ -37,10 +37,10 @@
  */
 
 
-/* Prevent recursive inclusion -----------------------------------------------*/
+/* Define to prevent recursive inclusion -------------------------------------*/
 
-#ifndef __COMPONENT_H__
-#define __COMPONENT_H__
+#ifndef __COMPONENT_H
+#define __COMPONENT_H
 
 
 /* Types ---------------------------------------------------------------------*/
@@ -75,7 +75,7 @@
     /* -----------------------------------------------------------------------*/
     /* Pointer to the Extended Virtual Table. */
     void *pExtVTable;
-} DrvContextTypeDef;
+} Handle_t;
 
 /**
  * @brief  Component's Status enumerator definition.
@@ -86,6 +86,8 @@
     COMPONENT_ERROR,
     COMPONENT_TIMEOUT,
     COMPONENT_NOT_IMPLEMENTED
-} DrvStatusTypeDef;
+} Status_t;
 
-#endif
\ No newline at end of file
+#endif /* __COMPONENT_H */
+
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
--- a/Components/Common/microstepping_motor.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/Common/microstepping_motor.h	Tue Feb 09 16:01:30 2016 +0000
@@ -1,42 +1,44 @@
 /**
-  ******************************************************************************
-  * @file    microstepping_motor.h
-  * @author  IPD SYSTEM LAB & TECH MKTG
-  * @version V0.0.1
-  * @date    04-June-2015
-  * @brief   This file contains all the functions prototypes for the microstepping
-  *          motor driver with motion engine.   
-  ******************************************************************************
-  * @attention
-  *
-  * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
-  *
-  * Redistribution and use in source and binary forms, with or without modification,
-  * are permitted provided that the following conditions are met:
-  *   1. Redistributions of source code must retain the above copyright notice,
-  *      this list of conditions and the following disclaimer.
-  *   2. 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.
-  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-  *      may be used to endorse or promote products derived from this software
-  *      without specific prior written permission.
-  *
-  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
-  *
-  ******************************************************************************
-  */ 
+ ******************************************************************************
+ * @file    microstepping_motor.h
+ * @author  IPD SYSTEM LAB & TECH MKTG
+ * @version V0.0.1
+ * @date    04-June-2015
+ * @brief   This file contains all the functions prototypes for the microstepping
+ *          motor driver with motion engine.   
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *   1. Redistributions of source code must retain the above copyright notice,
+ *      this list of conditions and the following disclaimer.
+ *   2. 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.
+ *   3. Neither the name of STMicroelectronics nor the names of its contributors
+ *      may be used to endorse or promote products derived from this software
+ *      without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
+ *
+ ******************************************************************************
+ */ 
+
 
 /* Define to prevent recursive inclusion -------------------------------------*/
+
 #ifndef __MICROSTEPPINGMOTOR_H
 #define __MICROSTEPPINGMOTOR_H
 
@@ -44,10 +46,15 @@
  extern "C" {
 #endif 
 
+
 /* Includes ------------------------------------------------------------------*/
+
 #include <stdint.h>
 #include "component.h"
    
+
+/* Types ---------------------------------------------------------------------*/
+
 /** @addtogroup BSP
   * @{
   */
@@ -92,7 +99,7 @@
   L6470_STEP_MODE_ID,           //!< Step mode
   L6470_ALARM_EN_ID,            //!< Alarm enable
   L6470_CONFIG_ID,              //!< IC configuration
-  L6470_STATUS_ID               //!< Status, (the reset value is according to startup conditions)
+  L6470_STATUS_ID               //!< Status, (the reset value is according to startup conditions)  
 } eL6470_RegId_t;
 
 /**
@@ -305,9 +312,9 @@
   uint16_t  STATUS;                 //!< Status Register
 } StepperMotorRegister_t;
 
-/**
-  * @brief Stepper Motor Driver Structure
-  */
+/** 
+ * @brief  MICROSTEPPING_MOTOR driver virtual table structure definition.
+ */
 typedef struct
 {
   /* ACTION ----------------------------------------------------------------*
@@ -319,12 +326,12 @@
    * specified exactly in the given way.                                    *
    *                                                                        *
    * Example:                                                               *
-   *   DrvStatusTypeDef (*Init)(void *handle, void *init);                  *
-   *   DrvStatusTypeDef (*ReadID)(void *handle, uint8_t *id);               *
+   *   Status_t (*Init)   (void *handle, void *init);                       *
+   *   Status_t (*ReadID) (void *handle, uint8_t *id);                      *
    *------------------------------------------------------------------------*/
   /* Generic */
-  DrvStatusTypeDef (*Init)(void *handle, void *init);
-  DrvStatusTypeDef (*ReadID)(void *handle, uint8_t *id);
+  Status_t (*Init)(void *handle, void *init);
+  Status_t (*ReadID)(void *handle, uint8_t *id);
   
   /* ACTION ----------------------------------------------------------------*
    * Declare here the component's specific functions.                       *
@@ -332,7 +339,7 @@
    * Do not specify any function if not required.                           *
    *                                                                        *
    * Example:                                                               *
-   *   DrvStatusTypeDef (*GetValue)(void *handle, float *pfData);           *
+   *   Status_t (*GetValue) (void *handle, float *f);                       *
    *------------------------------------------------------------------------*/
   /* Specific */
   void     (*SetParam)(void *handle, eL6470_RegId_t L6470_RegId, uint32_t Value);
@@ -400,7 +407,8 @@
   uint8_t  (*mA_2_OcdTh)(void *handle, float mA);
   float    (*StallTh_2_mA)(void *handle, uint8_t StallTh);
   uint8_t  (*mA_2_StallTh)(void *handle, float mA);
-} MICROSTEPPING_MOTOR_DrvVTableTypeDef;
+  uint32_t (*ExtractReturnedData)(void *handle, uint8_t* pL6470_DaisyChainSpiRxStruct, uint8_t LengthByte);
+} MICROSTEPPING_MOTOR_VTable_t;
 
 /**
   * @brief Stepper Motor Board Driver Structure
@@ -427,7 +435,7 @@
   uint16_t (*GetStatus)(uint8_t, uint8_t);
   uint8_t  (*CheckStatusRegisterFlag)(uint8_t, uint8_t, uint8_t);
   uint8_t* (*PerformPreparedApplicationCommand)(uint8_t);
-} MICROSTEPPING_MOTOR_EB_DrvVTableTypeDef;
+} MICROSTEPPING_MOTOR_EB_VTable_t;
 
 /**
   * @brief  Stepper Motor Handle Structure
@@ -435,7 +443,8 @@
 typedef struct __StepperMotorDriver_HandleTypeDef
 {
   uint8_t DaisyChainPosition;
-  MICROSTEPPING_MOTOR_DrvVTableTypeDef *Command;
+  void (*Config)(void*);
+  MICROSTEPPING_MOTOR_VTable_t *Command;
 } StepperMotorDriverHandle_t;
 
 /**
@@ -444,7 +453,8 @@
 typedef struct __StepperMotorBoard_HandleTypeDef
 {
   uint8_t StackedPosition;
-  MICROSTEPPING_MOTOR_EB_DrvVTableTypeDef *Command;
+  void (*Config)(void*);
+  MICROSTEPPING_MOTOR_EB_VTable_t *Command;
   StepperMotorDriverHandle_t *StepperMotorDriverHandle[2];
   uint8_t (*Select)(uint8_t);
 } StepperMotorBoardHandle_t;
--- a/Components/Interfaces/Component_class.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/Interfaces/Component_class.h	Tue Feb 09 16:01:30 2016 +0000
@@ -1,7 +1,7 @@
 /**
  ******************************************************************************
  * @file    Component_class.h
- * @author  Davide Aliprandi, STMicroelectronics
+ * @author  AST
  * @version V1.0.0
  * @date    April 13th, 2015
  * @brief   This file contains the abstract class describing the interface of a
@@ -37,7 +37,7 @@
  */
 
 
-/* Define to prevent from recursive inclusion --------------------------------*/
+/* Define to prevent recursive inclusion -------------------------------------*/
 
 #ifndef __COMPONENT_CLASS_H
 #define __COMPONENT_CLASS_H
@@ -56,20 +56,20 @@
 {
 public:
     /**
-     * @brief  Initializing the component.
-     * @param  init Pointer to device specific initalization structure.
-     * @retval "0" in case of success, an error code otherwise.
+     * @brief     Initializing the component.
+     * @param[in] init pointer to device specific initalization structure.
+     * @retval    "0" in case of success, an error code otherwise.
      */
     virtual int Init(void *init) = 0;
 
     /**
-     * @brief  Getting the ID of the component.
-     * @param  id Pointer to an allocated variable to store the ID into.
-     * @retval "0" in case of success, an error code otherwise.
+     * @brief      Getting the ID of the component.
+     * @param[out] id pointer to an allocated variable to store the ID into.
+     * @retval     "0" in case of success, an error code otherwise.
      */
     virtual int ReadID(uint8_t *id) = 0;
 };
 
 #endif /* __COMPONENT_CLASS_H */
 
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
--- a/Components/l6470/l6470.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/l6470/l6470.h	Tue Feb 09 16:01:30 2016 +0000
@@ -1,39 +1,41 @@
 /**
-  ******************************************************************************
-  * @file       L6470.h
-  * @date       01/10/2014 12:00:00
-  * @brief      This file contains definitions, exported variables and function
-  *             prototypes related to the L6470.
-  ******************************************************************************
-  *
-  * COPYRIGHT(c) 2014 STMicroelectronics
-  *
-  * Redistribution and use in source and binary forms, with or without modification,
-  * are permitted provided that the following conditions are met:
-  *   1. Redistributions of source code must retain the above copyright notice,
-  *      this list of conditions and the following disclaimer.
-  *   2. 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.
-  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-  *      may be used to endorse or promote products derived from this software
-  *      without specific prior written permission.
-  *
-  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
-  *
-  ******************************************************************************
-  */
+ ******************************************************************************
+ * @file       L6470.h
+ * @date       01/10/2014 12:00:00
+ * @brief      This file contains definitions, exported variables and function
+ *             prototypes related to the L6470.
+ ******************************************************************************
+ *
+ * COPYRIGHT(c) 2014 STMicroelectronics
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *   1. Redistributions of source code must retain the above copyright notice,
+ *      this list of conditions and the following disclaimer.
+ *   2. 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.
+ *   3. Neither the name of STMicroelectronics nor the names of its contributors
+ *      may be used to endorse or promote products derived from this software
+ *      without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
+ *
+ ******************************************************************************
+ */
+
 
 /* Define to prevent recursive inclusion -------------------------------------*/
+
 #ifndef __L6470_H
 #define __L6470_H
 
@@ -41,9 +43,86 @@
  extern "C" {
 #endif
 
+
 /* Includes ------------------------------------------------------------------*/
+
 #include "microstepping_motor.h"
 
+
+/* Definitions ---------------------------------------------------------------*/
+
+/** @addtogroup BSP
+ * @{
+ */
+
+/** @addtogroup Components
+ * @{
+ */  
+  
+/** @addtogroup L6470
+ * @{
+ */
+  
+/** @defgroup L6470_Exported_Defines L6470_Exported_Defines
+ * @{
+ */  
+
+/**
+  * @defgroup   L6470_Exported_Constants
+  * @brief      L6470 Exported Constants.
+  * @{
+  */
+
+/**
+  * @defgroup   L6470_Register_Max_Values
+  * @brief      Maximum values for L6470 registers.
+  * @{
+  */
+
+#define L6470_MAX_POSITION          (0x1FFFFF)          //!< Max position
+#define L6470_MIN_POSITION          (-(0x200000))       //!< Min position
+#define L6470_POSITION_RANGE        ((uint32_t)(L6470_MAX_POSITION - L6470_MIN_POSITION))   //!< Position range
+#define L6470_MAX_SPEED             (0xFFFFF)           //!< max value of SPEED
+#define L6470_MAX_ACC               (0xFFF)             //!< max value of ACC
+#define L6470_MAX_DEC               (0xFFF)             //!< max value of DEC
+#define L6470_MAX_MAX_SPEED         (0x3FF)             //!< max value of MAX_SPEED
+#define L6470_MAX_MIN_SPEED         (0xFFF)             //!< max value of MIN_SPEED
+#define L6470_MAX_FS_SPD            (0x3FF)             //!< max value of FS_SPD
+#define L6470_MAX_INT_SPEED         (0x3FFF)            //!< max value of INT_SPEED
+#define L6470_MAX_ST_SLP            (0xFF)              //!< max value of ST_SLP
+#define L6470_MAX_FN_SLP_ACC        (0xFF)              //!< max value of FN_SLP_ACC
+#define L6470_MAX_FN_SLP_DEC        (0xFF)              //!< max value of FN_SLP_DEC
+#define L6470_MAX_OCD_TH            (0xF)               //!< max value of OCD_TH
+#define L6470_MAX_STALL_TH          (0x7F)              //!< max value of STALL_TH
+
+/**
+  * @}
+  */ /* End of L6470_Register_Max_Values */
+
+#define L6470REGIDSIZE          25                  //!< Max number of identifiers of L6470 Registers
+#define L6470APPCMDIDSIZE       19                  //!< Max number of identifiers of L6470 Application Commands
+#define L6470DIRIDSIZE           2                  //!< Max number of identifiers of L6470 directions
+#define L6470ACTIDSIZE           2                  //!< Max number of identifiers of actions to perform about ABS_POS register
+#define L6470MAXSPICMDBYTESIZE   4                  //!< Max number of byte to send via SPI to perform an application command
+#define L6470DAISYCHAINSIZE      2                  //!< Max number of identifiers of L6470 in daisy chain configuration
+
+#define L6470_MAX_SPEED_VALUE   ((float)15610)      //!< max value for the speed in step/s
+#define L6470_MAX_ACC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
+#define L6470_MAX_DEC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
+#define L6470_MAX_DEC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
+
+#define OCD_TH_STEP             ((float)375)      //!< Minimum step for OCD_TH register in mAmpere
+#define STALL_TH_STEP           ((float)31.25)    //!< Minimum step for STALL_TH register in mAmpere
+
+#define L6470_ACC_CONV          ((float)0.068719)   //!< Conversion factor for acceleration value from step/s^2 to the right value
+#define L6470_DEC_CONV          ((float)0.068719)   //!< Conversion factor for deceleration value from step/s^2 to the right value
+#define L6470_MAXSPEED_CONV     ((float)0.065536)   //!< Conversion factor for max speed value from step/s to the right value
+#define L6470_MINSPEED_CONV     ((float)4.194304)   //!< Conversion factor for min speed value from step/s to the right value
+#define L6470_SPEED_CONV        ((float)67.108864)  //!< Conversion factor for speed value from step/s to the right value
+
+
+/* Types ---------------------------------------------------------------------*/
+
 /**
   * @addtogroup BSP
   * @{
@@ -119,63 +198,20 @@
   * @}
   */ /* End of L6470_Exported_Types */
 
-/**
-  * @defgroup   L6470_Exported_Constants
-  * @brief      L6470 Exported Constants.
-  * @{
-  */
-
-/**
-  * @defgroup   L6470_Register_Max_Values
-  * @brief      Maximum values for L6470 registers.
-  * @{
-  */
-
-#define L6470_MAX_POSITION          (0x1FFFFF)          //!< Max position
-#define L6470_MIN_POSITION          (-(0x200000))       //!< Min position
-#define L6470_POSITION_RANGE        ((uint32_t)(L6470_MAX_POSITION - L6470_MIN_POSITION))   //!< Position range
-#define L6470_MAX_SPEED             (0xFFFFF)           //!< max value of SPEED
-#define L6470_MAX_ACC               (0xFFF)             //!< max value of ACC
-#define L6470_MAX_DEC               (0xFFF)             //!< max value of DEC
-#define L6470_MAX_MAX_SPEED         (0x3FF)             //!< max value of MAX_SPEED
-#define L6470_MAX_MIN_SPEED         (0xFFF)             //!< max value of MIN_SPEED
-#define L6470_MAX_FS_SPD            (0x3FF)             //!< max value of FS_SPD
-#define L6470_MAX_INT_SPEED         (0x3FFF)            //!< max value of INT_SPEED
-#define L6470_MAX_ST_SLP            (0xFF)              //!< max value of ST_SLP
-#define L6470_MAX_FN_SLP_ACC        (0xFF)              //!< max value of FN_SLP_ACC
-#define L6470_MAX_FN_SLP_DEC        (0xFF)              //!< max value of FN_SLP_DEC
-#define L6470_MAX_OCD_TH            (0xF)               //!< max value of OCD_TH
-#define L6470_MAX_STALL_TH          (0x7F)              //!< max value of STALL_TH
-
-/**
-  * @}
-  */ /* End of L6470_Register_Max_Values */
-
-#define L6470REGIDSIZE          25                  //!< Max number of identifiers of L6470 Registers
-#define L6470APPCMDIDSIZE       19                  //!< Max number of identifiers of L6470 Application Commands
-#define L6470DIRIDSIZE           2                  //!< Max number of identifiers of L6470 directions
-#define L6470ACTIDSIZE           2                  //!< Max number of identifiers of actions to perform about ABS_POS register
-#define L6470MAXSPICMDBYTESIZE   4                  //!< Max number of byte to send via SPI to perform an application command
-#define L6470DAISYCHAINSIZE      2                  //!< Max number of identifiers of L6470 in daisy chain configuration
-
-#define L6470_MAX_SPEED_VALUE   ((float)15610)      //!< max value for the speed in step/s
-#define L6470_MAX_ACC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
-#define L6470_MAX_DEC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
-#define L6470_MAX_DEC_VALUE     ((float)59590)      //!< max value for the acceleration in step/s^2
-
-#define OCD_TH_STEP             ((float)375)      //!< Minimum step for OCD_TH register in mAmpere
-#define STALL_TH_STEP           ((float)31.25)    //!< Minimum step for STALL_TH register in mAmpere
-
-#define L6470_ACC_CONV          ((float)0.068719)   //!< Conversion factor for acceleration value from step/s^2 to the right value
-#define L6470_DEC_CONV          ((float)0.068719)   //!< Conversion factor for deceleration value from step/s^2 to the right value
-#define L6470_MAXSPEED_CONV     ((float)0.065536)   //!< Conversion factor for max speed value from step/s to the right value
-#define L6470_MINSPEED_CONV     ((float)4.194304)   //!< Conversion factor for min speed value from step/s to the right value
-#define L6470_SPEED_CONV        ((float)67.108864)  //!< Conversion factor for speed value from step/s to the right value
-
-
 /** 
-  * @brief  L6470 driver initialization structure definition.
-  */ 
+ * @brief  L6470 driver initialization structure definition.
+ */
+/* ACTION --------------------------------------------------------------------*
+ * Declare here the component's initialization structure, if any, one         *
+ * variable per line without initialization.                                  *
+ *                                                                            *
+ * Example:                                                                   *
+ *   typedef struct                                                           *
+ *   {                                                                        *
+ *     int frequency;                                                         *
+ *     int update_mode;                                                       *
+ *   } COMPONENT_Init_t;                                                      *
+ *----------------------------------------------------------------------------*/
 typedef struct
 {
   float     motorvoltage;           //!< motor supply voltage in V
@@ -202,11 +238,11 @@
   uint8_t   step_sel;               //!< step mode selection
   uint8_t   alarmen;                //!< alarm conditions enable
   uint16_t  config;                 //!< ic configuration
-} L6470_InitTypeDef;
+} L6470_Init_t;
 
 /** 
-  * @brief L6470 driver data structure definition.
-  */ 
+ * @brief  L6470 driver data structure definition.
+ */ 
 /* ACTION --------------------------------------------------------------------*
  * Declare here the structure of component's data, if any, one variable per   *
  * line without initialization.                                               *
@@ -218,8 +254,8 @@
  *       int T1_out;                                                          *
  *       float T0_degC;                                                       *
  *       float T1_degC;                                                       *
- *   } COMPONENT_DrvDataTypeDef;                                              *
- * ---------------------------------------------------------------------------*/
+ *   } COMPONENT_Data_t;                                                      *
+ *----------------------------------------------------------------------------*/
 typedef struct
 {
   uint8_t L6470_Id;                                                                  //!< The L6470 identifier inside the daisy chain
@@ -233,7 +269,7 @@
   eFlagStatus_t L6470_DaisyChain_HalfPrepared; /* = ZERO_F; */                       //!< Boolean variable used when more than one L6470 into the daisy chain is going to be addressed for commanding
   sL6470_StatusRegister_t L6470_StatusRegister;                                      //!< To store the received L6470_StatusRegister
   sL6470_StatusRegister_t *pL6470_StatusRegister; /* = &L6470_StatusRegister; */     //!< Pointer to the L6470_StatusRegister variable
-} L6470_DrvDataTypeDef;
+} L6470_Data_t;
 
 
 /* Functions -----------------------------------------------------------------*/
@@ -250,15 +286,19 @@
  * @{
  */
 
-/** @defgroup L6470_IO_Functions L6470_IO_Functions
+/** @defgroup L6470_Imported_Functions L6470_Imported_Functions
  * @{
  */
+
 /* ACTION --------------------------------------------------------------------*
- * Declare here extern I/O functions you need and implemented them in a glue  *
- * logic file on the target environment, for example within the expansion     *
- * board "*.c" file. E.g.:                                                    *
- *   extern DrvStatusTypeDef COMPONENT_IO_Read (handle, buf, regadd, bytes);  *
- *   extern DrvStatusTypeDef COMPONENT_IO_Write(handle, buf, regadd, bytes);  *
+ * Declare here extern platform-dependent APIs you might need (e.g.: I/O and  *
+ * interrupt related functions), and implement them in a glue-logic file on   *
+ * the target environment, for example within the "x_nucleo_board.c" file.    *
+ * E.g.:                                                                      *
+ *   extern Status_t COMPONENT_IO_Init (void *handle);                        *
+ *   extern Status_t COMPONENT_IO_Read (handle, buf, regadd, bytes);          *
+ *   extern Status_t COMPONENT_IO_Write(handle, buf, regadd, bytes);          *
+ *   extern void     COMPONENT_IO_ITConfig(void);                             *
  *----------------------------------------------------------------------------*/
 extern void L6470_DISABLE(void);
 extern void L6470_ENABLE(void);
@@ -266,22 +306,6 @@
 extern void L6470_nCS_HIGH(void);
 extern void L6470_SPI_Communication(uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
 
-/**
-  * @}
-  */ /* End of L6470_Exported_Variables */
-
-/**
-  * @}
-  */ /* End of L6470 */
-
-/**
-  * @}
-  */ /* End of Components */
-
-/**
-  * @}
-  */ /* End of BSP */
-
 #ifdef __cplusplus
 }
 #endif
--- a/Components/l6470/l6470_class.cpp	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/l6470/l6470_class.cpp	Tue Feb 09 16:01:30 2016 +0000
@@ -1,37 +1,37 @@
 /**
-  ******************************************************************************
-  * @file       l6470_class.cpp
-  * @date       01/10/2014 12:00:00
-  * @brief      This file provides set of firmware functions to manage the
-  *             L6470.
-  ******************************************************************************
-  *
-  * COPYRIGHT(c) 2014 STMicroelectronics
-  *
-  * Redistribution and use in source and binary forms, with or without modification,
-  * are permitted provided that the following conditions are met:
-  *   1. Redistributions of source code must retain the above copyright notice,
-  *      this list of conditions and the following disclaimer.
-  *   2. 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.
-  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-  *      may be used to endorse or promote products derived from this software
-  *      without specific prior written permission.
-  *
-  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
-  *
-  ******************************************************************************
-  */
+ ******************************************************************************
+ * @file       l6470_class.cpp
+ * @date       01/10/2014 12:00:00
+ * @brief      This file provides set of firmware functions to manage the
+ *             L6470.
+ ******************************************************************************
+ *
+ * COPYRIGHT(c) 2014 STMicroelectronics
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *   1. Redistributions of source code must retain the above copyright notice,
+ *      this list of conditions and the following disclaimer.
+ *   2. 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.
+ *   3. Neither the name of STMicroelectronics nor the names of its contributors
+ *      may be used to endorse or promote products derived from this software
+ *      without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.
+ *
+ ******************************************************************************
+ */
 
 
 /* Generated with Stm32CubeTOO -----------------------------------------------*/
@@ -52,66 +52,7 @@
 #include "l6470.h"
 
 
-/* Methods -------------------------------------------------------------------*/
-
-/**
-  * @defgroup   L6470_Conversion_Functions
-  * @brief      The following functions act just on one driver inside the L6470
-  *             daisy chain. The command is immediately sent.
-  * @{
-  */
-
-/* End of L6470_Conversion_Functions */
-
-/**
-  * @defgroup   L6470_AppCMDs
-  * @brief      The following functions act just on one driver inside the L6470
-  *             daisy chain. The command is immediately sent.
-  * @{
-  */
-
-/* End of L6470_AppCMDs */
-
-/**
-  * @defgroup L6470_AppCMDs_ToBePrepared
-  * @brief  The following functions act just on one driver inside the L6470 daisy
-  *         chain. The command is prepared and not sent. To send the application
-  *         commands already prepared for the addressed L6470 drivers you have to
-  *         use @ref L6470_PerformPreparedApplicationCommand.
-  * @{
-  */
-
-/* End of L6470_AppCMDs_ToBePrepared */
-
-/**
-  * @defgroup L6470_Private_Functions
-  * @brief    L6470 Private Functions.
-  * @{
-  */
-
-/* End of L6470_Private_Functions */
-
-
-/**
-  * @addtogroup BSP
-  * @{
-  */
-
-/**
-  * @addtogroup Components
-  * @{
-  */
-
-/**
-  * @addtogroup L6470
-  * @{
-  */
-    
-/**
-  * @defgroup   L6470_Private_Constants
-  * @brief      L6470 Private Constants.
-  * @{
-  */
+/* Variables -----------------------------------------------------------------*/
 
 /* Number of instantiated devices on an expansion board. */
 uint8_t L6470::number_of_devices = 0;
@@ -214,6 +155,9 @@
   * @{
   */
 
+
+/* Methods -------------------------------------------------------------------*/
+
 /**
   * @brief  Reset the structure used to store the identifier of the L6470
   *         application command and its the needed parameters.
@@ -1071,7 +1015,7 @@
   */
 void L6470::L6470_PrepareSetParam(eL6470_RegId_t L6470_RegId, uint32_t Value)
 {
-    L6470_PrepareAppCmdPkg(L6470_AppCmdPkg, L6470_SETPARAM_ID, L6470_RegId, Value, 0);
+  L6470_PrepareAppCmdPkg(L6470_AppCmdPkg, L6470_SETPARAM_ID, L6470_RegId, Value, 0);
 }
 
 /**
@@ -1087,7 +1031,7 @@
   */
 void L6470::L6470_PrepareGetParam(eL6470_RegId_t L6470_RegId)
 {
-    L6470_PrepareAppCmdPkg(L6470_AppCmdPkg, L6470_GETPARAM_ID, L6470_RegId, 0, 0);
+  L6470_PrepareAppCmdPkg(L6470_AppCmdPkg, L6470_GETPARAM_ID, L6470_RegId, 0, 0);
 }
 
 /**
@@ -1445,7 +1389,7 @@
   * @brief  Configures the L6470 registers.
   * @param  init The pointer to the initialization structure.
   */
-DrvStatusTypeDef L6470::L6470_Config(void *init)
+Status_t L6470::L6470_Config(void *init)
 {
   /* Disable the L6470. */
   L6470_DISABLE();
@@ -1460,7 +1404,7 @@
   GetStatus();
 
   /* Prepare the 'Register' field of StepperMotorDriverHandle */
-  L6470_InitTypeDef *MotorParameterData = (L6470_InitTypeDef *) init;
+  L6470_Init_t *MotorParameterData = (L6470_Init_t *) init;
   StepperMotorRegister.ACC = L6470_Step_s2_2_Acc(MotorParameterData->acc);
   StepperMotorRegister.DEC = L6470_Step_s2_2_Dec(MotorParameterData->dec);
   StepperMotorRegister.MAX_SPEED = L6470_Step_s_2_MaxSpeed(MotorParameterData->maxspeed);
--- a/Components/l6470/l6470_class.h	Tue Jan 19 16:07:00 2016 +0000
+++ b/Components/l6470/l6470_class.h	Tue Feb 09 16:01:30 2016 +0000
@@ -57,12 +57,12 @@
 
 /* ACTION 1 ------------------------------------------------------------------*
  * Include here platform specific header files.                               *
- *----------------------------------------------------------------------------*/        
+ *----------------------------------------------------------------------------*/
 #include "mbed.h"
 #include "DevSPI.h"
 /* ACTION 2 ------------------------------------------------------------------*
  * Include here component specific header files.                              *
- *----------------------------------------------------------------------------*/        
+ *----------------------------------------------------------------------------*/
 #include "l6470.h"
 /* ACTION 3 ------------------------------------------------------------------*
  * Include here interface specific header files.                              *
@@ -76,7 +76,8 @@
 
 /* Classes -------------------------------------------------------------------*/
 
-/** Class representing a L6470 component.
+/**
+ * @brief Class representing a L6470 component.
  */
 class L6470 : public StepperMotor
 {
@@ -153,9 +154,9 @@
      *     table's functions, if any (2).                                     *
      *                                                                        *
      * Example:                                                               *
-     *   virtual int GetValue(float *pData) //(1)                             *
+     *   virtual int GetValue(float *f)  //(1)                                *
      *   {                                                                    *
-     *     return COMPONENT_GetValue(float *pfData);                          *
+     *     return COMPONENT_GetValue(float *f);                               *
      *   }                                                                    *
      *                                                                        *
      *   virtual int EnableFeature(void) //(2)                                *
@@ -1054,11 +1055,11 @@
      * Implement here interrupt related methods, if any.                      *
      * Note that interrupt handling is platform dependent, e.g.:              *
      *   + mbed:                                                              *
-     *     InterruptIn feature_irq(pin); //Interrupt object.                  *
-     *     feature_irq.rise(callback);   //Attach a callback.                 *
-     *     feature_irq.mode(PullNone);   //Set interrupt mode.                *
-     *     feature_irq.enable_irq();     //Enable interrupt.                  *
-     *     feature_irq.disable_irq();    //Disable interrupt.                 *
+     *     InterruptIn feature_irq(pin);           //Interrupt object.        *
+     *     feature_irq.fall(callback);             //Attach a callback.       *
+     *     feature_irq.mode(PullNone);             //Set interrupt mode.      *
+     *     feature_irq.enable_irq();               //Enable interrupt.        *
+     *     feature_irq.disable_irq();              //Disable interrupt.       *
      *   + Arduino:                                                           *
      *     attachInterrupt(pin, callback, RISING); //Attach a callback.       *
      *     detachInterrupt(pin);                   //Detach a callback.       *
@@ -1066,7 +1067,7 @@
      * Example (mbed):                                                        *
      *   void AttachFeatureIRQ(void (*fptr) (void))                           *
      *   {                                                                    *
-     *     feature_irq.rise(fptr);                                            *
+     *     feature_irq.fall(fptr);                                            *
      *   }                                                                    *
      *                                                                        *
      *   void EnableFeatureIRQ(void)                                          *
@@ -1155,9 +1156,9 @@
      *     source files but not pointed by the component's virtual table (3). *
      *                                                                        *
      * Example:                                                               *
-     *   DrvStatusTypeDef COMPONENT_GetValue(float* pfData); //(1)            *
-     *   DrvStatusTypeDef COMPONENT_EnableFeature(void);     //(2)            *
-     *   DrvStatusTypeDef COMPONENT_ComputeAverage(void);    //(3)            *
+     *   Status_t COMPONENT_GetValue(float *f);   //(1)                       *
+     *   Status_t COMPONENT_EnableFeature(void);  //(2)                       *
+     *   Status_t COMPONENT_ComputeAverage(void); //(3)                       *
      *------------------------------------------------------------------------*/
     int32_t  L6470_AbsPos_2_Position(uint32_t AbsPos);
     uint32_t L6470_Position_2_AbsPos(int32_t Position);
@@ -1185,7 +1186,7 @@
     uint8_t  L6470_mA_2_OcdTh(float mA);
     float    L6470_StallTh_2_mA(uint8_t StallTh);
     uint8_t  L6470_mA_2_StallTh(float mA);
-    DrvStatusTypeDef L6470_Config(void *init);
+    Status_t L6470_Config(void *init);
     void     L6470_SetParam(eL6470_RegId_t L6470_RegId, uint32_t Value);
     uint32_t L6470_GetParam(eL6470_RegId_t L6470_RegId);
     void     L6470_Run(eL6470_DirId_t L6470_DirId, uint32_t Speed);
@@ -1254,7 +1255,7 @@
      * @param[in]  NumBytesToRead number of bytes to read.
      * @retval     COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
      */
-    DrvStatusTypeDef Read(uint8_t* pBuffer, uint16_t NumBytesToRead)
+    Status_t Read(uint8_t* pBuffer, uint16_t NumBytesToRead)
     {
         if (dev_spi.spi_read(pBuffer, ssel, NumBytesToRead) != 0)
             return COMPONENT_ERROR;
@@ -1267,7 +1268,7 @@
      * @param[in]  NumBytesToWrite number of bytes to write.
      * @retval     COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
      */
-    DrvStatusTypeDef Write(uint8_t* pBuffer, uint16_t NumBytesToWrite)
+    Status_t Write(uint8_t* pBuffer, uint16_t NumBytesToWrite)
     {
         if (dev_spi.spi_write(pBuffer, ssel, NumBytesToWrite) != 0)
             return COMPONENT_ERROR;
@@ -1281,7 +1282,7 @@
      * @param[in]  NumBytes number of bytes to read and write.
      * @retval     COMPONENT_OK in case of success, COMPONENT_ERROR otherwise.
      */
-    DrvStatusTypeDef ReadWrite(uint8_t* pBufferToRead, uint8_t* pBufferToWrite, uint16_t NumBytes)
+    Status_t ReadWrite(uint8_t* pBufferToRead, uint8_t* pBufferToWrite, uint16_t NumBytes)
     {
         if (dev_spi.spi_read_write(pBufferToRead, pBufferToWrite, ssel, NumBytes) != 0)
             return COMPONENT_ERROR;
@@ -1398,6 +1399,6 @@
     static uint8_t L6470_DaisyChainSpiRxStruct[L6470MAXSPICMDBYTESIZE][L6470DAISYCHAINSIZE];
 };
 
-#endif // __L6470_CLASS_H
+#endif /* __L6470_CLASS_H */
 
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/