flipperzero-firmware/applications/accessor/helpers/wiegand.h
SG eac8626c8c
[FL-1351] Wiegand read fix (#483)
* App accessor: fix external interrupts binding. Hal: removed InterruptTypeExternalInterrupt.
* GPIO hal: add ex and simple init functions to F6 target
* GPIO hal: add dummy alt fn to F6 target
* RFID hal: update gpio hal usage
* F5,F6: synchronize targets, backport VCP fixes, cleanup.

Co-authored-by: あく <alleteam@gmail.com>
2021-05-24 12:57:14 +03:00

28 lines
699 B
C++

#pragma once
class WIEGAND {
public:
WIEGAND();
void begin();
void end();
bool available();
unsigned long getCode();
unsigned long getCodeHigh();
int getWiegandType();
static void ReadD0();
static void ReadD1();
private:
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;
static unsigned long _codeHigh;
};