-
Notifications
You must be signed in to change notification settings - Fork 167
/
Copy pathMennekesLock.cpp
54 lines (45 loc) · 1.32 KB
/
MennekesLock.cpp
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
45
46
47
48
49
50
51
52
53
54
// -*- C++ -*-
/*
* Open EVSE Firmware
*
* Copyright (c) 2013-2014 Sam C. Lin <lincomatic@gmail.com>
*
* 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.
*/
#include "open_evse.h"
#ifdef MENNEKES_LOCK
void MennekesLock::Init()
{
pinA.init(MENNEKES_LOCK_PINA_REG,MENNEKES_LOCK_PINA_IDX,DigitalPin::OUT);
pinB.init(MENNEKES_LOCK_PINB_REG,MENNEKES_LOCK_PINB_IDX,DigitalPin::OUT);
Unlock();
}
void MennekesLock::Lock()
{
pinA.write(1);
pinB.write(0);
delay(300);
pinA.write(0);
pinB.write(0);
}
void MennekesLock::Unlock()
{
pinA.write(0);
pinB.write(1);
delay(300);
pinA.write(0);
pinB.write(0);
}
#endif // MENNEKES_LOCK