-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStepperController.h
43 lines (27 loc) · 1.03 KB
/
StepperController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef STEPPERCONTROLLER_H_RTJFI7CF
#define STEPPERCONTROLLER_H_RTJFI7CF
#include "config.h"
#include "owntypes.h"
#include "RingBuffer.h"
class StepperController
{
public:
StepperController();
void disableSteppers(bool x=true,bool y=true,bool z=true);
void enableSteppers(bool x=true, bool y=true, bool z=true);
void setPoint(int32_t x,int32_t y,int32_t z);
void setPoint(const Point& rPoint) { setPoint(rPoint.x,rPoint.y,rPoint.z); }
void moveTo(int32_t x,int32_t y,int32_t z,int32_t feedRate);
void getPoint(Point& rPoint);
void getRange(Point& rP) { rP.x = mRange.x; rP.y = mRange.y; rP.z = mRange.z; }
void setRange(const Point& rP) { mRange.x = rP.x; mRange.y = rP.y; mRange.z = rP.z; }
bool isMoving();
void update();
protected:
void doISR();
bool mbMoving;
Point mRange;
static void timerCallback(void*udata) { StepperController* sc = reinterpret_cast<StepperController*>(udata); sc->doISR(); }
};
extern StepperController stepperController;
#endif /* end of include guard: STEPPERCONTROLLER_H_RTJFI7CF */