Libary for Strpper motor controller, eg: Rep-Rap smart stick Catering for both, Phisical 'PIN' endstops, and PORT Expander end stops . ** BOTH IN TEST ** ** Phisical PIN tested (minimal) **** PORT PIN NOT TESTED ****

Committer:
ceri
Date:
Mon Jul 29 09:15:11 2013 +0000
Revision:
1:66e95666c3b5
Parent:
0:a509cc91f7c2
Child:
3:57d3774612fc
Sone uncommitted changes ?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ceri 0:a509cc91f7c2 1
ceri 0:a509cc91f7c2 2
ceri 0:a509cc91f7c2 3 #ifndef _stepper_h_
ceri 0:a509cc91f7c2 4 #define _stepper_h_
ceri 0:a509cc91f7c2 5
ceri 0:a509cc91f7c2 6 #include "mbed.h"
ceri 0:a509cc91f7c2 7
ceri 0:a509cc91f7c2 8 class Stepper {
ceri 0:a509cc91f7c2 9
ceri 0:a509cc91f7c2 10 public:
ceri 0:a509cc91f7c2 11
ceri 0:a509cc91f7c2 12 Stepper(PinName Step, PinName Dir, PinName En, PinName Endstop_Left, PinName Endstop_Right, bool Invert_Dir, bool Invert_ESL, bool Invert_ESR);
ceri 0:a509cc91f7c2 13
ceri 0:a509cc91f7c2 14 bool Pulse();
ceri 0:a509cc91f7c2 15 bool Set_Dir (bool Dir2Set);
ceri 0:a509cc91f7c2 16 bool ESL_Activeated();
ceri 0:a509cc91f7c2 17 bool ESR_Activeated();
ceri 0:a509cc91f7c2 18 bool ESL_Fitted();
ceri 0:a509cc91f7c2 19 bool ESR_Fitted();
ceri 1:66e95666c3b5 20
ceri 1:66e95666c3b5 21 bool Enable (bool OnOff);
ceri 0:a509cc91f7c2 22
ceri 0:a509cc91f7c2 23 protected:
ceri 0:a509cc91f7c2 24 DigitalOut _Step;
ceri 0:a509cc91f7c2 25 DigitalOut _Dir;
ceri 0:a509cc91f7c2 26 DigitalOut _En;
ceri 0:a509cc91f7c2 27
ceri 0:a509cc91f7c2 28 DigitalIn _Endstop_Left;
ceri 0:a509cc91f7c2 29 DigitalIn _Endstop_Right;
ceri 0:a509cc91f7c2 30
ceri 0:a509cc91f7c2 31
ceri 0:a509cc91f7c2 32 bool _Invert_Dir;
ceri 0:a509cc91f7c2 33 bool _Invert_ESL;
ceri 0:a509cc91f7c2 34 bool _Invert_ESR;
ceri 0:a509cc91f7c2 35 bool _g4;
ceri 0:a509cc91f7c2 36
ceri 0:a509cc91f7c2 37 bool ESL;
ceri 0:a509cc91f7c2 38
ceri 0:a509cc91f7c2 39 private:
ceri 0:a509cc91f7c2 40
ceri 0:a509cc91f7c2 41 int ESR;
ceri 0:a509cc91f7c2 42 int Set;
ceri 0:a509cc91f7c2 43
ceri 0:a509cc91f7c2 44 };
ceri 0:a509cc91f7c2 45
ceri 0:a509cc91f7c2 46 #endif // _stepper_h_