|
StepperII
Dual Axis Stepper Controller
|
00001 00002 #pragma once 00003 00004 #include "CBitio.h" 00005 #include "CMotor.h" 00006 00007 class CPulseMotor:public CMotor // Define hardware interface to LMD18245 devices 00008 { 00009 private: 00010 // Using "Bit" here to avoid naming conflicts, i.e. step() 00011 CBit(F, 4, WO_NC) brakeBit; // Brake output bit - here for initialization to 0 00012 CBit(B, 7, WO_NC) dirBit; // Direction bit 00013 CBit(F, 1, WO_AL_NC) motionBit; // True during step pulse sequences 00014 00015 public: 00016 CBit(C, 6, WO_NC) stepBit; // OC3A on ATmega32U4 00017 00018 public: 00019 void init(CProfile *pProfile, CRunProfile *pRunProfile); // Initialize device 00020 void setBrakeType(char x); // 0 clear H-bridge data, 1 short coils, 2 nothing 00021 void brakeOn(void); // Turn on brake 00022 void brakeOff(void); // Turn off brake 00023 00024 void profileChanged(void); // Process new profile settings 00025 void changeDirection(void); // Change current direction 00026 void setDirection(void); 00027 00028 void step(void); // Do a step (within a sequence of many) 00029 void singleStep(void); // Do one step 00030 };
1.7.3