Library to handle the X_NUCLEO_IHM02A1 Motor Control Expansion Board based on the L6470 component.

Dependencies:   X_NUCLEO_COMMON

Fork of X_NUCLEO_IHM02A1 by ST

Revision:
19:591ef53bc983
Parent:
18:ddf3d5dc8137
Child:
20:9821a6a2ca62
--- a/Components/l6470/l6470_class.h	Fri Apr 08 13:02:16 2016 +0000
+++ b/Components/l6470/l6470_class.h	Tue Jul 26 15:17:40 2016 +0000
@@ -113,7 +113,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.
      */
-    L6470(PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI &spi) : StepperMotor(), flag_irq(flag_irq), busy_irq(busy_irq), standby_reset(standby_reset), ssel(ssel), dev_spi(spi)
+    L6470(PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI &spi, uint8_t ExpBrd_Id) : StepperMotor(), flag_irq(flag_irq), busy_irq(busy_irq), standby_reset(standby_reset), ssel(ssel), dev_spi(spi)
     {
         /* ACTION 4 ----------------------------------------------------------*
          * Initialize here the component's member variables, one variable per *
@@ -129,7 +129,7 @@
         L6470_ACT = &_L6470_ACT[0];
         pL6470_StatusRegister = &L6470_StatusRegister;
         prepared_action = PREPARED_NO_ACTION;
-        L6470_Id = number_of_devices++;
+        L6470_Id = (number_of_devices++)/(ExpBrd_Id+1);
         L6470_DaisyChain_HalfPrepared = ZERO_F;
         memset(L6470_AppCmdPkg, 0, L6470DAISYCHAINSIZE * sizeof(sL6470_AppCmdPkg_t));
         memset(L6470_DaisyChainSpiTxStruct, 0, L6470MAXSPICMDBYTESIZE * L6470DAISYCHAINSIZE * sizeof(uint8_t));