Default mbed pwm doesn't have enough resolution at high frequencies, thats why I implemented VNH5019 Motor carrier with FastPWM.

Dependencies:   FastPWM

Fork of VNH5019 by IEEE RAS METU

Revision:
10:829d36e2de02
Parent:
9:1709d9b034f7
Child:
11:6902db5e7978
--- a/VNH5019.h	Thu Nov 30 17:05:25 2017 +0000
+++ b/VNH5019.h	Thu Nov 30 17:42:16 2017 +0000
@@ -40,6 +40,7 @@
 
         DigitalOut   INA;
         DigitalOut   INB;
+        DigitalInOut ENDIAG;
         AnalogIn     CS;
         FastPWM      PWM;
 };        
@@ -97,15 +98,18 @@
 inline
 bool VNH5019::is_fault()
 {
-  return false;
+  return !ENDIAG;
 }
 
 inline
 void VNH5019::disable()
 {
+    ENDIAG.output();
+    ENDIAG.write(0);
 }
 
 inline    
 void VNH5019::enable()
 {
+    ENDIAG.input();
 }