forked from lincomatic/open_evse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
J1772Pilot.h
38 lines (34 loc) · 1.11 KB
/
J1772Pilot.h
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
#pragma once
/*
* This file is part of Open EVSE.
* Open EVSE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
* Open EVSE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Open EVSE; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
typedef enum {
PILOT_STATE_P12,PILOT_STATE_PWM,PILOT_STATE_N12}
PILOT_STATE;
class J1772Pilot {
PILOT_STATE m_State;
#ifndef PAFC_PWM
DigitalPin pin;
#endif // !PAFC_PWM
public:
J1772Pilot() {
}
void Init();
void SetState(PILOT_STATE pstate); // P12/N12
PILOT_STATE GetState() {
return m_State;
}
int SetPWM(int amps); // 12V 1KHz PWM
};