motor board library

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Dependents:   selfbalansingcar

Fork of X_NUCLEO_IHM02A1 by ST

Revision:
9:d70452d7a1e1
Parent:
3:e3f6f4474d98
Child:
10:aa68441705b2
--- a/BSP/x_nucleo_ihm02a1_class.h	Thu Dec 10 15:42:20 2015 +0000
+++ b/BSP/x_nucleo_ihm02a1_class.h	Fri Dec 11 17:23:31 2015 +0000
@@ -78,16 +78,20 @@
 
     /**
      * @brief Constructor.
+     * @param init_0        pointer to the initialization structure of the first motor.
+     * @param init_1        pointer to the initialization structure of the second motor.
      * @param flag_irq      pin name of the FLAG pin of the component.
      * @param busy_irq      pin name of the BUSY pin of the component.
      * @param standby_reset pin name of the STBY\RST pin of the component.
      * @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(PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
+    X_NUCLEO_IHM02A1(MICROSTEPPING_MOTOR_InitTypeDef *init_0, MICROSTEPPING_MOTOR_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
 
     /**
      * @brief Constructor.
+     * @param init_0        pointer to the initialization structure of the first motor.
+     * @param init_1        pointer to the initialization structure of the second motor.
      * @param flag_irq      pin name of the FLAG pin of the component.
      * @param busy_irq      pin name of the BUSY pin of the component.
      * @param standby_reset pin name of the STBY\RST pin of the component.
@@ -96,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(PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
+    X_NUCLEO_IHM02A1(MICROSTEPPING_MOTOR_InitTypeDef *init_0, MICROSTEPPING_MOTOR_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
 
     /**
      * @brief Destructor.
@@ -168,9 +172,6 @@
     L6470 *l6470_0;
     L6470 *l6470_1;
 
-    /* Static data. */
-    static const MICROSTEPPING_MOTOR_InitTypeDef MotorParameterInitData[EXPBRD_MOUNTED_NR_MAX][L6470DAISYCHAINSIZE];
-
 
 protected:
 
@@ -196,6 +197,9 @@
     /* Components. */
     L6470 *components[L6470DAISYCHAINSIZE];
     
+    /* Components' initialization. */
+    MICROSTEPPING_MOTOR_InitTypeDef *init_components[L6470DAISYCHAINSIZE];
+
     /* Results of prepared actions. */
     uint32_t results[L6470DAISYCHAINSIZE];