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

Files at this revision

API Documentation at this revision

Comitter:
gregeric
Date:
Fri Sep 18 09:55:03 2015 +0000
Parent:
1:75a41f0c0586
Child:
3:56c7051bfb17
Commit message:
Added warnings re untested platforms.

Changed in this revision

IHM01A1/ihm01a1.h Show annotated file Show diff for this revision Revisions of this file
--- a/IHM01A1/ihm01a1.h	Fri Sep 18 08:44:48 2015 +0000
+++ b/IHM01A1/ihm01a1.h	Fri Sep 18 09:55:03 2015 +0000
@@ -47,8 +47,10 @@
 #if defined TARGET_STM32F4
 #include "stm32f4xx_nucleo_ihm01a1.h"
 #elif defined TARGET_STM32F0
+#warning Untested platform!
 #include "stm32f0xx_nucleo_ihm01a1.h"
 #elif defined TARGET_STM32L0
+#warning Untested platform!
 #include "stm32l0xx_nucleo_ihm01a1.h"
 #else
 #error Unknown Target: only STM32F0xx, F4xx, L0xx are supported.