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 ****
Stepper.h
00001 00002 00003 #ifndef _stepper_h_ 00004 #define _stepper_h_ 00005 00006 #include "mbed.h" 00007 00008 class Stepper { 00009 00010 public: 00011 00012 Stepper(PinName Step, PinName Dir, PinName En, PinName Endstop_Left, PinName Endstop_Right, bool Invert_Dir, bool Invert_ESL, bool Invert_ESR); 00013 00014 bool Pulse(); 00015 bool Set_Dir (bool Dir2Set); 00016 bool ESL_Activeated(); 00017 bool ESR_Activeated(); 00018 bool ESL_Fitted(); 00019 bool ESR_Fitted(); 00020 00021 void Enable (bool OnOff); 00022 00023 bool ESL_Port(int PORT_In); // bit MASK testing of non zero port bits 00024 00025 void ESL_Set_MASK (int Port_MASK_L_in); 00026 void ESL_Set_INV_MASK (int Port_INV_MASK_L_in); 00027 00028 00029 00030 protected: 00031 DigitalOut _Step; 00032 DigitalOut _Dir; 00033 DigitalOut _En; 00034 00035 DigitalIn _Endstop_Left; 00036 DigitalIn _Endstop_Right; 00037 00038 00039 bool _Invert_Dir; 00040 bool _Invert_ESL; 00041 bool _Invert_ESR; 00042 bool _g4; 00043 00044 bool ESL; 00045 int Port_MASK_L; 00046 00047 00048 private: 00049 00050 int ESR; 00051 int Set; 00052 00053 00054 int Port_INV_MASK_L; 00055 00056 }; 00057 00058 #endif // _stepper_h_
Generated on Sun Jul 17 2022 00:47:36 by 1.7.2