AresENSEA-CDF2020 / Mbed 2 deprecated DRV8825

Dependencies:   mbed FastPWM

Dependents:   AresCDFMainCode_capteur_US AresCDFMainCode_us2 AresCDFMainCode

Revision:
0:4bf91783cb4d
Child:
1:680064646da2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DRV8825.h	Fri Jun 12 17:24:35 2020 +0000
@@ -0,0 +1,32 @@
+#ifndef DRV8825_H
+#define DRV8825_H
+
+#include "mbed.h"
+#include "platform/mbed_thread.h"
+#include "FastPWM.h"
+
+#define FORWARD 1
+#define BACKWARD 0
+
+#define START 0
+#define STOP 1
+
+class DRV8825{
+    public:
+    DRV8825();
+    DRV8825(PinName  pinEN, PinName pinDIR, PinName pinStep);
+
+    void setDir(uint8_t dir);
+    void setEnable(uint8_t en);
+    void move(unsigned int Frequency);
+
+
+    private:
+    DigitalOut* m_en;
+    DigitalOut* m_dir;
+    FastPWM* m_step;
+
+};
+
+
+#endif //DRV8825_H