As our RFID tags cannot co-exist on the same reader as originally plan,
handle another reader on SPI1.
Checking tags is not time sensitive and can be made in successive loops, which
minimizes the changes needed from the original code.
Previously, checkTag() returned 0 when it failed or when there was no changes.
This is fine if we are only expecting already programmed tags, but as tags
arrive new with blocks zeroed out, which conflicts with the 0 return value.
Introduce a new constant to RFID for the return error, -1, and use it
instead of 0 everywhere.
Update comments and README to highlight this new reserved ID.
Define the protocol allowing the software to track tags
and program them, in the README.
The data structure is shared between a programming command and an
information message, so create a new struct for it and an array
to keep track of it and expose to the rest of the program.
The goal is to keep the protocol core and message construction
entirely inside Com, so this intermediary buffer allows exposing
it outside while hiding the protocol details.
This means that we are starting to receive data from the software,
so implement generic functions to check and receive data as well
as receiveMessage() which parses the message and handles them.
Platformio supports multiple environments and sharing a global configuration.
Make use of this to easily allow switching between the production build, with HID,
and the development build, with serial.
Update the README with information on how to build those environments.
Introduce the Speaker class to play audio from the SD card when detecting
tags.
The only audio supported is WAV.
Audio playback is handled via interrupts, so it might try to read from the
SD card at the same time as the LCD class is trying to read new frames.
Update the LCD animation code to temporarily disable audio interrupts while
reading from the SD card.
Add support for the LCD and using it for displaying animations.
Animations are automatically played if available for the ID of the
detected tag.
The code should support adding other kind of animations, for tags being
removed or for other UI interactions for example.
The next commit implements the LCD and animation support. To enable an easy
way to create animations for it, add details in the README regarding the way
the SD card is used and how the files need to be formatted.
Create the Utils directory and add a Rust project to do the bit flipping and
a script that automates all the steps described in the README.
Add a README for Utils explaining how to use them.
Implement a set of functions to create messages following the protocols
defined in the README for communication.
Handle HID, which is used to communicate with the interactive application.
Update README with details on the message structures.