-
Notifications
You must be signed in to change notification settings - Fork 15
/
Wiegand.h
64 lines (50 loc) · 1.27 KB
/
Wiegand.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _WIEGAND_H
#define _WIEGAND_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class WIEGAND {
public:
WIEGAND();
void begin(bool GateA, bool GateB, bool GateC);
bool available();
unsigned long getCode();
int getWiegandType();
int getGateActive();
int D0PinA ;
int D1PinA ;
int D0PinB ;
int D1PinB ;
int D0PinC ;
int D1PinC ;
private:
static void ReadD0A();
static void ReadD1A();
static void ReadD0B();
static void ReadD1B();
static void ReadD0C();
static void ReadD1C();
static bool DoWiegandConversion ();
static unsigned long GetCardId (unsigned long *codehigh, unsigned long *codelow, char bitlength);
static unsigned long _sysTick;
static unsigned long _lastWiegand;
static int _GateActive;
static unsigned long _cardTempHighA;
static unsigned long _cardTempA;
static int _bitCountA;
static int _wiegandTypeA;
static unsigned long _codeA;
static unsigned long _cardTempHighB;
static unsigned long _cardTempB;
static int _bitCountB;
static int _wiegandTypeB;
static unsigned long _codeB;
static unsigned long _cardTempHighC;
static unsigned long _cardTempC;
static int _bitCountC;
static int _wiegandTypeC;
static unsigned long _codeC;
};
#endif