-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrfid.h
67 lines (54 loc) · 1.2 KB
/
rfid.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef RFID_H
#define RFID_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <zephyr/kernel.h>
#include "room.h"
// The stack size of the rfid thread.
#define RFID_THREAD_STACK_SIZE 2048
// The thread priority of the thread logic.
#define RFID_THREAD_PRIORITY 5
// Defined in main.c
extern k_tid_t rfid_thread_id;
// The maximum number of tokens that should be tracked by the driver
#define MAX_TOKENS (NUM_ROOMS * 4)
enum TokenKind {
Player1,
Player2,
Player3,
Player4,
Garlic,
Sunlight,
HolyWater,
};
struct Token {
enum TokenKind kind;
enum RoomName room;
};
/**
* @brief Get a list of the currently tracked tokens and their positions
*
* Tokens will be output in an arbitrary order.
*
* @param[out] tokens
* @parblock
* A pointer to a list of tokens to be written to.
*
* The list must have space for at least MAX_TOKENS tokens, otherwise a buffer
* overflow may occur.
* @endparblock
*
* @return The number of tokens written
*/
int rfid_get_tokens(struct Token *tokens);
void rfid_onestep();
/**
* @brief The rfid thread handling I/O from rfid readers.
*/
void rfid_main(void *, void *, void *);
#ifdef __cplusplus
}
#endif
#endif // RFID_H