//
#ifndef Relay_h
#define Relay_h
//
#include <Define.h>
//
enum EStateRelay
{
    srlOff = 0,
    srlOn = 1
};
//
const bool INIT_RELAY_INVERTED = false;
const EStateRelay INIT_RELAY_STATE = srlOff;
//
class CRelay
{
    private:
    bool FInverted;
    int FPin;
    EStateRelay FState;
    //
    public:
    CRelay(int pin, EStateRelay initstate = srlOff, bool inverted = false);
    void Open(EStateRelay initstate = srlOff);
    void Close(void);
    EStateRelay GetState(void);
    void SetState(EStateRelay state);
    void SetOn(void);
    void SetOff(void);
    void Toggle(void);
    const char* GetStateText(void);
};
//
#endif // Relay_h
//
