Library to handle the X_NUCLEO_IHM02A1 Motor Control Expansion Board based on the L6470 component.
Fork of X_NUCLEO_IHM02A1 by
Diff: Components/l6470/l6470_class.h
- Revision:
- 20:9821a6a2ca62
- Parent:
- 19:591ef53bc983
--- a/Components/l6470/l6470_class.h Tue Jul 26 15:17:40 2016 +0000 +++ b/Components/l6470/l6470_class.h Wed Jul 27 09:15:53 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, uint8_t ExpBrd_Id) : 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) : 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++)/(ExpBrd_Id+1); + L6470_Id = (number_of_devices++)%(L6470DAISYCHAINSIZE); L6470_DaisyChain_HalfPrepared = ZERO_F; memset(L6470_AppCmdPkg, 0, L6470DAISYCHAINSIZE * sizeof(sL6470_AppCmdPkg_t)); memset(L6470_DaisyChainSpiTxStruct, 0, L6470MAXSPICMDBYTESIZE * L6470DAISYCHAINSIZE * sizeof(uint8_t));