Project

General

Profile

Statistics
| Branch: | Revision:

root / toolbox / rfid.h @ master

History | View | Annotate | Download (884 Bytes)

1 9b2b6d91 Tom Mullins
#ifndef RFID_H
2
#define RFID_H
3
4
/* Bytes in serial number on rfid tags */
5
#define RFID_SERNO_SIZE 4
6
7
/* Should be called before anything else */
8
void rfid_init();
9
10 532ba0bd Tom Mullins
/* Sends the read command to the rfid reader. After, you should call rfid_poll
11
 * until it returns nonzero */
12
void rfid_start_read();
13
14
/* Should only be called after rfid_start_read. Keep calling until it returns
15
 * nonzero, which means it is finished reading the serial number, and
16
 * rfid_get_serno can be called */
17
char rfid_poll();
18 9b2b6d91 Tom Mullins
19 532ba0bd Tom Mullins
/* Call this only after rfid_poll returns nonzero. This will copy the value it
20
 * read into serno, which should be at least RFID_SERNO_SIZE bytes */
21 e1d61b43 Tom Mullins
void rfid_get_serno(uint8_t *serno);
22 9b2b6d91 Tom Mullins
23 532ba0bd Tom Mullins
/* Call this only after rfid_poll returns nonzero. Returns 1 if the internal
24
 * buffer is nonzero, meaning a serial number was successfully read from an
25
 * rfid tag */
26 12ea39cc Tom Mullins
char rfid_nonzero();
27
28 9b2b6d91 Tom Mullins
#endif