X-CUBE-SPN1-20150128 example source code for one motor compiled under mbed. Tested OK on Nucleo F401. l6474.cpp is modified from original with defines in l6474_target_config.h to select the original behaviour (motor de-energised when halted), or new mode to continue powering with a (reduced) current in the coils (braking/position hold capability). On F401 avoid using mbed's InterruptIn on pins 10-15 (any port). Beware of other conflicts! L0 & F0 are included but untested.

Dependencies:   mbed

Revision:
6:19c1b4a04c24
Parent:
1:75a41f0c0586
--- a/IHM01A1/stm32f0xx_nucleo_ihm01a1.h	Fri Sep 18 12:10:45 2015 +0000
+++ b/IHM01A1/stm32f0xx_nucleo_ihm01a1.h	Tue Oct 13 10:46:01 2015 +0000
@@ -53,10 +53,6 @@
   * @{
   */   
    
-/** @addtogroup STM32F0XX_NUCLEO_IHM01A1
-  * @{   
-  */   
-
 /** @defgroup IHM01A1_Board_Private_Function_Prototypes
   * @{
   */   
@@ -76,6 +72,10 @@
 uint8_t BSP_MotorControlBoard_SpiInit(void);   //Initialise the SPI used for L6474s
 uint8_t BSP_MotorControlBoard_SpiWriteBytes(uint8_t *pByteToTransmit, uint8_t *pReceivedByte, uint8_t nbDevices); //Write bytes to the L6474s via SPI
 
+/** @addtogroup STM32F0XX_NUCLEO_IHM01A1
+  * @{   
+  */   
+
    
 /* Exported Constants --------------------------------------------------------*/