-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmotor.h
71 lines (50 loc) · 1.11 KB
/
motor.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <sys/_intsup.h>
#ifndef __motor_h__
#define __motor_h__
#include <cstddef>
enum cmd_input {
CMD_NONE,
CMD_OPEN,
CMD_CLOSE,
CMD_STOP,
CMD_LOCK,
CMD_AUXSET,
CMD_CONNECT,
CMD_DISCONNECT,
CMD_DISABLE
};
class Motor {
public:
virtual void runCommand(int command_input, char *value);
/* Pure abstract methods */
virtual void motorOff() = 0;
virtual void motorOn() = 0;
virtual void stopCommand() = 0;
virtual void connectCommand() = 0;
virtual void openCommand() = 0;
virtual void closeCommand() = 0;
virtual bool isRoofMoving() = 0;
virtual bool isStopAllowed() = 0;
virtual void checkRoofMovement() = 0;
virtual const char *getVersion() = 0;
};
class TA6586 : public Motor {
public:
unsigned long MotionStartTime = 0;
unsigned long MotionStopTime = 0;
public:
bool isRoofMoving();
bool isStopAllowed();
void checkRoofMovement();
void motorOff();
void motorOn();
void stopCommand();
void connectCommand();
void openCommand();
void closeCommand();
const char *getVersion();
};
class DRV8871 : public TA6586 {
const char *getVersion();
};
#endif