FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Support for seeedstudio Grove 125KHz RFID Reader in UART mode. More...
#include <fastarduino/devices/grove_rfid_reader.h>
Public Types | |
using | UART = UART_ |
The UART type used to communicate with the Grove device. More... | |
Public Member Functions | |
Grove125KHzRFIDReaderUART (UART &uart) | |
Construct a new Grove 125KHz RFID Reader UART instance. 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. More... | |
void | get_data (char *data, uint8_t size) |
Get complete data as ASCII C-string from the Grove device. More... | |
Support for seeedstudio Grove 125KHz RFID Reader in UART mode.
Pinout:
In general, it is preferred to use Wiegand mode rather than UART mode on the Grove device because:
UART_
may be a software UART implementation, it is not recommend to do so, because current FastArduino software UART implementation is not optimized for slow rates such as 9600bps as used by Grove device.UART_ | the UART_ class to use to access the Grove device; this may be hardware or software, this may be either UART or UARX (UATX not used). |
Definition at line 118 of file grove_rfid_reader.h.
using devices::rfid::Grove125KHzRFIDReaderUART< UART_ >::UART = UART_ |
The UART type used to communicate with the Grove device.
Definition at line 128 of file grove_rfid_reader.h.
|
inlineexplicit |
Construct a new Grove 125KHz RFID Reader UART instance.
uart | the UART to use for communicating with the Grove device; the caller shall just care about instantiation, this Grove125KHzRFIDReaderUART instance will handle everything else on uart . |
Definition at line 137 of file grove_rfid_reader.h.
|
inline |
Start operations of the device.
From here, all data received from the Grove device will be read into UART buffer.
Definition at line 149 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 160 of file grove_rfid_reader.h.
|
inline |
Check if data from Grove device is ready to read.
In this situation, your program can call get_data()
to receive the complete access data (read from an RFID tag).
true
as soon as the first character transmitted by the Grove device is ready, even if the remaining caharacters have not been received yet. get_data()
will wait for and read the remaining characters if needed.Definition at line 178 of file grove_rfid_reader.h.
|
inline |
Get complete data as ASCII C-string from the Grove device.
Data is displayable in ASCII as an hexadecimal representation of RFID tag actual data, e.g. "0F0024ADC442".
On UARX wire, the data transmitted by Grove device is embedded between special ASCII STX
(0x02
) and ETX
(0x03
); those markers are removed from returned data.
has_data()
first, to ensure data will be available.data | data buffer to be fed from device data |
size | size of data ; this will typically depend on RFID tags that you use; do not forget to add 1 character ofr the ending \\0 . |
Definition at line 206 of file grove_rfid_reader.h.