over current protection
This commit is contained in:
56
overCurrentProt.h
Normal file
56
overCurrentProt.h
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef OVERCURRENTPROT_H_
|
||||
#define OVERCURRENTPROT_H_
|
||||
|
||||
|
||||
#include "cmd.h"
|
||||
|
||||
|
||||
#define CURRENT_SHUTDOWN 5
|
||||
#define CURRENT_ON 0
|
||||
#define CURRENT_OFF 1
|
||||
#define CURRENT_INTERRUPT 0
|
||||
|
||||
const unsigned long TURN_ON_DELAY = 10000; // ms
|
||||
|
||||
|
||||
class OverCurrentProt;
|
||||
|
||||
class OverCurrentProtCmd : public Cmd {
|
||||
public:
|
||||
OverCurrentProtCmd(OverCurrentProt *overCurrentProt);
|
||||
virtual String getCmdName() { return "OCPC"; }
|
||||
virtual String getHelp() { return "OCP cnt"; }
|
||||
virtual String exec(String params);
|
||||
private:
|
||||
OverCurrentProt *m_overCurrentProt;
|
||||
};
|
||||
|
||||
class OverCurrentResetCmd : public Cmd {
|
||||
public:
|
||||
OverCurrentResetCmd(OverCurrentProt *overCurrentProt);
|
||||
virtual String getCmdName() { return "OCRST"; }
|
||||
virtual String getHelp() { return "OCP rst"; }
|
||||
virtual String exec(String params);
|
||||
private:
|
||||
OverCurrentProt *m_overCurrentProt;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class OverCurrentProt {
|
||||
public:
|
||||
OverCurrentProt();
|
||||
void begin(CmdServer *cmdServer);
|
||||
void exec();
|
||||
uint32_t getEventCnt() { return m_eventCnt; };
|
||||
void resetEventCnt() { m_eventCnt = 0; };
|
||||
private:
|
||||
OverCurrentProtCmd m_overCurrentProtCmd;
|
||||
OverCurrentResetCmd m_overCurrentResetCmd;
|
||||
uint32_t m_eventCnt;
|
||||
unsigned long m_timestamp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* OVERCURRENTPROT_H_ */
|
Reference in New Issue
Block a user