| Crates.io | rppal_mfrc522 |
| lib.rs | rppal_mfrc522 |
| version | 0.2.0 |
| created_at | 2025-06-07 18:19:06.30158+00 |
| updated_at | 2025-07-06 00:35:24.841398+00 |
| description | MFRC522 interface crate using the rppal crate and SPI |
| homepage | |
| repository | https://github.com/jlyonsmith/rppal_mfrc522 |
| max_upload_size | |
| id | 1704281 |
| size | 1,600,253 |
This is a crate for controlling MFRC522 based RFID boards. It is specifically designed to work with rppal over an SPI interface. My goal for this library was to be able to easily, reliably and synchronously read the 4-byte UID from PICC cards, key fobs and stickers when building escape room puzzles.
I was motivated to build this crate because I sadly could not get the mfrc522 crate to work. Specifically the select() call seems broken. I was able to get the very old Python code in mfrc522-python working. So I reproduced the Python code in Rust, then merged in some of the nicer design elements of the mfrc522 crate.
In the process I tried to fully document what the code is doing in comments to remove a lot of the mystery about the MFRC522 chip configuration and interfacing. Wherever possible I linked to the MFRC522 datasheet section so you can read about it yourself. I also included the PDF's for the MFRC522 and PICC cards in the repository.
What is implemented:
rppal::spi::Spi.uid() function to read card identifiersversion() function to read the board manufacturing identifierWhat does not work:
I used the [cross][4] crate for cross compilation to the aarch64-unknown-linux-gnu Raspberry Pi 64-bit platform. I have not been able to get the code coverage to work properly so the 100% code coverage number is incorrect.
The crate includes a command line program for testing called rppal-mfrc522. Run it with the --help argument to see options.