| LightHub v4.0.0 Smarthome controller firmware

out_motor.h
Go to the documentation of this file.
1 #pragma once
2 #include "options.h"
3 #ifndef MOTOR_DISABLE
4 #include <abstractout.h>
5 #include <item.h>
6 #include "itemCmd.h"
7
8 #ifndef POS_ERR
9 #define POS_ERR 10
10 #endif
11
12 #define MIN_PWM 70
13 // The number of simultaniusly working motors
14 #ifndef MOTOR_QUOTE
15 #define MOTOR_QUOTE 1
16 #endif
17
18 static int8_t motorQuote = MOTOR_QUOTE;
19
20 class out_Motor : public abstractOut {
21 public:
22
23 out_Motor(Item * _item):abstractOut(_item){getConfig();};
24 int Setup() override;
25 int Poll(short cause) override;
26 int Stop() override;
27 int Status() override;
28 //int isActive() override;
29 int getChanType() override;
30 int getDefaultStorageType(){return ST_PERCENTS255;};
31 //int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override;
32 int Ctrl(itemCmd cmd, char* subItem=NULL, bool toExecute=true) override;
33
34 int8_t pinUp;
35 int8_t pinDown;
36 int8_t pinFeedback;
37 int16_t maxOnTime;
38 uint16_t feedbackOpen;
39 uint16_t feedbackClosed;
40 bool inverted;
41 protected:
42 void getConfig();
43 };
44 #endif
out_Motor::pinFeedback
int8_t pinFeedback
Definition: out_motor.h:36
itemCmd.h
itemCmd
Definition: itemCmd.h:153
out_Motor::getDefaultStorageType
int getDefaultStorageType()
Definition: out_motor.h:30
out_Motor::inverted
bool inverted
Definition: out_motor.h:40
out_Motor::feedbackClosed
uint16_t feedbackClosed
Definition: out_motor.h:39
options.h
abstractOut
Definition: abstractout.h:8
out_Motor::getConfig
void getConfig()
Definition: out_motor.cpp:13
out_Motor::feedbackOpen
uint16_t feedbackOpen
Definition: out_motor.h:38
out_Motor::Status
int Status() override
Definition: out_motor.cpp:82
ST_PERCENTS255
#define ST_PERCENTS255
Definition: itemCmd.h:83
out_Motor::Setup
int Setup() override
Remove?? Now getChanType used instead.
Definition: out_motor.cpp:49
out_Motor
Definition: out_motor.h:20
out_Motor::pinDown
int8_t pinDown
Definition: out_motor.h:35
Item
Definition: item.h:104
out_Motor::pinUp
int8_t pinUp
Definition: out_motor.h:34
abstractout.h
out_Motor::maxOnTime
int16_t maxOnTime
Definition: out_motor.h:37
out_Motor::Stop
int Stop() override
Definition: out_motor.cpp:71
MOTOR_QUOTE
#define MOTOR_QUOTE
Definition: out_motor.h:15
out_Motor::Ctrl
int Ctrl(itemCmd cmd, char *subItem=NULL, bool toExecute=true) override
Definition: out_motor.cpp:263
out_Motor::getChanType
int getChanType() override
Definition: out_motor.cpp:256
out_Motor::out_Motor
out_Motor(Item *_item)
Definition: out_motor.h:23
out_Motor::Poll
int Poll(short cause) override
Definition: out_motor.cpp:102
item.h