FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Support for seeedstudio Grove 125KHz RFID Reader in Wiegand mode. More...
#include <fastarduino/devices/grove_rfid_reader.h>
Public Types | |
using | DATA_TYPE = typename protocols::Wiegand::DATA_TYPE |
The data type used to return data read from the Grove device. More... | |
Public Member Functions | |
Grove125KHzRFIDReaderWiegandEXT () | |
Construct a new Grove 125KHz RFID Reader instance in Wiegand mode, where wires are connected to board::ExternalInterruptPin pins. More... | |
void | begin () |
Start operations of the device. More... | |
void | end () |
Stop operations of the device. More... | |
bool | has_data () |
Check if data from Grove device is ready to read and valid (correct parity). More... | |
void | get_data (DATA_TYPE &data) |
Get complete data as a DATA_TYPE value (integral type) from the Grove device. More... | |
Static Public Attributes | |
static constexpr uint8_t | DATA_BITS = protocols::Wiegand::DATA_BITS |
The actual number of bits of data in DATA_TYPE . More... | |
Friends | |
struct | isr_handler_grove |
Support for seeedstudio Grove 125KHz RFID Reader in Wiegand mode.
This implementation needs 2 EXT pins from the MCU. If your design does not allow this, then you may use Grove125KHzRFIDReaderWiegandPCI
instead.
Pinout:
In Wiegand mode, the device provides only 3 bytes from a RFID tag. From experiment, these 3 bytes are the 3rd to 5th bytes from the tag, as read from the Grove device in UART mode.
For this API to be fully functional, you must register the right ISR in your program, through REGISTER_GROVE_RFID_READER_INT_ISR()
macro.
DATA0_ | the EXT pin used to connect to Grove device DATA0 (white) wire. |
DATA1_ | the EXT pin used to connect to Grove device DATA1 (yellow) wire. |
Definition at line 252 of file grove_rfid_reader.h.
using devices::rfid::Grove125KHzRFIDReaderWiegandEXT< DATA0_, DATA1_ >::DATA_TYPE = typename protocols::Wiegand::DATA_TYPE |
The data type used to return data read from the Grove device.
This may be larger than what is actually needed.
Definition at line 263 of file grove_rfid_reader.h.
|
inline |
Construct a new Grove 125KHz RFID Reader instance in Wiegand mode, where wires are connected to board::ExternalInterruptPin
pins.
Definition at line 277 of file grove_rfid_reader.h.
|
inline |
Start operations of the device.
From here, all data received from the Grove device will be read and stored.
Definition at line 292 of file grove_rfid_reader.h.
|
inline |
Stop operations of the device.
From here, any data received from the Grove device will be lost.
Definition at line 303 of file grove_rfid_reader.h.
|
inline |
Check if data from Grove device is ready to read and valid (correct parity).
In this situation, your program can call get_data()
to receive the complete access data (read from an RFID tag).
Definition at line 316 of file grove_rfid_reader.h.
|
inline |
Get complete data as a DATA_TYPE
value (integral type) from the Grove device.
In Wiegand mode only 3 bytes are available from the tag read by Grove device.
data | reference to be fed from device data; or 0 if no data was read from the device (no tag present since last call to get_data() ). |
Definition at line 334 of file grove_rfid_reader.h.
|
friend |
Definition at line 362 of file grove_rfid_reader.h.
|
staticconstexpr |
The actual number of bits of data in DATA_TYPE
.
This does not include parity bits which do not hold any access control data. The actual bits are always the LSB in DATA_TYPE
, other bits (HSB) are set to 0
.
Definition at line 271 of file grove_rfid_reader.h.