forked from cschleifenbaum/qleaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchargingrelaycontroller.h
More file actions
44 lines (33 loc) · 1.03 KB
/
chargingrelaycontroller.h
File metadata and controls
44 lines (33 loc) · 1.03 KB
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
#ifndef CHARGINGRELAYCONTROLLER_H
#define CHARGINGRELAYCONTROLLER_H
#include "nymea-gpio/gpio.h"
class ChargingRelayController : public QObject
{
public:
ChargingRelayController(QObject* parent = nullptr);
enum class ChargingMode
{
LIM,
LeafOBCharger
};
ChargingMode chargingMode() const;
void setChargingMode(ChargingMode mode);
bool chademoProximity() const;
void setChademoProximity(bool proximity);
void setChargeFlapOpen(bool open);
bool isChargeFlapOpen() const;
void setChargerStart1(bool set);
bool isChargerStart1Set() const;
void setChargerStart2(bool set);
bool isChargerStart2Set() const;
protected:
void deductChargingMode();
void fakeChargeFlap();
private:
Gpio m_gpio2; // High -> charge flap open
Gpio m_gpio3; // Chademo d1, pin 2 -> 12V
Gpio m_gpio4; // Chademo proximity, pin 7 -> GND
Gpio m_gpio14; // Chademo d2, pin 10 -> pin 4 (GND when charge enable by vehicle)
Gpio m_gpio15; // PP, CP, CCS plug lock...
};
#endif