forked from monkeyboard/Wiegand-Protocol-Library-for-Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wiegand.h
executable file
·35 lines (29 loc) · 807 Bytes
/
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
#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();
void begin(int pinD0, int pinD1);
void begin(int pinD0, int pinIntD0, int pinD1, int pinIntD1);
bool available();
unsigned long getCode();
int getWiegandType();
private:
static void ReadD0();
static void ReadD1();
static bool DoWiegandConversion ();
static unsigned long GetCardId (volatile unsigned long *codehigh, volatile unsigned long *codelow, char bitlength);
static volatile unsigned long _cardTempHigh;
static volatile unsigned long _cardTemp;
static volatile unsigned long _lastWiegand;
static volatile int _bitCount;
static int _wiegandType;
static unsigned long _code;
};
#endif