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

Auto generated API documentation and code listings for Nucleo_BSP_IHM01A1

Code

ihm01a1.h [code]
l6474.cpp [code]
l6474.h [code] Header for L6474 driver (fully integrated microstepping motor driver)
l6474_target_config.h [code] Predefines values for the L6474 registers and for the devices parameters
main.cpp [code]
motor.h [code] This file contains all the functions prototypes for motor drivers
motorcontrol.cpp [code]
motorcontrol.h [code] This file provides common definitions for motor control
stdint.h [code]
stm32f0xx_hal_msp.cpp [code]
stm32f0xx_it.cpp [code]
stm32f0xx_it.h [code]
stm32f0xx_nucleo_ihm01a1.cpp [code]
stm32f0xx_nucleo_ihm01a1.h [code] Header for BSP driver for x-nucleo-ihm01a1 Nucleo extension board (based on L6474)
stm32f4xx_hal_msp.cpp [code]
stm32f4xx_it.cpp [code]
stm32f4xx_it.h [code]
stm32f4xx_nucleo_ihm01a1.cpp [code]
stm32f4xx_nucleo_ihm01a1.h [code] Header for BSP driver for x-nucleo-ihm01a1 Nucleo extension board (based on L6474)
stm32l0xx_hal_msp.cpp [code]
stm32l0xx_it.cpp [code]
stm32l0xx_it.h [code]
stm32l0xx_nucleo_ihm01a1.cpp [code]
stm32l0xx_nucleo_ihm01a1.h [code] Header for BSP driver for x-nucleo-ihm01a1 Nucleo extension board (based on L6474)