add support for signals
split main into more files
This commit is contained in:
18
train.h
18
train.h
@ -8,6 +8,7 @@ private:
|
||||
uint8_t _function = 0;
|
||||
uint8_t _functionmask;
|
||||
uint8_t _speed = 0;
|
||||
uint8_t _quirks = 0;
|
||||
bool _direction = false;
|
||||
|
||||
uint16_t packetAddSpeed();
|
||||
@ -17,27 +18,24 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
Train(const uint8_t address, uint8_t functionmask = 0b0000);
|
||||
Train(const uint8_t address, uint8_t functionmask = 0, uint8_t quirks = 0);
|
||||
|
||||
void sendData();
|
||||
|
||||
void reverse();
|
||||
|
||||
void stop();
|
||||
|
||||
bool isActive() {return getSpeed() || getFunctions();}
|
||||
|
||||
uint16_t getLastPacket();
|
||||
|
||||
void setSpeed(uint8_t speed);
|
||||
|
||||
uint8_t getSpeed();
|
||||
void setSpeed(int8_t speed);
|
||||
int8_t getSpeed();
|
||||
|
||||
void setFunctionMask(uint8_t functionmask) {_functionmask = functionmask;}
|
||||
|
||||
uint8_t getFunctions();
|
||||
|
||||
uint8_t getFunctionMask();
|
||||
|
||||
uint8_t getFunctionMask();
|
||||
void sendFunction(const uint8_t function, bool enable = true);
|
||||
|
||||
uint8_t getQuirks();
|
||||
void setQuirks(uint8_t quirks);
|
||||
};
|
||||
|
Reference in New Issue
Block a user